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

[misc bug fixes]

properly hide broadcast failure messages if ignore connection lost is turned on
fix concurent issue for update stats history that happened with new event processing
make get/set additional property thread safe
add ellipse to truncated chat messages on home
This commit is contained in:
RaidMax
2020-04-25 19:01:26 -05:00
parent d5c45717a6
commit 1f7f40f296
26 changed files with 258 additions and 74 deletions

View File

@ -86,10 +86,7 @@ namespace SharedLibraryCore.Database.Models
{
ConnectionTime = DateTime.UtcNow;
ClientNumber = -1;
_additionalProperties = new Dictionary<string, object>
{
{ "_reportCount", 0 }
};
SetAdditionalProperty("_reportCount", 0);
ReceivedPenalties = new List<EFPenalty>();
_processingEvent = new SemaphoreSlim(1, 1);
}
@ -101,7 +98,7 @@ namespace SharedLibraryCore.Database.Models
public override string ToString()
{
return $"{CurrentAlias?.Name ?? "--"}::{NetworkId}";
return $"[Name={CurrentAlias?.Name ?? "--"}, NetworkId={NetworkId.ToString("X")}, IP={(string.IsNullOrEmpty(IPAddressString) ? "--" : IPAddressString)}, ClientSlot={ClientNumber}]";
}
[NotMapped]
@ -643,26 +640,6 @@ namespace SharedLibraryCore.Database.Models
return true;
}
[NotMapped]
readonly Dictionary<string, object> _additionalProperties;
public T GetAdditionalProperty<T>(string name)
{
return _additionalProperties.ContainsKey(name) ? (T)_additionalProperties[name] : default(T);
}
public void SetAdditionalProperty(string name, object value)
{
if (_additionalProperties.ContainsKey(name))
{
_additionalProperties[name] = value;
}
else
{
_additionalProperties.Add(name, value);
}
}
[NotMapped]
public int ClientNumber { get; set; }
[NotMapped]