Basic challenge info
This commit is contained in:
parent
8c1194eee4
commit
0b77031417
@ -1,10 +1,23 @@
|
||||
import { GetChallengeScRsp } from "../../data/proto/StarRail";
|
||||
import ChallengeActivityRaidConfigExcel from "../../util/excel/ChallengeActivityRaidConfigExcel";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
session.send("GetChallengeScRsp", {
|
||||
const activities = ChallengeActivityRaidConfigExcel.all();
|
||||
|
||||
const dataObj: GetChallengeScRsp = {
|
||||
retcode: 0,
|
||||
challengeList: []
|
||||
} as GetChallengeScRsp);
|
||||
}
|
||||
|
||||
activities.forEach(activity => {
|
||||
dataObj.challengeList.push({
|
||||
challengeId: activity.ChallengeID,
|
||||
stars: 0,
|
||||
takenReward: 0
|
||||
});
|
||||
});
|
||||
|
||||
session.send("GetChallengeScRsp", dataObj);
|
||||
}
|
@ -1,11 +1,23 @@
|
||||
import { GetChallengeRaidInfoScRsp } from "../../data/proto/StarRail";
|
||||
import RaidConfigExcel from "../../util/excel/RaidConfigExcel";
|
||||
import Packet from "../kcp/Packet";
|
||||
import Session from "../kcp/Session";
|
||||
|
||||
export default async function handle(session: Session, packet: Packet) {
|
||||
session.send("GetChallengeRaidInfoScRsp", {
|
||||
const activities = RaidConfigExcel.all();
|
||||
|
||||
const dataObj: GetChallengeRaidInfoScRsp = {
|
||||
retcode: 0,
|
||||
challengeRaidList: [],
|
||||
takenRewardIdList: []
|
||||
} as GetChallengeRaidInfoScRsp);
|
||||
}
|
||||
|
||||
activities.forEach(activity => {
|
||||
dataObj.challengeRaidList.push({
|
||||
maxScore: 0,
|
||||
raidId: activity.RaidID
|
||||
});
|
||||
})
|
||||
|
||||
session.send("GetChallengeRaidInfoScRsp", dataObj);
|
||||
}
|
13
src/util/excel/ChallengeActivityRaidConfigExcel.ts
Normal file
13
src/util/excel/ChallengeActivityRaidConfigExcel.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import ChallengeActivityRaidConfigExcelTable from "../../data/excel/ChallengeActivityRaidConfigExcelTable.json";
|
||||
|
||||
export default class ChallengeActivityRaidConfigExcel {
|
||||
private constructor() { }
|
||||
|
||||
public static fromId(id: number) {
|
||||
return Object.values(ChallengeActivityRaidConfigExcelTable).find(x => x.ChallengeID === id);
|
||||
}
|
||||
|
||||
public static all() {
|
||||
return Object.values(ChallengeActivityRaidConfigExcelTable);
|
||||
}
|
||||
}
|
60
src/util/excel/RaidConfigExcel.ts
Normal file
60
src/util/excel/RaidConfigExcel.ts
Normal file
@ -0,0 +1,60 @@
|
||||
import _RaidConfigExcelTable from "../../data/excel/RaidConfigExcelTable.json";
|
||||
const RaidConfigExcelTable = _RaidConfigExcelTable as { [key: string]: RaidConfigExcelTableEntry };
|
||||
|
||||
interface TextMap {
|
||||
hash: number;
|
||||
}
|
||||
|
||||
interface Param {
|
||||
RawValue: number;
|
||||
}
|
||||
|
||||
interface RaidConfigExcelTableEntry {
|
||||
RaidID: number;
|
||||
WorldLevel: number;
|
||||
Type: string;
|
||||
MappingInfoID: number;
|
||||
MonsterList: number[];
|
||||
MonsterHideList: number[];
|
||||
DisplayEventID: number;
|
||||
RaidName: TextMap;
|
||||
RaidDesc: TextMap;
|
||||
MapEntranceID: number;
|
||||
GroupID: number;
|
||||
ConfigIDList: number[];
|
||||
NpcMonsterIDList: number[];
|
||||
PlaneEventIDList: number[];
|
||||
BuffDesc: TextMap;
|
||||
ParamList: Param[];
|
||||
LimitIDList: number[];
|
||||
RecoverType: string[];
|
||||
FinishType: string;
|
||||
FinishParamList: number[];
|
||||
FinishAutoQuit: boolean;
|
||||
DropList: number[];
|
||||
StaminaCost: number;
|
||||
FailedType: string;
|
||||
FailedResult: string;
|
||||
LogoutType: string;
|
||||
TeamType: string;
|
||||
TrialAvatarList: number[];
|
||||
MainMissionID: number;
|
||||
IsEntryByProp: boolean;
|
||||
}
|
||||
|
||||
export default class RaidExcelConfig {
|
||||
private constructor() { }
|
||||
|
||||
public static fromId(id: number, wl: number = 0) {
|
||||
const key = `${id}:${wl}`;
|
||||
return RaidConfigExcelTable[key];
|
||||
}
|
||||
|
||||
public static all() {
|
||||
return Object.values(RaidConfigExcelTable);
|
||||
}
|
||||
|
||||
public static find(id: number) {
|
||||
return Object.values(RaidConfigExcelTable).find(x => x.RaidID === id);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user