1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00
Files
hl2sdk/public/engine/igameeventsystem.h

49 lines
2.1 KiB
C
Raw Normal View History

2015-09-27 17:05:29 -04:00
#ifndef GAMEEVENTSYSTEM_H
#define GAMEEVENTSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include <eiface.h>
#include <networksystem/inetworkserializer.h>
2015-09-27 17:05:29 -04:00
#include <tier1/utldelegate.h>
#include <tier1/utlsymbol.h>
2023-05-03 02:21:57 +03:00
#include <irecipientfilter.h>
#include <inetchannel.h>
2015-09-27 17:05:29 -04:00
class CUtlSlot;
#define GAMEEVENTSYSTEM_INTERFACE_VERSION "GameEventSystemServerV001"
abstract_class IGameEventSystem : public IAppSystem
{
public:
2023-05-03 11:12:45 +03:00
virtual void RegisterGameEvent( INetworkSerializable *pEvent ) = 0;
2023-05-03 02:21:57 +03:00
2023-05-03 11:12:45 +03:00
virtual void RegisterGameEventHandlerAbstract( CUtlSlot *nSlot, const CUtlAbstractDelegate &delegate, INetworkSerializable *pEvent ) = 0;
virtual void UnregisterGameEventHandlerAbstract( CUtlSlot *nSlot, const CUtlAbstractDelegate &delegate, INetworkSerializable *pEvent ) = 0;
2023-05-03 02:21:57 +03:00
2023-05-03 11:12:45 +03:00
// Providing nSize has no effect and is unused.
virtual void PostEventAbstract_Local( CSplitScreenSlot nSlot, INetworkSerializable *pEvent, const void *pData, unsigned long nSize ) = 0;
2023-05-03 02:21:57 +03:00
2023-05-03 11:12:45 +03:00
// Providing nSlot as -1 would select 0nth slot.
// clients pointer is a masked uint64 value where (client index - 1) is mapped to each bit.
// Providing nClientCount as -1 and clients pointer as NULL would post event to all available clients.
// Providing nSize has no effect and is unused.
virtual void PostEventAbstract( CSplitScreenSlot nSlot, bool bLocalOnly, int nClientCount, const uint64 *clients,
INetworkSerializable *pEvent, const void *pData, unsigned long nSize, NetChannelBufType_t bufType ) = 0;
virtual void PostEventAbstract( CSplitScreenSlot nSlot, bool bLocalOnly, IRecipientFilter *pFilter,
INetworkSerializable *pEvent, const void *pData, unsigned long nSize ) = 0;
2023-05-03 02:21:57 +03:00
2023-05-03 11:12:45 +03:00
// Posts the event to all clients, even tho the function name tells otherwise
// Providing nSize has no effect and is unused.
virtual void PostEntityEventAbstract( const CBaseHandle &hndl, INetworkSerializable *pEvent, const void *pData, unsigned long nSize, NetChannelBufType_t bufType ) = 0;
2023-05-03 02:21:57 +03:00
virtual void ProcessQueuedEvents() = 0;
virtual int GetEventSource() const = 0;
virtual void PurgeQueuedEvents() = 0;
2015-09-27 17:05:29 -04:00
};
#endif // GAMEEVENTSYSTEM_H