Move HandleSyncPckt to it's own call
This commit is contained in:
parent
97a6b74417
commit
48f02df34c
@ -97,12 +97,7 @@ namespace NeonTea.Quakeball.Networking.Instances {
|
||||
}
|
||||
} else if (packet is PlayerSyncPacket) {
|
||||
PlayerSyncPacket syncPckt = (PlayerSyncPacket)packet;
|
||||
if (Players[conn.uid].Controlled != null) {
|
||||
syncPckt.PlayerId = conn.uid;
|
||||
if (!Players[conn.uid].Controlled.ProcessSyncPacket(syncPckt, false)) {
|
||||
Players[conn.uid].Unsynced = true;
|
||||
}
|
||||
}
|
||||
HandleSyncPckt(conn.uid, syncPckt);
|
||||
} else if (packet is PlayerActionPckt) {
|
||||
PlayerActionPckt action = (PlayerActionPckt)packet;
|
||||
if (Players[conn.uid].Controlled != null) {
|
||||
@ -145,6 +140,15 @@ namespace NeonTea.Quakeball.Networking.Instances {
|
||||
PlayerList.Remove(player);
|
||||
}
|
||||
|
||||
private void HandleSyncPckt(ulong uid, PlayerSyncPacket pckt) {
|
||||
if (Players[uid].Controlled != null) {
|
||||
pckt.PlayerId = uid;
|
||||
if (!Players[uid].Controlled.ProcessSyncPacket(pckt, false)) {
|
||||
Players[uid].Unsynced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleAction(ulong uid, PlayerActionPckt action) {
|
||||
switch (action.Action) {
|
||||
case PlayerAction.Jump:
|
||||
|
Loading…
Reference in New Issue
Block a user