From a25f61ce0d6af5daa6282d2de705bb1f4de3dabb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 16 Aug 2022 18:58:32 +0800 Subject: [PATCH] 1 --- server/gameserver/mapmgr.cc | 3 +++ server/gameserver/player.cc | 3 +++ server/gameserver/room.cc | 16 +++++++++++++--- server/gameserver/room.h | 2 ++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/server/gameserver/mapmgr.cc b/server/gameserver/mapmgr.cc index c867df66..b2d87f83 100644 --- a/server/gameserver/mapmgr.cc +++ b/server/gameserver/mapmgr.cc @@ -49,6 +49,9 @@ void MapMgr::UnInit() void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info) { +#ifdef DEBUG + init_info.init_map_id = 1002; +#endif MapInstance* map_instance = init_info.init_map_id == 0 ? RandMapInstance(init_info.room_mode) : GetMapInstance(init_info.init_map_id); if (!map_instance) { diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 393a43aa..7d69c663 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -1284,6 +1284,9 @@ void Player::PushJoinRoomMsg() { cs::SMMapInfo notifymsg; notifymsg.set_map_id(room->GetMapMeta()->i->map_id()); +#ifdef DEBUG + notifymsg.set_map_id(1001); +#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()); diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 7e963564..86709bc8 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1221,6 +1221,15 @@ void Room::UpdateGas() } void Room::UpdateGasInactive() +{ + if (IsPveRoom()) { + UpdateGasInactivePve(); + } else { + UpdateGasInactivePvp(); + } +} + +void Room::UpdateGasInactivePvp() { if (GetFrameNo() - gas_data_.gas_start_frameno >= GetGasInactiveTime() * SERVER_FRAME_RATE) { long long begin_tick = a8::XGetTickCount(); @@ -1281,6 +1290,10 @@ void Room::UpdateGasInactive() } } +void Room::UpdateGasInactivePve() +{ +} + void Room::UpdateGasWaiting() { if (GetFrameNo() - gas_data_.gas_start_frameno >= @@ -1780,9 +1793,6 @@ void Room::AdjustAirDropPos(MetaData::MapThing* thing_meta, a8::Vec2& box_pos) void Room::ShuaPlane() { - if (IsPveRoom()) { - return; - } airline_ = MetaMgr::Instance()->RandAirLine(map_meta_->i->map_id()); if (!airline_) { A8_ABORT(); diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 1efd47ef..3531fbbe 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -237,6 +237,8 @@ private: void CreateAndroid(int android_num); void UpdateGas(); void UpdateGasInactive(); + void UpdateGasInactivePvp(); + void UpdateGasInactivePve(); void UpdateGasWaiting(); void UpdateGasMoving(); void UpdateGasJump();