aozhiwei b0c4341c04 1
2019-05-15 09:54:21 +08:00

41 lines
714 B
C++

#pragma once
#include "ss_proto.pb.h"
struct GSNode
{
std::string key;
int room_num = 0;
int online_num = 0;
std::string ip;
int port = 0;
};
class GSMgr : public a8::Singleton<GSMgr>
{
public:
enum { HID = HID_GSMgr };
private:
GSMgr() {};
friend class a8::Singleton<GSMgr>;
public:
void Init();
void UnInit();
void _SS_WSP_RequestTargetServer(f8::MsgHdr& hdr, const ss::SS_WSP_RequestTargetServer& msg);
void ___GSReport(f8::JsonHttpRequest* request);
private:
GSNode* GetNodeByTeamId(const std::string& team_id);
GSNode* AllocNode();
private:
std::map<std::string, GSNode*> team_hash_;
std::map<std::string, GSNode> node_hash_;
};