This commit is contained in:
aozhiwei 2023-05-10 11:48:39 +08:00
parent c323f75061
commit f755be2241
4 changed files with 26 additions and 1 deletions

View File

@ -25,7 +25,7 @@ void AirRaid::Init()
( (
[this] (const mt::AirRaid* air_raid, bool& stop) [this] (const mt::AirRaid* air_raid, bool& stop)
{ {
room_->xtimer.SetTimeoutEx auto timer_wp = room_->xtimer.SetTimeoutWpEx
(SERVER_FRAME_RATE * air_raid->time(), (SERVER_FRAME_RATE * air_raid->time(),
[this, air_raid] (int event, const a8::Args* args) [this, air_raid] (int event, const a8::Args* args)
{ {
@ -36,6 +36,9 @@ void AirRaid::Init()
} }
}, },
&room_->xtimer_attacher_); &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 #endif
} }
#ifdef DEBUG
void AirRaid::NextRaid()
{
}
#endif

View File

@ -8,6 +8,9 @@ class AirRaid
AirRaid(Room* room); AirRaid(Room* room);
void Init(); void Init();
#ifdef DEBUG
void NextRaid();
#endif
private: private:
@ -17,4 +20,7 @@ class AirRaid
private: private:
Room* room_ = nullptr; Room* room_ = nullptr;
#ifdef DEBUG
std::vector<a8::XTimerWp> timers_;
#endif
}; };

View File

@ -8,6 +8,7 @@
#include "ability.h" #include "ability.h"
#include "movement.h" #include "movement.h"
#include "android.h" #include "android.h"
#include "airraid.h"
#include "cs_proto.pb.h" #include "cs_proto.pb.h"
@ -170,6 +171,11 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg)
#if DEBUG #if DEBUG
room->debug_params[121] = 1; room->debug_params[121] = 1;
#endif #endif
} else if (cmd == "next_raid") {
#if DEBUG
room->debug_params[121] = 1;
room->GetAirRaid()->NextRaid();
#endif
} else if (cmd == "autodie") { } else if (cmd == "autodie") {
#if DEBUG #if DEBUG
if (cmds.size() >= 2) { if (cmds.size() >= 2) {

View File

@ -238,6 +238,7 @@ public:
int GetReportRoomMode(); int GetReportRoomMode();
int GetPvpMatchMode(); int GetPvpMatchMode();
void ForceOver(); void ForceOver();
std::shared_ptr<AirRaid> GetAirRaid() { return air_raid_; }
private: private:
void ShuaAndroid(); void ShuaAndroid();