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

implement more robust command api and login

improve web console command response reliability and consistency
This commit is contained in:
RaidMax
2021-01-17 21:58:18 -06:00
parent 17dd35c4bb
commit c231c6b610
12 changed files with 260 additions and 56 deletions

View File

@ -133,7 +133,7 @@ namespace SharedLibraryCore.Database.Models
/// send a message directly to the connected client
/// </summary>
/// <param name="message">message content to send to client</param>
public GameEvent Tell(String message)
public GameEvent Tell(string message)
{
var e = new GameEvent()
{
@ -141,8 +141,12 @@ namespace SharedLibraryCore.Database.Models
Target = this,
Owner = CurrentServer,
Type = GameEvent.EventType.Tell,
Data = message
Data = message,
CorrelationId = CurrentServer.Manager.ProcessingEvents.Values
.FirstOrDefault(ev => ev.Type == GameEvent.EventType.Command && (ev.Origin?.ClientId == ClientId || ev.ImpersonationOrigin?.ClientId == ClientId))?.CorrelationId ?? Guid.NewGuid()
};
e.Output.Add(message.StripColors());
CurrentServer?.Manager.AddEvent(e);
return e;