From f5e4b61bf8e2710c47a7c6cfe3aa5dc61964c5b3 Mon Sep 17 00:00:00 2001 From: homeremote Date: Tue, 18 Feb 2020 21:15:48 +0800 Subject: [PATCH] =?UTF-8?q?1:=E5=A2=9E=E5=8A=A0=E4=BB=8ELogonServer?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E5=8D=8F=E8=B0=83=E5=AD=98=E5=82=A8=E5=9C=A8?= =?UTF-8?q?redis=E4=B8=AD=E7=9A=84=E4=BF=A1=E6=81=AF=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bin/Debug_Unicode/ServerParameter.ini | Bin 4462 -> 4462 bytes .../CorrespondServer/AttemperEngineSink.cpp | 2 +- .../LogonServer/AttemperEngineSink.cpp | 19 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/俱乐部/Bin/Debug_Unicode/ServerParameter.ini b/俱乐部/Bin/Debug_Unicode/ServerParameter.ini index 3d03d26ea68261a05e54977ff1cfcef036523a13..f75d6de38ae8ed0635a7d4b947586b37738710c2 100644 GIT binary patch delta 14 VcmaE-^iFBRAAUxI&42j|838p&20j1) delta 14 VcmaE-^iFBRAAUx|&42j|838p;20s7* diff --git a/俱乐部/Source/ServerControl/CorrespondServer/AttemperEngineSink.cpp b/俱乐部/Source/ServerControl/CorrespondServer/AttemperEngineSink.cpp index 0ae490e..300fde0 100644 --- a/俱乐部/Source/ServerControl/CorrespondServer/AttemperEngineSink.cpp +++ b/俱乐部/Source/ServerControl/CorrespondServer/AttemperEngineSink.cpp @@ -1035,7 +1035,7 @@ bool CAttemperEngineSink::OnTCPNetworkMainServiceInfo(WORD wSubCmdID, VOID * pDa m_pITCPNetworkEngine->SendDataBatch(MDM_CS_SERVICE_INFO, SUB_CS_S_SERVER_ONLINE, &ServerOnLine, sizeof(ServerOnLine), 0L); - //存储信息到redis + //测试存储信息到redis std::vector> field_val; field_val.push_back({ "wServerID", string_format("%d",ServerOnLine.wServerID) }); field_val.push_back({ "dwOnLineCount", string_format("%d",ServerOnLine.dwOnLineCount) }); diff --git a/俱乐部/Source/ServerControl/LogonServer/AttemperEngineSink.cpp b/俱乐部/Source/ServerControl/LogonServer/AttemperEngineSink.cpp index 93a0476..b0ef31d 100644 --- a/俱乐部/Source/ServerControl/LogonServer/AttemperEngineSink.cpp +++ b/俱乐部/Source/ServerControl/LogonServer/AttemperEngineSink.cpp @@ -875,6 +875,25 @@ bool CAttemperEngineSink::OnTCPSocketMainServiceInfo(WORD wSubCmdID, VOID * pDat // CMD_CS_S_ServerOnLine * pServerOnLine = (CMD_CS_S_ServerOnLine *)pData; + //Դreidsȡ + //hmget + std::vector filelds{ "wServerID","dwOnLineCount" }; + //hmget + m_RedisClient->GetRedisClient()->hmget(string_format("Server_Info:%d", pServerOnLine->wServerID), filelds, [](cpp_redis::reply& reply) { + for (auto& res : reply.as_array()) + { + std::cout << res.as_string() << std::endl; + } + }); + //hgetall + m_RedisClient->GetRedisClient()->hgetall(string_format("Server_Info:%d", pServerOnLine->wServerID), [](const cpp_redis::reply& reply) { + for (auto& res : reply.as_array()) + { + //std::cout << res << std::endl; + std::cout << res.as_string() << std::endl; + } + }); + //ҷ CGameServerItem * pGameServerItem = m_ServerListManager.SearchGameServer(pServerOnLine->wServerID); if (pGameServerItem == NULL) return true;