上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 66 下一页
摘要: /** * boost::noncopyable 实现单例不用麻烦了,直接从这个继承就行了 */#include class myclass : public boost::noncopyable{public: myclass(){}; myclass(int i){}; ... 阅读全文
posted @ 2014-12-01 16:35 zzyoucan 阅读(245) 评论(0) 推荐(0) 编辑
摘要: #include #if 0//函数模板templateT max(T a, T b, T c)//函数模板{ if (a class Compare{public: T max(T a, T b); T min(T a, T b);};templateT Compare::max... 阅读全文
posted @ 2014-12-01 16:05 zzyoucan 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 宁可一思进,莫在一思停 阅读全文
posted @ 2014-12-01 13:26 zzyoucan 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 著名的小退问题说这个问题著名,听过很多次但不知咋回事其是走json过来的void GameChannel::OnLogOut(){ if(m_eGameState != eGameState_EnterMap) return; ClearMapRcd();//其实很简单,就... 阅读全文
posted @ 2014-11-30 00:40 zzyoucan 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 玩家下线,之前一直感觉这个过程有点复杂else if (stat == link_stat::link_disconnected || stat == link_stat::link_connect_failed ){ GameChannel* pDisconnectGC = m_vecCha... 阅读全文
posted @ 2014-11-30 00:28 zzyoucan 阅读(190) 评论(0) 推荐(0) 编辑
摘要: GS踢玩家下线功能 //key:userId, val:nChannelId (当前在线用户) std::map m_mapOnLineUserByUid; /// m_vecChannel; ... 阅读全文
posted @ 2014-11-27 23:34 zzyoucan 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 玩家上线这个过程看了很多很多次了,这里在看下客户端打开,服务器收到libevent事件,然后new Channel这个过程都付给他各种指针,然后放到channel容器中1.客户端发送c2s_login服务器发送s2c_login并带以下结果enum LoginEnum{ LoginSucces... 阅读全文
posted @ 2014-11-23 21:44 zzyoucan 阅读(310) 评论(0) 推荐(0) 编辑
摘要: GS界面上显示的重要参考数据,这个是压测时重要参考struct GSinfo{ int revBuffNum; int sendBuffNum; int clientNum; int dbAskNum; ///NET(A),如果这个数据比较大,就说明NET即网络... 阅读全文
posted @ 2014-11-23 18:30 zzyoucan 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 客户端发包,GS接收bool GameServer::ProcessLoop(packet& rPkt)//GS线程做的{ if(false == m_spDataLayer->Recv(rPkt)) return true;//没数据了 if(rPkt.is_da... 阅读全文
posted @ 2014-11-23 17:52 zzyoucan 阅读(547) 评论(0) 推荐(0) 编辑
摘要: struct LiveMgr{private: int m_nCount; /// m_vecChannels; /// m_spTimer; /// m... 阅读全文
posted @ 2014-11-23 15:47 zzyoucan 阅读(259) 评论(0) 推荐(0) 编辑
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 66 下一页