From 0bcc31093c691599a1f4d0a5696266dc45efc290 Mon Sep 17 00:00:00 2001 From: teascade Date: Sat, 8 Aug 2020 04:23:26 +0300 Subject: [PATCH] Change LocalPlayerJump -> LocalPlayerAction --- Assets/Scripts/Networking/Instances/Client.cs | 4 ++-- Assets/Scripts/Networking/Instances/NetInstance.cs | 2 +- Assets/Scripts/Networking/Instances/Server.cs | 4 ++-- Assets/Scripts/Players/LocalPlayer.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Networking/Instances/Client.cs b/Assets/Scripts/Networking/Instances/Client.cs index c56d107..a781806 100644 --- a/Assets/Scripts/Networking/Instances/Client.cs +++ b/Assets/Scripts/Networking/Instances/Client.cs @@ -151,9 +151,9 @@ namespace NeonTea.Quakeball.Networking.Instances { } } - public override void LocalPlayerJump() { + public override void LocalPlayerAction(PlayerAction action) { if (SelfIdentified && Server != null) { - PlayerActionPckt jump = new PlayerActionPckt(); + PlayerActionPckt jump = new PlayerActionPckt(action); Peer.SendReliable(Server.uid, jump); } } diff --git a/Assets/Scripts/Networking/Instances/NetInstance.cs b/Assets/Scripts/Networking/Instances/NetInstance.cs index 20bcb9d..7fb5e2b 100644 --- a/Assets/Scripts/Networking/Instances/NetInstance.cs +++ b/Assets/Scripts/Networking/Instances/NetInstance.cs @@ -25,7 +25,7 @@ namespace NeonTea.Quakeball.Networking.Instances { public abstract void UpdateLocalPlayer(); public abstract void SendPlayerSync(); - public abstract void LocalPlayerJump(); + public abstract void LocalPlayerAction(PlayerAction action); public virtual void Update() { } diff --git a/Assets/Scripts/Networking/Instances/Server.cs b/Assets/Scripts/Networking/Instances/Server.cs index 825cb8a..2a8ae5f 100644 --- a/Assets/Scripts/Networking/Instances/Server.cs +++ b/Assets/Scripts/Networking/Instances/Server.cs @@ -175,8 +175,8 @@ namespace NeonTea.Quakeball.Networking.Instances { SendUnreliableToAll(pckt); } - public override void LocalPlayerJump() { - PlayerActionPckt jump = new PlayerActionPckt(PlayerAction.Jump, LocalPlayer.Id); + public override void LocalPlayerAction(PlayerAction action) { + PlayerActionPckt jump = new PlayerActionPckt(action, LocalPlayer.Id); SendReliableToAll(jump); } diff --git a/Assets/Scripts/Players/LocalPlayer.cs b/Assets/Scripts/Players/LocalPlayer.cs index b73fe64..8b159b0 100644 --- a/Assets/Scripts/Players/LocalPlayer.cs +++ b/Assets/Scripts/Players/LocalPlayer.cs @@ -96,7 +96,7 @@ namespace NeonTea.Quakeball.Players { if (WantsToJump) { bool Jumped = Player.Jump(); if (Jumped && Networking.Net.Singleton.Instance != null) { - Networking.Net.Singleton.Instance.LocalPlayerJump(); + Networking.Net.Singleton.Instance.LocalPlayerAction(PlayerAction.Jump); } } WantsToJump = false;