1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 07:13:58 -05:00

fixed broken broadcast events

events don't get out of order when a invalid event line throws exception
handle the stats history update with no change throwing DBConcurrencyException
This commit is contained in:
RaidMax
2018-08-31 22:35:51 -05:00
parent 18aa6e85fc
commit 50b4426cab
11 changed files with 126 additions and 67 deletions

View File

@ -150,8 +150,8 @@ namespace SharedLibraryCore.RCon
// will this really prevent flooding?
if ((DateTime.Now - LastQuery).TotalMilliseconds < 350)
{
//await Task.Delay(350);
Thread.Sleep(350);
//await Task.Delay(350);
}
LastQuery = DateTime.Now;

View File

@ -116,7 +116,7 @@ namespace SharedLibraryCore
/// <param name="Message">Message to be sent to all players</param>
public async Task Broadcast(String Message)
{
#if !DEBUG
#if DEBUG == false
string formattedMessage = String.Format(RconParser.GetCommandPrefixes().Say, Message);
#else
Logger.WriteVerbose(Message.StripColors());
@ -124,8 +124,12 @@ namespace SharedLibraryCore
var e = new GameEvent()
{
Type = GameEvent.EventType.Broadcast,
#if DEBUG == true
Data = Message,
Owner = this
#else
Data = formattedMessage,
#endif
Owner = this,
};
Manager.GetEventHandler().AddEvent(e);