This causes premature rounding error (seen in tank turret bobbing) because full sync data has a rotation less than rotationSensitivity but non 0. but new snapshot derived from delta + quantized full sync data will produce a rotation of 0.
WIP - Need to fix this in V1
* feat(NetworkTransform): Default Sync Direction = Client To Server
- This is done in Reset so Network Behaviour isn't effected.
- This will not change NT components already in place on objects / prefabs unless user manually chooses Reset in the inspector.
* Update Assets/Mirror/Components/NetworkTransform/NetworkTransformBase.cs
---------
Co-authored-by: mischa <16416509+miwarnec@users.noreply.github.com>
Renamed SyncSettings to FullHeader - Affects V1 and V2
Added new enum SyncSettings to exclude rotation sync methods - Only affects V2
Added new enum RotationSettings to select rotation sync methods - Only affects V2
Added function to consider unsynced axes and use current axes values.
Added check to ensure deltas do not send before full syncs and full sync index should start at 1.
This prevents sending of delta, indexed at 0, being received and applied because the initial value of the index is 0 (thus the delta does not get rejected).
* fix(NetworkServer): Improve Warnings
- Attempt to dig up the Object, component, and method name to make debugging easier
- Changes identity to identity.name so the object name is logged correctly.
* Update Assets/Mirror/Core/NetworkServer.cs
Co-authored-by: mischa <16416509+miwarnec@users.noreply.github.com>
* Update Assets/Mirror/Core/NetworkServer.cs
Co-authored-by: mischa <16416509+miwarnec@users.noreply.github.com>
* Use GetFunctionMethodName
* cleanup
---------
Co-authored-by: mischa <16416509+miwarnec@users.noreply.github.com>
* fix: NT-Unreliable Quaternion Compression Fix
Credits to ninja of course :D
* Client using server snapshots fix.
* Nothing to see here..
* Added comment to Quat Rotation Fix
- Same as NetworkServer...allows NetworkMessage handlers to have a channelId param
This is NetworkServer's version:
```cs
public static void RegisterHandler<T>(Action<NetworkConnectionToClient, T, int> handler, bool requireAuthentication = true)
where T : struct, NetworkMessage
{
ushort msgType = NetworkMessageId<T>.Id;
if (handlers.ContainsKey(msgType))
{
Debug.LogWarning($"NetworkServer.RegisterHandler replacing handler for {typeof(T).FullName}, id={msgType}. If replacement is intentional, use ReplaceHandler instead to avoid this warning.");
}
// register Id <> Type in lookup for debugging.
NetworkMessages.Lookup[msgType] = typeof(T);
handlers[msgType] = NetworkMessages.WrapHandler(handler, requireAuthentication, exceptionsDisconnect);
}
```
No need to send the Trigger message back to the owner since we already called animator.SetTrigger
- RpcOnAnimationTriggerClientMessage
- RpcOnAnimationResetTriggerClientMessage
- added [KCP] to all log messages
- fix: #3704 remove old fix for #2353 which caused log spam and isn't needed anymore since the
original Mirror issue is long gone
- fix: KcpClient.RawSend now returns if socket wasn't created yet
- fix: https://github.com/MirrorNetworking/Mirror/issues/3591 KcpPeer.SendDisconnect now rapid
fires several unreliable messages instead of sending reliable. Fixes disconnect message not
going through if the connection is closed & removed immediately after.
* perf(Match Interest Mgmt) Use Dictionary instead of spawned
This is better than iterating all spawned objects and doing TryGetComponent in Update.
* undo rename
* Simplified OnRebuildObservers
* Overhauled Match Interest Mgmt
- no more looping dictionaries
- no more TryGetComponent in hot path
- NetworkMatch component drives the updates
* Cleanup
* syntax
* Merged UpdateDirtyMatches & UpdateMatchObjects into OnMatchChanged
* NetworkMatch - Added isServer check
* MatchInterestManagement: Better matchObjects cleanup
- moved match removal to LateUpdate
- added matchCount for debugging
* Added comment
Co-authored-by: Robin Rolf <imer@imer.cc>
* Formatting
Co-authored-by: Robin Rolf <imer@imer.cc>
* Updated OnMatchChanged / matchCount -> ushort
- Depends on ReadOnlyAttribute
* matchCount -> internal
* matchCount Header
---------
Co-authored-by: Robin Rolf <imer@imer.cc>