loldevs / leaguespec

community crafted knowledge base around Riot Games observer system
Other
149 stars 18 forks source link

How to get Platform ID for in-progress game? #33

Closed MicahZoltu closed 9 years ago

MicahZoltu commented 9 years ago

The REST spectator API requires a Platform ID for most of the API calls. Is there a deterministic way to figure out the platform from the game information or do they map directly to the various game regions (many to one, regions to platforms)?

I can make some educated guesses about which regions end up on which platform IDs, but the fact that many of the platforms are suffixed with a "1" suggest to me that they are dynamic in some way and that perhaps there is (or one day will be) an NA2. In such a situation, how can I know which platform ID a particular game played in the NA region will be on?

Divi commented 9 years ago

Regions are statics, here the list :

EUW1:    185.40.64.163:80
NA1:     192.64.174.163:80
EUN1:    95.172.65.26:8088
KR:      110.45.191.11:8088
BR1:     66.151.33.19:80
TR1:     95.172.65.242:80 
TW:      112.121.84.194:8088
LA1:     66.151.33.19:80
LA2:     66.151.33.19:80
RU:      95.172.65.242:80
PBE1:    69.88.138.29:8088
OC1:     95.172.65.242:80

Changes can happen, but only if Riot change their servers.

Note: the port is very important for the client, even if it's 80.

MicahZoltu commented 9 years ago

So if I were to create a map of IP/Port to platform ID (from the list above), I could then use the observer IP/port from the game info to look up the platform?

Divi commented 9 years ago

Yes.

MicahZoltu commented 9 years ago

Thanks, I'll update the Wiki.

Divi commented 9 years ago

Platform ID are already available : https://github.com/loldevs/leaguespec/wiki/REST-Service But I don't know if the wiki is up to date...