momentum-mod / game

Momentum Mod - Standalone Source Movement Speedrunning (READ README)
https://momentum-mod.org
Other
531 stars 209 forks source link

Lower lobby list refresh cooldown #1597

Open tsa96 opened 2 years ago

tsa96 commented 2 years ago

What feature is your improvement idea related to?

Currently it's there's C++ hardcoded to limit the rate at which you can request a lobby list update from Steam to 10 seconds. IMO this is far too long, Steam's API isn't going to get upset if someone decides to request a refresh every couple of seconds.

Describe the solution you'd like

Lower the limit to something around 1-3 seconds, then update the JS const (I've changed it to a REFRESH_COOLDOWN const on my branch, on master it's a static var in the Lobby class)

Describe alternatives you've considered, if any.

No response

Additional context

No response

Gocnak commented 2 years ago

The problem isn't a rate limit, it's that you actually might not have every public lobby returned from the API call. We could let the UI know when the API call completes and is therefore able to refresh if we get the callback sooner than 10 seconds?

tsa96 commented 2 years ago

Gotcha, yeah this would be ideal. Firing a event like PanoramaComponent_SteamLobby_RequestReturned or something would be great. I think BLT said there is a rate limiter in place in the C++ as well though, I assume we'd want to keep that but still lower it?

lvaness commented 2 years ago

there is no singular request finished really, the friend and global request are completely separate, and each is completed as soon as the data is sent to js, so that can be considered as the completed event.

Changing the refresh limit to be some small value like 3 seconds and just dismissing the request for the specific type if it's still in flight should work fine (comes at the risk of having them and their parameters out of sync though)