chaitu236 / TakServer

Server to handle online TAK games
https://www.playtak.com
GNU General Public License v2.0
35 stars 8 forks source link

Database IDs should match online IDs #18

Closed nelhage closed 7 years ago

nelhage commented 8 years ago

Right now, the IDs received via the server protocol are not the same IDs that end up in the database. A lot of things would be more convenient, programmatically, if they did – for example, a tool could automatically generate archive links from games in real-time. It would enable me to cross-reference my own logs with the server database.

chaitu236 commented 8 years ago

This is because when saving games to db, I don't specify the game id and let the db pick the next one. If I use the game id as db id, when server is restarted there will be unused db ids since games ongoing during restart are not committed to db. I'll have to think about this a little.

nelhage commented 8 years ago

I think -- without having read too much of the code -- that the natural thing here would be to insert "placeholder" games as soon as the game starts, and use the returned id, and then update the record on completion.

chaitu236 commented 8 years ago

But when server is restarted, the placeholder games can't be populated as they're not completed..

chaitu236 commented 8 years ago

I should just record those games as aborted.. yes I'll do that I think