Fix "Player account does not exist." bug when trying to view finished games.
Once games are finished the turns become publicly viewable. But there is a bug which block 1 or more player slots in most races to be viewed. The returned error is "Player account does not exist." and it mostly happens when a slot was open or dead at the end of the game. (But there is no player account missing.)
Apart from making turns just non-viewable, it also prevents effort like creating timelapse videos of games.
-
kedalion commented
Ted, that's the error I mentioned below. All the previously affected turns now require you to be logged in. So your script needs to append your API-KEY to the request or you will get that ill-formatted error message. Though I only got invalid json objects out, but never tried to fix them. Thanks for the hint with removing CR and LF.
-
Ted commented
Just a small note.
http://api.planets.nu/game/loadturn?gameid=40940&playerid=9&turn=1
produce now:
{"success":false,"error":"An API error has occurred - Value cannot be null.
Parameter name: g at System.Guid..ctor(String g)
at PlanetsAPI.GameActions.LoadTurn(HttpRequest request) in c:\Users\Joshua\Documents\Dev\Planets\PlanetsAPI\GameActions.cs:line 78
at PlanetsAPI.API.ProcessRequest(HttpContext context) in c:\Users\Joshua\Documents\Dev\Planets\PlanetsAPI\API.cs:line 136"}Had CR and LF to remove inside my JSON Wrapper. Anyway, would be nice to get access over all turn data.
-
kedalion commented
Joshua, this is indeed fixed, but there is still a difference to all other turns. (Don't get me wrong, I'm happy I can get the data in some way.) All previously affected turns now can only be loaded with a valid API key while all other turns don't need one.
For example these two player turns. Player 4 was previously affected by the bug.
https://api.planets.nu/game/loadturn?gameid=1000&playerid=4&turn=55
https://api.planets.nu/game/loadturn?gameid=1000&playerid=5&turn=55 -
CSY commented
One beneficial side-effect of the newly introduced tenacity system is that it is encouraging more replacements, which helps time-lapse projects (such as Nu Replayer) because there is a better chance that the slot will be occupied (or marked dead) when the game ends.
Still, the bug is widely prevalent, particularly in Melee games (especially where a slot is marked dead on the join page, but still marked open in-game).
-
kedalion commented
Oh, an example for such a game would be player 10 in http://planets.nu/games/49311
But it's easy to find more as they exist in maybe every 2 out of 3 games.