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

implement new eventing system

This commit is contained in:
RaidMax
2023-04-05 09:54:57 -05:00
parent 53a6ef2ec3
commit ebe69a94ad
39 changed files with 1410 additions and 526 deletions

View File

@ -8,6 +8,7 @@ using System.Threading.Tasks;
using Data.Models;
using Microsoft.Extensions.Logging;
using Serilog.Context;
using SharedLibraryCore.Events.Management;
using SharedLibraryCore.Localization;
namespace SharedLibraryCore.Database.Models
@ -603,7 +604,13 @@ namespace SharedLibraryCore.Database.Models
LastConnection = DateTime.UtcNow;
Utilities.DefaultLogger.LogInformation("Client {client} is leaving the game", ToString());
CurrentServer?.Manager.QueueEvent(new ClientStateDisposeEvent
{
Source = CurrentServer,
Client = this
});
try
{
await CurrentServer.Manager.GetClientService().Update(this);
@ -658,6 +665,11 @@ namespace SharedLibraryCore.Database.Models
};
CurrentServer.Manager.AddEvent(e);
CurrentServer.Manager.QueueEvent(new ClientStateAuthorizeEvent
{
Source = CurrentServer,
Client = this
});
}
}