C++,服務器為對象書寫的
定義 login
[cpp]v
#include "OConnection.h"
#include "network/worldserverlist.h"
#include "netmessgehandle.h"
#include "OClientnet.h"
#include "db_mysql.h"
#include "OClientNetCluster.h"
用戶定義空間
[cpp]
class CClientlogin : public NetMessageHandle //當前隊列消息
{
public:
CClientlogin(net::AddressStr addr,int nAccount,COClientNetCluster* pClientNetCluster);
virtual ~CClientlogin();
public:
void InitRole(int nID,int nRoleID,string RoleName);
void Moving(int nRoleX,int nRoleY,int nRoleID);
void SceneSwitching(int nScene,int nRoleID);
void Logic();
unsigned int RandomData(int min,int max);
public:
void Login(int nRoleID ,string RoleName);
void TestWorld();
void InitDB();
void InsertData();
bool IsValid();
bool Connect(void);
void SendPacket(PacketBase& packet);
int m_nPlayerID;
int m_nAccount;
COClientNetCluster* m_pClientNetCluster;
CMysql m_Mysql;
bool m_bLoginSuccess;
void ActiveClose();
(待續)