For context, this is the current FileSystem KV in CS2 gameinfo.gi:
FileSystem
{
SearchPaths
{
Game_LowViolence csgo_lv // Perfect World content override
Game csgo
Game csgo_imported
Game csgo_core
Game core
Mod csgo
Mod csgo_imported
Mod csgo_core
AddonRoot csgo_addons
OfficialAddonRoot csgo_community_addons
LayeredGameRoot "../game_otherplatforms/etc" [$MOBILE || $ETC_TEXTURES] //Some platforms do not support DXT compression. ETC is a well-supported alternative.
LayeredGameRoot "../game_otherplatforms/low_bitrate" [$MOBILE]
}
"UserSettingsPathID" "USRLOCAL"
"UserSettingsFileEx" "cs2_"
}
I noticed some problems in Source2GameInfoProvider initialization:
-
It doesn't always follow top-down order. Due to the KV parsing trying to group multiple values from multiple KVs with a same name into a list, the search order is only correct if the search_path_type are sorted like above. Otherwise, it will be wrong if the KV names have a mixed order.
-
The iterable self.filesystem.get("searchpaths", {}).items() here doesn't always yield a list of search_paths, it will yield a single search_path if there's only 1 KV of that search_path_type. This will turn iterating over a list into character iterating, which is wrong.
-
These problems seem to also exist in Source1GameInfoProvider.
-
Additionally, there are 2 new search path types (Game_LowViolence, OfficialAddonRoot) that need support as well.
For context, this is the current FileSystem KV in CS2 gameinfo.gi:
I noticed some problems in Source2GameInfoProvider initialization:
It doesn't always follow top-down order. Due to the KV parsing trying to group multiple values from multiple KVs with a same name into a list, the search order is only correct if the
search_path_typeare sorted like above. Otherwise, it will be wrong if the KV names have a mixed order.The iterable
self.filesystem.get("searchpaths", {}).items()here doesn't always yield a list of search_paths, it will yield a single search_path if there's only 1 KV of that search_path_type. This will turn iterating over a list into character iterating, which is wrong.These problems seem to also exist in Source1GameInfoProvider.
Additionally, there are 2 new search path types (Game_LowViolence, OfficialAddonRoot) that need support as well.