ServerInterface
well since unlimited ammo was released...
might as well leak this around. please don't spam
IDK whats been going on but code tags are spazzing lately its all in the same file not split like this
Credits to:
Tim0n
mattypatty
necrosyz
s0beit
myself
FEAR and NOLF2 SDK
RuKKa
&
RuKKa's BiTCh (yes that's his actual username)
might as well leak this around. please don't spam
ServerInt.h:
Code:
#ifndef __SERVER_INT_H__
Code:
#define __SERVER_INT_H__
#ifndef __LTBASEDEFS_H__
#include "ltbasedefs.h"
#endif
#include "iltmessage.h"
class ILTMessage_Read;
class ILTMessage_Write;
#define SI_VERSION 2
enum
{
UPDATEFLAG_NONACTIVE = 1,
};
typedef uint32 SI_CREATESTATUS;
enum
{
SI_OK = 0,
SI_ALREADYINSTANCED = 1,
SI_INVALIDVERSION = 2,
SI_ERRORINITTING = 3,
SI_CANTLOADRESOURCEMODULE = 4,
};
#define MAX_CLIENTINFO_NAME 64
struct ClientInfo
{
char m_sName[MAX_CLIENTINFO_NAME];
uint32 m_ClientID;
float m_Ping;
};
class ServerAppHandler
{
public:
virtual LTRESULT ShellMessageFn( ILTMessage_Read& /*msg*/ ) {return LT_OK;}
virtual LTRESULT ConsoleOutputFn(const char * /*pMsg*/) {return LT_OK;}
virtual LTFLOAT GetCPUUtilization() { return 0.0f; }
virtual LTRESULT OutOfMemory() {return LT_OK;}
virtual LTRESULT ProcessPacket(ILTMessage_Read & /*cMsg*/, uint8 senderAddr[4], uint16 /*senderPort*/) {return LT_OK;}
};
class ServerInt
{
public:
virtual LTRESULT SetAppHandler(ServerAppHandler *pHandler)=0;
virtual bool Init(int argc, char** argv)=0;
virtual LTRESULT LoadConfigFile(char *pFilename)=0;
virtual LTRESULT SaveConfigFile(char *pFilename)=0;
virtual LTRESULT SendToServerShell( ILTMessage_Read& msg )=0;
virtual bool AddResources(const char **pResources, uint32 nResources)=0;
virtual bool SetGameInfo( void *pGameInfo, uint32 nGameInfoLen ) = 0;
virtual bool LoadBinaries( ) = 0;
virtual FileEntry* GetFileList(char *pDirName)=0;
virtual void FreeFileList(FileEntry *pList)=0;
virtual bool StartWorld(StartGameRequest *pRequest)=0;
virtual int GetNumClients()=0;
virtual bool GetClientName(int index, char *pName, int maxChars)=0;
virtual bool SetClientName(int index, char *pName, int maxChars)=0;
virtual bool GetClientInfo(int index, ClientInfo* pInfo)=0;
virtual bool BootClient(uint32 dwClientID)=0;
virtual bool GetClientPing( uint32 nClientId, float &ping )=0;
virtual bool GetClientAddr( uint32 nClientId, uint8 pAddr[4], uint16 *pPort) = 0;
virtual void GetErrorString(wchar_t* pwszString, int maxLen)=0;
virtual bool Update(long flags)=0;
virtual bool InitNetworking(char *pDriver, uint32 dwFlags)=0;
virtual bool GetServiceList(NetService *&pListHead)=0;
virtual bool FreeServiceList(NetService *pListHead)=0;
virtual bool SelectService(HNETSERVICE hNetService)=0;
virtual bool UpdateSessionName(const char* sName)=0;
virtual bool HostGame(NetHost* pHostInfo)=0;
virtual bool GetTcpIpAddress(char* sAddress, uint32 dwBufferSize, unsigned short &hostPort)=0;
virtual LTRESULT SendTo(ILTMessage_Read *pMsg, const char *sAddr, uint32 port)=0;
};
}
Credits to:
Tim0n
mattypatty
necrosyz
s0beit
myself
FEAR and NOLF2 SDK
RuKKa
&
RuKKa's BiTCh (yes that's his actual username)

