From 72f4bbe89c8b2b92ad6aa19e01fc1453c00f731b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 13 Oct 2022 13:10:15 +0800 Subject: [PATCH] 1 --- server/gameserver/constant_export.h | 1 + server/gameserver/handlermgr.cc | 1 + server/gameserver/player.cc | 12 ++++++++++++ server/gameserver/player.h | 2 ++ server/tools/protobuild/cs_msgid.proto | 1 + server/tools/protobuild/cs_proto.proto | 8 ++++++++ 6 files changed, 25 insertions(+) diff --git a/server/gameserver/constant_export.h b/server/gameserver/constant_export.h index beac8d71..378c4b95 100644 --- a/server/gameserver/constant_export.h +++ b/server/gameserver/constant_export.h @@ -21,6 +21,7 @@ const int kInRescueBuffId = 7020; const int kKeepShotAnimiBuffId = 7021; const int kVertigoEffectBuffId = 7022; const int kDispelEffectBuffId = 7023; +const int kImmuneEffectBuffId = 7024; const int kPullToWalkableBuffId = 8003; const int kDiveBuffId = 8054; const int kInvincibleBuffId = 1005; diff --git a/server/gameserver/handlermgr.cc b/server/gameserver/handlermgr.cc index 168cd0eb..e3b6b3d2 100644 --- a/server/gameserver/handlermgr.cc +++ b/server/gameserver/handlermgr.cc @@ -93,6 +93,7 @@ void HandlerMgr::RegisterNetMsgHandlers() RegisterNetMsgHandler(&ggmsghandler, &MatchMgr::_CMMatchCancelStartGame); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMMove); + RegisterNetMsgHandler(&ggmsghandler, &Player::_CMImmediateMsg); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMExecCommand); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMEmote); RegisterNetMsgHandler(&ggmsghandler, &Player::_CMVoice); diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 9c8e17e5..7a6e97a2 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -929,6 +929,18 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg) #endif } +void Player::_CMImmediateMsg(f8::MsgHdr& hdr, const cs::CMImmediateMsg& msg) +{ + if (msg.stop_move()) { + moving = false; + } + if (msg.stop_shot()) { + shot_start = false; + shot_hold = false; + series_shot_frames = 0; + } +} + void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg) { std::vector cmds; diff --git a/server/gameserver/player.h b/server/gameserver/player.h index fab4f7f0..5b3c2d2f 100644 --- a/server/gameserver/player.h +++ b/server/gameserver/player.h @@ -10,6 +10,7 @@ namespace cs class CMEmote; class CMVoice; class CMStowShield; + class CMImmediateMsg; class MFActivePlayerData; class MFGasData; class MFPair; @@ -108,6 +109,7 @@ class Player : public Human void _CMReconnect(f8::MsgHdr& hdr, const cs::CMReconnect& msg); void _CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg); + void _CMImmediateMsg(f8::MsgHdr& hdr, const cs::CMImmediateMsg& msg); void _CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg); void _CMEmote(f8::MsgHdr& hdr, const cs::CMEmote& msg); void _CMVoice(f8::MsgHdr& hdr, const cs::CMVoice& msg); diff --git a/server/tools/protobuild/cs_msgid.proto b/server/tools/protobuild/cs_msgid.proto index 5512a9ec..08d91cdb 100644 --- a/server/tools/protobuild/cs_msgid.proto +++ b/server/tools/protobuild/cs_msgid.proto @@ -24,6 +24,7 @@ enum CMMessageId_e _CMMatchBroadcastMsg = 223; _CMRequestBulletDmg = 230; _CMStowShield = 231; + _CMImmediateMsg = 232; } enum SMMessageId_e diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 3586e995..63be2b87 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -977,6 +977,14 @@ message CMMove optional int32 trace_target_uniid = 41; //自动追踪目标uniid } + +//立刻消息 +message CMImmediateMsg +{ + optional int32 stop_move = 1; //停止移动 + optional int32 stop_shot = 2; //停止射击 +} + //执行GM指令 message CMExecCommand {