37 lines
892 B
C++
37 lines
892 B
C++
#pragma once
|
|
|
|
#include <f8/timer.h>
|
|
|
|
class Client;
|
|
class GameClientMgr : public a8::Singleton<GameClientMgr>
|
|
{
|
|
private:
|
|
GameClientMgr() {};
|
|
friend class a8::Singleton<GameClientMgr>;
|
|
|
|
public:
|
|
|
|
void Init();
|
|
void UnInit();
|
|
|
|
#if 0
|
|
void OnClientDisconnect(a8::XParams& param);
|
|
void OnTargetServerDisconnect(a8::XParams& param);
|
|
void OnTargetServerConnect(a8::XParams& param);
|
|
#endif
|
|
Client* 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::Attacher timer_attacher_;
|
|
std::map<int, Client*> socket_hash_;
|
|
#if 0
|
|
std::map<int, std::tuple<std::string, long long, timer_list*>> pending_account_hash_;
|
|
#endif
|
|
};
|