Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't log masterserver registration errors in the lobby #543

Merged

Conversation

ASpoonPlaysGames
Copy link
Contributor

Testing:
image

The error saying "reached maximum ms registration attempts" i think is fine to show? The main purpose of this PR is to not flood the console with errors that aren't really errors, thus preventing various tickets or misleading users.

@ASpoonPlaysGames
Copy link
Contributor Author

Im aware that this code isnt fantastic, but I've been waiting too long for the fabled MS rewrite that I'm just gonna PR a stopgap solution

@F1F7Y
Copy link
Member

F1F7Y commented Sep 6, 2023

I've been waiting too long for the fabled MS rewrite

https://github.com/F1F7Y/NorthstarLauncher/blob/primedev/primedev/networksystem/atlas.cpp 👉 👈

@ASpoonPlaysGames ASpoonPlaysGames added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Sep 6, 2023
Copy link
Member

@pg9182 pg9182 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works overall.

NorthstarDLL/masterserver/masterserver.cpp Outdated Show resolved Hide resolved
@uniboi
Copy link
Contributor

uniboi commented Sep 7, 2023

Reached max ms server registration attempts should be a warning imo. If it's an error it's still misleading for users.

@ASpoonPlaysGames
Copy link
Contributor Author

Reached max ms server registration attempts should be a warning imo. If it's an error it's still misleading for users.

I can do this if needed, would like a second opinion though if possible.
@pg9182 ?

@ASpoonPlaysGames
Copy link
Contributor Author

Side note: format check is so stupid sometimes:

bool shouldLogError =
	!strstr(pServerPresence->m_MapName, "mp_lobby")
	&& strstr(pServerPresence->m_PlaylistName, "private_match")
	&& !IsDedicatedServer();

is apparently bad, and should become

bool shouldLogError = !strstr(pServerPresence->m_MapName, "mp_lobby") &&
					  strstr(pServerPresence->m_PlaylistName, "private_match") && !IsDedicatedServer();

it seriously wants me to use 5 tabs + 2 spaces to indent that (relative to the start of the line)

@pg9182
Copy link
Member

pg9182 commented Sep 8, 2023

I can do this if needed, would like a second opinion though if possible.

Yes, warning for non-dedi; error for dedi (in fact, should consider making another PR to exit if it fails unless a convar is set to disable it -- then version gates could update automatically with docker always-pull too).

@GeckoEidechse
Copy link
Member

GeckoEidechse commented Sep 8, 2023

Yes, warning for non-dedi; error for dedi (in fact, should consider making another PR to exit if it fails unless a convar is set to disable it -- then version gates could update automatically with docker always-pull too).

We already established in testing that with auto restart and alway-pull in docker compose will, the container dying and restarting does not actually pull a new image. Only explicit restart docker compose down && docker compose up actually restarts it.

@Alystrasz
Copy link
Contributor

I tested this PR with the game client, and saw no errors while in lobby.
But while launching a dedicated server, I had the following output:

image

Since it's a dedicated server, I would expect the error messages to be displayed, but they do not appear.
Is this expected behaviour?

@ASpoonPlaysGames
Copy link
Contributor Author

Since it's a dedicated server, I would expect the error messages to be displayed, but they do not appear. Is this expected behaviour?

Nah, seemingly that's just me a month ago apparently not knowing how boolean operations work, will fix later

@GeckoEidechse
Copy link
Member

If someone wants to host a listen server but forgot to set up port forwarding, do they still have a way to see the error message like "Unable to reach gameserver"?

So that in the rare case someone is actually trying to host a listen server but failing they actually have a way of seeing what's wrong.

@ASpoonPlaysGames
Copy link
Contributor Author

If someone wants to host a listen server but forgot to set up port forwarding, do they still have a way to see the error message like "Unable to reach gameserver"?

They would already see it, since a listen server would be in private match. This PR stops it specifically in the normal lobby.

@GeckoEidechse
Copy link
Member

They would already see it, since a listen server would be in private match. This PR stops it specifically in the normal lobby.

I'm aware that it doesn't show in normal lobby. What I'm wondering is what happens if the player doesn't go to private match before the 4 registration attempts but only afterwards. AFAIK there's no explicit re-registration attempt when we enter private match so they wouldn't see the error message. Or am I missing something? ^^

@ASpoonPlaysGames
Copy link
Contributor Author

What I'm wondering is what happens if the player doesn't go to private match before the 4 registration attempts but only afterwards. AFAIK there's no explicit re-registration attempt when we enter private match so they wouldn't see the error message. Or am I missing something? ^^

Yeah that's probably accurate, haven't tested though, will maybe test this case later

@GeckoEidechse
Copy link
Member

Aight. Otherwise I'd suggest re-trying master server registration in case of failure on private match but that would probably be a separate PR ^^

Copy link
Contributor

@Alystrasz Alystrasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code logic looks good.
Registration error messages aren't displayed on client anymore (while still displayed on dedicated).
Reached max ms server registration attempts message is now displayed as a warning on client (still as an error on dedicated).

@Jan200101
Copy link
Contributor

Alystrasz tested and reviewed the code, marking as ready to be merged

@Jan200101 Jan200101 added READY TO MERGE This mergeable right now and removed needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Oct 20, 2023
@GeckoEidechse
Copy link
Member

Merging based on reviews

@GeckoEidechse GeckoEidechse merged commit 86c2001 into R2Northstar:main Nov 20, 2023
2 checks passed
@ASpoonPlaysGames ASpoonPlaysGames deleted the no-log-gameserver-error branch January 4, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
READY TO MERGE This mergeable right now
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants