server
server copied to clipboard
Explicitly set startTime
The server needs to set game_stats.startTime
explicitly. See FAForever/db#83
Not required for v0.8 as we just go with the insert time of the database, for now-
Is this still relevant ? It is true that the game record lacks a createTime, and therefore has a startTime with a similar functionality - and that therefore the server should set the start time manually. But if the result is the same, how important is that issue ?
Is this somthing to be worked on ? It sounds like somthing easy to do for a newbie. i can look into this.
Yea this could still be done. It would allow us to move the game_stats
insertion somewhere else if we wanted. Just gotta beware of timezone issues.
would it be a good idea to get the time in on_game_launched
method put it into a variable like self.startTime
to be used in update_game_stats
?
and is it ok to use sql_now
since endTime
uses it too ?
Yea that would be the way to go. Create a variable and use the built in datetime.now
function to create a timezone aware date time object. Then I think you can just use that variable in the insert and sqlalchemy should figure out how to convert it to the correct database timestamp.
If you do the same thing for end time then at some point we can combine the end of game database updates into a single update statement.