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

update to .NET Core 2.1

fix bower repo deprecation
This commit is contained in:
RaidMax
2018-07-29 14:43:42 -05:00
parent 6fb99864b7
commit 3684ed2032
73 changed files with 86 additions and 73 deletions

View File

@ -94,7 +94,7 @@ namespace IW4MAdmin.Application
.ToList();
// this is to prevent the log reader from starting before the initial
// query of players on the server
// query of players on the server
if (serverTasksToRemove.Count > 0)
{
IsInitialized = true;
@ -142,7 +142,7 @@ namespace IW4MAdmin.Application
{
Running = true;
#region DATABASE
#region DATABASE
var ipList = (await ClientSvc.Find(c => c.Level > Player.Permission.Trusted))
.Select(c => new
{
@ -172,9 +172,9 @@ namespace IW4MAdmin.Application
continue;
}
}
#endregion
#endregion
#region CONFIG
#region CONFIG
var config = ConfigHandler.Configuration();
// copy over default config if it doesn't exist
@ -225,8 +225,8 @@ namespace IW4MAdmin.Application
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Utilities.EncodingType = Encoding.GetEncoding(!string.IsNullOrEmpty(config.CustomParserEncoding) ? config.CustomParserEncoding : "windows-1252");
#endregion
#region PLUGINS
#endregion
#region PLUGINS
SharedLibraryCore.Plugins.PluginImporter.Load(this);
foreach (var Plugin in SharedLibraryCore.Plugins.PluginImporter.ActivePlugins)
@ -243,9 +243,9 @@ namespace IW4MAdmin.Application
Logger.WriteDebug($"Stack Trace: {e.StackTrace}");
}
}
#endregion
#endregion
#region COMMANDS
#region COMMANDS
if (ClientSvc.GetOwners().Result.Count == 0)
Commands.Add(new COwner());
@ -289,9 +289,9 @@ namespace IW4MAdmin.Application
foreach (Command C in SharedLibraryCore.Plugins.PluginImporter.ActiveCommands)
Commands.Add(C);
#endregion
#endregion
#region INIT
#region INIT
async Task Init(ServerConfiguration Conf)
{
// setup the event handler after the class is initialized
@ -327,7 +327,7 @@ namespace IW4MAdmin.Application
}
await Task.WhenAll(config.Servers.Select(c => Init(c)).ToArray());
#endregion
#endregion
}
private async Task SendHeartbeat(object state)
@ -445,7 +445,7 @@ namespace IW4MAdmin.Application
{
// wait for new event to be added
OnEvent.Wait();
while((queuedEvent = Handler.GetNextEvent()) != null)
while ((queuedEvent = Handler.GetNextEvent()) != null)
{
if (GameEvent.ShouldOriginEventBeDelayed(queuedEvent))
{
@ -462,7 +462,17 @@ namespace IW4MAdmin.Application
queuedEvent.Target.DelayedEvents.Enqueue(queuedEvent);
continue;
}
await processEvent(queuedEvent);
if (queuedEvent.Type == GameEvent.EventType.Connect)
{
// we don't want to block here to due to needing event completion in the addplayer method
processEvent(queuedEvent);
}
else
{
await processEvent(queuedEvent);
}
}
// signal that all events have been processed