1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

convert GetPort to auto property

don't force disconnect player if someone is "in" their spot
increase gamelogserver max time before purge
This commit is contained in:
RaidMax
2019-05-31 10:17:01 -05:00
parent 39d31dbe3c
commit 3ffb163caf
12 changed files with 48 additions and 53 deletions

View File

@ -202,28 +202,33 @@ namespace IW4MAdmin.Application
string lastCommand;
var Origin = Utilities.IW4MAdminClient(ServerManager.Servers[0]);
while (!ServerManager.CancellationToken.IsCancellationRequested)
try
{
lastCommand = Console.ReadLine();
if (lastCommand?.Length > 0)
while (!ServerManager.CancellationToken.IsCancellationRequested)
{
lastCommand = Console.ReadLine();
if (lastCommand?.Length > 0)
{
GameEvent E = new GameEvent()
if (lastCommand?.Length > 0)
{
Type = GameEvent.EventType.Command,
Data = lastCommand,
Origin = Origin,
Owner = ServerManager.Servers[0]
};
GameEvent E = new GameEvent()
{
Type = GameEvent.EventType.Command,
Data = lastCommand,
Origin = Origin,
Owner = ServerManager.Servers[0]
};
ServerManager.GetEventHandler().AddEvent(E);
await E.WaitAsync(Utilities.DefaultCommandTimeout, ServerManager.CancellationToken);
Console.Write('>');
ServerManager.GetEventHandler().AddEvent(E);
await E.WaitAsync(Utilities.DefaultCommandTimeout, ServerManager.CancellationToken);
Console.Write('>');
}
}
}
}
catch (OperationCanceledException)
{ }
}
}
}