Skip to content

Commit a422735

Browse files
committed
Fixed response rpc timeout chekcs
1 parent 6e667cc commit a422735

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

MLAPI/NetworkingManagerComponents/Core/ResponseMessageManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Linq;
23
using UnityEngine;
34

45
namespace MLAPI.Internal
@@ -17,16 +18,15 @@ internal static ulong GenerateMessageId()
1718

1819
internal static void CheckTimeouts()
1920
{
20-
while (responseAdded.Count > 0 && Time.time - responseAdded[0] > pendingResponses[responseAdded.Keys[0]].Timeout)
21+
while (responseAdded.Count > 0 && Time.time - responseAdded[responseAdded.Keys[0]] > pendingResponses[responseAdded.Keys[0]].Timeout)
2122
{
2223
ulong key = responseAdded.Keys[0];
2324

2425
RpcResponseBase response = pendingResponses[key];
2526
response.IsDone = true;
2627
response.IsSuccessful = false;
27-
28-
responseAdded.Remove(key);
29-
pendingResponses.Remove(key);
28+
29+
Remove(key);
3030
}
3131
}
3232

0 commit comments

Comments
 (0)