This commit is contained in:
aozhiwei 2024-03-18 20:13:51 +08:00
parent e057e00e8d
commit 8f665be9df
2 changed files with 10 additions and 15 deletions

View File

@ -324,8 +324,7 @@ std::shared_ptr<Room> 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<Room> RoomMgr::CreateRoom(const cs::CMJoin& msg,
RoomType_e room_type,
std::shared_ptr<Room> RoomMgr::CreateRoom(RoomType_e room_type,
int game_times,
int creator_register_time,
int creator_proto_version,
@ -530,14 +528,16 @@ std::shared_ptr<Room> 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(),

View File

@ -107,8 +107,7 @@ class RoomMgr : public a8::Singleton<RoomMgr>
bool IsLimitJoin();
int AllocRoomIdx();
std::shared_ptr<Room> CreateRoom(const cs::CMJoin& msg,
RoomType_e room_type,
std::shared_ptr<Room> CreateRoom(RoomType_e room_type,
int game_times,
int creator_register_time,
int creator_proto_version,