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

hopefully finished with RCon changes.

added more tests.
fixed issues from event changes (there's most definitely still issues related to that)
This commit is contained in:
RaidMax
2018-10-02 12:39:08 -05:00
parent 4eea217e82
commit ca9e20ebd3
15 changed files with 428 additions and 219 deletions

View File

@ -181,10 +181,10 @@ namespace SharedLibraryCore
/// asynchronously wait for GameEvent to be processed
/// </summary>
/// <returns>waitable task </returns>
public Task<bool> WaitAsync(int timeOut = int.MaxValue) => Task.Run(() =>
public Task<GameEvent> WaitAsync(int timeOut = int.MaxValue) => Task.Run(() =>
{
OnProcessed.Wait(timeOut);
return !Failed;
return this;
});
/// <summary>
@ -214,7 +214,7 @@ namespace SharedLibraryCore
/// <returns>true if event should be delayed, false otherwise</returns>
public static bool ShouldTargetEventBeDelayed(GameEvent queuedEvent)
{
return queuedEvent.Target != null &&
return (queuedEvent.Target != null && queuedEvent.Target.ClientNumber != -1) &&
(queuedEvent.Target.State != Player.ClientState.Connected &&
queuedEvent.Target.NetworkId != 0);
}