Open speed2CZ opened 5 years ago
How does the python client know which map to load if the mapname is not specified? Are all maps in the feature mod files?
I believe there's a mapname in the lua replay header. Some data is duplicated between it and the json header, probably to make it easier for the client do parse replays in bulk.
This is the query that the legacy replayserver does to pull out info including the mapname:
"SELECT game_featuredMods.gamemod, gameType, filename, gameName, host, login, playerId, AI, team FROM `game_stats` LEFT JOIN game_player_stats ON `game_player_stats`.`gameId` = game_stats.id LEFT JOIN table_map ON `game_stats`.`mapId` = table_map.id LEFT JOIN login ON login.id = `game_player_stats`.`playerId` LEFT JOIN game_featuredMods ON `game_stats`.`gameMod` = game_featuredMods.id WHERE game_stats.id = %i" % self.uid
Looks like the legacy replay server tries to get filename
from table table_map
which appears to be deprecated. The Java API uses table map_version
instead to store the filename
.
The map x1mp_017
is "Eye of the Storm" which is a super old map so I would bet that it has an entry in the table_map
table and therefore the filename is found by the replay server.
@speed2CZ Which map is that coop game using? Was it maybe uploaded using the Java API and therefore has no entry in table_map
?
coop has its own maps, each mission is just a map with extended script. Its not uploaded as a normal map. They are taken from the git repo https://github.com/FAForever/faf-coop-maps/ and some script in the server renames then to correct version and packs them
Root cause of the issue:
table_map
)map_id
's from the table map_version
map_id
to set on the game_stats
table.Here is where the replay server get's the map name: https://github.com/FAForever/legacy-replay-server/blob/1c9d06c9d09a76b641800a85ccdc14442b48945a/liveReplay/replays.py#L148. It dumps that to a file (on line 283).
Solutions:
map_version
and table_map
tables.
map_version
and table_map
tables for maps that it hasn't seen before.
When opening the replay files I found out that the coop replays are missing the mapname. The client is then not showing them properly in the online vault, and downlord's client can't even lauch the replays.
I dont know if it would completelly fix the issue with coop replays, but it would surely be a good start.
Some examples of the replays files: Coop Game:
"mapname": ""
FAF game
"mapname": "x1mp_017"