Add no cheating this time -flag

This commit is contained in:
Sofia 2020-08-07 05:34:38 +03:00
parent 276c1b265e
commit 550b42bc95
3 changed files with 4 additions and 3 deletions

View File

@ -51,7 +51,6 @@ namespace NeonTea.Quakeball.Net.Instances {
SelfIdentPckt ident = (SelfIdentPckt)packet; SelfIdentPckt ident = (SelfIdentPckt)packet;
LocalPlayer.Id = ident.PlayerId; LocalPlayer.Id = ident.PlayerId;
Players.Add(LocalPlayer.Id, LocalPlayer); Players.Add(LocalPlayer.Id, LocalPlayer);
Debug.Log($"I got self-identified as {LocalPlayer.Id}");
SpawnPckt spawn = new SpawnPckt(); SpawnPckt spawn = new SpawnPckt();
spawn.Location = LocalPlayer.Controlled.transform.position; spawn.Location = LocalPlayer.Controlled.transform.position;

View File

@ -46,7 +46,6 @@ namespace NeonTea.Quakeball.Net.Instances {
Players.Add(RemotePlayer.Id, RemotePlayer); Players.Add(RemotePlayer.Id, RemotePlayer);
SelfIdentPckt ident = new SelfIdentPckt(); SelfIdentPckt ident = new SelfIdentPckt();
ident.PlayerId = RemotePlayer.Id; ident.PlayerId = RemotePlayer.Id;
Debug.Log("Send self-ident!");
Peer.SendReliable(conn.uid, ident); Peer.SendReliable(conn.uid, ident);
} }
@ -55,7 +54,6 @@ namespace NeonTea.Quakeball.Net.Instances {
public override void Handle(Connection conn, Packet packet) { public override void Handle(Connection conn, Packet packet) {
if (packet is SpawnPckt) { if (packet is SpawnPckt) {
Debug.Log("Do i ever get it");
SpawnPckt spawn = (SpawnPckt)packet; SpawnPckt spawn = (SpawnPckt)packet;
if (Players[conn.uid].Controlled == null) { if (Players[conn.uid].Controlled == null) {
GameObject obj = Net.SpawnPlayer(spawn.Location); GameObject obj = Net.SpawnPlayer(spawn.Location);

View File

@ -210,6 +210,10 @@ namespace NeonTea.Quakeball.TeaNet.Peers {
conn.Status = ConnectionStatus.Ready; conn.Status = ConnectionStatus.Ready;
ProtocolActionQueues[protocol.Identifier].Enqueue(new ConnectionChangedAction(oldStatus, conn.Status, conn)); ProtocolActionQueues[protocol.Identifier].Enqueue(new ConnectionChangedAction(oldStatus, conn.Status, conn));
} }
if (!(oldStatus == ConnectionStatus.Establishing || oldStatus == ConnectionStatus.Ready)) {
break; // No cheating at this table! For realsies this time!
}
conn.Internal.LatestOutwardReliable = buffer.ReadInt(); conn.Internal.LatestOutwardReliable = buffer.ReadInt();
List<Packet> list = PacketQueue[conn.uid]; List<Packet> list = PacketQueue[conn.uid];