fix: properly provide hex conquest for pre-U40 clients
All checks were successful
Build / build (pull_request) Successful in 1m56s
All checks were successful
Build / build (pull_request) Successful in 1m56s
The missing mf field did end up causing script errors + exterminate was not provided in the proper format
This commit is contained in:
@@ -429,9 +429,6 @@ export const getMissionTypeForLegacyOverride = (missionType: TMissionType, conqu
|
||||
return "EndlessCapture";
|
||||
}
|
||||
let str = missionType.substring(3, 4).toUpperCase() + missionType.substring(4).toLowerCase();
|
||||
if (str == "Extermination") {
|
||||
str = "Exterminate";
|
||||
}
|
||||
if (str == "Artifact") {
|
||||
str = "Disruption";
|
||||
}
|
||||
@@ -440,3 +437,31 @@ export const getMissionTypeForLegacyOverride = (missionType: TMissionType, conqu
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
export const factionToInt = (faction: TFaction | "FC_TENNO"): number => {
|
||||
switch (faction) {
|
||||
case "FC_GRINEER":
|
||||
return 0;
|
||||
case "FC_CORPUS":
|
||||
return 1;
|
||||
case "FC_INFESTATION":
|
||||
return 2;
|
||||
case "FC_OROKIN":
|
||||
return 3;
|
||||
case "FC_RED_VEIL":
|
||||
return 4;
|
||||
case "FC_SENTIENT":
|
||||
return 5;
|
||||
case "FC_NARMER":
|
||||
return 6;
|
||||
case "FC_MITW":
|
||||
return 7;
|
||||
case "FC_SCALDRA":
|
||||
return 8;
|
||||
case "FC_TECHROT":
|
||||
return 9;
|
||||
case "FC_DUVIRI":
|
||||
return 10;
|
||||
}
|
||||
throw new Error(`unexpected faction ${faction}`);
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ import type {
|
||||
import { toMongoDate, toOid, version_compare } from "../helpers/inventoryHelpers.ts";
|
||||
import { logger } from "../utils/logger.ts";
|
||||
import { DailyDeal, Fissure } from "../models/worldStateModel.ts";
|
||||
import { getConquest, getMissionTypeForLegacyOverride } from "./conquestService.ts";
|
||||
import { factionToInt, getConquest, getMissionTypeForLegacyOverride } from "./conquestService.ts";
|
||||
|
||||
const sortieBosses = [
|
||||
"SORTIE_BOSS_HYENA",
|
||||
@@ -3628,6 +3628,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
|
||||
hqo: {
|
||||
mt: hexConquest.Missions.map(x => getMissionTypeForLegacyOverride(x.missionType, "CT_HEX")),
|
||||
mv: hexConquest.Missions.map(x => x.difficulties[1].deviation),
|
||||
mf: hexConquest.Missions.map(x => factionToInt(x.faction)),
|
||||
c: hexConquest.Missions.map(x => x.difficulties[1].risks),
|
||||
fv: hexConquest.Variables
|
||||
},
|
||||
|
||||
@@ -487,7 +487,7 @@ interface IFbst {
|
||||
interface IConquestOverride {
|
||||
mt?: string[];
|
||||
mv?: string[];
|
||||
mf?: number[]; // hex conquest only. unknown purpose.
|
||||
mf?: number[];
|
||||
c?: [string, string][];
|
||||
fv?: string[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user