1
This commit is contained in:
parent
f6b03686be
commit
d8b77f3381
@ -44,9 +44,6 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!msg.team_uuid().empty()) {
|
if (!msg.team_uuid().empty()) {
|
||||||
if (RoomMgr::Instance()->IsProtectTeam(msg.team_uuid())) {
|
|
||||||
return RT_MidBrid;
|
|
||||||
}
|
|
||||||
bool has_mid_brid = false;
|
bool has_mid_brid = false;
|
||||||
bool has_old_brid1 = false;
|
bool has_old_brid1 = false;
|
||||||
bool has_old_brid2 = 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) {
|
if (rank >= 0 && rank <= 6) {
|
||||||
return RT_OldBrid1;
|
return RT_OldBrid1;
|
||||||
} else {
|
} else {
|
||||||
return RT_OldBrid2;
|
return RT_OldBrid2;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomMgr::Init()
|
void RoomMgr::Init()
|
||||||
@ -511,23 +483,3 @@ bool RoomMgr::IsGM(const cs::CMJoin& msg)
|
|||||||
}
|
}
|
||||||
return false;
|
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();
|
|
||||||
}
|
|
||||||
|
@ -29,8 +29,6 @@ class RoomMgr : public a8::Singleton<RoomMgr>
|
|||||||
Room* GetRoomByUuid(long long uuid);
|
Room* GetRoomByUuid(long long uuid);
|
||||||
void AddOverRoom(long long room_uuid);
|
void AddOverRoom(long long room_uuid);
|
||||||
bool IsGM(const cs::CMJoin& msg);
|
bool IsGM(const cs::CMJoin& msg);
|
||||||
void AddProtectTeam(const std::string& team_uuid);
|
|
||||||
bool IsProtectTeam(const std::string& team_uuid);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InstallReportStateTimer();
|
void InstallReportStateTimer();
|
||||||
@ -60,5 +58,4 @@ class RoomMgr : public a8::Singleton<RoomMgr>
|
|||||||
std::map<long long, Room*> over_room_hash_;
|
std::map<long long, Room*> over_room_hash_;
|
||||||
a8::TimerAttacher reportstate_timer_attacher_;
|
a8::TimerAttacher reportstate_timer_attacher_;
|
||||||
std::map<std::string, int> gm_hash_;
|
std::map<std::string, int> gm_hash_;
|
||||||
std::map<std::string, int> protect_team_hash_;
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user