当前位置:编程学习 > C/C++ >>

网游测试登陆的程序

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(); 

 (待续)

 

补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,