-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Fix for NetworkBehaviour.authority #3495
Conversation
good find. |
Yeah I could do that. Would 4 tests that check if it's true work? I'm thinking client only, server only, host as client, host as server. Also, should it be included in |
@Pelax any chance you could explain how to reproduce this with our tanks example? |
@vis2k You can repro it by spawning any server-to-client object without ownerConnection while in host mode, and evaluating the authority. Debug.Log("syncDirection: " + syncDirection);
Debug.Log("authority: " + authority); Then you start the host, and shoot, the console will indicate that the projectile is server-to-client and authority is false (but as we know authority is true) |
thanks for explanation, gonna test in a few days! |
there are two issues here: |
fixed slightly differently. nice find! |
@vis2k looks like you did what @MrGadget1024 suggested a few weeks ago. I might be wrong, but as I mentioned in that conversation, I think this only reverses the problem. Wouldn't a client-owned with client-to-server sync direction entity return false in a host now? |
I reopend the PR: #3531 |
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.
I tested this and for me this works just as I expect it to work based on the documentation.
Update from master
Update to latest Mirror master
Updated to latest Mirror
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.
@vis2k I added these 8 tests with the variations that make sense to me, let me know what you think. If I run them in master branch, the one at line 174 fails (Host isOwned=false syncDirection=ServerToClient), basically the error that motivated this change suggestion.
Update to latest master
update to latest master
update from mirror master
Update from master
sorry, totally forgot this. |
Checking for both isClient and isServer to consider NetworkManagerMode.Host
Currently this flag is returning false if a NB is spawned without an ownerConnection (server-owned) in a host. It evaluates isClient as true and does the clients checks only. But if the NB syncs server-to-client, the host actually has authority.