This commit is contained in:
aozhiwei 2023-06-25 14:53:40 +08:00
parent 12c82c3b25
commit d044953e9c
4 changed files with 18 additions and 5 deletions

View File

@ -45,6 +45,7 @@ namespace mt
s_.match_lock_time++; s_.match_lock_time++;
#endif #endif
s_.pre_client_shot = GetIntParam("pre_client_shot", 0); s_.pre_client_shot = GetIntParam("pre_client_shot", 0);
s_.match_mode_wait_time = GetIntParam("match_mode_wait_time", 10);
#if 1 #if 1
{ {
std::string point = GetStringParam("newbie_room_born_point", "3471.3662:6.8399:5268.6240"); std::string point = GetStringParam("newbie_room_born_point", "3471.3662:6.8399:5268.6240");

View File

@ -114,6 +114,8 @@ namespace mt
int newbie_room_battle_times = 0; int newbie_room_battle_times = 0;
int mid_room_max_rank = 0; int mid_room_max_rank = 0;
int match_mode_wait_time = 0;
}; };
static void StaticPostInit(); static void StaticPostInit();
static const S& s() { return s_; }; static const S& s() { return s_; };

View File

@ -1008,6 +1008,9 @@ bool Room::CanJoin(const std::string& accountid,
const cs::CMJoin& msg) const cs::CMJoin& msg)
{ {
if (lock_room_) { if (lock_room_) {
if (IsPvpRankModeRoom()) {
}
return false; return false;
} }
if (IsNewBieRoom()) { if (IsNewBieRoom()) {
@ -1075,9 +1078,6 @@ bool Room::CanJoin(const std::string& accountid,
break; break;
} }
} }
}
if (IsPvpRankModeRoom()) {
} }
return GetPlayerNum() < (int)GetRoomMaxPlayerNum(); return GetPlayerNum() < (int)GetRoomMaxPlayerNum();
} }
@ -1325,7 +1325,10 @@ void Room::UpdateGasInactivePvp()
bool over = GetFrameNo() - gas_data_.gas_start_frameno >= bool over = GetFrameNo() - gas_data_.gas_start_frameno >=
GetGasInactiveTime() * SERVER_FRAME_RATE; GetGasInactiveTime() * SERVER_FRAME_RATE;
if (IsPvpRankModeRoom()) { if (IsPvpRankModeRoom()) {
if (lock_room_) {
over = GetFrameNo() - lock_room_frameno_ >=
mt::Param::s().match_mode_wait_time * SERVER_FRAME_RATE;
}
} }
if (over) { if (over) {
long long begin_tick = a8::XGetTickCount(); long long begin_tick = a8::XGetTickCount();
@ -3455,3 +3458,9 @@ void Room::GMFastForward()
}, },
&xtimer_attacher_); &xtimer_attacher_);
} }
void Room::LockRoom()
{
lock_room_ = true;
lock_room_frameno_ = GetFrameNo();
}

View File

@ -249,7 +249,7 @@ public:
bool SupportSandTable(); bool SupportSandTable();
std::shared_ptr<SandTable> GetSandTable() { return sand_table_; } std::shared_ptr<SandTable> GetSandTable() { return sand_table_; }
bool IsSandTableRoom(); bool IsSandTableRoom();
void LockRoom() { lock_room_ = true; } void LockRoom();
void CombineTeam(); void CombineTeam();
void FillTeam(); void FillTeam();
bool HasRoomSwitch(int tag); bool HasRoomSwitch(int tag);
@ -405,6 +405,7 @@ private:
Team* victory_team_ = nullptr; Team* victory_team_ = nullptr;
bool force_over_ = false; bool force_over_ = false;
bool lock_room_ = false; bool lock_room_ = false;
long long lock_room_frameno_ = 0;
long long room_switch_ = 0; long long room_switch_ = 0;