This commit is contained in:
aozhiwei 2024-04-02 16:23:23 +08:00
parent d183654fef
commit ff990d4db8
6 changed files with 16 additions and 34 deletions

View File

@ -3556,10 +3556,10 @@ void Human::InternalBeKill(int killer_id, const std::string& killer_name, int we
room->frame_event.AddDead(GetWeakPtrRef(), 0); room->frame_event.AddDead(GetWeakPtrRef(), 0);
} }
} }
room->GetInGameVoice()->OnHumanBeKill(real_killer_id, this);
} }
SendViewerUiMemberUpdate({GetUniId(), killer_id, real_killer_id}); SendViewerUiMemberUpdate({GetUniId(), killer_id, real_killer_id});
room->NotifyUiUpdate(); room->NotifyUiUpdate();
room->GetInGameVoice()->OnHumanBeKill(real_killer_id, this);
} }
int Human::GetTeamMode() int Human::GetTeamMode()

View File

@ -62,7 +62,7 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
if (global_kills_ > 0) { if (global_kills_ > 0) {
if (room_->GetFrameNo() - killer->stats->last_kill_frameno > if (room_->GetFrameNo() - killer->stats->last_kill_frameno >
SERVER_FRAME_RATE * mt::InGameVoice::s_series_kill_interval) { 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_kills_, killer_id);
IncIntMap(personal_series_kills_, killer_id); IncIntMap(personal_series_kills_, killer_id);

View File

@ -1098,7 +1098,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
data->ToJsonStr(); data->ToJsonStr();
msg.mutable_settlement_new()->set_box_payload(custom_data); 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); msg.mutable_settlement_new()->set_settlement_status(1);
auto p = msg.mutable_settlement_new(); auto p = msg.mutable_settlement_new();
p->set_version(20230321); p->set_version(20230321);
@ -1695,7 +1695,7 @@ void Human::SendUpdateMsg()
void Human::SendGameOver() void Human::SendGameOver()
{ {
if (stats->abandon_battle == 1 || (GetTeam()->HasPlayer()) || GetTeam()->MemberHasOb()) { if (stats->abandon_battle == 1 || (GetTeam()->HasPlayer()) || GetTeam()->MemberHasOb()) {
if (GetTeam()->already_report_battle) { if (GetTeam()->already_report_battle_) {
cs::SMGameOver msg; cs::SMGameOver msg;
FillSMGameOver(msg); FillSMGameOver(msg);
#if 0 #if 0
@ -1721,8 +1721,8 @@ void Human::SendGameOver()
} }
if (GetTeam()->team_rank && GetTeam()->HasPlayer() && !GetTeam()->IsViewTeam() && if (GetTeam()->team_rank && GetTeam()->HasPlayer() && !GetTeam()->IsViewTeam() &&
stats->abandon_battle != 1) { stats->abandon_battle != 1) {
if (!GetTeam()->sending_battlereport) { if (!GetTeam()->sending_battlereport_) {
GetTeam()->sending_battlereport = true; GetTeam()->sending_battlereport_ = true;
GetTeam()->SendTeamBattleReport(this); GetTeam()->SendTeamBattleReport(this);
} }
} else { } else {
@ -2937,22 +2937,6 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
return 0; 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) void SyncObject::FillSMSyncPosition(cs::SMSyncPosition& sync_msg)
{ {
if (!c.Get()) { if (!c.Get()) {

View File

@ -298,12 +298,9 @@ public:
std::shared_ptr<RoomOb> GetRoomOb(); std::shared_ptr<RoomOb> GetRoomOb();
void SendSMTeamFull(Human* hum); void SendSMTeamFull(Human* hum);
void OnTeamPartChg(Human* hum); void OnTeamPartChg(Human* hum);
bool IsAlreadyRoomReportBattle() { return already_room_report_battle_; }
std::shared_ptr<InGameVoice> GetInGameVoice() { return ingame_voice_; } std::shared_ptr<InGameVoice> 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: private:
void ShuaAndroid(); void ShuaAndroid();
@ -381,6 +378,7 @@ private:
const mt::Map* map_meta_ = nullptr; const mt::Map* map_meta_ = nullptr;
std::string map_tpl_name_; std::string map_tpl_name_;
RoomType_e room_type_ = RoomType_NewBrid; RoomType_e room_type_ = RoomType_NewBrid;
bool already_room_report_battle_ = false;
GasData gas_data_; GasData gas_data_;
long long frameno_ = 0; long long frameno_ = 0;

View File

@ -222,8 +222,8 @@ void Team::SendTeamBattleReport(Human* sender)
std::string room_uuid = room->GetRoomUuid(); std::string room_uuid = room->GetRoomUuid();
int team_id = GetTeamId(); int team_id = GetTeamId();
if (room->GetCustomBattle()) { if (room->GetCustomBattle()) {
already_report_battle = true; already_report_battle_ = true;
sending_battlereport = false; sending_battlereport_ = false;
TraverseMembers TraverseMembers
( (
[] (Human* hum) [] (Human* hum)
@ -243,8 +243,8 @@ void Team::SendTeamBattleReport(Human* sender)
Team* team = room->GetTeam(team_id); Team* team = room->GetTeam(team_id);
if (team) { if (team) {
if (ok) { if (ok) {
team->already_report_battle = true; team->already_report_battle_ = true;
team->sending_battlereport = false; team->sending_battlereport_ = false;
team->TraverseMembers team->TraverseMembers
( (
[] (Human* hum) [] (Human* hum)
@ -253,8 +253,8 @@ void Team::SendTeamBattleReport(Human* sender)
return true; return true;
}); });
} else { } else {
team->already_report_battle = false; team->already_report_battle_ = false;
team->sending_battlereport = false; team->sending_battlereport_ = false;
team->TraverseMembers team->TraverseMembers
( (
[] (Human* hum) [] (Human* hum)

View File

@ -21,8 +21,8 @@ class Team : public std::enable_shared_from_this<Team>
int team_rank = 0; int team_rank = 0;
std::map<int, glm::vec3> target_pos; std::map<int, glm::vec3> target_pos;
int settlement_color = 0; int settlement_color = 0;
bool sending_battlereport = false; bool sending_battlereport_ = false;
bool already_report_battle = false; bool already_report_battle_ = false;
Team(); Team();
~Team(); ~Team();