From f7a93b7c407e609c2f67bbaf4305f03d38e5d41e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 13 Apr 2021 16:12:37 +0800 Subject: [PATCH 1/4] 1 --- server/tools/protobuild/cs_proto.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index c4a2ff8..95178dc 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -667,6 +667,7 @@ message MFPlayerStats optional int32 vip_lv = 35 [default = 0]; //等级 optional int32 head = 36 [default = 0]; //头像框 optional int32 sex = 37 [default = 0]; //性别 + optional int32 charid = 38; //人物id } //空投 From 1c23be3bc988e21d2ce8983dc68b5222cff940b4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 13 Apr 2021 16:14:51 +0800 Subject: [PATCH 2/4] 1 --- server/tools/protobuild/cs_proto.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 95178dc..9fb908c 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -668,6 +668,7 @@ message MFPlayerStats optional int32 head = 36 [default = 0]; //头像框 optional int32 sex = 37 [default = 0]; //性别 optional int32 charid = 38; //人物id + optional int32 team_id = 39; //tamid } //空投 From e79c487caff203d2c606c7457548fbbd00fb2bf6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 13 Apr 2021 16:19:09 +0800 Subject: [PATCH 3/4] 1 --- server/gameserver/human.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index e2ad221..76f1bcd 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -246,6 +246,8 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb) { stats_pb->set_player_id(GetEntityUniId()); stats_pb->set_player_avatar_url(avatar_url); + stats_pb->set_charid(meta->i->id()); + stats_pb->set_team_id(team_id); if (!dead) { stats_pb->set_time_alive(room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE); From 4efd559043e71bdcd67d40169de176c7b9c31abb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 13 Apr 2021 16:43:36 +0800 Subject: [PATCH 4/4] 1 --- server/gameserver/creature.cc | 1 + server/gameserver/human.cc | 2 ++ server/gameserver/molotor_cocktail_mitask.cc | 3 +++ server/gameserver/posiongas_mitask.cc | 3 +++ server/gameserver/room.cc | 5 +++++ server/gameserver/room.h | 1 + server/tools/protobuild/cs_proto.proto | 2 ++ 7 files changed, 17 insertions(+) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 6da8f6c..04ef185 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -501,6 +501,7 @@ void Creature::DoSkill(int skill_id, skill_distance_ = skill_distance; curr_skill_ = skill; playing_skill = true; + buff_vec2_param1 = GetPos() + skill_dir_ * skill_distance_; CurrentSkill()->last_use_frameno = room->GetFrameNo(); if (CurrentSkill()->meta->i->skill_target() == kST_Self ) { diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 76f1bcd..6a5f124 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -696,6 +696,8 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) msg.set_game_over(room->IsGameOver()); msg.set_victory(!dead); msg.set_room_uuid(a8::XValue(room->GetRoomUuid())); + msg.set_total_human_num(room->GetHumanNum()); + msg.set_alive_human_num(room->AliveCount()); { for (auto& itr : *team_members) { diff --git a/server/gameserver/molotor_cocktail_mitask.cc b/server/gameserver/molotor_cocktail_mitask.cc index 60d472b..3d65a2e 100644 --- a/server/gameserver/molotor_cocktail_mitask.cc +++ b/server/gameserver/molotor_cocktail_mitask.cc @@ -64,11 +64,14 @@ void MolotorCocktailMiTask::Check() } } ); + a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1; + sender.Get()->buff_vec2_param1 = sender.Get()->GetPos(); for (Creature* target : objects) { if (!target->GetBuffById(meta->i->buffid())) { target->MustBeAddBuff(sender.Get(), meta->i->buffid()); } } + sender.Get()->buff_vec2_param1 = old_buff_vec2_param1; } } diff --git a/server/gameserver/posiongas_mitask.cc b/server/gameserver/posiongas_mitask.cc index f580c25..9a4efc3 100644 --- a/server/gameserver/posiongas_mitask.cc +++ b/server/gameserver/posiongas_mitask.cc @@ -64,11 +64,14 @@ void PosionGasMiTask::Check() } } ); + a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1; + sender.Get()->buff_vec2_param1 = sender.Get()->GetPos(); for (Creature* target : objects) { if (!target->GetBuffById(meta->i->buffid())) { target->MustBeAddBuff(sender.Get(), meta->i->buffid()); } } + sender.Get()->buff_vec2_param1 = old_buff_vec2_param1; } } diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 5db96d0..d872b61 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -171,6 +171,11 @@ int Room::GetPlayerNum() return accountid_hash_.size(); } +int Room::GetHumanNum() +{ + return human_hash_.size(); +} + Player* Room::GetPlayerByAccountId(const std::string& accountid) { auto itr = accountid_hash_.find(accountid); diff --git a/server/gameserver/room.h b/server/gameserver/room.h index e4144bd..0697126 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -74,6 +74,7 @@ public: #endif int GetPlayerNum(); + int GetHumanNum(); int AliveCount(); long long AliveCountChgFrameNo() { return alive_count_chged_frameno_; }; inline int RealAliveCount() { return alive_human_hash_.size(); } diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 9fb908c..9fbfd35 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -1066,6 +1066,8 @@ message SMGameOver optional int32 team_allcnt = 3; optional bool game_over = 4; //是否结束 optional bool victory = 5; //是否胜利 + optional int32 total_human_num = 12; //房间总人数 + optional int32 alive_human_num = 13; //房间剩余存活人数 repeated MFPlayerStats player_stats = 6; //玩家信息统计 optional string room_uuid = 7; //房间唯一id