define new event types
This commit is contained in:
parent
5e32536821
commit
dab429776d
6
SharedLibraryCore/Events/Game/ClientCommandEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/ClientCommandEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientCommandEvent : ClientMessageEvent
|
||||
{
|
||||
|
||||
}
|
30
SharedLibraryCore/Events/Game/ClientDamageEvent.cs
Normal file
30
SharedLibraryCore/Events/Game/ClientDamageEvent.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using SharedLibraryCore.Database.Models;
|
||||
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientDamageEvent : ClientGameEvent
|
||||
{
|
||||
public EFClient Attacker => Origin;
|
||||
|
||||
public void UpdateAttacker(EFClient client)
|
||||
{
|
||||
Origin = client;
|
||||
}
|
||||
|
||||
public EFClient Victim => Target;
|
||||
|
||||
public string AttackerClientName => ClientName;
|
||||
public string AttackerNetworkId => ClientNetworkId;
|
||||
public int AttackerClientSlotNumber => ClientSlotNumber;
|
||||
public string AttackerTeamName { get; init; }
|
||||
|
||||
public string VictimClientName { get; init; }
|
||||
public string VictimNetworkId { get; init; }
|
||||
public int VictimClientSlotNumber { get; init; }
|
||||
public string VictimTeamName { get; init; }
|
||||
|
||||
public string WeaponName { get; init; }
|
||||
public int Damage { get; init; }
|
||||
public string MeansOfDeath { get; init; }
|
||||
public string HitLocation { get; init; }
|
||||
}
|
6
SharedLibraryCore/Events/Game/ClientEnterMatchEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/ClientEnterMatchEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientEnterMatchEvent : ClientGameEvent
|
||||
{
|
||||
|
||||
}
|
6
SharedLibraryCore/Events/Game/ClientExitMatchEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/ClientExitMatchEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientExitMatchEvent : ClientGameEvent
|
||||
{
|
||||
|
||||
}
|
12
SharedLibraryCore/Events/Game/ClientGameEvent.cs
Normal file
12
SharedLibraryCore/Events/Game/ClientGameEvent.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using SharedLibraryCore.Database.Models;
|
||||
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public abstract class ClientGameEvent : GameEventV2
|
||||
{
|
||||
public string ClientName { get; init; }
|
||||
public string ClientNetworkId { get; init; }
|
||||
public int ClientSlotNumber { get; init; }
|
||||
|
||||
public EFClient Client => Origin;
|
||||
}
|
20
SharedLibraryCore/Events/Game/ClientJoinTeamEvent.cs
Normal file
20
SharedLibraryCore/Events/Game/ClientJoinTeamEvent.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using SharedLibraryCore.Database.Models;
|
||||
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientJoinTeamEvent : ClientGameEvent
|
||||
{
|
||||
public string TeamName { get; init; }
|
||||
public EFClient.TeamType? Team {
|
||||
get
|
||||
{
|
||||
if (Enum.TryParse(typeof(EFClient.TeamType), TeamName, out var parsedTeam) && parsedTeam is not null)
|
||||
{
|
||||
return (EFClient.TeamType)parsedTeam;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
6
SharedLibraryCore/Events/Game/ClientKillEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/ClientKillEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientKillEvent : ClientDamageEvent
|
||||
{
|
||||
|
||||
}
|
6
SharedLibraryCore/Events/Game/ClientMessageEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/ClientMessageEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class ClientMessageEvent : ClientGameEvent
|
||||
{
|
||||
public bool IsTeamMessage { get; init; }
|
||||
}
|
8
SharedLibraryCore/Events/Game/GameEventV2.cs
Normal file
8
SharedLibraryCore/Events/Game/GameEventV2.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public abstract class GameEventV2 : GameEvent
|
||||
{
|
||||
public IGameServer Server { get; init; }
|
||||
}
|
6
SharedLibraryCore/Events/Game/GameScriptEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/GameScriptEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class GameScriptEvent : GameEventV2
|
||||
{
|
||||
public string ScriptData { get; init; }
|
||||
}
|
6
SharedLibraryCore/Events/Game/MatchEndEvent.cs
Normal file
6
SharedLibraryCore/Events/Game/MatchEndEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class MatchEndEvent : GameEventV2
|
||||
{
|
||||
public string SessionData { get; init; }
|
||||
}
|
8
SharedLibraryCore/Events/Game/MatchStartEvent.cs
Normal file
8
SharedLibraryCore/Events/Game/MatchStartEvent.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Events.Game;
|
||||
|
||||
public class MatchStartEvent : GameEventV2
|
||||
{
|
||||
public IReadOnlyDictionary<string, string> SessionData { get; init; } = new Dictionary<string, string>();
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientExecuteCommandEvent : ClientStateEvent
|
||||
{
|
||||
public IManagerCommand Command { get; init; }
|
||||
public string CommandText { get; init; }
|
||||
}
|
10
SharedLibraryCore/Events/Management/ClientPenaltyEvent.cs
Normal file
10
SharedLibraryCore/Events/Management/ClientPenaltyEvent.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Data.Models;
|
||||
using Data.Models.Client;
|
||||
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientPenaltyEvent : ManagementEvent
|
||||
{
|
||||
public EFClient Client { get; init; }
|
||||
public EFPenalty Penalty { get; init; }
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientPenaltyRevokeEvent : ClientPenaltyEvent
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using Data.Models.Client;
|
||||
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientPermissionChangeEvent : ClientStateEvent
|
||||
{
|
||||
public EFClient.Permission OldPermission { get; init; }
|
||||
public EFClient.Permission NewPermission { get; init; }
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientStateAuthorizeEvent : ClientStateEvent
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientStateDisposeEvent : ClientStateEvent
|
||||
{
|
||||
|
||||
}
|
8
SharedLibraryCore/Events/Management/ClientStateEvent.cs
Normal file
8
SharedLibraryCore/Events/Management/ClientStateEvent.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using EFClient = SharedLibraryCore.Database.Models.EFClient;
|
||||
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public abstract class ClientStateEvent : ManagementEvent
|
||||
{
|
||||
public EFClient Client { get; init; }
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ClientStateInitializeEvent : ClientStateEvent
|
||||
{
|
||||
|
||||
}
|
14
SharedLibraryCore/Events/Management/LoginEvent.cs
Normal file
14
SharedLibraryCore/Events/Management/LoginEvent.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class LoginEvent : ManagementEvent
|
||||
{
|
||||
public enum LoginSourceType
|
||||
{
|
||||
Ingame,
|
||||
Webfront
|
||||
}
|
||||
|
||||
public string EntityId { get; init; }
|
||||
public string Identifier { get; init; }
|
||||
public LoginSourceType LoginSource { get; init; }
|
||||
}
|
6
SharedLibraryCore/Events/Management/LogoutEvent.cs
Normal file
6
SharedLibraryCore/Events/Management/LogoutEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class LogoutEvent : LoginEvent
|
||||
{
|
||||
|
||||
}
|
6
SharedLibraryCore/Events/Management/ManagementEvent.cs
Normal file
6
SharedLibraryCore/Events/Management/ManagementEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class ManagementEvent : CoreEvent
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class NotifyAfterDelayCompleteEvent : ManagementEvent
|
||||
{
|
||||
public Delegate Action { get; init; }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Events.Management;
|
||||
|
||||
public class NotifyAfterDelayRequestEvent : ManagementEvent
|
||||
{
|
||||
public int DelayMs { get; init; }
|
||||
public Action Action { get; init; }
|
||||
}
|
9
SharedLibraryCore/Events/Server/ClientDataUpdateEvent.cs
Normal file
9
SharedLibraryCore/Events/Server/ClientDataUpdateEvent.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using SharedLibraryCore.Database.Models;
|
||||
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ClientDataUpdateEvent : GameServerEvent
|
||||
{
|
||||
public IReadOnlyCollection<EFClient> Clients { get; init; }
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ConnectionInterruptEvent : GameServerEvent
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ConnectionRestoreEvent : GameServerEvent
|
||||
{
|
||||
|
||||
}
|
8
SharedLibraryCore/Events/Server/GameServerEvent.cs
Normal file
8
SharedLibraryCore/Events/Server/GameServerEvent.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public abstract class GameServerEvent : CoreEvent
|
||||
{
|
||||
public IGameServer Server { get; init; }
|
||||
}
|
5
SharedLibraryCore/Events/Server/MonitorStartEvent.cs
Normal file
5
SharedLibraryCore/Events/Server/MonitorStartEvent.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class MonitorStartEvent : GameServerEvent
|
||||
{
|
||||
}
|
6
SharedLibraryCore/Events/Server/MonitorStopEvent.cs
Normal file
6
SharedLibraryCore/Events/Server/MonitorStopEvent.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class MonitorStopEvent : GameServerEvent
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ServerCommandExecuteEvent : GameServerEvent
|
||||
{
|
||||
public string Command { get; init; }
|
||||
public string[] Output { get; init; }
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ServerValueReceiveEvent : GameServerEvent
|
||||
{
|
||||
public Dvar<string> Response { get; init; }
|
||||
public bool Success { get; init; }
|
||||
}
|
17
SharedLibraryCore/Events/Server/ServerValueRequestEvent.cs
Normal file
17
SharedLibraryCore/Events/Server/ServerValueRequestEvent.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ServerValueRequestEvent : GameServerEvent
|
||||
{
|
||||
public ServerValueRequestEvent(string valueName, IGameServer server)
|
||||
{
|
||||
ValueName = valueName;
|
||||
Server = server;
|
||||
}
|
||||
|
||||
public string ValueName { get; init; }
|
||||
public int? DelayMs { get; init; }
|
||||
public int? TimeoutMs { get; init; }
|
||||
public string FallbackValue { get; init; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ServerValueSetCompleteEvent : GameServerEvent
|
||||
{
|
||||
public bool Success { get; init; }
|
||||
public string ValueName { get; init; }
|
||||
public string Value { get; set; }
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace SharedLibraryCore.Events.Server;
|
||||
|
||||
public class ServerValueSetRequestEvent : GameServerEvent
|
||||
{
|
||||
public ServerValueSetRequestEvent(string valueName, string value, IGameServer server)
|
||||
{
|
||||
ValueName = valueName;
|
||||
Server = server;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string ValueName { get; init; }
|
||||
public string Value { get; init; }
|
||||
public int? DelayMs { get; init; }
|
||||
public int? TimeoutMs { get; init; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user