Salvage stats when player reconnects
Previously, when a player disconnects and then reconnects to the server the stats gained in the previous session where lost. The CRCON would always only save the 'higher' stats value to compensate this a bit, which was far from perfect. With this commit, the CRCON will try to salvage the previously gained stats and combine them after the round ended.
I'm fairly unfamiliar with the stats portion of CRCON, this won't double count if people disconnect/reconnect multiple times will it?
No, it should not. The stats are only "recovered", if the stats reported by the server are less than the stats we have in our records. This can only happen once, when the user disconnects and reconnects. And it will always start from zero. What will happen is, if the player disconnects again, that the points they gained during the time of the reconnect and second disconnect, are added up in the prevvious value.
E.g.:
- join server - 0 CE (previous CE: 0, displayed in Stats page: 0 CE)
- some kills etc - 50 CE (previous CE: 0, displayed in Stats page: 50 CE)
- disconnect
- reconnect - 0 CE (previous CE: 50, displayed in Stats page: 50 CE)
- some kills etc - 20 CE (previous CE: 50, displayed in Stats page: 70 CE)
- disconnect
- reconect - 0 CE (previous CE: 70, displayed in Stats page: 70 CE)
- some kills - 40 CE (previous CE: 70, displayed in Stats page: 110 CE)
- match end What the stats page will show at the end are 110 CE for that player.