This commit is contained in:
aozhiwei 2020-01-06 22:03:03 +08:00
parent 3a0f9795c0
commit 8107accaaf
7 changed files with 21 additions and 2 deletions

View File

@ -91,6 +91,7 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMWatchWar);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMLeave);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMRevive);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMCancelRevive);
}
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,

View File

@ -25,7 +25,7 @@
#include "framework/cpp/utils.h"
#include "framework/cpp/httpclientpool.h"
const int kReviveTimeAdd = 6;
const int kReviveTimeAdd = 8;
Human::Human():Entity()
{

View File

@ -215,6 +215,7 @@ class Human : public Entity
int SkinId();
int SkinLv();
void CheckSkinTank();
void OnDie();
protected:
void _UpdateMove(int speed);
@ -228,7 +229,6 @@ private:
void FillSMGameOver(cs::SMGameOver& msg);
void SendBattleReport();
void FindLocationWithTarget(Entity* target);
void OnDie();
void Revive();
protected:

View File

@ -1101,3 +1101,13 @@ void Player::_CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg)
revive_timer = nullptr;
}
}
void Player::_CMCancelRevive(f8::MsgHdr& hdr, const cs::CMCancelRevive& msg)
{
if (dead && !real_dead) {
dead = true;
real_dead = true;
downed = false;
OnDie();
}
}

View File

@ -89,5 +89,6 @@ class Player : public Human
void _CMWatchWar(f8::MsgHdr& hdr, const cs::CMWatchWar& msg);
void _CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg);
void _CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg);
void _CMCancelRevive(f8::MsgHdr& hdr, const cs::CMCancelRevive& msg);
};

View File

@ -13,6 +13,7 @@ enum CMMessageId_e
_CMWatchWar = 208;
_CMLeave = 209;
_CMRevive = 210;
_CMCancelRevive = 211;
}
enum SMMessageId_e

View File

@ -736,6 +736,12 @@ message CMRevive
}
//
message CMCancelRevive
{
}
//endcmmsg
//error_code == 0 ,