This commit is contained in:
aozhiwei 2020-07-16 11:41:29 +08:00
parent f6b03686be
commit d8b77f3381
2 changed files with 0 additions and 51 deletions

View File

@ -44,9 +44,6 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times)
#endif
if (!msg.team_uuid().empty()) {
if (RoomMgr::Instance()->IsProtectTeam(msg.team_uuid())) {
return RT_MidBrid;
}
bool has_mid_brid = false;
bool has_old_brid1 = false;
bool has_old_brid2 = false;
@ -98,36 +95,11 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times)
}
}
#if 0
time_t register_time = f8::ExtractRegisterTimeFromSessionId(msg.session_id());
if (!msg.team_uuid().empty()) {
bool has_new_brid = false;
for (auto& team_member : msg.team_members()) {
if (team_member.create_time() != 0 &&
a8::BetweenDays(Global::g_nowtime, team_member.create_time()) <= 0) {
has_new_brid = true;
break;
}
}
if (has_new_brid) {
return RT_OldBrid1;
} else {
return RT_OldBrid2;
}
} else {
if (a8::BetweenDays(Global::g_nowtime, register_time) <= 0) {
return RT_OldBrid1;
} else {
return RT_OldBrid2;
}
}
#else
if (rank >= 0 && rank <= 6) {
return RT_OldBrid1;
} else {
return RT_OldBrid2;
}
#endif
}
void RoomMgr::Init()
@ -511,23 +483,3 @@ bool RoomMgr::IsGM(const cs::CMJoin& msg)
}
return false;
}
void RoomMgr::AddProtectTeam(const std::string& team_uuid)
{
protect_team_hash_[team_uuid] = 1;
a8::Timer::Instance()->AddDeadLineTimer
(
1000 * 30,
a8::XParams()
.SetSender(team_uuid),
[] (const a8::XParams& param)
{
RoomMgr::Instance()->protect_team_hash_.erase(param.sender.GetString());
}
);
}
bool RoomMgr::IsProtectTeam(const std::string& team_uuid)
{
return protect_team_hash_.find(team_uuid) != protect_team_hash_.end();
}

View File

@ -29,8 +29,6 @@ class RoomMgr : public a8::Singleton<RoomMgr>
Room* GetRoomByUuid(long long uuid);
void AddOverRoom(long long room_uuid);
bool IsGM(const cs::CMJoin& msg);
void AddProtectTeam(const std::string& team_uuid);
bool IsProtectTeam(const std::string& team_uuid);
private:
void InstallReportStateTimer();
@ -60,5 +58,4 @@ class RoomMgr : public a8::Singleton<RoomMgr>
std::map<long long, Room*> over_room_hash_;
a8::TimerAttacher reportstate_timer_attacher_;
std::map<std::string, int> gm_hash_;
std::map<std::string, int> protect_team_hash_;
};