Core/Movement: implement SMSG_SUSPEND_TOKEN and CMSG_SUSPEND_TOKEN_RESPONSE packets and converted SMSG_TRANSFER_PENDING and SMSG_NEW_WORLD to packet class

This commit is contained in:
Ovahlord committed 2020-02-17 18:40:21 +01:00
1 parent a5e56171af
commit 22ed3f306d
7 files changed
+186 -20

No files matched your search

@@ -0,0 +1,66 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MovementPackets.h"
#include "MoveSpline.h"
#include "MoveSplineFlag.h"
#include "MovementTypedefs.h"
#include "PacketUtilities.h"
#include "Unit.h"
WorldPacket const* WorldPackets::Movement::TransferPending::Write()
{
_worldPacket.WriteBit(TransferSpellID.is_initialized());
_worldPacket.WriteBit(Ship.is_initialized());
if (Ship)
{
_worldPacket << int32(Ship->OriginMapID);
_worldPacket << uint32(Ship->ID);
}
if (TransferSpellID)
_worldPacket << int32(*TransferSpellID);
_worldPacket << int32(MapID);
_worldPacket.FlushBits();
return &_worldPacket;
}
WorldPacket const* WorldPackets::Movement::SuspendToken::Write()
{
_worldPacket.WriteBit(Unk);
_worldPacket << uint32(SequenceIndex);
_worldPacket.FlushBits();
return &_worldPacket;
}
void WorldPackets::Movement::SuspendTokenResponse::Read()
{
_worldPacket >> SequenceIndex;
}
WorldPacket const* WorldPackets::Movement::NewWorld::Write()
{
_worldPacket << Pos.GetPositionX();
_worldPacket << Pos.GetOrientation();
_worldPacket << Pos.GetPositionY();
_worldPacket << int32(MapID);
_worldPacket << Pos.GetPositionZ();
return &_worldPacket;
}