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

started update for readme

start update for version changes
hopefully fixed pesky stat bug
move vpn detection into script plugin
This commit is contained in:
RaidMax
2018-08-26 19:20:47 -05:00
parent 7bb2c8601b
commit d3333aa019
22 changed files with 388 additions and 192 deletions

View File

@ -415,6 +415,34 @@ namespace IW4MAdmin.Application
try
{
await newEvent.Owner.ExecuteEvent(newEvent);
// todo: this is a hacky mess
if (newEvent.Origin?.DelayedEvents?.Count > 0 &&
newEvent.Origin?.State == Player.ClientState.Connected)
{
var events = newEvent.Origin.DelayedEvents;
// add the delayed event to the queue
while (events?.Count > 0)
{
var e = events.Dequeue();
e.Origin = newEvent.Origin;
// check if the target was assigned
if (e.Target != null)
{
// update the target incase they left or have newer info
e.Target = newEvent.Owner.GetPlayersAsList()
.FirstOrDefault(p => p.NetworkId == e.Target.NetworkId);
// we have to throw out the event because they left
if (e.Target == null)
{
Logger.WriteWarning($"Delayed event for {e.Origin} was removed because the target has left");
continue;
}
}
this.GetEventHandler().AddEvent(e);
}
}
#if DEBUG
Logger.WriteDebug("Processed Event");
#endif