Skip to content

Commit b0c37e8

Browse files
revert: refactor RPQQueue singleton, shutdown queue flush (#585)
Revert change as it's not intended for release 0.1.0
1 parent 8f8770a commit b0c37e8

File tree

3 files changed

+142
-212
lines changed

3 files changed

+142
-212
lines changed

com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,17 @@ private void Init(bool server)
324324
if (RpcQueueContainer != null)
325325
{
326326
UnityEngine.Debug.LogError("Init was invoked, but rpcQueueContainer was already initialized! (destroying previous instance)");
327-
RpcQueueContainer.Dispose();
327+
RpcQueueContainer.Shutdown();
328328
RpcQueueContainer = null;
329329
}
330330

331331
//The RpcQueueContainer must be initialized within the Init method ONLY
332332
//It should ONLY be shutdown and destroyed in the Shutdown method (other than just above)
333-
RpcQueueContainer = new RpcQueueContainer(this);
333+
RpcQueueContainer = new RpcQueueContainer(false);
334+
335+
//Note: Since frame history is not being used, this is set to 0
336+
//To test frame history, increase the number to (n) where n > 0
337+
RpcQueueContainer.Initialize(0);
334338

335339
// Register INetworkUpdateSystem (always register this after rpcQueueContainer has been instantiated)
336340
this.RegisterNetworkUpdate(NetworkUpdateStage.EarlyUpdate);
@@ -595,7 +599,7 @@ public void Shutdown()
595599
//If an instance of the RpcQueueContainer is still around, then shut it down and remove the reference
596600
if (RpcQueueContainer != null)
597601
{
598-
RpcQueueContainer.Dispose();
602+
RpcQueueContainer.Shutdown();
599603
RpcQueueContainer = null;
600604
}
601605

0 commit comments

Comments
 (0)