update readme
add vision average to client stats other stuff
This commit is contained in:
@ -35,7 +35,6 @@ namespace SharedLibraryCore.RCon
|
||||
ILogger Log;
|
||||
int FailedSends;
|
||||
int FailedReceives;
|
||||
static DateTime LastQuery;
|
||||
string response;
|
||||
|
||||
ManualResetEvent OnConnected;
|
||||
@ -142,14 +141,14 @@ 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 < 350)
|
||||
{
|
||||
Thread.Sleep(350);
|
||||
//await Task.Delay(350);
|
||||
}
|
||||
//// will this really prevent flooding?
|
||||
//if ((DateTime.Now - LastQuery).TotalMilliseconds < 350)
|
||||
//{
|
||||
// Thread.Sleep(350);
|
||||
// //await Task.Delay(350);
|
||||
//}
|
||||
|
||||
LastQuery = DateTime.Now;
|
||||
// LastQuery = DateTime.Now;
|
||||
|
||||
OnSent.Reset();
|
||||
OnReceived.Reset();
|
||||
|
@ -4,15 +4,45 @@ namespace SharedLibraryCore.RCon
|
||||
{
|
||||
public static class StaticHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// defines the type of RCon query sent to a server
|
||||
/// </summary>
|
||||
public enum QueryType
|
||||
{
|
||||
/// <summary>
|
||||
/// retrieve the status of a server
|
||||
/// does not require RCon password
|
||||
/// </summary>
|
||||
GET_STATUS,
|
||||
/// <summary>
|
||||
/// retrieve the information of a server
|
||||
/// server responds with key/value pairs
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
GET_INFO,
|
||||
/// <summary>
|
||||
/// retrieve the value of a DVAR
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
DVAR,
|
||||
/// <summary>
|
||||
/// execute a command
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
COMMAND,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// line seperator char included in response from the server
|
||||
/// </summary>
|
||||
public static char SeperatorChar = (char)int.Parse("0a", System.Globalization.NumberStyles.AllowHexSpecifier);
|
||||
/// <summary>
|
||||
/// timeout in seconds to wait for a socket send or receive before giving up
|
||||
/// </summary>
|
||||
public static readonly TimeSpan SocketTimeout = new TimeSpan(0, 0, 10);
|
||||
/// <summary>
|
||||
/// interval in milliseconds to wait before sending the next RCon request
|
||||
/// </summary>
|
||||
public static readonly int FloodProtectionInterval = 350;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user