RiotGames / developer-relations

Riot Games Developer Ecosystem Bug Reporting
http://developer.riotgames.com
745 stars 44 forks source link

Epoch time timestamp of the instant when the game timer was at 0:00. #81

Open chipimix opened 5 years ago

chipimix commented 5 years ago

Hi! Noob here :) I'm trying to get the timestamp in epoch time of the instant when the game timer was at 0:00. So far I've only been able to get the timestamp of when champion select ended and the loading screen appeared :( Is this possible? Thanks in advance!

Querijn commented 5 years ago

Hey there.

The game timer starts at 0. The champion select phase and the loading screen are not included. The timestamps should mirror the ingame timer.

Also, this is not a bug or issue with the Riot API. I recommend you get on the Discord, and ask your questions there: https://discord.gg/riotapi

chipimix commented 5 years ago

Thanks for the fast reply. I understand this. I can get the timestamps relative to the instant 0 - the game start. However I would also like to know the non-relative, epoch time of this start event. Is it possible?

Querijn commented 5 years ago

The start epoch is the game start. But I'm going on a limb here and assume you want to know when the game has started relative to Linux epoch, that's the gameCreation in /lol/match/v4/matches/, in milliseconds.

chipimix commented 5 years ago

yes you are correct! However gamecreation is relative to the loadingscreen appearing:

gameCreation | long | Designates the timestamp when champion select ended and the loading screen appeared, NOT when the game timer was at 0:00.

What I'm looking for is the loadingscreen ending and match start :)

Querijn commented 5 years ago

Just for clarity for the Rioters here: You'd like to know the duration of the loading screen.

chipimix commented 5 years ago

Adding the duration of the loading screen to the gameCreation long would be a workaround, Yes.

But to put it plainly I would say what I am looking is the following: Timestamp of when the game timer was at 0:00, NOT when champion select ended and the loading screen appeared.

Because, as far as I can tell, there is no way to know at what time of the day did any match event occurred.

Thanks again!

Querijn commented 5 years ago

Why would you like to see the exact time of the game start? I thought, as you mentioned above, you wanted to know the loading time duration.

Colorfulstan commented 5 years ago

What I can tell you is, the property gameStartTime within the spectate active game endpoint is accurately the point of when the players actually appear within the game. But I don't know if you can find that elsewhere to process after a game has ended.

It also is only set after the loading screen ended (for obvious reasons), so trying to get it from an active game requires a bit caution/some retries too

chipimix commented 5 years ago

Why would you like to see the exact time of the game start? I thought, as you mentioned above, you wanted to know the loading time duration.

So that I can sync game events' data with other external data. As it stands, the API does not allow this to happen :(

jjmaldonis commented 5 years ago

I want to +1 this request. I've been wanting to make an automatic highlights tool, and knowing the epoch time when the game actually starts is crucial. Right now that's impossible without using computer vision and analyzing the screen, which is pretty much a show-stopper for now.

Sauraus commented 5 years ago

Same here +1 💯 on the request.