ServerInterface

Posts 115 of 17 · Page 1 of 2
ServerInterface
well since unlimited ammo was released...
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;


};


}
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)
What is this. This looks absolutely useless.

You should explain what it is, since by looking at it there's not much there.
i was a bit confused by it too. i've never even seen this before and i've been through every header file and cpp file in CShell for NOLF2
its basically all server shit
and more detail on how they work
theres more to it, there still not much
if any documentation on it.
if it wasnt for RuKKa and mattypatty
i would have never known at all

but basically just a bunch of shit for how the server reads
and writes and sends
i still have mattypatty's original with all the million comments and
a few things i took out that are still in it
..............
Credit necrosyz to, what ever matty did and does was because of necro...
Quote Originally Posted by Acea View Post
..............
Credit necrosyz to, what ever matty did and does was because of necro...
ok,, i only put credits of who i knew im not as familiar with necro as the others my bad
Quote Originally Posted by -Bl00d- View Post

ok,, i only put credits of who i knew im not as familiar with necro as the others my bad
Necrosyz = Legendy on this forum.

So you can mention him, but include his most known name.
i didnt know that ?! oh snap my bad
so this is for the different functions of the
server and examples of how to use them?
Very interesting, but how to use? To which servanthood?
i mean if you can emulate or capture the server's response, you can do anything. i'm guessing that's what this is for?
interesting.. i see this is finally getting out, i have the commented version.. along with menu bases
Quote Originally Posted by iamspeedforyou View Post
interesting.. i see this is finally getting out, i have the commented version.. along with menu bases
i have a commented one but its the original source... same thing?
Quote Originally Posted by supercarz1991 View Post
i have a commented one but its the original source... same thing?
Code:
   virtual LTRESULT    SendTo(ILTMessage_Read *pMsg, const char *sAddr, uint32 port)=0;
see if thats the last line on your source.if thats the last line then you have this version thats commented,thers another version that has more crap in it but it wont work for CA
Quote Originally Posted by -Bl00d- View Post

Code:
   virtual LTRESULT    SendTo(ILTMessage_Read *pMsg, const char *sAddr, uint32 port)=0;
see if thats the last line on your source.if thats the last line then you have this version thats commented,thers another version that has more crap in it but it wont work for CA
nope its different. oh well no biggy
Posts 115 of 17 · Page 1 of 2
This thread is closed for replies.

Tags for this Thread

None

Need help?