1
This commit is contained in:
parent
9e82d0dbcd
commit
0ba7dcf07b
@ -18,6 +18,7 @@ enum CreatureStatus
|
|||||||
CS_ForceTeam,
|
CS_ForceTeam,
|
||||||
CS_PreDieSuspended,
|
CS_PreDieSuspended,
|
||||||
CS_DeadNoDrop,
|
CS_DeadNoDrop,
|
||||||
|
CS_Reviving,
|
||||||
CS_End
|
CS_End
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
#include <a8/mutable_xobject.h>
|
||||||
|
|
||||||
#include "playermgr.h"
|
#include "playermgr.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
@ -20,6 +22,7 @@
|
|||||||
#include "jsondatamgr.h"
|
#include "jsondatamgr.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "team.h"
|
#include "team.h"
|
||||||
|
#include "httpproxy.h"
|
||||||
|
|
||||||
const int kREVIVE_BUFF_ID = 1005;
|
const int kREVIVE_BUFF_ID = 1005;
|
||||||
|
|
||||||
@ -1155,7 +1158,41 @@ void Player::_CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg)
|
|||||||
void Player::_CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg)
|
void Player::_CMRevive(f8::MsgHdr& hdr, const cs::CMRevive& msg)
|
||||||
{
|
{
|
||||||
Human* hum = room->GetHumanByUniId(msg.target_uniid());
|
Human* hum = room->GetHumanByUniId(msg.target_uniid());
|
||||||
if (hum && !hum->real_dead && hum->dead) {
|
if (hum && !hum->real_dead && hum->dead &&
|
||||||
|
!a8::HasBitFlag(status, CS_Reviving) &&
|
||||||
|
GetBattleContext()->GetReviveCoin() > 0) {
|
||||||
|
a8::SetBitFlag(status, CS_Reviving);
|
||||||
|
{
|
||||||
|
std::string url;
|
||||||
|
JsonDataMgr::Instance()->GetApiUrl(url);
|
||||||
|
if (url.find('?') != std::string::npos) {
|
||||||
|
url += "&c=Bag&a=decReviveCoin";
|
||||||
|
} else {
|
||||||
|
url += "?&c=Bag&a=decReviveCoin";
|
||||||
|
}
|
||||||
|
auto url_params = a8::MutableXObject::CreateObject();
|
||||||
|
url_params->SetVal("account_id", account_id);
|
||||||
|
url_params->SetVal("session_id", session_id);
|
||||||
|
HttpProxy::Instance()->HttpGet
|
||||||
|
(
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(room->GetRoomUuid())
|
||||||
|
.SetParam1(account_id)
|
||||||
|
.SetParam2(msg.target_uniid()),
|
||||||
|
[] (a8::XParams& param, a8::XObject& data)
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
[] (a8::XParams& param, const std::string& response)
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
url.c_str(),
|
||||||
|
*url_params
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
hum->dead = false;
|
hum->dead = false;
|
||||||
hum->real_dead = false;
|
hum->real_dead = false;
|
||||||
hum->downed = false;
|
hum->downed = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user