diff --git a/scripts/net/Peer.cs b/scripts/net/Peer.cs index 9bc3157..e984250 100644 --- a/scripts/net/Peer.cs +++ b/scripts/net/Peer.cs @@ -65,6 +65,7 @@ namespace Network { int Port = PacketPeer.GetPacketPort(); PacketBuffer PB = PacketBuffer.FromByteBuffer(Buffer); + if (PB.Length > ConfirmationBytes.Length) { bool Confirmed = true; foreach (byte B in ConfirmationBytes) { diff --git a/scripts/net/packethandling/PacketBuffer.cs b/scripts/net/packethandling/PacketBuffer.cs index e83380b..edb22dc 100644 --- a/scripts/net/packethandling/PacketBuffer.cs +++ b/scripts/net/packethandling/PacketBuffer.cs @@ -9,7 +9,7 @@ namespace Network.PacketHandling { public byte[] ByteBuffer { get { return ByteList.ToArray(); } } public int Length { get { return ByteList.Count; } } - public bool HasNext { get { return ReadCounter > ByteList.Count; } } + public bool HasNext { get { return ReadCounter < ByteList.Count; } } public byte Read() { if (!HasNext) {