SS_IM_IMServerList改为返回所有节点

This commit is contained in:
aozhiwei 2020-07-04 21:22:38 +08:00
parent 72dd914c79
commit 61cc416356

View File

@ -122,21 +122,16 @@ void SvrMgr::_SS_IM_ReportServerInfo(f8::MsgHdr& hdr, const ss::SS_IM_ReportServ
void SvrMgr::_SS_IM_IMServerList(f8::MsgHdr& hdr, const ss::SS_IM_IMServerList& msg) void SvrMgr::_SS_IM_IMServerList(f8::MsgHdr& hdr, const ss::SS_IM_IMServerList& msg)
{ {
SvrNode* node = GetNodeBySocket(hdr.socket_handle); ss::SS_MS_IMServerList respmsg;
if (node) { for (auto& pair : node_key_hash_) {
ss::SS_MS_IMServerList respmsg; auto p = respmsg.add_server_list();
for (auto& pair : node_key_hash_) { p->set_instance_id(pair.second->instance_id);
if (node != pair.second) { p->set_online_num(pair.second->online_num);
auto p = respmsg.add_server_list(); p->set_ip(pair.second->ip);
p->set_instance_id(pair.second->instance_id); p->set_port(pair.second->port);
p->set_online_num(pair.second->online_num); p->set_servicing(pair.second->servicing);
p->set_ip(pair.second->ip);
p->set_port(pair.second->port);
p->set_servicing(pair.second->servicing);
}
}
IMListener::Instance()->SendMsg(hdr.socket_handle, respmsg);
} }
IMListener::Instance()->SendMsg(hdr.socket_handle, respmsg);
} }
void SvrMgr::___GSList(f8::JsonHttpRequest* request) void SvrMgr::___GSList(f8::JsonHttpRequest* request)