This commit is contained in:
aozhiwei 2024-03-18 11:49:29 +08:00
parent 9c81c17c9a
commit ddd9940cb6
6 changed files with 35 additions and 0 deletions

View File

@ -134,6 +134,7 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportHookHitPos); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportHookHitPos);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportSpecShotHitPos); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportSpecShotHitPos);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMWatchTarget); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMWatchTarget);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMTeamCommand);
} }
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle, void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,

View File

@ -949,6 +949,7 @@ void Human::FillMFTeamData(Human* hum, cs::MFTeamData* team_data, bool is_game_o
team_data->set_hero_exp(GetHeroExp()); team_data->set_hero_exp(GetHeroExp());
team_data->set_hero_max_exp(GetHeroMaxExp()); team_data->set_hero_max_exp(GetHeroMaxExp());
team_data->set_score(stats->pve_rank_score); team_data->set_score(stats->pve_rank_score);
team_data->set_main_skill_useable(GetMainSkill()->GetLeftTime() <= 0);
if (is_game_over || !real_dead || room->GetFrameNo() - GetRealDeadFrameNo(room) < 4) { if (is_game_over || !real_dead || room->GetFrameNo() - GetRealDeadFrameNo(room) < 4) {
TypeConvert::ToPb(GetPos(), team_data->mutable_pos()); TypeConvert::ToPb(GetPos(), team_data->mutable_pos());
TypeConvert::ToPb(GetAttackDir(), team_data->mutable_dir()); TypeConvert::ToPb(GetAttackDir(), team_data->mutable_dir());

View File

@ -1863,6 +1863,19 @@ void Player::_CMWatchTarget(f8::MsgHdr* hdr, const cs::CMWatchTarget& msg)
SendNotifyMsg(rsp_msg); SendNotifyMsg(rsp_msg);
} }
void Player::_CMTeamCommand(f8::MsgHdr* hdr, const cs::CMTeamCommand& msg)
{
cs::SMTeamCommandNotify notify_msg;
notify_msg.set_sender_id(GetUniId());
notify_msg.set_custom_command(msg.custom_command());
for (int target_uniid : msg.target_list()) {
Human* hum = room->GetHumanByUniId(target_uniid);
if (hum) {
hum->SendNotifyMsg(notify_msg);
}
}
}
void Player::SetShotHold(bool hold) void Player::SetShotHold(bool hold)
{ {
if (!hold && shot_hold) { if (!hold && shot_hold) {

View File

@ -29,6 +29,7 @@ namespace cs
class CMReportHookHitPos; class CMReportHookHitPos;
class CMReportSpecShotHitPos; class CMReportSpecShotHitPos;
class CMWatchTarget; class CMWatchTarget;
class CMTeamCommand;
} }
class Room; class Room;
@ -145,6 +146,7 @@ class Player : public Human
void _CMReportHookHitPos(f8::MsgHdr* hdr, const cs::CMReportHookHitPos& msg); void _CMReportHookHitPos(f8::MsgHdr* hdr, const cs::CMReportHookHitPos& msg);
void _CMReportSpecShotHitPos(f8::MsgHdr* hdr, const cs::CMReportSpecShotHitPos& msg); void _CMReportSpecShotHitPos(f8::MsgHdr* hdr, const cs::CMReportSpecShotHitPos& msg);
void _CMWatchTarget(f8::MsgHdr* hdr, const cs::CMWatchTarget& msg); void _CMWatchTarget(f8::MsgHdr* hdr, const cs::CMWatchTarget& msg);
void _CMTeamCommand(f8::MsgHdr* hdr, const cs::CMTeamCommand& msg);
virtual void SetAttackDir(const glm::vec3& attack_dir) override; virtual void SetAttackDir(const glm::vec3& attack_dir) override;
void AsyncRequestWatchWar(bool send_rsp_msg); void AsyncRequestWatchWar(bool send_rsp_msg);

View File

@ -33,6 +33,7 @@ enum CMMessageId_e
_CMReportHookHitPos = 239; _CMReportHookHitPos = 239;
_CMReportSpecShotHitPos = 240; _CMReportSpecShotHitPos = 240;
_CMWatchTarget = 241; _CMWatchTarget = 241;
_CMTeamComamnd = 242;
} }
enum SMMessageId_e enum SMMessageId_e
@ -47,6 +48,7 @@ enum SMMessageId_e
_SMMatchCancel = 218; _SMMatchCancel = 218;
_SMGetSettlementTeamList = 238; _SMGetSettlementTeamList = 238;
_SMWatchTarget = 241; _SMWatchTarget = 241;
_SMTeamComamnd = 242;
_SMJoinedNotify = 103; _SMJoinedNotify = 103;
_SMMapInfo = 1002; _SMMapInfo = 1002;
@ -75,4 +77,5 @@ enum SMMessageId_e
_SMSyncMobaTeam = 1028; _SMSyncMobaTeam = 1028;
_SMViewerUiNotify = 1029; _SMViewerUiNotify = 1029;
_SMViewerUiMemberUpdate = 1030; _SMViewerUiMemberUpdate = 1030;
_SMTeamComamndNotify = 1031;
} }

View File

@ -724,6 +724,7 @@ message MFTeamData
optional int32 hero_level = 72; //hero等级 optional int32 hero_level = 72; //hero等级
optional int32 hero_exp = 73; //hero经验 optional int32 hero_exp = 73; //hero经验
optional int32 hero_max_exp = 74; //hero max经验 optional int32 hero_max_exp = 74; //hero max经验
optional int32 main_skill_useable = 80 [default = 0]; //使
// //
optional string account_id = 10; //id optional string account_id = 10; //id
@ -1728,6 +1729,13 @@ message SMWatchTarget
optional int32 target_uniid = 2 [default = 0]; //target_uniid optional int32 target_uniid = 2 [default = 0]; //target_uniid
} }
//()
message CMTeamCommand
{
repeated int32 target_list = 1; //id
optional string custom_command = 2; //(json格式,)
}
// //
message SMJoinedNotify message SMJoinedNotify
{ {
@ -2019,3 +2027,10 @@ message SMViewerUiMemberUpdate
{ {
repeated MFViewTeamMember members = 1; repeated MFViewTeamMember members = 1;
} }
//
message SMTeamCommandNotify
{
optional int32 sender_id = 1; //
optional string custom_command = 2; //(json格式客户端自定义)
}