mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
adding Cod4 support (for steam GUID is truncated to 16 characters)
exit properly whoops add all linked accounts to drop down consolidate linked admin accounts to the most recently seen one limited some waits to 5s to hopefully prevent a rare thread lock
This commit is contained in:
@ -33,25 +33,6 @@ namespace SharedLibraryCore.RCon
|
||||
}
|
||||
}
|
||||
|
||||
class ResponseEvent
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string[] Response { get; set; }
|
||||
public Task Awaiter
|
||||
{
|
||||
get
|
||||
{
|
||||
return Task.Run(() => FinishedEvent.Wait());
|
||||
}
|
||||
}
|
||||
private ManualResetEventSlim FinishedEvent;
|
||||
|
||||
public ResponseEvent()
|
||||
{
|
||||
FinishedEvent = new ManualResetEventSlim();
|
||||
}
|
||||
}
|
||||
|
||||
public class Connection
|
||||
{
|
||||
public IPEndPoint Endpoint { get; private set; }
|
||||
@ -110,7 +91,7 @@ namespace SharedLibraryCore.RCon
|
||||
OnSent.Set();
|
||||
}
|
||||
|
||||
catch (SocketException)
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -167,9 +148,9 @@ namespace SharedLibraryCore.RCon
|
||||
public async Task<string[]> SendQueryAsync(StaticHelpers.QueryType type, string parameters = "", bool waitForResponse = true)
|
||||
{
|
||||
// will this really prevent flooding?
|
||||
if ((DateTime.Now - LastQuery).TotalMilliseconds < 250)
|
||||
if ((DateTime.Now - LastQuery).TotalMilliseconds < 350)
|
||||
{
|
||||
await Task.Delay(250);
|
||||
await Task.Delay(350);
|
||||
}
|
||||
|
||||
LastQuery = DateTime.Now;
|
||||
|
Reference in New Issue
Block a user