1
This commit is contained in:
parent
ffb835ccf3
commit
6b6daeda98
@ -999,9 +999,11 @@ bool Room::CanJoin(const std::string& accountid,
|
||||
if (msg.force_enter_newbie_room()) {
|
||||
return false;
|
||||
}
|
||||
#if 0
|
||||
if (room_mode_ != self_room_mode) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (GetGasData().GetGasMode() != GasInactive) {
|
||||
return false;
|
||||
}
|
||||
@ -2238,6 +2240,16 @@ long long Room::GetGasInactiveTime()
|
||||
}
|
||||
}
|
||||
|
||||
long long Room::GetGasInactiveReaminTime()
|
||||
{
|
||||
if (GetGasData().GetGasMode() != GasInactive) {
|
||||
return -1;
|
||||
}
|
||||
long long remain_time = GetGasInactiveTime() -
|
||||
(GetFrameNo() - GetGasData().gas_start_frameno) * FRAME_RATE_MS;
|
||||
return std::max((int)remain_time, 0);
|
||||
}
|
||||
|
||||
void Room::EnableHuman(Human* target)
|
||||
{
|
||||
if (!RuningInTimer()) {
|
||||
|
@ -209,6 +209,7 @@ public:
|
||||
int CreateAndTakeonCar(int car_id, glm::vec3 pos);
|
||||
bool HaveMyTeam(const std::string& team_uuid);
|
||||
long long GetGasInactiveTime();
|
||||
long long GetGasInactiveReaminTime();
|
||||
void CheckPartObjects(Human* testa = nullptr, Human* testb = nullptr);
|
||||
bool RuningInTimer();
|
||||
Human* GetOneCanEnableAndroid();
|
||||
|
@ -284,8 +284,19 @@ Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg,
|
||||
return group_rooms[self_room_type][rand() % group_rooms[self_room_type].size()];
|
||||
}
|
||||
if (self_room_type == RoomType_OldBrid2) {
|
||||
|
||||
for (auto& room : group_rooms[RoomType_OldBrid3]) {
|
||||
if (room->GetGasInactiveReaminTime() > 8 &&
|
||||
room->GetPlayerNum() + 8 < room->GetRoomMaxPlayerNum()) {
|
||||
return room;
|
||||
}
|
||||
}
|
||||
} else if (self_room_type == RoomType_OldBrid3) {
|
||||
for (auto& room : group_rooms[RoomType_OldBrid2]) {
|
||||
if (room->GetGasInactiveReaminTime() > 8 &&
|
||||
room->GetPlayerNum() + 8 < room->GetRoomMaxPlayerNum()) {
|
||||
return room;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CreateRoom(msg,
|
||||
self_room_type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user