This commit is contained in:
aozhiwei 2020-05-29 13:04:03 +08:00
parent 572f39d848
commit 1d5737cb12
2 changed files with 4 additions and 10 deletions

View File

@ -46,12 +46,10 @@ public:
GasData gas_data;
bool game_over = false;
long long game_over_frameno = 0;
long long game_over_tick = 0;
a8::XTimer xtimer;
GridService* grid_service = nullptr;
MapService* map_service = nullptr;
long long battle_start_frameno_ = 0;
long long pending_request = 0;
long long last_debugout_tick = 0;
bool waiting_start = false;
RoomType_e room_type = RT_NewBrid;

View File

@ -163,21 +163,17 @@ void RoomMgr::AddOverRoom(long long room_uuid)
{
Room* room = RoomMgr::Instance()->GetRoomByUuid(param.sender);
if (room) {
if ((room->pending_request <= 0) ||
(a8::XGetTickCount() - room->game_over_tick > 1000 * 8)) {
RoomMgr::Instance()->room_hash_.erase(room->room_uuid);
RoomMgr::Instance()->over_room_hash_[room->room_uuid] = room;
RoomMgr::Instance()->FreeOverRoom(param.sender);
}
RoomMgr::Instance()->room_hash_.erase(room->room_uuid);
RoomMgr::Instance()->over_room_hash_[room->room_uuid] = room;
RoomMgr::Instance()->FreeOverRoom(param.sender);
}
};
inactive_room_hash_.erase(room_uuid);
Room* room = GetRoomByUuid(room_uuid);
if (room) {
room->game_over_tick = a8::XGetTickCount();
a8::Timer::Instance()->AddRepeatTimerAndAttach
(500,
(1000 * 5,
a8::XParams()
.SetSender(room_uuid),
callback,