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

more changes to the event management.

bots ip adjusted
This commit is contained in:
RaidMax
2018-07-01 19:30:38 -05:00
parent 104bdf590b
commit dd86087336
5 changed files with 69 additions and 42 deletions

View File

@ -51,24 +51,8 @@ namespace IW4MAdmin.Application
public GameEvent GetNextEvent()
{
if (EventQueue.Count > 0)
{
#if DEBUG
Manager.GetLogger().WriteDebug("Getting next event to be processed");
#endif
if (!EventQueue.TryDequeue(out GameEvent newEvent))
{
Manager.GetLogger().WriteWarning("Could not dequeue event for processing");
}
else
{
return newEvent;
}
}
if (DelayedEventQueue.Count > 0 &&
(DateTime.Now - LastDelayedEvent).TotalMilliseconds > DelayAmount)
(DateTime.Now - LastDelayedEvent).TotalMilliseconds > DelayAmount)
{
LastDelayedEvent = DateTime.Now;
#if DEBUG
@ -85,6 +69,22 @@ namespace IW4MAdmin.Application
}
}
if (EventQueue.Count > 0)
{
#if DEBUG
Manager.GetLogger().WriteDebug("Getting next event to be processed");
#endif
if (!EventQueue.TryDequeue(out GameEvent newEvent))
{
Manager.GetLogger().WriteWarning("Could not dequeue event for processing");
}
else
{
return newEvent;
}
}
return null;
}
}