From c31c48ec484fb516feb4ecc288ce189ff9aa01a2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 15 Jan 2024 17:20:31 +0800 Subject: [PATCH] 1 --- server/gameserver/commands.cc | 9 +++++++++ server/gameserver/netdata.cc | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index 29c369b2..4c28f4c9 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -398,6 +398,15 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) &xtimer_attacher); } else if (cmd == "fast_forward") { room->GMFastForward(); + } else if (cmd == "winexp" && cmds.size() >= 1) { + float exp = a8::XValue(cmds[1]).GetDouble(); + if (exp > 0) { + WinExp(exp); + } + std::vector strings = GetAbility()->GMShowAttrs(); + for (auto& str : strings) { + SendDebugMsg("数值: " + str); + } } else if (cmd == "findpath" && cmds.size() >= 3) { float x = a8::XValue(cmds[1]).GetDouble(); float y = a8::XValue(cmds[2]).GetDouble(); diff --git a/server/gameserver/netdata.cc b/server/gameserver/netdata.cc index edaa4b79..9fc6858b 100644 --- a/server/gameserver/netdata.cc +++ b/server/gameserver/netdata.cc @@ -641,7 +641,9 @@ void BattleDataContext::GetHeroLvQuality(long long& hero_uniid, int& hero_lv, in quality = hero_dto->Get("quality", 0).GetInt(); } } - hero_lv = owner_.Get()->GetHeroLevel(); + if (owner_.Get()) { + hero_lv = owner_.Get()->GetHeroLevel(); + } } void BattleDataContext::GetWeaponLvQuality(long long weapon_uniid, int& weapon_lv, int& quality)