C ++, the server is written as an object
Define login
[Cpp] v
# Include "OConnection. h"
# Include "network/worldserverlist. h"
# Include "netmessgehandle. h"
# Include "OClientnet. h"
# Include "db_mysql.h"
# Include "OClientNetCluster. h"
User-defined space
[Cpp]
Class CClientlogin: public NetMessageHandle // message in the current queue
{
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 ();
(To be continued)