fix more factoring issues
This commit is contained in:
parent
69b014a718
commit
f5d5808ca9
@ -22,7 +22,7 @@ export default class Database {
|
||||
return Database.instance;
|
||||
}
|
||||
|
||||
public async get(collection: string, query?: {}) {
|
||||
public async get(collection: string, query?: object) {
|
||||
try {
|
||||
const db = await Database.client.db();
|
||||
const _collection = db.collection(collection);
|
||||
@ -52,7 +52,7 @@ export default class Database {
|
||||
}
|
||||
}
|
||||
|
||||
public async delete(collection: string, query: {}) {
|
||||
public async delete(collection: string, query: object) {
|
||||
try {
|
||||
const db = await Database.client.db();
|
||||
const _collection = db.collection(collection);
|
||||
@ -66,7 +66,7 @@ export default class Database {
|
||||
}
|
||||
}
|
||||
|
||||
public async update(collection: string, query: {}, payload: {}) {
|
||||
public async update(collection: string, query: object, payload: object) {
|
||||
try {
|
||||
const db = await Database.client.db();
|
||||
const _collection = db.collection(collection);
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetAllLineupDataCsReq, GetAllLineupDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetAllLineupDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetAllLineupDataCsReq;
|
||||
|
||||
session.send("GetAllLineupDataScRsp", {
|
||||
retcode: 0,
|
||||
lineupList: []
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ActivateFarmElementCsReq, GetAvatarDataCsReq, GetAvatarDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetAvatarDataCsReq, GetAvatarDataScRsp } from "../../data/proto/StarRail";
|
||||
import AvatarExcelTable from "../../data/excel/AvatarExcelTable.json";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetBagCsReq, GetBagScRsp } from "../../data/proto/StarRail";
|
||||
import { GetBagScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetBagCsReq;
|
||||
|
||||
session.send("GetBagScRsp", {
|
||||
equipmentList: [],
|
||||
materialList: [],
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetBasicInfoCsReq, GetBasicInfoScRsp } from "../../data/proto/StarRail";
|
||||
import { GetBasicInfoScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetBasicInfoCsReq;
|
||||
|
||||
session.send("GetBasicInfoScRsp", {
|
||||
curDay: 1,
|
||||
exchangeTimes: 0,
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetChallengeCsReq, GetChallengeScRsp } from "../../data/proto/StarRail";
|
||||
import { GetChallengeScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetChallengeCsReq;
|
||||
|
||||
session.send("GetChallengeScRsp", {
|
||||
retcode: 0,
|
||||
challengeList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetChallengeRaidInfoCsReq, GetChallengeRaidInfoScRsp } from "../../data/proto/StarRail";
|
||||
import { GetChallengeRaidInfoScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetChallengeRaidInfoCsReq;
|
||||
|
||||
session.send("GetChallengeRaidInfoScRsp", {
|
||||
retcode: 0,
|
||||
challengeRaidList: [],
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { AvatarType, BattleEndStatus, GetCurBattleInfoCsReq, GetCurBattleInfoScRsp } from "../../data/proto/StarRail";
|
||||
import { AvatarType, BattleEndStatus, GetCurBattleInfoScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetCurBattleInfoCsReq;
|
||||
|
||||
session.send("GetCurBattleInfoScRsp", {
|
||||
retcode: 0,
|
||||
avatarList: [{
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { AvatarSlotType, AvatarType, GetCurLineupDataCsReq, GetCurLineupDataScRsp } from "../../data/proto/StarRail";
|
||||
import { AvatarType, GetCurLineupDataCsReq, GetCurLineupDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetCurLineupDataCsReq;
|
||||
|
||||
session.send("GetCurLineupDataScRsp", {
|
||||
retcode: 0,
|
||||
lineup: {
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetCurSceneInfoCsReq, GetCurSceneInfoScRsp } from "../../data/proto/StarRail";
|
||||
import { GetCurSceneInfoScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetCurSceneInfoCsReq;
|
||||
|
||||
session.send("GetCurSceneInfoScRsp", {
|
||||
retcode: 0,
|
||||
scene: {
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetDialogueEventDataCsReq, GetDialogueEventDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetDialogueEventDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetDialogueEventDataCsReq;
|
||||
|
||||
session.send("GetDialogueEventDataScRsp", {
|
||||
dialogueEventList: [],
|
||||
retcode: 0
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetExpeditionDataCsReq, GetExpeditionDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetExpeditionDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetExpeditionDataCsReq;
|
||||
|
||||
session.send("GetExpeditionDataScRsp", {
|
||||
retcode: 0,
|
||||
expedtionList: [],
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetFirstTalkNpcCsReq, GetFirstTalkNpcScRsp } from "../../data/proto/StarRail";
|
||||
import { GetFirstTalkNpcScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetFirstTalkNpcCsReq;
|
||||
|
||||
session.send("GetFirstTalkNpcScRsp", {
|
||||
retcode: 0,
|
||||
} as GetFirstTalkNpcScRsp);
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { Gender, GetHeroBasicTypeInfoCsReq, GetHeroBasicTypeInfoScRsp, HeroBasicType } from "../../data/proto/StarRail";
|
||||
import { Gender, GetHeroBasicTypeInfoScRsp, HeroBasicType } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetHeroBasicTypeInfoCsReq;
|
||||
|
||||
session.send("GetHeroBasicTypeInfoScRsp", {
|
||||
retcode: 0,
|
||||
gender: Gender.GenderMan,
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetHeroPathCsReq, GetHeroPathScRsp } from "../../data/proto/StarRail";
|
||||
import { GetHeroPathScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetHeroPathCsReq;
|
||||
|
||||
session.send("GetHeroPathScRsp", {
|
||||
retcode: 0,
|
||||
heroPathList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetLevelRewardTakenListCsReq, GetLevelRewardTakenListScRsp } from "../../data/proto/StarRail";
|
||||
import { GetLevelRewardTakenListScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetLevelRewardTakenListCsReq;
|
||||
|
||||
session.send("GetLevelRewardTakenListScRsp", {
|
||||
retcode: 0,
|
||||
takenLevelList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetLoginActivityCsReq, GetLoginActivityScRsp } from "../../data/proto/StarRail";
|
||||
import { GetLoginActivityScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetLoginActivityCsReq;
|
||||
|
||||
session.send("GetLoginActivityScRsp", {
|
||||
retcode: 0,
|
||||
loginActivityList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetMailCsReq, GetMailScRsp } from "../../data/proto/StarRail";
|
||||
import { GetMailScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetMailCsReq;
|
||||
|
||||
session.send("GetMailScRsp", {
|
||||
retcode: 0,
|
||||
mailList: [],
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetMazeTimeOfDayCsReq, GetMazeTimeOfDayScRsp } from "../../data/proto/StarRail";
|
||||
import { GetMazeTimeOfDayScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetMazeTimeOfDayCsReq;
|
||||
|
||||
session.send("GetMazeTimeOfDayScRsp", {
|
||||
retcode: 0,
|
||||
mazeTimeOfDayMap: {}
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetMissionDataCsReq, GetMissionDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetMissionDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetMissionDataCsReq;
|
||||
|
||||
session.send("GetMissionDataScRsp", {
|
||||
retcode: 0,
|
||||
missionList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetMissionEventDataCsReq, GetMissionEventDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetMissionEventDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetMissionEventDataCsReq;
|
||||
|
||||
session.send("GetMissionEventDataScRsp", {
|
||||
retcode: 0,
|
||||
missionEventList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetNpcStatusCsReq, GetNpcStatusScRsp } from "../../data/proto/StarRail";
|
||||
import { GetNpcStatusScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetNpcStatusCsReq;
|
||||
|
||||
session.send("GetNpcStatusScRsp", {
|
||||
retcode: 0,
|
||||
messageStatusList: []
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetQuestDataCsReq, GetQuestDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetQuestDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetQuestDataCsReq;
|
||||
|
||||
session.send("GetQuestDataScRsp", {
|
||||
questList: [],
|
||||
retcode: 0,
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetRogueInfoCsReq, GetRogueInfoScRsp, RogueStatus } from "../../data/proto/StarRail";
|
||||
import { GetRogueInfoScRsp, RogueStatus } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetRogueInfoCsReq;
|
||||
|
||||
session.send("GetRogueInfoScRsp", {
|
||||
retcode: 0,
|
||||
rogueInfo: {
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { GetSpringRecoverDataCsReq, GetSpringRecoverDataScRsp } from "../../data/proto/StarRail";
|
||||
import { GetSpringRecoverDataScRsp } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as GetSpringRecoverDataCsReq;
|
||||
|
||||
session.send("GetSpringRecoverDataScRsp", {
|
||||
retcode: 0,
|
||||
healPoolInfo: {
|
||||
|
@ -1,9 +1,6 @@
|
||||
import { PlayerKeepAliveNotify } from "../../data/proto/StarRail";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
const body = packet.body as PlayerKeepAliveNotify;
|
||||
|
||||
// We actually don't need to handle this
|
||||
}
|
Loading…
Reference in New Issue
Block a user