wsproxy/server/wsproxy/gameclientmgr.h
aozhiwei fb958c1a83 1
2019-12-12 16:14:51 +08:00

33 lines
867 B
C++

#pragma once
#include <a8/timer.h>
class GameClient;
class GameClientMgr : public a8::Singleton<GameClientMgr>
{
private:
GameClientMgr() {};
friend class a8::Singleton<GameClientMgr>;
public:
void Init();
void UnInit();
void OnClientDisconnect(a8::XParams& param);
void OnTargetServerDisconnect(a8::XParams& param);
void OnTargetServerConnect(a8::XParams& param);
GameClient* GetGameClientBySocket(int sockhande);
void BindTargetConn(int socket_handle, int conn_instance_id);
void AddPendingAccount(const std::string& account_id, int socket_handle, long long req_tick);
private:
void RemovePendingAccount(int socket_handle);
private:
a8::TimerAttacher timer_attacher_;
std::map<int, GameClient*> socket_hash_;
std::map<int, std::tuple<std::string, long long, timer_list*>> pending_account_hash_;
};