This commit is contained in:
aozhiwei 2023-09-23 12:58:09 +08:00
parent 37558ededf
commit 59cca98c1e
4 changed files with 28 additions and 9 deletions

View File

@ -107,3 +107,15 @@ std::shared_ptr<CustomTeam> CustomBattle::GetTeamByTeamUuid(const std::string& t
auto itr = uuid_hash_.find(team_uuid);
return itr != uuid_hash_.end() ? itr->second : nullptr;
}
bool CustomBattle::AllIsJoined()
{
bool ok = true;
for (auto& pair : member_id_hash_) {
if (!pair.second->IsJoined()) {
ok = false;
break;
}
}
return ok;
}

View File

@ -24,6 +24,7 @@ class CustomBattle
std::shared_ptr<CustomTeam> GetTeamByAccountId(const std::string& account_id);
std::shared_ptr<CustomMember> GetMemberByAccountId(const std::string& account_id);
std::shared_ptr<CustomTeam> GetTeamByTeamUuid(const std::string& team_uuid);
bool AllIsJoined();
private:
bool parse_ok_ = false;

View File

@ -42,6 +42,7 @@
#include "sandtable.h"
#include "batchsync.h"
#include "trigger.h"
#include "custom_battle.h"
#include "mt/Param.h"
#include "mt/Hero.h"
@ -331,6 +332,9 @@ void Room::AddPlayer(Player* hum, std::shared_ptr<BornPoint> init_born_point, bo
OnAddHuman(hum);
frame_event.AddEnterGame(hum->GetWeakPtrRef());
GameLog::Instance()->GameStart(hum);
if (custom_battle_ && custom_battle_->AllIsJoined()) {
}
}
int Room::AllocUniid()
@ -2275,24 +2279,25 @@ void Room::NotifyGameStart()
long long Room::GetGasInactiveTime()
{
#ifdef DEBUG
if (!f8::IsTestEnv()) {
return 12;
}
#endif
long long inactive_time = 0;
if (IsPveRoom()) {
return 10;
inactive_time = 10;
} else {
if (IsPvpRankModeRoom()) {
if (IsPvpMasterRankModeRoom()) {
return mt::Param::s().master_rank_gas_inactive_time;
inactive_time = mt::Param::s().master_rank_gas_inactive_time;
} else {
return mt::Param::s().rank_gas_inactive_time;
inactive_time = mt::Param::s().rank_gas_inactive_time;
}
} else {
return mt::Param::s().gas_inactive_time;
inactive_time = mt::Param::s().gas_inactive_time;
}
}
#ifdef DEBUG
if (!f8::IsTestEnv()) {
inactive_time = 12;
}
#endif
}
long long Room::GetGasInactiveReaminTime()

View File

@ -423,6 +423,7 @@ private:
a8::XTimerWp lock_room_timer_;
long long room_switch_ = 0;
long long acc_inactive_time_ = 0;
const mt::RankMatchConf* rank_match_conf_ = nullptr;