From bc5b1ca1ebfa94c0b00979a6c89287dd0d02fef0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 4 Jun 2019 11:49:10 +0800 Subject: [PATCH] =?UTF-8?q?battleReport=E6=B7=BB=E5=8A=A0map=5Fid=20map=5F?= =?UTF-8?q?tpl=5Fname=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/human.cc | 2 ++ server/gameserver/room.cc | 4 ++-- server/gameserver/room.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 5237c84..183e1ad 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1769,7 +1769,9 @@ void Human::GenBattleReportData(a8::MutableXObject* params) } } params->SetVal("account_id", account_id); + params->SetVal("map_id", room->map_meta->i->map_id()); params->SetVal("map_name", room->map_meta->i->map_name()); + params->SetVal("map_tpl_name", room->map_tpl_name); params->SetVal("game_time", time(nullptr)); params->SetVal("hurt", stats.damage_amount_in); params->SetVal("rank", rank); diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index c7ff655..e9c31ae 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -319,8 +319,8 @@ void Room::ScatterDrop(Vector2D center, int drop_id) void Room::CreateThings() { - std::string tpl_name = map_meta->RandTemplate(); - std::vector* things = MetaMgr::Instance()->GetMapTplThing(tpl_name); + map_tpl_name = map_meta->RandTemplate(); + std::vector* things = MetaMgr::Instance()->GetMapTplThing(map_tpl_name); if (things) { for (auto& thing_tpl : *things) { if (thing_tpl.i->weight() >= rand() % 10000) { diff --git a/server/gameserver/room.h b/server/gameserver/room.h index e9955c8..d400b69 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -34,6 +34,7 @@ class Room public: long long room_uuid = 0; MetaData::Map* map_meta = nullptr; + std::string map_tpl_name; FrameEvent frame_event; FrameMaker frame_maker; long long frame_no = 0;