MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / getDBVersionByTableName

Function getDBVersionByTableName

src/packFileSerializer.ts:669–688  ·  view source on GitHub ↗
(packFile: PackedFile, dbName: string)

Source from the content-addressed store, hash-verified

667 }
668};
669export const getDBVersionByTableName = (packFile: PackedFile, dbName: string) => {
670 if (packFile.name.endsWith(".loc")) return LocVersion;
671 const dbversions = DBNameToDBVersions[appData.currentGame][dbName];
672 // console.log("GETTING DB VERSIONS, dbversions IS", dbversions);
673 if (!dbversions) return;
674 // console.log("getting db version for", dbName, "version in file is:", packFile.version);
675 const dbversion =
676 dbversions.find((dbversion) => dbversion.version == packFile.version) ||
677 dbversions.find((dbversion) => dbversion.version == 0) ||
678 dbversions[0];
679 // console.log("GETTING DB VERSION from dbversions, dbversion IS", dbversion);
680 if (!dbversion) {
681 console.log("FAILED getting db version for", dbName, "version in file is:", packFile.version);
682 return;
683 }
684 // console.log("GETTING DB VERSION packFile version IS", packFile.version);
685 if (packFile.version == null) return dbversion;
686 if (dbversion.version < packFile.version) return;
687 return dbversion;
688};
689export const getDBVersion = (packFile: PackedFile) => {
690 if (packFile.name.endsWith(".loc")) return LocVersion;
691 // console.log("GETTING DB VERSION FOR", packFile.name);

Callers 4

findPackTableReferencesFunction · 0.90
getDBVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected