From 8f665be9df20892c9fff6bcc8b4481eebd32a0f1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 18 Mar 2024 20:13:51 +0800 Subject: [PATCH] 1 --- server/gameserver/roommgr.cc | 22 +++++++++------------- server/gameserver/roommgr.h | 3 +-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index cb45dc80..8504b994 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -324,8 +324,7 @@ std::shared_ptr RoomMgr::GetJoinableRoom(const cs::CMJoin& msg, } } } - return CreateRoom(msg, - self_room_type, + return CreateRoom(self_room_type, game_times, creator_register_time, proto_version, @@ -511,8 +510,7 @@ int RoomMgr::AllocRoomIdx() return current_room_idx_; } -std::shared_ptr RoomMgr::CreateRoom(const cs::CMJoin& msg, - RoomType_e room_type, +std::shared_ptr RoomMgr::CreateRoom(RoomType_e room_type, int game_times, int creator_register_time, int creator_proto_version, @@ -530,14 +528,16 @@ std::shared_ptr RoomMgr::CreateRoom(const cs::CMJoin& msg, init_info.room_idx = room_idx; init_info.room_uuid = f8::App::Instance()->NewGlobalUuid(); init_info.room_type = room_type; - init_info.room_mode = (RoomMode_e)msg.room_mode(); + init_info.room_mode = room_mode; init_info.init_map_id = map_id; init_info.creator_game_times = game_times; init_info.creator_register_time = creator_register_time; init_info.creator_proto_version = creator_proto_version; init_info.creator_channel = creator_channel; +#if 0 init_info.pve_instance_id = msg.pve_instance_id(); init_info.pve_human_num = std::max(1, msg.team_members_size()); +#endif init_info.custom_battle = custom_battle; if (GetRoomByUuid(init_info.room_uuid)) { A8_ABORT(); @@ -1043,8 +1043,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu if (!room) { if (p->IsPvp()) { room = RoomMgr::Instance()->CreateRoom - (*join_msg, - self_room_type, + (self_room_type, game_times, register_time, join_msg->proto_version(), @@ -1054,8 +1053,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu nullptr); } else { room = RoomMgr::Instance()->CreateRoom - (*join_msg, - self_room_type, + (self_room_type, game_times, register_time, join_msg->proto_version(), @@ -1070,8 +1068,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu } else { if (p->IsPvp()) { room = RoomMgr::Instance()->CreateRoom - (*join_msg, - self_room_type, + (self_room_type, game_times, register_time, join_msg->proto_version(), @@ -1081,8 +1078,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu p); } else { room = RoomMgr::Instance()->CreateRoom - (*join_msg, - self_room_type, + (self_room_type, game_times, register_time, join_msg->proto_version(), diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index ab919ad5..6b5c3913 100644 --- a/server/gameserver/roommgr.h +++ b/server/gameserver/roommgr.h @@ -107,8 +107,7 @@ class RoomMgr : public a8::Singleton bool IsLimitJoin(); int AllocRoomIdx(); - std::shared_ptr CreateRoom(const cs::CMJoin& msg, - RoomType_e room_type, + std::shared_ptr CreateRoom(RoomType_e room_type, int game_times, int creator_register_time, int creator_proto_version,