Fix for NetworkBehaviour.authority#3495
Fix for NetworkBehaviour.authority#3495Pelax wants to merge 9 commits intoMirrorNetworking:masterfrom
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 |
aletoivonen
left a comment
There was a problem hiding this comment.
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.
@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.