|
|
@@ -1035,6 +1035,16 @@ bool CAttemperEngineSink::OnTCPNetworkMainServiceInfo(WORD wSubCmdID, VOID * pDa |
|
|
|
|
|
|
|
|
|
|
|
m_pITCPNetworkEngine->SendDataBatch(MDM_CS_SERVICE_INFO, SUB_CS_S_SERVER_ONLINE, &ServerOnLine, sizeof(ServerOnLine), 0L);
|
|
|
|
//存储信息到redis
|
|
|
|
std::vector<std::pair<std::string, std::string>> field_val;
|
|
|
|
field_val.push_back({ "wServerID", string_format("%d",ServerOnLine.wServerID) });
|
|
|
|
field_val.push_back({ "dwOnLineCount", string_format("%d",ServerOnLine.dwOnLineCount) });
|
|
|
|
field_val.push_back({ "wTableOnlineCount", string_format("%d",ServerOnLine.wTableOnlineCount) });
|
|
|
|
field_val.push_back({ "wTableFullCount", string_format("%d",ServerOnLine.wTableFullCount) });
|
|
|
|
m_RedisClient->GetRedisClient()->hmset(string_format("Server_Info:%d", ServerOnLine.wServerID), field_val, [](const cpp_redis::reply& reply) {
|
|
|
|
std::cout << "hmset: " << reply << std::endl;
|
|
|
|
});
|
|
|
|
m_RedisClient->GetRedisClient()->sync_commit();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|