sourcemm/CServerGameDLL.h
author David Anderson <dvander@alliedmods.net>
Thu Apr 28 17:24:39 2005 +0000 (2005-04-28)
changeset 40 dc68364fda90
parent 23 86f3894c86e9
child 55 12937809811e
permissions -rw-r--r--
Reorganized makefiles a tad
     1 /* ======== SourceMM ========
     2 * Copyright (C) 2004-2005 Metamod:Source Development Team
     3 * No warranties of any kind
     4 *
     5 * License: zlib/libpng
     6 *
     7 * Author(s): David "BAILOPAN" Anderson
     8 * ============================
     9 */
    10 
    11 #ifndef _INCLUDE_CSERVER_GAMEDLL_H
    12 #define _INCLUDE_CSERVER_GAMEDLL_H
    13 
    14 /**
    15  * @brief Defines wrapper class for gamedll interfaces
    16  * @file CServerGameDLL.h
    17  */
    18 
    19 #include <eiface.h>
    20 
    21 /**
    22  * @brief Empty class.  We only care about DLLInit.
    23  */
    24 class CServerGameDLL : public IServerGameDLL
    25 {
    26 	IServerGameDLL *m_pOrig;
    27 	char m_GameDescBuffer[256];
    28 public:
    29 	CServerGameDLL() : m_pOrig(0)
    30 	{
    31 		strcpy(m_GameDescBuffer, "Metamod:Source");
    32 	}
    33 	void SetOrig(IServerGameDLL *pOrig)
    34 	{
    35 		m_pOrig = pOrig;
    36 		snprintf(m_GameDescBuffer, 255, "%s", pOrig->GetGameDescription());
    37 	}
    38 
    39 	virtual bool DLLInit(	CreateInterfaceFn engineFactory, CreateInterfaceFn physicsFactory, CreateInterfaceFn fileSystemFactory, CGlobalVars *pGlobals);
    40 	virtual bool GameInit( void )
    41 	{ return m_pOrig->GameInit(); }
    42 	virtual bool LevelInit( char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background )
    43 	{ return m_pOrig->LevelInit(pMapName, pMapEntities, pOldLevel, pLandmarkName, loadGame, background); }
    44 	virtual void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
    45 	{ m_pOrig->ServerActivate(pEdictList, edictCount, clientMax); }
    46 	virtual void GameFrame( bool simulating )
    47 	{ m_pOrig->GameFrame(simulating); }
    48 	virtual void PreClientUpdate( bool simulating )
    49 	{ m_pOrig->PreClientUpdate(simulating); }
    50 	virtual void LevelShutdown( void )
    51 	{ m_pOrig->LevelShutdown(); }
    52 	virtual void GameShutdown( void )
    53 	{ m_pOrig->GameShutdown(); }
    54 	virtual void DLLShutdown( void );
    55 	virtual float GetTickInterval( void ) const
    56 	{ return m_pOrig->GetTickInterval(); }
    57 	virtual ServerClass *GetAllServerClasses( void )
    58 	{ return m_pOrig->GetAllServerClasses(); }
    59 	virtual const char *GetGameDescription( void )
    60 	{ return m_GameDescBuffer; }
    61 	virtual void CreateNetworkStringTables( void )
    62 	{ m_pOrig->CreateNetworkStringTables(); }
    63 	virtual CSaveRestoreData  *SaveInit( int size )
    64 	{ return m_pOrig->SaveInit(size); }
    65 	virtual void SaveWriteFields( CSaveRestoreData *a1, const char *a2, void *a3, datamap_t *a4, typedescription_t *a5, int a6)
    66 	{ m_pOrig->SaveWriteFields(a1, a2, a3, a4, a5, a6); }
    67 	virtual void SaveReadFields( CSaveRestoreData *a1, const char *a2, void *a3, datamap_t *a4, typedescription_t *a5, int a6)
    68 	{ m_pOrig->SaveReadFields(a1, a2, a3, a4, a5, a6); }
    69 	virtual void SaveGlobalState( CSaveRestoreData *a1)
    70 	{ m_pOrig->SaveGlobalState(a1); }
    71 	virtual void RestoreGlobalState( CSaveRestoreData *a1)
    72 	{ m_pOrig->RestoreGlobalState(a1); }
    73 	virtual void PreSave( CSaveRestoreData *a1)
    74 	{ m_pOrig->PreSave(a1); }
    75 	virtual void Save( CSaveRestoreData *a1)
    76 	{ m_pOrig->Save(a1); }
    77 	virtual void GetSaveComment( char *comment, int maxlength )
    78 	{ m_pOrig->GetSaveComment(comment, maxlength); }
    79 	virtual void WriteSaveHeaders( CSaveRestoreData *a1)
    80 	{ m_pOrig->WriteSaveHeaders(a1); }
    81 	virtual void ReadRestoreHeaders( CSaveRestoreData *a1)
    82 	{ m_pOrig->ReadRestoreHeaders(a1); }
    83 	virtual void Restore( CSaveRestoreData *a1, bool a2)
    84 	{ m_pOrig->Restore(a1, a2); }
    85 	virtual bool IsRestoring()
    86 	{ return m_pOrig->IsRestoring(); }
    87 	virtual int CreateEntityTransitionList( CSaveRestoreData *a1, int a2)
    88 	{ return m_pOrig->CreateEntityTransitionList(a1, a2); }
    89 	virtual void BuildAdjacentMapList( void )
    90 	{ m_pOrig->BuildAdjacentMapList(); }
    91 	virtual bool GetUserMessageInfo( int msg_type, char *name, int maxnamelength, int& size )
    92 	{ return m_pOrig->GetUserMessageInfo(msg_type, name, maxnamelength, size); }
    93 	virtual CStandardSendProxies* GetStandardSendProxies()
    94 	{ return m_pOrig->GetStandardSendProxies(); }
    95 };
    96 
    97 #endif //_INCLUDE_CSERVER_GAMEDLL_H