Skip to content

Fix judge of custom server from findgamebycode - #101

Open
NikoCat233 wants to merge 5 commits into
NuclearPowered:masterfrom
NikoCat233:Fix-matchmaking
Open

NikoCat233 wants to merge 5 commits into
NuclearPowered:masterfrom
NikoCat233:Fix-matchmaking

Conversation

@NikoCat233

Copy link
Copy Markdown

Server issued by the new FindGameByCode can be different from the one set in ServerManager.

This means that if we find a game on officials, but ServerManager's region is set to a modded server, dtls nonce will be skipped, thus resulting in auth failure.

This pr attempts to ease the issue by logging the FindGameByCode response, record the ip and the region name and compare it on actual joining the server.

The code does not seem to fit in the current codebase so changes are welcome.

image

@miniduikboot

Copy link
Copy Markdown
Collaborator

I see the problem, I'll try and clean up the patch

@NikoCat233

Copy link
Copy Markdown
Author

cleaned up

miniduikboot
miniduikboot previously approved these changes Sep 28, 2026
@NikoCat233

Copy link
Copy Markdown
Author

Lets listen for the suggestions from gpt-6-astra xhigh before continuing to merge

@NikoCat233

Copy link
Copy Markdown
Author

They do have suggestions lol

@NikoCat233
NikoCat233 marked this pull request as draft October 3, 2026 16:30
@NikoCat233

Copy link
Copy Markdown
Author

gpt-6-astra messed up

@NikoCat233

Copy link
Copy Markdown
Author

Previous commits did not cover the condition where players accept invitations from discord links

Newer commits directly patches shared method CoFindGameInfo so all the possible findgame paths are covered

Tested and should be working on latest versions. I guess Starlight needs some more adjustments.

[Message:     Unity] Selected server: http-1: https://au-us.niko233.top:443 False
[Message:     Unity] [Network] > [HttpMatchmakerManager] > Selecting region: Niko233(NA), with uri: https://au-us.niko233.top:443/api/games/-1931541461
[Message:     Unity] [Network] > [HttpMatchmakerManager] > Sent UserIDToken Request
[Message:     Unity] [Network] > [HttpMatchmakerManager] > CoSendRequest failed:
        Status Code: 404
        Context: request gamecode server
        Request: GET at https://au-us.niko233.top:443/api/games/-1931541461
        Response: {"Errors":[{"Reason":"GameNotFound","Message":"game not found"}],"Game":null}
        Error: HTTP/1.1 404 Not Found
[Warning:     Unity] [Network] > [HttpMatchmakerManager] > HTTP-MM request failed with reason
Status Code: 404
Context: request gamecode server
Request: GET at https://au-us.niko233.top:443/api/games/-1931541461
Reason: GameNotFound
[Message:     Unity] [Network] > [HttpMatchmakerManager] > Unable to find game in region: Niko233(NA)
[Message:     Unity] ServerManager::ReselectServer
[Message:     Unity] Selected server: Http-1: https://matchmaker.among.us:443 False
[Message:     Unity] [Network] > [HttpMatchmakerManager] > Selecting region: North America, with uri: https://matchmaker.among.us:443/api/games/-1931541461
[Message:     Unity] ServerManager::LoadServers
[Info   :   Reactor] Region file reloaded
[Message:     Unity] [Network] > [HttpMatchmakerManager] > CoSendRequest failed:
        Status Code: 401
        Context: request gamecode server
        Request: GET at https://matchmaker.among.us:443/api/games/-1931541461
        Response: {"Errors":[{"Reason":11}]}
        Error: HTTP/1.1 401 Unauthorized
[Message:     Unity] [Network] > [HttpMatchmakerManager] > Authorization failure. Attempting to refresh token.
[Message:     Unity] [Network] > [HttpMatchmakerManager] > Sent UserIDToken Request
[Error  :     Unity] [GameOptionsFactory] Could not parse 'Normal' options data for version '12': GameOptionsDefinition for Version 12 (and associated Deserializer) could not be retrieved.
[Info   :   Reactor] Code lookup completed: official region: True, target: 192.155.97.13
[Info   :   Reactor] Using refreshed matchmaking token from the successful code lookup request
[Message:     Unity] ServerManager::ReselectServer
[Message:     Unity] Selected server: http-1: https://au-us.niko233.top:443 False
[Warning:   Reactor] Connected to a vanilla HTTP matchmaking server
[Message:     Unity] ServerManager::LoadServers
[Info   :   Reactor] Region file reloaded
[Info   :   Reactor] Joining 192.155.97.13:22923
[Info   :   Reactor] Authentication _CoConnect_d__4: running for 192.155.97.13 (official region: False, code lookup target: True)
[Info   :   Reactor] Authentication _CoWaitForNonce_d__6: running for 192.155.97.13 (official region: False, code lookup target: True)
[Info   :   Reactor] Currently using dtls: False. Should use dtls: False
[Message:     Unity] Updating cached platform name
[Message:     Unity] Client joining game: -1931541461/ZWBMAF useDtls: False
[Error  :     Unity] Server > Client DC because MismatchedVersion: 2026.7.20.0

@NikoCat233
NikoCat233 marked this pull request as ready for review October 3, 2026 17:05
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