Core/PacketIO:

* Updated and enabled SMSG_RESURRECT_REQUEST
* Fix typo for CMSG_RESURRECT_RESPONSE
This commit is contained in:
Vincent-Michael
2015-04-19 13:45:43 +02:00
parent a39b2a3da9
commit b2e6e678c3
5 changed files with 54 additions and 14 deletions
+1 -1
View File
@@ -571,7 +571,7 @@ void WorldSession::HandleResurrectResponse(WorldPackets::Misc::ResurrectResponse
if (GetPlayer()->IsAlive())
return;
if (packet.Response == 0)
if (packet.Response != 0) // Accept = 0 Decline = 1 Timeout = 2
{
GetPlayer()->ClearResurrectRequestData(); // reject
return;
@@ -677,3 +677,22 @@ WorldPacket const* WorldPackets::Spells::SpellChannelUpdate::Write()
_worldPacket << int32(TimeRemaining);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Spells::ResurrectRequest::Write()
{
_worldPacket << ResurrectOffererGUID;
_worldPacket << ResurrectOffererVirtualRealmAddress;
_worldPacket << PetNumber;
_worldPacket << SpellID;
_worldPacket.WriteBits(Name.length(), 6);
_worldPacket.WriteBit(UseTimer);
_worldPacket.WriteBit(Sickness);
_worldPacket.FlushBits();
_worldPacket.WriteString(Name);
return &_worldPacket;
}
@@ -660,6 +660,22 @@ namespace WorldPackets
ObjectGuid CasterGUID;
int32 TimeRemaining = 0;
};
class ResurrectRequest final : public ServerPacket
{
public:
ResurrectRequest() : ServerPacket(SMSG_RESURRECT_REQUEST, 16 + 4 + 4 + 4 + 1) { }
WorldPacket const* Write() override;
ObjectGuid ResurrectOffererGUID;
uint32 ResurrectOffererVirtualRealmAddress = 0;
uint32 PetNumber = 0;
int32 SpellID = 0;
bool UseTimer = false;
bool Sickness = false;
std::string Name;
};
}
}
+1 -1
View File
@@ -1568,7 +1568,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESUME_COMMS, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESUME_TOKEN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ROLE_CHANGED_INFORM, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ROLE_CHOSEN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
+17 -12
View File
@@ -4315,21 +4315,26 @@ void Spell::SendResurrectRequest(Player* target)
// get resurrector name for creature resurrections, otherwise packet will be not accepted
// for player resurrections the name is looked up by guid
std::string const sentName(m_caster->GetTypeId() == TYPEID_PLAYER
? ""
: m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex()));
? "" : m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex()));
WorldPackets::Spells::ResurrectRequest resurrectRequest;
resurrectRequest.ResurrectOffererGUID = m_caster->GetGUID();
resurrectRequest.ResurrectOffererVirtualRealmAddress = GetVirtualRealmAddress();
WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+sentName.size()+1+1+1+4));
data << m_caster->GetGUID();
data << uint32(sentName.size() + 1);
if (Pet* pet = target->GetPet())
{
if (CharmInfo* charmInfo = pet->GetCharmInfo())
resurrectRequest.PetNumber = charmInfo->GetPetNumber();
}
data << sentName;
data << uint8(0); // null terminator
resurrectRequest.SpellID = m_spellInfo->Id;
data << uint8(m_caster->GetTypeId() == TYPEID_PLAYER ? 0 : 1); // "you'll be afflicted with resurrection sickness"
// override delay sent with SMSG_CORPSE_RECLAIM_DELAY, set instant resurrection for spells with this attribute
// 4.2.2 edit : id of the spell used to resurect. (used client-side for Mass Resurect)
data << uint32(m_spellInfo->Id);
target->GetSession()->SendPacket(&data);
//packet.ReadBit("UseTimer"); /// @todo: 6.x Has to be implemented
resurrectRequest.Sickness = m_caster->GetTypeId() != TYPEID_PLAYER; // "you'll be afflicted with resurrection sickness"
resurrectRequest.Name = sentName;
target->GetSession()->SendPacket(resurrectRequest.Write());
}
void Spell::TakeCastItem()