Skip to content

Commit

Permalink
perf: Applied Channels.DefaultUnreliable to Experimental Network Tran…
Browse files Browse the repository at this point in the history
…sform
  • Loading branch information
MrGadget1024 committed Nov 28, 2020
1 parent 1616f57 commit 0856bc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Assets/Mirror/Components/Experimental/NetworkTransformBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool NeedsTeleport()
}

// local authority client sends sync message to server for broadcasting
[Command]
[Command(channel = Channels.DefaultUnreliable)]
void CmdClientToServerSync(Vector3 position, uint packedRotation, Vector3 scale)
{
// Ignore messages from client if not in client authority mode
Expand All @@ -229,7 +229,7 @@ void CmdClientToServerSync(Vector3 position, uint packedRotation, Vector3 scale)
RpcMove(position, packedRotation, scale);
}

[ClientRpc]
[ClientRpc(channel = Channels.DefaultUnreliable)]
void RpcMove(Vector3 position, uint packedRotation, Vector3 scale)
{
if (hasAuthority && excludeOwnerUpdate) return;
Expand Down Expand Up @@ -456,7 +456,7 @@ void DoTeleport(Vector3 newLocalPosition, Quaternion newLocalRotation)
lastRotation = newLocalRotation;
}

[ClientRpc]
[ClientRpc(channel = Channels.DefaultUnreliable)]
void RpcTeleport(Vector3 newPosition, uint newPackedRotation, bool isClientAuthority)
{
DoTeleport(newPosition, Compression.DecompressQuaternion(newPackedRotation));
Expand All @@ -470,7 +470,7 @@ void RpcTeleport(Vector3 newPosition, uint newPackedRotation, bool isClientAutho
/// This RPC will be invoked on server after client finishes overriding the position.
/// </summary>
/// <param name="initialAuthority"></param>
[Command]
[Command(channel = Channels.DefaultUnreliable)]
void CmdTeleportFinished()
{
if (clientAuthorityBeforeTeleport)
Expand Down

0 comments on commit 0856bc0

Please sign in to comment.