1
This commit is contained in:
parent
a12af68c88
commit
a15a050def
@ -84,29 +84,6 @@ void Android::Update(int delta_time)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef MYDEBUG
|
|
||||||
if (room->BattleStarted()) {
|
|
||||||
if (!dead &&
|
|
||||||
room->debug_params.find(119) != room->debug_params.end()) {
|
|
||||||
BeKill(VP_Gas,
|
|
||||||
TEXT("battle_server_killer_gas", "毒圈"),
|
|
||||||
VW_Gas,
|
|
||||||
VP_Gas,
|
|
||||||
TEXT("battle_server_killer_gas", "毒圈"));
|
|
||||||
a8::UnSetBitFlag(status, CS_Disable);
|
|
||||||
}
|
|
||||||
if (!dead &&
|
|
||||||
a8::HasBitFlag(status, CS_ForceTeam) &&
|
|
||||||
App::Instance()->debug_params.find(120) != App::Instance()->debug_params.end()) {
|
|
||||||
BeKill(VP_Gas,
|
|
||||||
TEXT("battle_server_killer_gas", "毒圈"),
|
|
||||||
VW_Gas,
|
|
||||||
VP_Gas,
|
|
||||||
TEXT("battle_server_killer_gas", "毒圈"));
|
|
||||||
a8::UnSetBitFlag(status, CS_Disable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
InternalUpdate(delta_time);
|
InternalUpdate(delta_time);
|
||||||
shot_hold = false;
|
shot_hold = false;
|
||||||
CheckShotHold();
|
CheckShotHold();
|
||||||
|
@ -249,8 +249,6 @@ void App::UnInit()
|
|||||||
|
|
||||||
FreeSocketMsgQueue();
|
FreeSocketMsgQueue();
|
||||||
msg_mutex_ = nullptr;
|
msg_mutex_ = nullptr;
|
||||||
loop_cond_ = nullptr;
|
|
||||||
loop_mutex_ = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int App::Run()
|
int App::Run()
|
||||||
@ -307,7 +305,7 @@ void App::AddSocketMsg(SocketFrom_e sockfrom,
|
|||||||
}
|
}
|
||||||
++msgnode_size_;
|
++msgnode_size_;
|
||||||
msg_mutex_->unlock();
|
msg_mutex_->unlock();
|
||||||
NotifyLoopCond();
|
f8::App::Instance()->NotifyLoopCond();
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::QuickExecute(int delta_time)
|
void App::QuickExecute(int delta_time)
|
||||||
@ -322,18 +320,6 @@ void App::SlowerExecute(int delta_time)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::NotifyLoopCond()
|
|
||||||
{
|
|
||||||
std::unique_lock<std::mutex> lk(*loop_mutex_);
|
|
||||||
loop_cond_->notify_all();
|
|
||||||
}
|
|
||||||
|
|
||||||
void App::Schedule()
|
|
||||||
{
|
|
||||||
std::unique_lock<std::mutex> lk(*loop_mutex_);
|
|
||||||
loop_cond_->wait_for(lk, std::chrono::milliseconds(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool App::HasTask()
|
bool App::HasTask()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -14,9 +14,6 @@ private:
|
|||||||
friend class a8::Singleton<App>;
|
friend class a8::Singleton<App>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef MYDEBUG
|
|
||||||
std::map<int, int> debug_params;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual const std::string GetPkgName() override;
|
virtual const std::string GetPkgName() override;
|
||||||
virtual void Init() override;
|
virtual void Init() override;
|
||||||
@ -34,12 +31,8 @@ public:
|
|||||||
const char *msgbody,
|
const char *msgbody,
|
||||||
int bodylen);
|
int bodylen);
|
||||||
|
|
||||||
void NotifyLoopCond();
|
|
||||||
|
|
||||||
long long AllocTempHeroUniId();
|
long long AllocTempHeroUniId();
|
||||||
long long AllocTempWeaponUniId();
|
long long AllocTempWeaponUniId();
|
||||||
bool IsTestMode() const { return is_test_mode_; }
|
|
||||||
int GetTestParam() const { return test_param_; }
|
|
||||||
bool IsServicing() const { return servicing_; }
|
bool IsServicing() const { return servicing_; }
|
||||||
void SetServicing(bool open) { servicing_ = open; }
|
void SetServicing(bool open) { servicing_ = open; }
|
||||||
int GetVersion();
|
int GetVersion();
|
||||||
@ -47,7 +40,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
void QuickExecute(int delta_time);
|
void QuickExecute(int delta_time);
|
||||||
void SlowerExecute(int delta_time);
|
void SlowerExecute(int delta_time);
|
||||||
void Schedule();
|
|
||||||
bool HasTask();
|
bool HasTask();
|
||||||
|
|
||||||
void DispatchMsg();
|
void DispatchMsg();
|
||||||
@ -57,19 +49,11 @@ private:
|
|||||||
void InitLog();
|
void InitLog();
|
||||||
void UnInitLog();
|
void UnInitLog();
|
||||||
|
|
||||||
bool ParseOpt();
|
|
||||||
void FreeSocketMsgQueue();
|
void FreeSocketMsgQueue();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool is_test_mode_ = false;
|
|
||||||
int test_param_ = 0;
|
|
||||||
bool servicing_ = true;
|
bool servicing_ = true;
|
||||||
|
|
||||||
long long last_run_tick_ = 0;
|
|
||||||
std::shared_ptr<std::mutex> loop_mutex_;
|
|
||||||
std::shared_ptr<std::condition_variable> loop_cond_;
|
|
||||||
|
|
||||||
std::shared_ptr<std::mutex> msg_mutex_;
|
std::shared_ptr<std::mutex> msg_mutex_;
|
||||||
MsgNode* top_node_ = nullptr;
|
MsgNode* top_node_ = nullptr;
|
||||||
MsgNode* bot_node_ = nullptr;
|
MsgNode* bot_node_ = nullptr;
|
||||||
|
@ -192,39 +192,10 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
} else if (cmd == "set_inactive_time" && cmds.size() >= 2) {
|
|
||||||
#if MYDEBUG
|
|
||||||
App::Instance()->debug_params[1] = a8::XValue(cmds[1]);
|
|
||||||
#endif
|
|
||||||
} else if (cmd == "set_born_frameno_offset" && cmds.size() >= 2) {
|
|
||||||
#if MYDEBUG
|
|
||||||
App::Instance()->debug_params[118] = a8::XValue(cmds[1]);
|
|
||||||
#endif
|
|
||||||
} else if (cmd == "chiji") {
|
|
||||||
#if MYDEBUG
|
|
||||||
room->debug_params[119] = 1;
|
|
||||||
#endif
|
|
||||||
} else if (cmd == "airraid") {
|
|
||||||
#if MYDEBUG
|
|
||||||
room->debug_params[121] = 1;
|
|
||||||
#endif
|
|
||||||
} else if (cmd == "next_raid") {
|
} else if (cmd == "next_raid") {
|
||||||
#if MYDEBUG
|
#if MYDEBUG
|
||||||
room->debug_params[121] = 1;
|
|
||||||
room->GetAirRaid()->NextRaid();
|
room->GetAirRaid()->NextRaid();
|
||||||
#endif
|
#endif
|
||||||
} else if (cmd == "autodie") {
|
|
||||||
#if MYDEBUG
|
|
||||||
if (cmds.size() >= 2) {
|
|
||||||
if (cmds[1] == "open") {
|
|
||||||
App::Instance()->debug_params[120] = 1;
|
|
||||||
} else if (cmds[1] == "close") {
|
|
||||||
App::Instance()->debug_params.erase(120);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
App::Instance()->debug_params[120] = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else if (cmd == "wudi") {
|
} else if (cmd == "wudi") {
|
||||||
int buff_uniid = TryAddBuff(this, 1005);
|
int buff_uniid = TryAddBuff(this, 1005);
|
||||||
if (buff_uniid != 0) {
|
if (buff_uniid != 0) {
|
||||||
|
@ -54,13 +54,6 @@ void RoomObstacle::Initialize()
|
|||||||
room->mine_objects[GetUniId()] = GetWeakPtrRef();
|
room->mine_objects[GetUniId()] = GetWeakPtrRef();
|
||||||
}
|
}
|
||||||
born_frameno = room->GetFrameNo();
|
born_frameno = room->GetFrameNo();
|
||||||
#ifdef MYDEBUG
|
|
||||||
{
|
|
||||||
if (App::Instance()->debug_params.find(118) != App::Instance()->debug_params.end()) {
|
|
||||||
born_frameno += App::Instance()->debug_params[118] * 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomObstacle::ActiveTimerFunc()
|
void RoomObstacle::ActiveTimerFunc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user