From 9da86d6e8fa9a5a8332b7967ca33c67e519f88a7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 20 Sep 2023 10:43:02 +0800 Subject: [PATCH] 1 --- server/gameserver/custom_battle.h | 6 ++++-- server/gameserver/roommgr.cc | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/gameserver/custom_battle.h b/server/gameserver/custom_battle.h index 3df8b22d..e5b07f72 100644 --- a/server/gameserver/custom_battle.h +++ b/server/gameserver/custom_battle.h @@ -12,7 +12,8 @@ class CustomBattle Room* GetRoom() { return room_; } const std::string& GetRoomId() { return room_id_; } const std::string& GetRoomUuid() { return room_uuid_; } - const std::string& GetRawData() { return raw_data_; } + const std::string& GetSign() { return sign_; } + const std::shared_ptr& GetRawData() { return raw_data_; } int GetZoneId() { return zone_id_; } int GetNodeId() { return zone_id_; } int GetStartTime() { return start_time_; } @@ -24,6 +25,7 @@ class CustomBattle int zone_id_ = 0; int node_id_ = 0; int start_time_ = 0; - std::string raw_data_; + std::string sign_; + std::shared_ptr raw_data_; std::map> team_hash_; }; diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 8c656a74..400c7cff 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -873,4 +873,6 @@ void RoomMgr::SendGetCustomBattleData(std::shared_ptr join_msg, } head = join_msg->custom_room_payload().substr(0, pos - 1); body = join_msg->custom_room_payload().substr(pos); + auto data = std::make_shared(); + data->ReadFromJsonString(body); }