mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
adding IW5m parsers
reduce status polling rate adding preliminary russian localization small rcon tweak to attempt to send custom encoded messages removed exception handling in ConvertLong throttled servers will still attempt to execute events
This commit is contained in:
@ -11,10 +11,17 @@ namespace SharedLibraryCore.Configuration
|
||||
public List<string> Rules { get; set; }
|
||||
public List<string> AutoMessages { get; set; }
|
||||
public bool UseT6MParser { get; set; }
|
||||
public bool UseIW5MParser { get; set; }
|
||||
public string ManualLogPath { get; set; }
|
||||
|
||||
public IBaseConfiguration Generate()
|
||||
{
|
||||
UseT6MParser = Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationSet["SETUP_SERVER_USET6M"]);
|
||||
if (!UseT6MParser)
|
||||
UseIW5MParser = Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationSet["SETUP_SERVER_USEIW5M"]);
|
||||
if (UseIW5MParser)
|
||||
ManualLogPath = Utilities.PromptString(Utilities.CurrentLocalization.LocalizationSet["SETUP_SERVER_MANUALLOG"]);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -172,19 +172,23 @@ namespace SharedLibraryCore.RCon
|
||||
OnSent.Reset();
|
||||
OnReceived.Reset();
|
||||
string queryString = "";
|
||||
byte[] payload = null;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case StaticHelpers.QueryType.DVAR:
|
||||
case StaticHelpers.QueryType.COMMAND:
|
||||
queryString = $"ÿÿÿÿrcon {RConPassword} {parameters}";
|
||||
var header = "ÿÿÿÿrcon ".Select(Convert.ToByte).ToList();
|
||||
byte[] p = Utilities.EncodingType.GetBytes($"{RConPassword} {parameters}");
|
||||
header.AddRange(p);
|
||||
payload = header.ToArray();
|
||||
break;
|
||||
case StaticHelpers.QueryType.GET_STATUS:
|
||||
queryString = "ÿÿÿÿgetstatus";
|
||||
payload = "ÿÿÿÿgetstatus".Select(Convert.ToByte).ToArray();
|
||||
break;
|
||||
}
|
||||
|
||||
byte[] payload = queryString.Select(Convert.ToByte).ToArray();
|
||||
// byte[] payload = Utilities.EncodingType.GetBytes(queryString); // queryString.Select(Convert.ToByte).ToArray();
|
||||
|
||||
retrySend:
|
||||
try
|
||||
|
@ -290,8 +290,8 @@ namespace SharedLibraryCore
|
||||
// Info
|
||||
public string Hostname { get; protected set; }
|
||||
public string Website { get; protected set; }
|
||||
public string Gametype { get; protected set; }
|
||||
public Map CurrentMap { get; protected set; }
|
||||
public string Gametype { get; set; }
|
||||
public Map CurrentMap { get; set; }
|
||||
public int ClientNum
|
||||
{
|
||||
get
|
||||
|
@ -9,6 +9,7 @@ using static SharedLibraryCore.Server;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Globalization;
|
||||
|
||||
namespace SharedLibraryCore
|
||||
{
|
||||
@ -181,16 +182,8 @@ namespace SharedLibraryCore
|
||||
|
||||
public static long ConvertLong(this string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Int64.Parse(str, System.Globalization.NumberStyles.HexNumber);
|
||||
}
|
||||
|
||||
|
||||
catch (FormatException)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
Int64.TryParse(str, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out long id);
|
||||
return id;
|
||||
}
|
||||
|
||||
public static int ConvertToIP(this string str)
|
||||
|
Reference in New Issue
Block a user