-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
breaking: Using Events instead of Message for connect and disconnect #2397
Conversation
3 things that keep doing
I dont like the name of the events public static event ConnectionEvent OnConnected;
public static event ConnectionEvent OnDisconnect; the |
Since you're obsoleting the messages, I don't think this is a breaking change, unless I missed something else. |
they are not longer being invoked, so if someone manually replaced the handlers this would break edit: changes to NetworkManager have been done in this PR, so users using the |
as far as I can tell, UNET team did it this way so that there is only one way for all events (message + handler). |
I think this is one of the few cases where even though your PR is more simple, we should keep the previous solution with the big picture in mind. |
reopening as discussed on discord |
44ad47d
to
512f5db
Compare
@James-Frowen please rebase, fix sonar errors and switch from draft to live :) |
I'm in the process of fixing the tests, it seems some of them aren't clean up after themselves, I will make it live PR once I sort it out |
This change also stops attackers from sending Connect/Disconnect Message |
* Using events is simpler to understand than InvokeHandler * Allows multiple objects to listen for connect events to add message handlers to NetworkClient this change does cause client OnClientConnect in host mode to be called the same BREAKING CHANGE: use events in NetworkServer/Client instead of handlers for Connect/DisconnectMessage
- removing body (removes references to calls) - adding ObsoleteAttribute
- function not have Internal sufix - events no longer have even sufix
512f5db
to
e55671d
Compare
6bbb0f4
to
1c7156f
Compare
Kudos, SonarCloud Quality Gate passed! |
Please elaborate :) |
An attacker can send the ConnectMessage and Mirror will treat it the same as if it came from I'm not sure exactly how NetworkManager would handle receiving multiple of these from the same client but It will likely call the |
reading through changes again:
|
They have to be renamed so that the events can be called I'm not sure what less this this PR can do? the main point is now to remove
Its been about a month since I started hat and since then we have found that |
closing in favor of 52747a4 |
this change does cause client OnClientConnect in host mode to be called the same
BREAKING CHANGE: use events in NetworkServer/Client instead of handlers for Connect/DisconnectMessage