1
This commit is contained in:
parent
3b1a8bc94d
commit
572f39d848
@ -59,10 +59,6 @@ void Room::Init()
|
|||||||
void Room::UnInit()
|
void Room::UnInit()
|
||||||
{
|
{
|
||||||
App::Instance()->perf.alive_count -= alive_count_;
|
App::Instance()->perf.alive_count -= alive_count_;
|
||||||
if (game_over_timer) {
|
|
||||||
a8::Timer::Instance()->DeleteTimer(game_over_timer);
|
|
||||||
game_over_timer = nullptr;
|
|
||||||
}
|
|
||||||
xtimer_attacher_.ClearTimerList();
|
xtimer_attacher_.ClearTimerList();
|
||||||
for (auto& pair : accountid_hash_) {
|
for (auto& pair : accountid_hash_) {
|
||||||
PlayerMgr::Instance()->RemovePlayerBySocket(pair.second->socket_handle);
|
PlayerMgr::Instance()->RemovePlayerBySocket(pair.second->socket_handle);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <a8/xtimer.h>
|
#include <a8/xtimer.h>
|
||||||
#include <a8/timer_attacher.h>
|
|
||||||
|
|
||||||
#include "frameevent.h"
|
#include "frameevent.h"
|
||||||
#include "framemaker.h"
|
#include "framemaker.h"
|
||||||
@ -23,7 +22,6 @@ namespace metatable
|
|||||||
class DropObjJson;
|
class DropObjJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct timer_list;
|
|
||||||
struct xtimer_list;
|
struct xtimer_list;
|
||||||
class Entity;
|
class Entity;
|
||||||
class RoomEntity;
|
class RoomEntity;
|
||||||
@ -34,7 +32,6 @@ class Bullet;
|
|||||||
class Human;
|
class Human;
|
||||||
class Player;
|
class Player;
|
||||||
class Building;
|
class Building;
|
||||||
class Hero;
|
|
||||||
class AabbCollider;
|
class AabbCollider;
|
||||||
class Android;
|
class Android;
|
||||||
class Room
|
class Room
|
||||||
@ -50,7 +47,6 @@ public:
|
|||||||
bool game_over = false;
|
bool game_over = false;
|
||||||
long long game_over_frameno = 0;
|
long long game_over_frameno = 0;
|
||||||
long long game_over_tick = 0;
|
long long game_over_tick = 0;
|
||||||
timer_list* game_over_timer = nullptr;
|
|
||||||
a8::XTimer xtimer;
|
a8::XTimer xtimer;
|
||||||
GridService* grid_service = nullptr;
|
GridService* grid_service = nullptr;
|
||||||
MapService* map_service = nullptr;
|
MapService* map_service = nullptr;
|
||||||
@ -64,6 +60,7 @@ public:
|
|||||||
std::vector<MetaData::MapTplThing*>* loots = nullptr;
|
std::vector<MetaData::MapTplThing*>* loots = nullptr;
|
||||||
std::vector<Building*>* buildings = nullptr;
|
std::vector<Building*>* buildings = nullptr;
|
||||||
Human* first_newbie = nullptr;
|
Human* first_newbie = nullptr;
|
||||||
|
a8::XTimerAttacher timer_attacher;
|
||||||
|
|
||||||
~Room();
|
~Room();
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -176,10 +176,12 @@ void RoomMgr::AddOverRoom(long long room_uuid)
|
|||||||
Room* room = GetRoomByUuid(room_uuid);
|
Room* room = GetRoomByUuid(room_uuid);
|
||||||
if (room) {
|
if (room) {
|
||||||
room->game_over_tick = a8::XGetTickCount();
|
room->game_over_tick = a8::XGetTickCount();
|
||||||
room->game_over_timer = a8::Timer::Instance()->AddRepeatTimer(500,
|
a8::Timer::Instance()->AddRepeatTimerAndAttach
|
||||||
|
(500,
|
||||||
a8::XParams()
|
a8::XParams()
|
||||||
.SetSender(room_uuid),
|
.SetSender(room_uuid),
|
||||||
callback);
|
callback,
|
||||||
|
&room->timer_attacher.timer_list_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
third_party/a8engine
vendored
2
third_party/a8engine
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 51e182024207ec893cd0ed1b8f8d971341afb4a9
|
Subproject commit 8ab07d896fab50c552a60220fa2508967f76a69b
|
Loading…
x
Reference in New Issue
Block a user