1
0
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:
RaidMax
2023-02-11 21:03:35 -06:00
parent 36cca2f93b
commit 2b6720d4e2
36 changed files with 320 additions and 0 deletions

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class ClientCommandEvent : ClientMessageEvent
{
}

View 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; }
}

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class ClientEnterMatchEvent : ClientGameEvent
{
}

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class ClientExitMatchEvent : ClientGameEvent
{
}

View 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;
}

View 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;
}
}
}

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class ClientKillEvent : ClientDamageEvent
{
}

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class ClientMessageEvent : ClientGameEvent
{
public bool IsTeamMessage { get; init; }
}

View File

@ -0,0 +1,8 @@
using SharedLibraryCore.Interfaces;
namespace SharedLibraryCore.Events.Game;
public abstract class GameEventV2 : GameEvent
{
public IGameServer Server { get; init; }
}

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class GameScriptEvent : GameEventV2
{
public string ScriptData { get; init; }
}

View File

@ -0,0 +1,6 @@
namespace SharedLibraryCore.Events.Game;
public class MatchEndEvent : GameEventV2
{
public string SessionData { get; init; }
}

View 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>();
}