diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index 8c46f115..affed37b 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -2036,3 +2036,8 @@ void Team::FillSMGameOver(cs::SMGameOver& msg) } } } + +bool PBUtils::SupportSandTable(int proto_version) +{ + return proto_version >= 2023051601; +} diff --git a/server/gameserver/pbutils.h b/server/gameserver/pbutils.h index 1407f3a0..b9ba21ce 100644 --- a/server/gameserver/pbutils.h +++ b/server/gameserver/pbutils.h @@ -42,6 +42,8 @@ class PBUtils static void Human_SendSMPvePassWave(Human* self, int new_wave, int pve_max_wave, int wait_time); + static bool SupportSandTable(int proto_version); + private: static void _Ability_FillMFAttrAdditionList (Ability* self, diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index d6e3242b..bdfab5a0 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -95,7 +95,6 @@ void Room::InitData(RoomInitInfo& init_info) force_entry_newbie_room_ = init_info.force_entry_newbie_room; pve_human_num = init_info.pve_human_num; is_newbie_room_ = init_info.is_newbie_room; - support_sand_table_room = init_info.support_sand_table_room; map_tpl_name_ = init_info.map_tpl_name; grid_service = init_info.grid_service; @@ -944,10 +943,8 @@ bool Room::CanJoin(const std::string& accountid, if (IsNewBieRoom()) { return false; } - if (self_proto_version < 2023051601) { - if (support_sand_table_room) { - return false; - } + if (PBUtils::SupportSandTable(self_proto_version) != SupportSandTable()) { + return false; } if (msg.force_enter_newbie_room()) { return false; @@ -3781,3 +3778,8 @@ bool Room::IsNewBieRoom() { return is_newbie_room_; } + +bool Room::SupportSandTable() +{ + return PBUtils::SupportSandTable(creator_proto_version_); +} diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 142341a2..cd44d80b 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -238,6 +238,7 @@ public: int GetReportRoomMode(); int GetPvpMatchMode(); void ForceOver(); + bool SupportSandTable(); private: void ShuaAndroid(); @@ -355,7 +356,6 @@ private: int creator_channel_ = 0; bool force_entry_newbie_room_ = false; bool is_newbie_room_ = false; - bool support_sand_table_room = false; a8::XTimerWp battle_report_timer_; int current_teamid_ = 0; diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index bf7dfbe5..dd7a790c 100644 --- a/server/gameserver/roommgr.h +++ b/server/gameserver/roommgr.h @@ -39,7 +39,6 @@ struct RoomInitInfo int pve_instance_id = 0; int pve_human_num = 0; bool is_newbie_room = false; - bool support_sand_table_room = false; const mt::Map* map_meta = nullptr; std::string map_tpl_name;