This commit is contained in:
aozhiwei 2024-03-18 18:01:53 +08:00
parent 312de4a951
commit e26fa22fac

View File

@ -1034,7 +1034,29 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
channel
);
if (!room) {
if (p->IsPvp()) {
room = RoomMgr::Instance()->CreateRoom
(*join_msg,
self_room_type,
game_times,
register_time,
join_msg->proto_version(),
channel,
msg.mapid(),
p);
} else {
room = RoomMgr::Instance()->CreateRoom
(*join_msg,
self_room_type,
game_times,
register_time,
join_msg->proto_version(),
channel,
msg.mapid(),
nullptr);
}
}
p->SetRoom(room.get());
room->JoinWithCustomBattle(ip_saddr, socket_handle, join_msg, p);
} else {
if (p->IsPvp()) {