⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 charserver.h.svn-base

📁 ROSE的源代码。了解的自己研究,编译通过
💻 SVN-BASE
字号:
/*
    Open Source Rose Online Team - http://osroseon.to.md/
    note: the Server is develop with erose source server + eich source        
*/
#ifndef __ROSE_SERVERS__
#define __ROSE_SERVERS__

#include <time.h>
#include "../common/sockets.h"
#include "datatypes.h"
#define ClearItem(i) { i.durability=0; i.itemnum=0; i.itemtype=0; i.lifespan=0; i.refine=0; }

// Clent class
class CCharClient : public CClientSocket
{
    public:
    	CCharClient ( );   // constructor
    	~CCharClient ( );  // destructor

        // User information
    	UINT userid;
        bool platinum;    
    	char username[17];
    	char password[33];
    	UINT accesslevel;
    	UINT channel;
	
    	// Character information
    	char charname[17];	
    	UINT clanid;	
    	int clan_rank;
    	UINT level;
    	UINT job;
        UINT charid;	
	
    	bool isLoggedIn;
    	bool logout;	
    	vector<CFriendList*> FriendList;
};

// Server class
class CCharServer : public CServerSocket
{
    public:
    	CCharServer ( string );
    	~CCharServer( );
        CCharClient* CreateClientSocket( );
    	void DeleteClientSocket( CClientSocket* thisclient );
    	void OnClientDisconnect( CClientSocket* thisclient );
    	bool OnServerReady( );    	
        void LoadConfigurations( char* );    	
    	bool OnReceivePacket( CClientSocket* thisclient, CPacket* P );

    	//LMA BEGIN
    	//20070623, 224500
    	bool Ping();             //MySQL Ping
    	//LMA END
    
        // Extra functions
        CChanels* GetChannelByID( UINT id );
        CCharClient* GetClientByUserID( UINT id );
      	CCharClient* GetClientByID( UINT id );
    	CCharClient* GetClientByName( char *name );
    	CCharClient* GetClientByUserName( char *username );	
    	CClans* GetClanByID( int id );
        unsigned long int GetServerTime( );
        
        //LMA BEGIN
        //MySQL Pinging
        bool CCharServer::PingMySQL( MYSQL_RES*  DB );
        //LMA END
        

        // Community functions
        bool ChangeMessengerStatus (CCharClient* thisclient, CCharClient* otherclient, int status);	
        bool pakMessengerManager   ( CCharClient* thisclient, CPacket* P );
        bool pakMessengerChat  ( CCharClient* thisclient, CPacket* P );
    
        // Clan Functions
        bool SendClanInfo (CCharClient* thisclient);
        bool ChangeClanStatus (CCharClient* thisclient, CCharClient* otherclient, int channel);
        bool SendToClanMembers( int clanid,CPacket* pak );
        bool pakClanMembers ( CCharClient* thisclient );
        bool pakClanManager ( CCharClient* thisclient, CPacket* P );
        bool pakClanChat ( CCharClient* thisclient, CPacket* P );
        bool ClanLogout ( CCharClient* thisclient );
        bool pakUploadCM ( CCharClient* thisclient, CPacket* P );
        bool pakDownloadCM( CCharClient* thisclient, CPacket* P );
        bool pakClanIconTime( CCharClient* thisclient, CPacket* P );
    
        // General Packets
        bool pakUpdateLevel( CCharClient* thisclient, CPacket* P );
    	bool pakDoIdentify( CCharClient* thisclient, CPacket* P );
    	bool pakGetCharacters( CCharClient* thisclient, CPacket* P );
    	bool pakRequestWorld( CCharClient* thisclient, CPacket* P );
    	bool pakCreateChar( CCharClient* thisclient, CPacket* P );
    	bool pakDeleteChar( CCharClient* thisclient, CPacket* P );
    	bool pakWSReady ( CCharClient* thisclient, CPacket* P );
    	bool pakWSCharSelect ( CCharClient* thisclient, CPacket* P );
    	bool pakLoginConnected  ( CCharClient* thisclient, CPacket* P );
    	bool pakLoginDSClient( CCharClient* thisclient, CPacket* P );
    	bool pak7e5 ( CCharClient* thisclient, CPacket* P );
        bool pakChatrooms ( CCharClient* thisclient, CPacket* P );
            
        // Variables
        string filename;
        vector <CClans*> ClanList;
        vector <CChanels*> ChannelList;
        
            //Login
            SOCKET lsock;                // Socket to Login
        	char*    lct;                // Encryption table for login server  
       CDatabase* DB;          
};
void StartSignal( );
void StopSignal( );
void HandleSignal( int num );
extern class CCharServer* GServer;
#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -