mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-21 20:50:40 -05:00
add localized level names
intellisense suggestion junk
This commit is contained in:
@ -36,7 +36,7 @@ namespace IW4MAdmin.Application.API.Master
|
||||
public class Endpoint
|
||||
{
|
||||
#if !DEBUG
|
||||
private static IMasterApi api = RestClient.For<IMasterApi>("http://api.raidmax.org:5000");
|
||||
private static readonly IMasterApi api = RestClient.For<IMasterApi>("http://api.raidmax.org:5000");
|
||||
#else
|
||||
private static IMasterApi api = RestClient.For<IMasterApi>("http://127.0.0.1");
|
||||
#endif
|
||||
|
@ -11,7 +11,7 @@ namespace IW4MAdmin.Application.IO
|
||||
Server Server;
|
||||
long PreviousFileSize;
|
||||
GameLogReader Reader;
|
||||
string GameLogFile;
|
||||
readonly string GameLogFile;
|
||||
|
||||
class EventState
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ namespace IW4MAdmin.Application.IO
|
||||
class GameLogReader
|
||||
{
|
||||
IEventParser Parser;
|
||||
string LogFile;
|
||||
readonly string LogFile;
|
||||
|
||||
public GameLogReader(string logFile, IEventParser parser)
|
||||
{
|
||||
|
@ -17,8 +17,8 @@ namespace IW4MAdmin.Application
|
||||
Assert
|
||||
}
|
||||
|
||||
string FileName;
|
||||
object ThreadLock;
|
||||
readonly string FileName;
|
||||
readonly object ThreadLock;
|
||||
|
||||
public Logger(string fn)
|
||||
{
|
||||
|
@ -36,12 +36,12 @@ namespace IW4MAdmin.Application
|
||||
public DateTime StartTime { get; private set; }
|
||||
|
||||
static ApplicationManager Instance;
|
||||
List<AsyncStatus> TaskStatuses;
|
||||
readonly List<AsyncStatus> TaskStatuses;
|
||||
List<Command> Commands;
|
||||
List<MessageToken> MessageTokens;
|
||||
readonly List<MessageToken> MessageTokens;
|
||||
ClientService ClientSvc;
|
||||
AliasService AliasSvc;
|
||||
PenaltyService PenaltySvc;
|
||||
readonly AliasService AliasSvc;
|
||||
readonly PenaltyService PenaltySvc;
|
||||
BaseConfigurationHandler<ApplicationConfiguration> ConfigHandler;
|
||||
EventApi Api;
|
||||
GameEventHandler Handler;
|
||||
|
@ -14,7 +14,7 @@ namespace Application.RconParsers
|
||||
{
|
||||
class IW4RConParser : IRConParser
|
||||
{
|
||||
private static CommandPrefix Prefixes = new CommandPrefix()
|
||||
private static readonly CommandPrefix Prefixes = new CommandPrefix()
|
||||
{
|
||||
Tell = "tellraw {0} {1}",
|
||||
Say = "sayraw {0}",
|
||||
@ -23,7 +23,7 @@ namespace Application.RconParsers
|
||||
TempBan = "tempbanclient {0} \"{1}\""
|
||||
};
|
||||
|
||||
private static string StatusRegex = @"^( *[0-9]+) +-*([0-9]+) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){16}|(?:[a-z]|[0-9]){32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +([0-9]+) +(\d+\.\d+\.\d+.\d+\:-*\d{1,5}|0+.0+:-*\d{1,5}|loopback) +(-*[0-9]+) +([0-9]+) *$";
|
||||
private static readonly string StatusRegex = @"^( *[0-9]+) +-*([0-9]+) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){16}|(?:[a-z]|[0-9]){32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +([0-9]+) +(\d+\.\d+\.\d+.\d+\:-*\d{1,5}|0+.0+:-*\d{1,5}|loopback) +(-*[0-9]+) +([0-9]+) *$";
|
||||
|
||||
public async Task<string[]> ExecuteCommandAsync(Connection connection, string command)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ namespace Application.RconParsers
|
||||
{
|
||||
public class IW5MRConParser : IRConParser
|
||||
{
|
||||
private static CommandPrefix Prefixes = new CommandPrefix()
|
||||
private static readonly CommandPrefix Prefixes = new CommandPrefix()
|
||||
{
|
||||
Tell = "tell {0} {1}",
|
||||
Say = "say {0}",
|
||||
|
@ -52,7 +52,7 @@ namespace Application.RconParsers
|
||||
public PInfo[] Players { get; set; }
|
||||
}
|
||||
|
||||
private static CommandPrefix Prefixes = new CommandPrefix()
|
||||
private static readonly CommandPrefix Prefixes = new CommandPrefix()
|
||||
{
|
||||
Tell = "tell {0} {1}",
|
||||
Say = "say {0}",
|
||||
|
@ -218,14 +218,23 @@ namespace IW4MAdmin
|
||||
if (currentBan.Type == Penalty.PenaltyType.TempBan)
|
||||
{
|
||||
string formattedKick = String.Format(
|
||||
RconParser.GetCommandPrefixes().Kick,
|
||||
polledPlayer.ClientNumber,
|
||||
RconParser.GetCommandPrefixes().Kick,
|
||||
polledPlayer.ClientNumber,
|
||||
$"{loc["SERVER_TB_REMAIN"]} ({(currentBan.Expires - DateTime.UtcNow).TimeSpanText()} {loc["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]})");
|
||||
await this.ExecuteCommandAsync(formattedKick);
|
||||
}
|
||||
// the player is permanently banned
|
||||
else
|
||||
await player.Kick($"{loc["SERVER_BAN_PREV"]} {currentBan.Offense} ({loc["SERVER_BAN_APPEAL"]} {Website})", autoKickClient);
|
||||
{
|
||||
// don't store the kick message
|
||||
string formattedKick = String.Format(
|
||||
RconParser.GetCommandPrefixes().Kick,
|
||||
polledPlayer.ClientNumber,
|
||||
$"{loc["SERVER_BAN_PREV"]} {currentBan.Offense} ({loc["SERVER_BAN_APPEAL"]} {Website})");
|
||||
await this.ExecuteCommandAsync(formattedKick);
|
||||
}
|
||||
|
||||
// reban the "evading" guid
|
||||
if (player.Level != Player.Permission.Banned && currentBan.Type == Penalty.PenaltyType.Ban)
|
||||
await player.Ban($"{currentBan.Offense}", autoKickClient);
|
||||
|
||||
@ -594,7 +603,6 @@ namespace IW4MAdmin
|
||||
DateTime start = DateTime.Now;
|
||||
DateTime playerCountStart = DateTime.Now;
|
||||
DateTime lastCount = DateTime.Now;
|
||||
DateTime tickTime = DateTime.Now;
|
||||
|
||||
override public async Task<bool> ProcessUpdatesAsync(CancellationToken cts)
|
||||
{
|
||||
|
Reference in New Issue
Block a user