From ff990d4db888003f3ef7673d6f94a6114a9c72a5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 2 Apr 2024 16:23:23 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 2 +- server/gameserver/ingamevoice.cc | 2 +- server/gameserver/pbutils.cc | 24 ++++-------------------- server/gameserver/room.h | 6 ++---- server/gameserver/team.cc | 12 ++++++------ server/gameserver/team.h | 4 ++-- 6 files changed, 16 insertions(+), 34 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 8a1e1f70..bc178587 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -3556,10 +3556,10 @@ void Human::InternalBeKill(int killer_id, const std::string& killer_name, int we room->frame_event.AddDead(GetWeakPtrRef(), 0); } } + room->GetInGameVoice()->OnHumanBeKill(real_killer_id, this); } SendViewerUiMemberUpdate({GetUniId(), killer_id, real_killer_id}); room->NotifyUiUpdate(); - room->GetInGameVoice()->OnHumanBeKill(real_killer_id, this); } int Human::GetTeamMode() diff --git a/server/gameserver/ingamevoice.cc b/server/gameserver/ingamevoice.cc index 6f3f697d..62aff61c 100644 --- a/server/gameserver/ingamevoice.cc +++ b/server/gameserver/ingamevoice.cc @@ -62,7 +62,7 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader) if (global_kills_ > 0) { if (room_->GetFrameNo() - killer->stats->last_kill_frameno > SERVER_FRAME_RATE * mt::InGameVoice::s_series_kill_interval) { - personal_kills_.erase(killer_id); + personal_series_kills_.erase(killer_id); } IncIntMap(personal_kills_, killer_id); IncIntMap(personal_series_kills_, killer_id); diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index 5fa84391..9caf7e5a 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -1098,7 +1098,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) data->ToJsonStr(); msg.mutable_settlement_new()->set_box_payload(custom_data); } - if (GetTeam()->already_report_battle) { + if (GetTeam()->already_report_battle_) { msg.mutable_settlement_new()->set_settlement_status(1); auto p = msg.mutable_settlement_new(); p->set_version(20230321); @@ -1695,7 +1695,7 @@ void Human::SendUpdateMsg() void Human::SendGameOver() { if (stats->abandon_battle == 1 || (GetTeam()->HasPlayer()) || GetTeam()->MemberHasOb()) { - if (GetTeam()->already_report_battle) { + if (GetTeam()->already_report_battle_) { cs::SMGameOver msg; FillSMGameOver(msg); #if 0 @@ -1721,8 +1721,8 @@ void Human::SendGameOver() } if (GetTeam()->team_rank && GetTeam()->HasPlayer() && !GetTeam()->IsViewTeam() && stats->abandon_battle != 1) { - if (!GetTeam()->sending_battlereport) { - GetTeam()->sending_battlereport = true; + if (!GetTeam()->sending_battlereport_) { + GetTeam()->sending_battlereport_ = true; GetTeam()->SendTeamBattleReport(this); } } else { @@ -2937,22 +2937,6 @@ int Room::JoinWithCustomBattle(std::shared_ptr p) return 0; } -void Room::SendSelfInGameVoice(int killer_uniid, int voice_id) -{ - -} - -void Room::SendTeamInGameVoice(int killer_uniid, int voice_id, int team_id) -{ - -} - -void Room::SendGlobalInGameVoice(int killer_uniid, int voice_id, int dead_uniid, - int exclude_uniid, int exclude_team_id) -{ - -} - void SyncObject::FillSMSyncPosition(cs::SMSyncPosition& sync_msg) { if (!c.Get()) { diff --git a/server/gameserver/room.h b/server/gameserver/room.h index a4e42b71..a4a4b93a 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -298,12 +298,9 @@ public: std::shared_ptr GetRoomOb(); void SendSMTeamFull(Human* hum); void OnTeamPartChg(Human* hum); + bool IsAlreadyRoomReportBattle() { return already_room_report_battle_; } std::shared_ptr GetInGameVoice() { return ingame_voice_; } - void SendSelfInGameVoice(int killer_uniid, int voice_id); - void SendTeamInGameVoice(int killer_uniid, int voice_id, int team_id); - void SendGlobalInGameVoice(int killer_uniid, int voice_id, int dead_uniid, - int exclude_uniid, int exclude_team_id); private: void ShuaAndroid(); @@ -381,6 +378,7 @@ private: const mt::Map* map_meta_ = nullptr; std::string map_tpl_name_; RoomType_e room_type_ = RoomType_NewBrid; + bool already_room_report_battle_ = false; GasData gas_data_; long long frameno_ = 0; diff --git a/server/gameserver/team.cc b/server/gameserver/team.cc index c63d43d3..7066c56f 100644 --- a/server/gameserver/team.cc +++ b/server/gameserver/team.cc @@ -222,8 +222,8 @@ void Team::SendTeamBattleReport(Human* sender) std::string room_uuid = room->GetRoomUuid(); int team_id = GetTeamId(); if (room->GetCustomBattle()) { - already_report_battle = true; - sending_battlereport = false; + already_report_battle_ = true; + sending_battlereport_ = false; TraverseMembers ( [] (Human* hum) @@ -243,8 +243,8 @@ void Team::SendTeamBattleReport(Human* sender) Team* team = room->GetTeam(team_id); if (team) { if (ok) { - team->already_report_battle = true; - team->sending_battlereport = false; + team->already_report_battle_ = true; + team->sending_battlereport_ = false; team->TraverseMembers ( [] (Human* hum) @@ -253,8 +253,8 @@ void Team::SendTeamBattleReport(Human* sender) return true; }); } else { - team->already_report_battle = false; - team->sending_battlereport = false; + team->already_report_battle_ = false; + team->sending_battlereport_ = false; team->TraverseMembers ( [] (Human* hum) diff --git a/server/gameserver/team.h b/server/gameserver/team.h index 5d9ff1a1..3672b834 100644 --- a/server/gameserver/team.h +++ b/server/gameserver/team.h @@ -21,8 +21,8 @@ class Team : public std::enable_shared_from_this int team_rank = 0; std::map target_pos; int settlement_color = 0; - bool sending_battlereport = false; - bool already_report_battle = false; + bool sending_battlereport_ = false; + bool already_report_battle_ = false; Team(); ~Team();