mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
define new event types
This commit is contained in:
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>();
|
||||
}
|
Reference in New Issue
Block a user