Skip to content

Conversation

@benjaminpjones
Copy link
Contributor

@benjaminpjones benjaminpjones commented Jan 4, 2026

Summary

OGS provides live player stats for the automatch queue via /termination-api/automatch-stats.

This PR uses it to populate AutomatchPresets.playerCount (sort of).

Discussion needed Resolved!

GameClient.automatchPresets is a synchronous API. Therefore, playerCount is not available when the list is requested by ServerLobbyPage.

There are two potential fixes:

  • Make GameClient.automatchPresets return a Future so that we can make network requests.
  • [preferred] split out playerCount into a separate, asynchronous method or ValueNotifier.

I need help deciding how to resolve as this would affect the other clients (probably in a good way)

Testing

Screenshot 2026-01-04 at 2 09 09 PM

Note: because of the login/sync/caching issue, this only works if you navigate to another screen (e.g. game record page) and return to the lobby page after the cache has been set.

@ale64bit
Copy link
Owner

ale64bit commented Jan 4, 2026

[preferred] split out playerCount into a separate, asynchronous method or ValueNotifier.

I agree! This would be the cleanest solution. I can refactor it so that playerCount is removed from the preset and we add a new:

ValueNotifier<IMap<String, AutomatchStats>> get automatchStats;

to GameClient, where AutomatchStats is a class containing playerCount (and potentially other fields later on).

@ale64bit
Copy link
Owner

ale64bit commented Jan 5, 2026

this is now ready in cbd33d5

- Remove trivial comments
- Prevent spamming stats refresh
- Move shared constants into shared location
@benjaminpjones benjaminpjones changed the title [needs input] Add automatch stats Add automatch stats Jan 6, 2026
@benjaminpjones
Copy link
Contributor Author

@ale64bit Amazing, thank you! I updated this PR and re-tested. Now the player counts show up on first load!

@ale64bit ale64bit merged commit 783127a into ale64bit:main Jan 6, 2026
1 check passed
@benjaminpjones benjaminpjones deleted the automatch-stats branch January 6, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants