1
This commit is contained in:
commit
0e09610af6
@ -134,6 +134,7 @@ void HandlerMgr::RegisterNetMsgHandlers()
|
||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportHookHitPos);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportSpecShotHitPos);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMWatchTarget);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMTeamCommand);
|
||||
}
|
||||
|
||||
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,
|
||||
|
@ -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_max_exp(GetHeroMaxExp());
|
||||
team_data->set_score(stats->pve_rank_score);
|
||||
team_data->set_main_skill_cd(GetMainSkill()->GetLeftTime());
|
||||
if (is_game_over || !real_dead || room->GetFrameNo() - GetRealDeadFrameNo(room) < 4) {
|
||||
TypeConvert::ToPb(GetPos(), team_data->mutable_pos());
|
||||
TypeConvert::ToPb(GetAttackDir(), team_data->mutable_dir());
|
||||
|
@ -1863,6 +1863,19 @@ void Player::_CMWatchTarget(f8::MsgHdr* hdr, const cs::CMWatchTarget& 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)
|
||||
{
|
||||
if (!hold && shot_hold) {
|
||||
|
@ -29,6 +29,7 @@ namespace cs
|
||||
class CMReportHookHitPos;
|
||||
class CMReportSpecShotHitPos;
|
||||
class CMWatchTarget;
|
||||
class CMTeamCommand;
|
||||
}
|
||||
|
||||
class Room;
|
||||
@ -145,6 +146,7 @@ class Player : public Human
|
||||
void _CMReportHookHitPos(f8::MsgHdr* hdr, const cs::CMReportHookHitPos& msg);
|
||||
void _CMReportSpecShotHitPos(f8::MsgHdr* hdr, const cs::CMReportSpecShotHitPos& 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;
|
||||
void AsyncRequestWatchWar(bool send_rsp_msg);
|
||||
|
||||
|
@ -33,6 +33,7 @@ enum CMMessageId_e
|
||||
_CMReportHookHitPos = 239;
|
||||
_CMReportSpecShotHitPos = 240;
|
||||
_CMWatchTarget = 241;
|
||||
_CMTeamCommand = 242;
|
||||
}
|
||||
|
||||
enum SMMessageId_e
|
||||
@ -47,6 +48,7 @@ enum SMMessageId_e
|
||||
_SMMatchCancel = 218;
|
||||
_SMGetSettlementTeamList = 238;
|
||||
_SMWatchTarget = 241;
|
||||
_SMTeamComamnd = 242;
|
||||
|
||||
_SMJoinedNotify = 103;
|
||||
_SMMapInfo = 1002;
|
||||
@ -75,4 +77,5 @@ enum SMMessageId_e
|
||||
_SMSyncMobaTeam = 1028;
|
||||
_SMViewerUiNotify = 1029;
|
||||
_SMViewerUiMemberUpdate = 1030;
|
||||
_SMTeamCommandNotify = 1031;
|
||||
}
|
||||
|
@ -724,6 +724,7 @@ message MFTeamData
|
||||
optional int32 hero_level = 72; //hero等级
|
||||
optional int32 hero_exp = 73; //hero经验
|
||||
optional int32 hero_max_exp = 74; //hero max经验
|
||||
optional int32 main_skill_cd = 80 [default = 0]; //技能cd时间
|
||||
|
||||
//一下字段只在结算的时候该字段才有内容
|
||||
optional string account_id = 10; //账号id
|
||||
@ -1728,6 +1729,13 @@ message SMWatchTarget
|
||||
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
|
||||
{
|
||||
@ -2019,3 +2027,10 @@ message SMViewerUiMemberUpdate
|
||||
{
|
||||
repeated MFViewTeamMember members = 1;
|
||||
}
|
||||
|
||||
//队伍指令通知
|
||||
message SMTeamCommandNotify
|
||||
{
|
||||
optional int32 sender_id = 1; //指令发起者
|
||||
optional string custom_command = 2; //指令(json格式客户端自定义)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user