diff --git a/server/gameserver/airraid.cc b/server/gameserver/airraid.cc index 978799e4..2dac5770 100644 --- a/server/gameserver/airraid.cc +++ b/server/gameserver/airraid.cc @@ -25,7 +25,7 @@ void AirRaid::Init() ( [this] (const mt::AirRaid* air_raid, bool& stop) { - room_->xtimer.SetTimeoutEx + auto timer_wp = room_->xtimer.SetTimeoutWpEx (SERVER_FRAME_RATE * air_raid->time(), [this, air_raid] (int event, const a8::Args* args) { @@ -36,6 +36,9 @@ void AirRaid::Init() } }, &room_->xtimer_attacher_); + #ifdef DEBUG + timers_.push_back(timer_wp); + #endif }); } @@ -207,3 +210,12 @@ void AirRaid::ExecOneRoundAirRaid(const mt::AirRaid* raid_meta, const glm::vec3& } #endif } + +#ifdef DEBUG + +void AirRaid::NextRaid() +{ + +} + +#endif diff --git a/server/gameserver/airraid.h b/server/gameserver/airraid.h index df9211e3..5bfe5ae0 100644 --- a/server/gameserver/airraid.h +++ b/server/gameserver/airraid.h @@ -8,6 +8,9 @@ class AirRaid AirRaid(Room* room); void Init(); +#ifdef DEBUG + void NextRaid(); +#endif private: @@ -17,4 +20,7 @@ class AirRaid private: Room* room_ = nullptr; +#ifdef DEBUG + std::vector timers_; +#endif }; diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index d531c260..334fbe5c 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -8,6 +8,7 @@ #include "ability.h" #include "movement.h" #include "android.h" +#include "airraid.h" #include "cs_proto.pb.h" @@ -170,6 +171,11 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg) #if DEBUG room->debug_params[121] = 1; #endif + } else if (cmd == "next_raid") { + #if DEBUG + room->debug_params[121] = 1; + room->GetAirRaid()->NextRaid(); + #endif } else if (cmd == "autodie") { #if DEBUG if (cmds.size() >= 2) { diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 05155e48..b557f9b2 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -238,6 +238,7 @@ public: int GetReportRoomMode(); int GetPvpMatchMode(); void ForceOver(); + std::shared_ptr GetAirRaid() { return air_raid_; } private: void ShuaAndroid();