1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 07:13:58 -05:00

fixed issue with status response erroring when incorrect length

view angle vector parse fail is now a handled exception
change local host check to byte array to make it faster than comparing string
kick command now requires moderator level or higher
tempban now requires administrator level or higher
hopefully fixed negative SPM bug
pipelined the events and consolidated them to run through GameEventHandler
uniform console colors
This commit is contained in:
RaidMax
2018-04-26 01:13:04 -05:00
parent 21e4bdb614
commit 82a20e999c
26 changed files with 526 additions and 355 deletions

View File

@ -0,0 +1,46 @@
using SharedLibraryCore;
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace IW4MAdmin.Application
{
class GameEventHandler : IEventHandler
{
private Queue<GameEvent> EventQueue;
private IManager Manager;
public GameEventHandler(IManager mgr)
{
EventQueue = new Queue<GameEvent>();
Manager = mgr;
}
public void AddEvent(GameEvent gameEvent)
{
#if DEBUG
Manager.GetLogger().WriteDebug($"Got new event of type {gameEvent.Type} for {gameEvent.Owner}");
#endif
EventQueue.Enqueue(gameEvent);
#if DEBUG
Manager.GetLogger().WriteDebug($"There are now {EventQueue.Count} events in queue");
#endif
Manager.SetHasEvent();
}
public string[] GetEventOutput()
{
throw new NotImplementedException();
}
public GameEvent GetNextEvent()
{
#if DEBUG
Manager.GetLogger().WriteDebug("Getting next event to be processed");
#endif
return EventQueue.Count > 0 ? EventQueue.Dequeue() : null;
}
}
}