adding clientAuthority to commands (#2064)

This commit is contained in:
James Frowen 2020-07-03 16:31:42 +01:00 committed by GitHub
parent c278c004f6
commit 57bc80c9cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,6 +270,10 @@ void SendRigidBodySettings()
[Command]
void CmdSendVelocity(Vector3 velocity)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.velocity = velocity;
target.velocity = velocity;
}
@ -280,6 +284,10 @@ void CmdSendVelocity(Vector3 velocity)
[Command]
void CmdSendVelocityAndAngular(Vector3 velocity, Vector3 angularVelocity)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
if (syncVelocity)
{
this.velocity = velocity;
@ -294,6 +302,10 @@ void CmdSendVelocityAndAngular(Vector3 velocity, Vector3 angularVelocity)
[Command]
void CmdSendIsKinematic(bool isKinematic)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.isKinematic = isKinematic;
target.isKinematic = isKinematic;
}
@ -301,6 +313,10 @@ void CmdSendIsKinematic(bool isKinematic)
[Command]
void CmdSendUseGravity(bool useGravity)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.useGravity = useGravity;
target.useGravity = useGravity;
}
@ -308,6 +324,10 @@ void CmdSendUseGravity(bool useGravity)
[Command]
void CmdSendDrag(float drag)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.drag = drag;
target.drag = drag;
}
@ -315,6 +335,10 @@ void CmdSendDrag(float drag)
[Command]
void CmdSendAngularDrag(float angularDrag)
{
// Ignore messages from client if not in client authority mode
if (!clientAuthority)
return;
this.angularDrag = angularDrag;
target.angularDrag = angularDrag;
}