XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: provide PVPChallengeInstances without buildLabel as well (#3503)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3503 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

5ba2977b
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +21 -9
Modified src/services/worldStateService.ts +21 -9
@@ -3906,15 +3906,15 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3906 3906 pushSyndicateMissions(worldState, sdy, rng.randomInt(0, 100_000), "ba6f84724fa48061", "SteelMeridianSyndicate");
3907 3907 }
3908 3908
3909 if (buildLabel && version_compare(buildLabel, gameToBuildVersion["17.7.1"]) >= 0) {
3910 if (version_compare(buildLabel, gameToBuildVersion["18.0.2"]) >= 0) {
3909 if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["17.7.1"]) >= 0) {
3910 if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["18.0.2"]) >= 0) {
3911 3911 const conclaveWeekStart = weekStart + 40 * unixTimesInMs.minute - 2 * unixTimesInMs.day;
3912 3912 const conclaveWeekEnd = conclaveWeekStart + unixTimesInMs.week;
3913 3913
3914 pushConclaveWeakly(worldState.PVPChallengeInstances, week, buildLabel);
3914 pushConclaveWeekly(worldState.PVPChallengeInstances, week, buildLabel);
3915 3915
3916 3916 if (isBeforeNextExpectedWorldStateRefresh(timeMs, conclaveWeekEnd)) {
3917 pushConclaveWeakly(worldState.PVPChallengeInstances, week + 1, buildLabel);
3917 pushConclaveWeekly(worldState.PVPChallengeInstances, week + 1, buildLabel);
3918 3918 }
3919 3919 }
3920 3920
@@ -4378,9 +4378,11 @@ const pushConclaveDaily = (
4378 4378 }[],
4379 4379 day: number,
4380 4380 id: number,
4381 buildLabel: string
4381 buildLabel: string | undefined
4382 4382 ): void => {
4383 if (version_compare(buildLabel, gameToBuildVersion["18.0.2"]) < 0) PVPMode = PVPMode.replace("PVPMODE_", "");
4383 if (buildLabel && version_compare(buildLabel, gameToBuildVersion["18.0.2"]) < 0) {
4384 PVPMode = PVPMode.replace("PVPMODE_", "");
4385 }
4384 4386 const conclaveDayStart = EPOCH + day * unixTimesInMs.day + 5 * unixTimesInMs.hour + 30 * unixTimesInMs.minute;
4385 4387 const conclaveDayEnd = conclaveDayStart + unixTimesInMs.day;
4386 4388 const challengeId = day * 8 + id;
@@ -4411,10 +4413,16 @@ const pushConclaveDaily = (
4411 4413 });
4412 4414 };
4413 4415
4414 const pushConclaveDailys = (activeChallenges: IPVPChallengeInstance[], day: number, buildLabel: string): void => {
4416 const pushConclaveDailys = (
4417 activeChallenges: IPVPChallengeInstance[],
4418 day: number,
4419 buildLabel: string | undefined
4420 ): void => {
4415 4421 const modes = ["PVPMODE_CAPTURETHEFLAG", "PVPMODE_DEATHMATCH", "PVPMODE_TEAMDEATHMATCH"];
4416 4422 // closest known version to Update: Lunaro
4417 if (version_compare(buildLabel, gameToBuildVersion["18.13.3"]) > 0) modes.push("PVPMODE_SPEEDBALL");
4423 if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["18.13.3"]) > 0) {
4424 modes.push("PVPMODE_SPEEDBALL");
4425 }
4418 4426 const challengesMap: Record<
4419 4427 string,
4420 4428 {
@@ -4438,7 +4446,11 @@ const pushConclaveDailys = (activeChallenges: IPVPChallengeInstance[], day: numb
4438 4446 });
4439 4447 };
4440 4448
4441 const pushConclaveWeakly = (activeChallenges: IPVPChallengeInstance[], week: number, buildLabel: string): void => {
4449 const pushConclaveWeekly = (
4450 activeChallenges: IPVPChallengeInstance[],
4451 week: number,
4452 buildLabel: string | undefined
4453 ): void => {
4442 4454 const weekStart = EPOCH + week * unixTimesInMs.week;
4443 4455 const conclaveWeekStart = weekStart + 40 * unixTimesInMs.minute - 2 * unixTimesInMs.day;
4444 4456 const conclaveWeekEnd = conclaveWeekStart + unixTimesInMs.week;