This commit is contained in:
aozhiwei 2023-07-01 16:41:49 +08:00
parent 71ec386aa1
commit cb96f862db
8 changed files with 30 additions and 2 deletions

View File

@ -130,6 +130,7 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMRequestThrowDmg);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMStowShield);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMTeamMarkTargetPos);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMSetRevivePosition);
}
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,

View File

@ -3352,7 +3352,17 @@ void Human::InternalBeKill(int killer_id, const std::string& killer_name, int we
GetTrigger()->Die(killer_id, weapon_id);
OnDie();
KillMgr::Instance()->OnHumanDead(this, &info);
room->frame_event.AddDead(GetWeakPtrRef(), 1000 * mt::Param::s().revive_time);
room->frame_event.AddDead(GetWeakPtrRef(),
1000 * mt::Param::s().pvp_revive_time);
dead_timer = room->xtimer.SetTimeoutWpEx
(mt::Param::s().pvp_revive_time * SERVER_FRAME_RATE,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
}
},
&xtimer_attacher);
++revive_count;
} else {
dead = true;
real_dead = true;

View File

@ -50,6 +50,7 @@ namespace mt
s_.downed_switch = GetIntParam("downed_switch", 0);
s_.bullet_through_wall_check = GetIntParam("bullet_through_wall_check", 1);
s_.revive_count = GetIntParam("revive_count", 1);
s_.pvp_revive_time = GetIntParam("pvp_revive_time", 10);
#if 1
{
std::string point = GetStringParam("newbie_room_born_point", "3471.3662:6.8399:5268.6240");

View File

@ -121,6 +121,8 @@ namespace mt
int downed_switch = 0;
int bullet_through_wall_check = 1;
int revive_count = 1;
int pvp_revive_time = 10;
};
static void StaticPostInit();
static const S& s() { return s_; };

View File

@ -1754,3 +1754,8 @@ void Player::UpdateThrowBomb()
}
throw_bomb.reset();
}
void Player::_CMSetRevivePosition(f8::MsgHdr& hdr, const cs::CMSetRevivePosition& msg)
{
}

View File

@ -20,6 +20,7 @@ namespace cs
class CMCancelRevive;
class CMRequestBulletDmg;
class CMRequestThrowDmg;
class CMSetRevivePosition;
class MFActivePlayerData;
class MFGasData;
class MFPair;
@ -135,6 +136,7 @@ class Player : public Human
void _CMRequestThrowDmg(f8::MsgHdr& hdr, const cs::CMRequestThrowDmg& msg);
void _CMStowShield(f8::MsgHdr& hdr, const cs::CMStowShield& msg);
void _CMTeamMarkTargetPos(f8::MsgHdr& hdr, const cs::CMTeamMarkTargetPos& msg);
void _CMSetRevivePosition(f8::MsgHdr& hdr, const cs::CMSetRevivePosition& msg);
virtual void SetAttackDir(const glm::vec3& attack_dir) override;
void AsyncRequestWatchWar(bool send_rsp_msg);

View File

@ -28,6 +28,7 @@ enum CMMessageId_e
_CMImmediateMsg = 232;
_CMTeamMarkTargetPos = 233;
_CMRequestThrowDmg = 236;
_CMSetRevivePosition = 237;
}
enum SMMessageId_e

View File

@ -1582,6 +1582,12 @@ message CMStowShield
}
//
message CMSetRevivePosition
{
optional MFVec3 pos = 1; //
}
//endcmmsg
//error_code == 0 ,
@ -1856,4 +1862,4 @@ message SMDebugCmd
message SMNewBieEnd
{
repeated MFPlayerFull victory_team = 1; //
}
}