This commit is contained in:
aozhiwei 2022-08-19 16:42:02 +08:00
parent fa046e5481
commit 543d06564d
5 changed files with 14 additions and 5 deletions

View File

@ -50,7 +50,7 @@ void MapMgr::UnInit()
void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info)
{
if (init_info.pve_instance_id) {
init_info.room_mode = (RoomMode_e)((rand() % 2) + (int)kChiJiMode);
init_info.room_mode = (RoomMode_e)((rand() % 2) + 1 + (int)kChiJiMode);
room->pve_mode_meta = MetaMgr::Instance()->GetPveGeminiMode(init_info.room_mode);
if (!room->pve_mode_meta) {
abort();
@ -59,7 +59,15 @@ void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info)
room->pve_instance = MetaMgr::Instance()->GetPveGemini(init_info.pve_instance_id);
if (!room->pve_instance) {
abort();
}
#ifdef DEBUG
a8::XPrintf("attachRoom pve_instance_id:%d room_mode:%d\n",
{
init_info.pve_instance_id,
init_info.room_mode
});
#endif
}
MapInstance* map_instance = init_info.init_map_id == 0 ?
RandMapInstance(init_info.room_mode) : GetMapInstance(init_info.init_map_id);

View File

@ -1276,7 +1276,6 @@ void Player::PushJoinRoomMsg()
if (!a8::HasBitFlag(status, CS_ForceTeam)) {
cs::SMJoinedNotify notifymsg;
notifymsg.set_error_code(0);
notifymsg.set_room_mode((int)room->GetRoomMode());
notifymsg.set_server_info(JsonDataMgr::Instance()->server_info);
room->FillSMJoinedNotify(this, notifymsg);
GGListener::Instance()->SendToClient(socket_handle, 0, notifymsg);
@ -1289,7 +1288,7 @@ void Player::PushJoinRoomMsg()
#endif
notifymsg.set_map_width(room->GetMapMeta()->i->map_width());
notifymsg.set_map_height(room->GetMapMeta()->i->map_height());
//notifymsg.set_room_mode((int)room->GetRoomMode());
notifymsg.set_room_mode((int)room->GetRoomMode());
notifymsg.set_server_info(JsonDataMgr::Instance()->server_info);
//notifymsg.set_team_mode(team_mode());
notifymsg.set_player_id(GetUniId());

View File

@ -1184,7 +1184,7 @@ void Room::UpdateGas()
break;
}
if (gas_data_.gas_mode != GasInactive && gas_data_.gas_mode != GasJump) {
if (gas_data_.gas_mode != GasInactive && GetRoomMode() == kChiJiMode) {
if (gas_data_.gas_mode != GasInactive) {
if (IsPveRoom()) {
} else {

View File

@ -125,10 +125,12 @@ void RoomMgr::Update(int delta_time)
void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
{
#if 0
if (msg.proto_version() < 2021073001) {
JoinErrorHandle(msg, 6, hdr.socket_handle);
return;
}
#endif
if (IsLimitJoin()) {
JoinErrorHandle(msg, 2, hdr.socket_handle);
return;

View File

@ -1238,7 +1238,6 @@ message SMJoinedNotify
optional int32 error_code = 7; // 1: 2
optional int32 error_msg = 10; //
optional int32 room_mode = 8; //0: 1: 2:
optional string server_info = 9; //使 SMMapInfo
}
@ -1254,6 +1253,7 @@ message SMMapInfo
optional bool started = 8; //
optional string room_uuid = 9; //id
optional string server_info = 10; //使
optional int32 room_mode = 11; //0: 1: 2:
}
//