Add IGameEventSystem.

This commit is contained in:
Nicholas Hastings 2015-09-27 17:05:29 -04:00
parent 2e859c5e04
commit 2ae117ccca
2 changed files with 77 additions and 5 deletions

View File

@ -88,9 +88,6 @@ namespace google
typedef uint32 SpawnGroupHandle_t; typedef uint32 SpawnGroupHandle_t;
typedef uint32 SwapChainHandle_t; typedef uint32 SwapChainHandle_t;
// This is really an enum included in a proto-generated header. Not sure if we want to include that here.
typedef int ENetworkDisconnectionReason;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// defines // defines
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -140,6 +137,21 @@ struct CEntityIndex
int _index; int _index;
}; };
struct CSplitScreenSlot
{
CSplitScreenSlot( int index )
{
_index = index;
}
int Get() const
{
return _index;
}
int _index;
};
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: Interface the engine exposes to the game DLL and client DLL // Purpose: Interface the engine exposes to the game DLL and client DLL
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -562,8 +574,8 @@ public:
virtual void ClientFullyConnect( CEntityIndex index, CPlayerSlot slot ) = 0; virtual void ClientFullyConnect( CEntityIndex index, CPlayerSlot slot ) = 0;
// Client is disconnecting from server // Client is disconnecting from server
virtual void ClientDisconnect( CEntityIndex index, int userId, ENetworkDisconnectionReason reason, const char *pszName, virtual void ClientDisconnect( CEntityIndex index, int userId, /* ENetworkDisconnectionReason */ int reason,
uint64 xuid, const char *pszNetworkID ) = 0; const char *pszName, uint64 xuid, const char *pszNetworkID ) = 0;
// Sets the client index for the client who typed the command into his/her console // Sets the client index for the client who typed the command into his/her console
virtual void SetCommandClient( CPlayerSlot slot) = 0; virtual void SetCommandClient( CPlayerSlot slot) = 0;

View File

@ -0,0 +1,60 @@
#ifndef GAMEEVENTSYSTEM_H
#define GAMEEVENTSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include <eiface.h>
#include <tier1/utldelegate.h>
class IRecipientFilter;
class CUtlSlot;
namespace google {
namespace protobuf {
class Message;
}
}
enum NetChannelBufType_t
{
};
struct GameEventHandle_t__
{
void *m_pUnknown;
const char* m_szMessageType;
int m_iUnknown2;
void *m_pUnknown3;
void *m_pUnknown4;
void *m_pUnknown5;
unsigned short m_MessageID;
};
#define GAMEEVENTSYSTEM_INTERFACE_VERSION "GameEventSystemServerV001"
abstract_class IGameEventSystem : public IAppSystem
{
public:
virtual void RegisterGameEvent( GameEventHandle_t__ *pEvent ) = 0;
virtual void RegisterGameEventHandlerAbstract( CUtlSlot *slot, const CUtlAbstractDelegate &delegate,
GameEventHandle_t__ *pEvent, int ) = 0;
virtual void UnregisterGameEventHandlerAbstract( CUtlSlot *slot, const CUtlAbstractDelegate &delegate,
GameEventHandle_t__ *pEvent ) = 0;
virtual void PostEventAbstract_Local( CSplitScreenSlot slot, GameEventHandle_t__ *, const void *pData,
unsigned long nSize ) = 0;
virtual void PostEventAbstract( CSplitScreenSlot slot, bool bLocalOnly, int nClientCount, const unsigned char *clients,
GameEventHandle_t__ *pEvent, const void *pData, unsigned long nSize, NetChannelBufType_t bufType ) = 0;
virtual void PostEventAbstract( CSplitScreenSlot slot, bool bLocalOnly, IRecipientFilter *pFilter,
GameEventHandle_t__ *pEvent, const void *pData, unsigned long nSize ) = 0;
virtual void PostEntityEventAbstract( const CBaseHandle &hndl, GameEventHandle_t__ *pEvent, const void *pData,
unsigned long nSize, NetChannelBufType_t bufType ) = 0;
virtual void ProcessQueuedEvents( void ) = 0;
virtual int GetEventSource( void ) const = 0;
virtual void PurgeQueuedEvents( void ) = 0;
};
#endif // GAMEEVENTSYSTEM_H