Change LocalPlayerJump -> LocalPlayerAction

This commit is contained in:
Sofia 2020-08-08 04:23:26 +03:00
parent d33028047e
commit 0bcc31093c
4 changed files with 6 additions and 6 deletions

View File

@ -151,9 +151,9 @@ namespace NeonTea.Quakeball.Networking.Instances {
} }
} }
public override void LocalPlayerJump() { public override void LocalPlayerAction(PlayerAction action) {
if (SelfIdentified && Server != null) { if (SelfIdentified && Server != null) {
PlayerActionPckt jump = new PlayerActionPckt(); PlayerActionPckt jump = new PlayerActionPckt(action);
Peer.SendReliable(Server.uid, jump); Peer.SendReliable(Server.uid, jump);
} }
} }

View File

@ -25,7 +25,7 @@ namespace NeonTea.Quakeball.Networking.Instances {
public abstract void UpdateLocalPlayer(); public abstract void UpdateLocalPlayer();
public abstract void SendPlayerSync(); public abstract void SendPlayerSync();
public abstract void LocalPlayerJump(); public abstract void LocalPlayerAction(PlayerAction action);
public virtual void Update() { } public virtual void Update() { }

View File

@ -175,8 +175,8 @@ namespace NeonTea.Quakeball.Networking.Instances {
SendUnreliableToAll(pckt); SendUnreliableToAll(pckt);
} }
public override void LocalPlayerJump() { public override void LocalPlayerAction(PlayerAction action) {
PlayerActionPckt jump = new PlayerActionPckt(PlayerAction.Jump, LocalPlayer.Id); PlayerActionPckt jump = new PlayerActionPckt(action, LocalPlayer.Id);
SendReliableToAll(jump); SendReliableToAll(jump);
} }

View File

@ -96,7 +96,7 @@ namespace NeonTea.Quakeball.Players {
if (WantsToJump) { if (WantsToJump) {
bool Jumped = Player.Jump(); bool Jumped = Player.Jump();
if (Jumped && Networking.Net.Singleton.Instance != null) { if (Jumped && Networking.Net.Singleton.Instance != null) {
Networking.Net.Singleton.Instance.LocalPlayerJump(); Networking.Net.Singleton.Instance.LocalPlayerAction(PlayerAction.Jump);
} }
} }
WantsToJump = false; WantsToJump = false;