Initial .net 6 upgrades
This commit is contained in:
@ -17,4 +17,4 @@
|
||||
public string RConResponse { get; set; }
|
||||
public string RconGetInfoResponseHeader { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,53 +1,65 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace SharedLibraryCore.RCon
|
||||
{
|
||||
public static class StaticHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// defines the type of RCon query sent to a server
|
||||
/// 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
|
||||
/// 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
|
||||
/// 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
|
||||
/// retrieve the value of a DVAR
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
GET_DVAR,
|
||||
|
||||
/// <summary>
|
||||
/// set the value of a DVAR
|
||||
/// RCon password is required
|
||||
/// set the value of a DVAR
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
SET_DVAR,
|
||||
|
||||
/// <summary>
|
||||
/// execute a command
|
||||
/// RCon password is required
|
||||
/// execute a command
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
COMMAND,
|
||||
|
||||
/// <summary>
|
||||
/// get the full server command information
|
||||
/// RCon password is required
|
||||
/// get the full server command information
|
||||
/// RCon password is required
|
||||
/// </summary>
|
||||
COMMAND_STATUS
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// line seperator char included in response from the server
|
||||
/// line seperator char included in response from the server
|
||||
/// </summary>
|
||||
public static char SeperatorChar = (char)int.Parse("0a", System.Globalization.NumberStyles.AllowHexSpecifier);
|
||||
public static char SeperatorChar = (char)int.Parse("0a", NumberStyles.AllowHexSpecifier);
|
||||
|
||||
/// <summary>
|
||||
/// timeout in seconds to wait for a socket send or receive before giving up
|
||||
/// interval in milliseconds to wait before sending the next RCon request
|
||||
/// </summary>
|
||||
public static readonly int FloodProtectionInterval = 750;
|
||||
|
||||
/// <summary>
|
||||
/// timeout in seconds to wait for a socket send or receive before giving up
|
||||
/// </summary>
|
||||
public static TimeSpan SocketTimeout(int retryAttempt)
|
||||
{
|
||||
@ -57,12 +69,8 @@ namespace SharedLibraryCore.RCon
|
||||
2 => TimeSpan.FromMilliseconds(1000),
|
||||
3 => TimeSpan.FromMilliseconds(2000),
|
||||
4 => TimeSpan.FromMilliseconds(5000),
|
||||
_ => TimeSpan.FromMilliseconds(10000),
|
||||
_ => TimeSpan.FromMilliseconds(10000)
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// interval in milliseconds to wait before sending the next RCon request
|
||||
/// </summary>
|
||||
public static readonly int FloodProtectionInterval = 750;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user