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) {
|
} else if (packet is PlayerSyncPacket) {
|
||||||
PlayerSyncPacket syncPckt = (PlayerSyncPacket)packet;
|
PlayerSyncPacket syncPckt = (PlayerSyncPacket)packet;
|
||||||
if (Players[conn.uid].Controlled != null) {
|
HandleSyncPckt(conn.uid, syncPckt);
|
||||||
syncPckt.PlayerId = conn.uid;
|
|
||||||
if (!Players[conn.uid].Controlled.ProcessSyncPacket(syncPckt, false)) {
|
|
||||||
Players[conn.uid].Unsynced = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (packet is PlayerActionPckt) {
|
} else if (packet is PlayerActionPckt) {
|
||||||
PlayerActionPckt action = (PlayerActionPckt)packet;
|
PlayerActionPckt action = (PlayerActionPckt)packet;
|
||||||
if (Players[conn.uid].Controlled != null) {
|
if (Players[conn.uid].Controlled != null) {
|
||||||
@ -145,6 +140,15 @@ namespace NeonTea.Quakeball.Networking.Instances {
|
|||||||
PlayerList.Remove(player);
|
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) {
|
private void HandleAction(ulong uid, PlayerActionPckt action) {
|
||||||
switch (action.Action) {
|
switch (action.Action) {
|
||||||
case PlayerAction.Jump:
|
case PlayerAction.Jump:
|
||||||
|
Loading…
Reference in New Issue
Block a user