server icon indicating copy to clipboard operation
server copied to clipboard

Explicitly set startTime

Open micheljung opened this issue 7 years ago • 7 comments

The server needs to set game_stats.startTime explicitly. See FAForever/db#83

micheljung avatar Apr 18 '17 09:04 micheljung

Not required for v0.8 as we just go with the insert time of the database, for now-

micheljung avatar May 08 '17 11:05 micheljung

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 ?

Rackover avatar Dec 13 '18 22:12 Rackover

Is this somthing to be worked on ? It sounds like somthing easy to do for a newbie. i can look into this.

KaukaHan avatar Nov 11 '21 11:11 KaukaHan

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.

Askaholic avatar Nov 13 '21 20:11 Askaholic

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 ?

KaukaHan avatar Dec 02 '21 16:12 KaukaHan

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.

Askaholic avatar Dec 02 '21 17:12 Askaholic

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.

Askaholic avatar Dec 02 '21 17:12 Askaholic