mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: ClientToServer [SyncVar] wouldn't be broadcast to other clients because server never set it dirty
This commit is contained in:
parent
4743d27f74
commit
d5f7c4bc01
@ -1047,6 +1047,15 @@ internal bool DeserializeServer(NetworkReader reader)
|
||||
// server always knows the initial state (initial=false)
|
||||
// disconnect if failed, to prevent exploits etc.
|
||||
if (!comp.Deserialize(reader, false)) return false;
|
||||
|
||||
// server received state from the owner client.
|
||||
// set dirty so it's broadcast to other clients too.
|
||||
//
|
||||
// note that we set the _whole_ component as dirty.
|
||||
// everything will be broadcast to others.
|
||||
// SetSyncVarDirtyBits() would be nicer, but not all
|
||||
// components use [SyncVar]s.
|
||||
comp.SetDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user