This commit is contained in:
aozhiwei 2023-12-27 15:09:15 +08:00
parent 10ebbf85d4
commit aa9f1fc53a
2 changed files with 8 additions and 8 deletions

View File

@ -140,7 +140,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr* hdr, const cs::CMJoin& msg)
JoinErrorHandle(msg, 3, hdr->socket_handle); JoinErrorHandle(msg, 3, hdr->socket_handle);
return; return;
} }
if (!msg.custom_room_payload().empty()) { if (!msg.payload_data().empty()) {
_CMJoinCustomBattle(hdr, msg); _CMJoinCustomBattle(hdr, msg);
return; return;
} }
@ -907,7 +907,7 @@ void RoomMgr::AdjustCMJoin(cs::CMJoin* msg)
#ifdef MYDEBUG #ifdef MYDEBUG
a8::XPrintf("custom_room_payload %s\n", a8::XPrintf("custom_room_payload %s\n",
{ {
msg->custom_room_payload() msg->payload_data()
}); });
#endif #endif
#if 0 #if 0
@ -949,7 +949,7 @@ std::shared_ptr<CustomBattle> RoomMgr::GetHisCustomRoom(const std::string& room_
void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg) void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg)
{ {
if (msg.custom_room_payload().empty()) { if (msg.payload_data().empty()) {
return; return;
} }
std::shared_ptr<cs::CMJoin> join_msg = std::make_shared<cs::CMJoin>(); std::shared_ptr<cs::CMJoin> join_msg = std::make_shared<cs::CMJoin>();
@ -1045,15 +1045,15 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg)
void RoomMgr::SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg, void RoomMgr::SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg,
std::function<void(int, const std::string, std::shared_ptr<CustomBattle>)> cb) std::function<void(int, const std::string, std::shared_ptr<CustomBattle>)> cb)
{ {
auto pos = join_msg->custom_room_payload().find('|'); auto pos = join_msg->payload_data().find('|');
std::string head; std::string head;
std::string body; std::string body;
if (pos == std::string::npos) { if (pos == std::string::npos) {
cb(1, "custom battle data error", nullptr); cb(1, "custom battle data error", nullptr);
return; return;
} }
head = join_msg->custom_room_payload().substr(0, pos); head = join_msg->payload_data().substr(0, pos);
body = join_msg->custom_room_payload().substr(pos + 1); body = join_msg->payload_data().substr(pos + 1);
auto data = std::make_shared<a8::XObject>(); auto data = std::make_shared<a8::XObject>();
if (!data->ReadFromJsonString(body) || if (!data->ReadFromJsonString(body) ||
!data->IsObject()) { !data->IsObject()) {
@ -1091,7 +1091,7 @@ void RoomMgr::SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg,
auto url_params = a8::MutableXObject::CreateObject(); auto url_params = a8::MutableXObject::CreateObject();
url_params->SetVal("account_id", join_msg->account_id()); url_params->SetVal("account_id", join_msg->account_id());
url_params->SetVal("session_id", join_msg->session_id()); url_params->SetVal("session_id", join_msg->session_id());
url_params->SetVal("__POST", join_msg->custom_room_payload()); url_params->SetVal("__POST", join_msg->payload_data());
HttpProxy::Instance()->HttpGet HttpProxy::Instance()->HttpGet
( (
[cb] [cb]

View File

@ -1415,7 +1415,7 @@ message CMJoin
optional int32 pve_instance_id = 72; //pve副本id optional int32 pve_instance_id = 72; //pve副本id
optional int32 team_slot_num = 73; //1-4 optional int32 team_slot_num = 73; //1-4
optional int32 force_enter_newbie_room = 74; // optional int32 force_enter_newbie_room = 74; //
optional string custom_room_payload = 75; // optional string payload_data = 75; //
} }
//线 //线