R2NorthstarTools / Reaper

Open source GitHub repo for the Northstar discord server bot "Reaper"
MIT License
0 stars 1 forks source link

Handle "Invalid Value" master server response #9

Closed GeckoEidechse closed 2 months ago

GeckoEidechse commented 2 months ago

Basically when a player tries to host a server but something is not set up correctly, master server will return a 5XX HTTP error with an error JSON response.

However Cloudflare somehow intercepts that and adds its own information to it, resulting in client failing to parse the response and showing "Invalid Value".

Until this is addressed Reaper should handle the case when a user asks and point out that the most common reason is non-functioning port-forwarding (be it user error or technical limitations).

In logs this looks something like:

[19:41:37] [NORTHSTAR] [errr] Failed reading masterserver authentication response: encountered parse error "Invalid value."
[19:41:37] [NORTHSTAR] [errr] Reached max ms server registration attempts

It should be pointed out however, that the IIRC the master server registration attempt happens even if the player is not trying to host a server as the the multiplayer menu (the on in mp_lobby) is also technically a game server that tries to register itself.

As such we need to take care to only parse the log for it if the person that uploaded the log mentions that they are attempting to host a server.

Bobbyperson commented 2 months ago

Can you please give an example of what this looks like/what it should look for?

GeckoEidechse commented 2 months ago

Updated the description now with the information from https://github.com/R2Northstar/Northstar/issues/685 which is a bit more detailed ^^

IMO, the most difficult thing about this is that we also need to check whether based on their messages whether a player is actually attempting to host a server as each game client tries to register with master server when they join multiplayer lobby.

GeckoEidechse commented 2 months ago

Hmm, maybe we don't need to check if the person mentioned wanting to host a server after all?

https://github.com/R2Northstar/NorthstarLauncher/pull/543

Bobbyperson commented 2 months ago

Alrighty, I'll hold off for now until that maybe becomes a definitely

GeckoEidechse commented 2 months ago

Eh, I think we can just try without the additional check, verify in prod whether it works and if it does not we just disable the cog again until we fix it ^^