2018-04-08 02:44:42 -04:00
|
|
|
|
using System;
|
2018-04-02 01:25:06 -04:00
|
|
|
|
|
2018-04-08 02:44:42 -04:00
|
|
|
|
namespace SharedLibraryCore.RCon
|
2018-04-02 01:25:06 -04:00
|
|
|
|
{
|
|
|
|
|
public static class StaticHelpers
|
|
|
|
|
{
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// defines the type of RCon query sent to a server
|
|
|
|
|
/// </summary>
|
2018-04-02 01:25:06 -04:00
|
|
|
|
public enum QueryType
|
|
|
|
|
{
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// retrieve the status of a server
|
|
|
|
|
/// does not require RCon password
|
|
|
|
|
/// </summary>
|
2018-04-02 01:25:06 -04:00
|
|
|
|
GET_STATUS,
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// retrieve the information of a server
|
|
|
|
|
/// server responds with key/value pairs
|
|
|
|
|
/// RCon password is required
|
|
|
|
|
/// </summary>
|
2018-04-02 01:25:06 -04:00
|
|
|
|
GET_INFO,
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// retrieve the value of a DVAR
|
|
|
|
|
/// RCon password is required
|
|
|
|
|
/// </summary>
|
2019-02-03 21:47:05 -05:00
|
|
|
|
GET_DVAR,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// set the value of a DVAR
|
|
|
|
|
/// RCon password is required
|
|
|
|
|
/// </summary>
|
|
|
|
|
SET_DVAR,
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// execute a command
|
|
|
|
|
/// RCon password is required
|
|
|
|
|
/// </summary>
|
2018-04-02 01:25:06 -04:00
|
|
|
|
COMMAND,
|
2019-02-09 16:35:13 -05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// get the full server command information
|
|
|
|
|
/// RCon password is required
|
|
|
|
|
/// </summary>
|
|
|
|
|
COMMAND_STATUS
|
2018-04-02 01:25:06 -04:00
|
|
|
|
}
|
|
|
|
|
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// line seperator char included in response from the server
|
|
|
|
|
/// </summary>
|
2018-04-02 01:25:06 -04:00
|
|
|
|
public static char SeperatorChar = (char)int.Parse("0a", System.Globalization.NumberStyles.AllowHexSpecifier);
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// timeout in seconds to wait for a socket send or receive before giving up
|
|
|
|
|
/// </summary>
|
2018-10-09 21:19:06 -04:00
|
|
|
|
public static readonly int SocketTimeout = 10000;
|
2018-09-07 23:29:42 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// interval in milliseconds to wait before sending the next RCon request
|
|
|
|
|
/// </summary>
|
2019-01-26 21:33:37 -05:00
|
|
|
|
public static readonly int FloodProtectionInterval = 650;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// how mant failed connection attempts before aborting connection
|
|
|
|
|
/// </summary>
|
2018-09-29 15:52:22 -04:00
|
|
|
|
public static readonly int AllowedConnectionFails = 3;
|
2018-04-02 01:25:06 -04:00
|
|
|
|
}
|
|
|
|
|
}
|