mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
fix parsing of certain chat messages
print out the correct exception message when a server is not responding. prevent log reader from reading before the servers have initialized
This commit is contained in:
@ -9,7 +9,7 @@ namespace SharedLibraryCore
|
||||
public enum EventType
|
||||
{
|
||||
Unknown,
|
||||
|
||||
|
||||
// events "generated" by the server
|
||||
Start,
|
||||
Stop,
|
||||
@ -76,5 +76,35 @@ namespace SharedLibraryCore
|
||||
public ManualResetEventSlim OnProcessed { get; set; }
|
||||
public DateTime Time { get; private set; }
|
||||
public long Id { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// determine whether an event should be delayed or not
|
||||
/// applies only to the origin entity
|
||||
/// </summary>
|
||||
/// <param name="queuedEvent">event to determine status for</param>
|
||||
/// <returns>true if event should be delayed, false otherwise</returns>
|
||||
public static bool ShouldOriginEventBeDelayed(GameEvent queuedEvent)
|
||||
{
|
||||
return queuedEvent.Origin != null &&
|
||||
!queuedEvent.Origin.IsAuthenticated &&
|
||||
// we want to allow join and quit events
|
||||
queuedEvent.Type != EventType.Join &&
|
||||
queuedEvent.Type != EventType.Quit &&
|
||||
// we don't care about unknown events
|
||||
queuedEvent.Origin.NetworkId != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determine whether an event should be delayed or not
|
||||
/// applies only to the target entity
|
||||
/// </summary>
|
||||
/// <param name="queuedEvent">event to determine status for</param>
|
||||
/// <returns>true if event should be delayed, false otherwise</returns>
|
||||
public static bool ShouldTargetEventBeDelayed(GameEvent queuedEvent)
|
||||
{
|
||||
return queuedEvent.Target != null &&
|
||||
!queuedEvent.Target.IsAuthenticated &&
|
||||
queuedEvent.Target.NetworkId != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ namespace SharedLibraryCore.Objects
|
||||
{
|
||||
ConnectionTime = DateTime.UtcNow;
|
||||
ClientNumber = -1;
|
||||
DelayedEvents = new Queue<GameEvent>();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
@ -120,6 +121,8 @@ namespace SharedLibraryCore.Objects
|
||||
public bool IsAuthenticated { get; set; }
|
||||
[NotMapped]
|
||||
public ClientState State { get; set; }
|
||||
[NotMapped]
|
||||
public Queue<GameEvent> DelayedEvents { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
|
@ -327,6 +327,7 @@ namespace SharedLibraryCore
|
||||
LastConnection = client.LastConnection == DateTime.MinValue ? DateTime.UtcNow : client.LastConnection,
|
||||
CurrentAlias = client.CurrentAlias,
|
||||
CurrentAliasId = client.CurrentAlias.AliasId,
|
||||
// todo: make sure this is up to date
|
||||
IsBot = client.NetworkId == -1,
|
||||
Password = client.Password,
|
||||
PasswordSalt = client.PasswordSalt
|
||||
|
Reference in New Issue
Block a user