返回提交历史
Modified
src/constants/gameToBuildVersion.ts
+1
-0
Modified
src/services/missionInventoryUpdateService.ts
+1
-1
Modified
src/services/worldStateService.ts
+5
-3
XFEstudio/SpaceNinjaServer
chore: avoid kuva fortress when generating sorties for pre-U19 clients (#4085)
Closes #4081 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4085 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
46c7f661
代码差异
3 个文件
+7
-4
@@ -52,6 +52,7 @@ const gameToBuildVersion = {
52
52
"20.0.0": "2017.03.24.17.25",
53
53
"19.5.0": "2016.12.21.19.13",
54
54
"19.4.1": "2016.12.16.14.33",
55
"19.0.1": "2016.11.12.20.09",
55
56
"18.22.1": "2016.09.30.12.04",
56
57
"18.18.0": "2016.08.19.17.12",
57
58
"18.16.0": "2016.07.08.16.56",
@@ -2145,7 +2145,7 @@ async function getRandomMissionDrops(
2145
2145
const arr = RewardInfo.sortieId.split("_");
2146
2146
let giveNodeReward = false;
2147
2147
if (arr[1] != "Lite") {
2148
const sortie = getSortie(idToDay(arr[1]));
2148
const sortie = getSortie(idToDay(arr[1]), account.BuildLabel);
2149
2149
giveNodeReward = sortie.Variants.find(x => x.node == arr[0])!.missionType == "MT_ASSASSINATION";
2150
2150
}
2151
2151
rewardManifests = giveNodeReward ? region.rewardManifests : [];
@@ -601,7 +601,7 @@ const pushTilesetModifiers = (modifiers: string[], tileset: TSortieTileset): voi
601
601
}
602
602
};
603
603
604
export const getSortie = (day: number): ISortie => {
604
export const getSortie = (day: number, buildLabel: string | undefined): ISortie => {
605
605
const seed = new SRng(day).randomInt(0, 100_000);
606
606
//logger.debug(`sortie seed: ${seed}`);
607
607
const rng = new SRng(seed);
@@ -610,8 +610,10 @@ export const getSortie = (day: number): ISortie => {
610
610
const enemyFaction = sortieBossToFaction[boss];
611
611
612
612
const nodes: string[] = [];
613
const canUseKuvaFortress = !buildLabel || version_compare(buildLabel, gameToBuildVersion["19.0.1"]) >= 0;
613
614
for (const [key, value] of Object.entries(ExportRegions)) {
614
615
if (
616
(canUseKuvaFortress || value.systemIndex != 18) &&
615
617
sortieFactionToSystemIndexes[enemyFaction].includes(value.systemIndex) &&
616
618
sortieFactionToFactions[enemyFaction].includes(value.faction!) &&
617
619
key in sortieTilesets &&
@@ -4261,10 +4263,10 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4261
4263
// Omit sorties for pre-Star Chart 3.0 clients to avoid breaking them.
4262
4264
if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["18.18.0"]) >= 0) {
4263
4265
if (timeMs < rollover) {
4264
worldState.Sorties.push(getSortie(day - 1));
4266
worldState.Sorties.push(getSortie(day - 1, buildLabel));
4265
4267
}
4266
4268
if (isBeforeNextExpectedWorldStateRefresh(timeMs, rollover)) {
4267
worldState.Sorties.push(getSortie(day));
4269
worldState.Sorties.push(getSortie(day, buildLabel));
4268
4270
}
4269
4271
}
4270
4272