Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ public unsafe void Send(ulong clientId, NetworkDelivery delivery, FastBufferWrit
break;
}
case TypeOfCorruption.CorruptBytes:
batchData.Seek(batchData.Length - 2);
var currentByte = batchData.GetUnsafePtr()[0];
batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0));
MessageQueue.Add(batchData.ToArray());
for (int i = 0; i < 4; i++)
{
var currentByte = batchData.GetUnsafePtr()[i];
currentByte = (byte)((currentByte + 1) % 255);
batchData.WriteByteSafe(currentByte);
MessageQueue.Add(batchData.ToArray());
}
break;
case TypeOfCorruption.Truncated:
batchData.Truncate(batchData.Length - 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public IEnumerator Cleanup()

// Need to destroy the GameObject (all assigned components will get destroyed too)
UnityEngine.Object.DestroyImmediate(m_Server.gameObject);
m_Server = null;
}

if (m_Client1)
Expand All @@ -59,6 +60,7 @@ public IEnumerator Cleanup()

// Need to destroy the GameObject (all assigned components will get destroyed too)
UnityEngine.Object.DestroyImmediate(m_Client1.gameObject);
m_Client1 = null;
}

if (m_Client2)
Expand All @@ -67,6 +69,7 @@ public IEnumerator Cleanup()

// Need to destroy the GameObject (all assigned components will get destroyed too)
UnityEngine.Object.DestroyImmediate(m_Client2.gameObject);
m_Client2 = null;
}
m_ServerEvents?.Clear();
m_Client1Events?.Clear();
Expand Down Expand Up @@ -317,7 +320,7 @@ public IEnumerator DisconnectOnReliableSendQueueOverflow()
m_Server.StartServer();
m_Client1.StartClient();

yield return WaitForNetworkEvent(NetworkEvent.Connect, m_Client1Events);
yield return WaitForNetworkEvent(NetworkEvent.Connect, m_Client1Events, 5.0f);

var serverClientId = m_Client1.ServerClientId;

Expand Down
Loading