1
This commit is contained in:
parent
2c3b6b62c1
commit
c1fb30c835
@ -4,7 +4,6 @@
|
||||
#include "human.h"
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
#include "pbutils.h"
|
||||
#include "mt/Param.h"
|
||||
|
||||
bool RollMsgHintInfo::Replace(int idx, std::string& text)
|
||||
@ -49,26 +48,6 @@ void KillMgr::UnInit()
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
master.name
|
||||
killer.name
|
||||
dead.name
|
||||
weapon.name
|
||||
weapon.text_icon
|
||||
image.id:
|
||||
*/
|
||||
void KillMgr::OnHumanDead(Human* dead_hum, KillInfo* info)
|
||||
{
|
||||
// 222
|
||||
#if 0
|
||||
RollMsgHintInfo hint_info;
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg = std::make_shared<cs::SMRollMsg>();
|
||||
FillHintInfo(dead_hum, info, hint_info);
|
||||
PBUtils::KillMgr_PreprocessRollMsg(pb_msg, hint_info);
|
||||
PBUtils::KillMgr_BoradcastRollMsg(dead_hum, info, 0, pb_msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
void KillMgr::FillHintInfo(Human* dead_hum, KillInfo* info, RollMsgHintInfo& hint_info)
|
||||
{
|
||||
hint_info.dead_name = dead_hum->GetName();
|
||||
|
@ -44,6 +44,17 @@ class KillMgr : public a8::Singleton<KillMgr>
|
||||
|
||||
private:
|
||||
void FillHintInfo(Human* dead_hum, KillInfo* info, RollMsgHintInfo& hint_info);
|
||||
void PreprocessRollMsg(std::shared_ptr<cs::SMRollMsg> pb_msg,
|
||||
RollMsgHintInfo& hint_info);
|
||||
void BoradcastRollMsg(Human* dead_hum,
|
||||
KillInfo* info,
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
||||
void BoradcastRollMsgCb(Human* dead_hum,
|
||||
KillInfo* info,
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
||||
|
||||
|
||||
friend class PBUtils;
|
||||
};
|
||||
|
@ -63,10 +63,26 @@ void PBUtils::_Ability_FillMFAttrAdditionList(Ability* self,
|
||||
}
|
||||
}
|
||||
|
||||
void PBUtils::KillMgr_PreprocessRollMsg(std::shared_ptr<cs::SMRollMsg> pb_msg,
|
||||
/*
|
||||
master.name
|
||||
killer.name
|
||||
dead.name
|
||||
weapon.name
|
||||
weapon.text_icon
|
||||
image.id:
|
||||
*/
|
||||
void KillMgr::OnHumanDead(Human* dead_hum, KillInfo* info)
|
||||
{
|
||||
RollMsgHintInfo hint_info;
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg = std::make_shared<cs::SMRollMsg>();
|
||||
FillHintInfo(dead_hum, info, hint_info);
|
||||
PreprocessRollMsg(pb_msg, hint_info);
|
||||
BoradcastRollMsg(dead_hum, info, 0, pb_msg);
|
||||
}
|
||||
|
||||
void KillMgr::PreprocessRollMsg(std::shared_ptr<cs::SMRollMsg> pb_msg,
|
||||
RollMsgHintInfo& hint_info)
|
||||
{
|
||||
#if 0
|
||||
if (hint_info.hint_template) {
|
||||
for (auto& tuple : *hint_info.hint_template) {
|
||||
int el_type = std::get<0>(tuple);
|
||||
@ -105,15 +121,13 @@ void PBUtils::KillMgr_PreprocessRollMsg(std::shared_ptr<cs::SMRollMsg> pb_msg,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void PBUtils::KillMgr_BoradcastRollMsg(Human* dead_hum,
|
||||
void KillMgr::BoradcastRollMsg(Human* dead_hum,
|
||||
KillInfo* info,
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg)
|
||||
{
|
||||
#if 0
|
||||
std::shared_ptr<KillInfo> info_copy = std::make_shared<KillInfo>();
|
||||
*info_copy = *info;
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg_copy = std::make_shared<cs::SMRollMsg>();
|
||||
@ -125,7 +139,7 @@ void PBUtils::KillMgr_BoradcastRollMsg(Human* dead_hum,
|
||||
(int event, const a8::Args* args) mutable
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
PBUtils::KillMgr_BoradcastRollMsgCb
|
||||
KillMgr::Instance()->BoradcastRollMsgCb
|
||||
(dead_hum,
|
||||
info_copy.get(),
|
||||
killer_team_id,
|
||||
@ -133,15 +147,13 @@ void PBUtils::KillMgr_BoradcastRollMsg(Human* dead_hum,
|
||||
}
|
||||
},
|
||||
&dead_hum->xtimer_attacher);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PBUtils::KillMgr_BoradcastRollMsgCb(Human* dead_hum,
|
||||
void KillMgr::BoradcastRollMsgCb(Human* dead_hum,
|
||||
KillInfo* info,
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg)
|
||||
{
|
||||
#if 0
|
||||
dead_hum->room->TraversePlayerList
|
||||
(
|
||||
[dead_hum, info, &pb_msg, killer_team_id]
|
||||
@ -168,7 +180,6 @@ void PBUtils::KillMgr_BoradcastRollMsgCb(Human* dead_hum,
|
||||
hum->SendNotifyMsg(*pb_msg);
|
||||
return true;
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void PBUtils::Weapon_ToPB(Weapon* self, Creature* c, cs::MFWeapon* pb_obj)
|
||||
|
@ -40,17 +40,6 @@ class PBUtils
|
||||
static void Ability_FillMFAttrAdditionList(Ability* self, Human* hum, cs::MFActivePlayerData* player_data);
|
||||
static void Ability_FillMFAttrAdditionList(Ability* self, Human* hum, cs::MFPlayerFull* full_data);
|
||||
|
||||
static void KillMgr_PreprocessRollMsg(std::shared_ptr<cs::SMRollMsg> pb_msg,
|
||||
RollMsgHintInfo& hint_info);
|
||||
static void KillMgr_BoradcastRollMsg(Human* dead_hum,
|
||||
KillInfo* info,
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
||||
static void KillMgr_BoradcastRollMsgCb(Human* dead_hum,
|
||||
KillInfo* info,
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
||||
|
||||
static void Weapon_ToPB(Weapon* self, Creature* c, cs::MFWeapon* pb_obj);
|
||||
|
||||
static void Buff_FillMFBuff(Buff* self, cs::MFBuff* buff_pb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user