-
Notifications
You must be signed in to change notification settings - Fork 0
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
Updated remote error handling #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work. I tested it and it works as intended. That improves what errors are shown
Maybe we can consider printing every detail on errors with connected players, as these are the errors we are actually "interested in" most of the time. I marked it below
Uhm I generally think its confusing that we have a connected flag in every player... |
It is also used to make sure that we are not trying to send something to a disconnected player (which would cause an error). For that we need to know if a player is connected or not (or the game would have to know, but I think that would be even more confusing). Like I wrote, I'm not sure if this is the best way to know if the player is connected. Are you suggesting using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work. it works now as intended.
Problem
@PacoSchatz and I noticed that the remote error handling that was introduced with a dummy handling function in #82 is not practical for debugging. The problem was that a disconnected player can cause remote errors, but they are not really that important because the player already disconnected, and everything is handled. But for connected players, the remote errors are important for debugging.
Changes
This problem is trying to be solved here, by making sure that there are less remote errors and sorting the errors by connected and disconnected players.
Action validation on client side
It is now checked that every action that is being sent is a list of floats. This makes sure that the client does not send something that would cause a remote error. But the actual action validation still happens on the server side.
Knowing which player is connected
Every player has now a variable
is_connected
. I'm not sure if that is the best solution. It would also be possible to do this with the connected player list in the player manager, but I thought this would be more complicated. But I am open for other suggestions here.Sending commands
Commands (e.g. to notify start, end, ...) are now only sent if the player is actually connected. This also reduces the number or remote errors.
Handling remote errors
The remote errors are now handled by the
Server
by the methodon_remote_error()
. There are different error messages created for connected and disconnected players.