2022-06-13 14:16:57 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Events : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef void(ClientCallback)(int clientNum);
|
2023-01-25 13:20:44 -05:00
|
|
|
typedef void(ClientConnectCallback)(Game::client_t* cl);
|
2022-06-13 14:16:57 -04:00
|
|
|
typedef void(Callback)();
|
|
|
|
|
|
|
|
Events();
|
|
|
|
|
|
|
|
// Server side
|
|
|
|
static void OnClientDisconnect(const Utils::Slot<ClientCallback>& callback);
|
|
|
|
|
2023-01-25 13:20:44 -05:00
|
|
|
// Server side
|
|
|
|
static void OnClientConnect(const Utils::Slot<ClientConnectCallback>& callback);
|
|
|
|
|
2022-06-13 14:16:57 -04:00
|
|
|
// Client side
|
|
|
|
static void OnSteamDisconnect(const Utils::Slot<Callback>& callback);
|
|
|
|
|
|
|
|
static void OnVMShutdown(const Utils::Slot<Callback>& callback);
|
|
|
|
|
2022-07-16 17:24:26 -04:00
|
|
|
static void OnClientInit(const Utils::Slot<Callback>& callback);
|
|
|
|
|
2022-06-28 14:57:58 -04:00
|
|
|
// Client & Server (triggered once)
|
|
|
|
static void OnSVInit(const Utils::Slot<Callback>& callback);
|
|
|
|
|
2023-01-27 18:05:26 -05:00
|
|
|
// Client & Server (triggered once)
|
|
|
|
static void OnDvarInit(const Utils::Slot<Callback>& callback);
|
|
|
|
|
2022-06-13 14:16:57 -04:00
|
|
|
private:
|
|
|
|
static Utils::Signal<ClientCallback> ClientDisconnectSignal;
|
2023-01-25 13:20:44 -05:00
|
|
|
static Utils::Signal<ClientConnectCallback> ClientConnectSignal;
|
2022-06-13 14:16:57 -04:00
|
|
|
static Utils::Signal<Callback> SteamDisconnectSignal;
|
|
|
|
static Utils::Signal<Callback> ShutdownSystemSignal;
|
2022-07-16 17:24:26 -04:00
|
|
|
static Utils::Signal<Callback> ClientInitSignal;
|
2022-06-28 14:57:58 -04:00
|
|
|
static Utils::Signal<Callback> ServerInitSignal;
|
2023-01-27 18:05:26 -05:00
|
|
|
static Utils::Signal<Callback> DvarInitSignal;
|
2022-06-13 14:16:57 -04:00
|
|
|
|
|
|
|
static void ClientDisconnect_Hk(int clientNum);
|
2023-01-25 13:20:44 -05:00
|
|
|
static void SV_UserinfoChanged_Hk(Game::client_t* cl);
|
2022-06-13 14:16:57 -04:00
|
|
|
static void SteamDisconnect_Hk();
|
|
|
|
static void Scr_ShutdownSystem_Hk(unsigned char sys);
|
2022-07-16 17:24:26 -04:00
|
|
|
static void CL_InitOnceForAllClients_HK();
|
2022-06-28 14:57:58 -04:00
|
|
|
static void SV_Init_Hk();
|
2023-01-27 18:05:26 -05:00
|
|
|
static void Com_InitDvars_Hk();
|
2022-06-13 14:16:57 -04:00
|
|
|
};
|
|
|
|
}
|