From ecbba052c5997efc4aedecb4dd5c71088ffb7842 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 15 Aug 2019 14:52:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=80=E6=89=8B=E5=A4=B4?= =?UTF-8?q?=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/human.cc | 11 +++++++++++ server/tools/protobuild/cs_proto.proto | 2 ++ 2 files changed, 13 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 4502fe3..6024a93 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -18,6 +18,7 @@ #include "gamelog.h" #include "typeconvert.h" #include "obstacle.h" +#include "player.h" #include "framework/cpp/utils.h" #include "framework/cpp/httpclientpool.h" @@ -158,6 +159,16 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb) stats_pb->set_dead(dead); stats_pb->set_killer_id(stats.killer_id); stats_pb->set_killer_name(stats.killer_name); + { + Player* killer = room->GetPlayerByUniId(stats.killer_id); + if (killer) { + stats_pb->set_killer_avatar_url(killer->avatar_url); + stats_pb->set_killer_account_id(killer->account_id); + } else { + stats_pb->set_killer_avatar_url(""); + stats_pb->set_killer_account_id(""); + } + } stats_pb->set_account_id(account_id); diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index ba038a0..b7726c3 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -561,6 +561,8 @@ message MFPlayerStats optional bool dead = 5; //是否已死亡 optional int32 killer_id = 7; //杀手id(自杀时为自己) 特殊id: -1:倒在安全区 optional string killer_name = 40; //杀手名称 + optional string killer_avatar_url = 41; //杀手头像(机器人头像为空) + optional string killer_account_id = 42; //杀手accountid(机器人为空) optional string account_id = 21; //账号id }