diff --git a/Integrations/Cod/CodRConConnection.cs b/Integrations/Cod/CodRConConnection.cs index 1e299a7b..9868c717 100644 --- a/Integrations/Cod/CodRConConnection.cs +++ b/Integrations/Cod/CodRConConnection.cs @@ -63,10 +63,21 @@ namespace Integrations.Cod finally { - if (ActiveQueries[Endpoint].OnComplete.CurrentCount == 0) + var state = ActiveQueries[Endpoint]; + if (state.OnComplete.CurrentCount == 0) { - ActiveQueries[Endpoint].OnComplete.Release(1); - ActiveQueries[Endpoint].ConnectionAttempts = 0; + state.OnComplete.Release(1); + state.ConnectionAttempts = 0; + } + + if (state.OnReceivedData.CurrentCount == 0) + { + state.OnReceivedData.Release(1); + } + + if (state.OnSentData.CurrentCount == 0) + { + state.OnSentData.Release(1); } } } diff --git a/SharedLibraryCore/Server.cs b/SharedLibraryCore/Server.cs index 76729b97..48102eeb 100644 --- a/SharedLibraryCore/Server.cs +++ b/SharedLibraryCore/Server.cs @@ -391,7 +391,7 @@ namespace SharedLibraryCore public string[] ExecuteServerCommand(string command) { var tokenSource = new CancellationTokenSource(); - tokenSource.CancelAfter(TimeSpan.FromSeconds(1)); + tokenSource.CancelAfter(TimeSpan.FromSeconds(5)); try { @@ -406,7 +406,7 @@ namespace SharedLibraryCore public string GetServerDvar(string dvarName) { var tokenSource = new CancellationTokenSource(); - tokenSource.CancelAfter(TimeSpan.FromSeconds(1)); + tokenSource.CancelAfter(TimeSpan.FromSeconds(5)); try { return this.GetDvarAsync(dvarName, token: tokenSource.Token).GetAwaiter().GetResult().Value; @@ -420,7 +420,7 @@ namespace SharedLibraryCore public bool SetServerDvar(string dvarName, string dvarValue) { var tokenSource = new CancellationTokenSource(); - tokenSource.CancelAfter(TimeSpan.FromSeconds(1)); + tokenSource.CancelAfter(TimeSpan.FromSeconds(5)); try { this.SetDvarAsync(dvarName, dvarValue, tokenSource.Token).GetAwaiter().GetResult();