Пример #1
0
        public void SetFacing(float orientation)
        {
            if (!Player.GetPosition().IsValid)
            {
                return;
            }
            var packet = new OutPacket(WorldCommand.MSG_MOVE_SET_FACING);

            packet.WritePacketGuid(Player.GUID);
            packet.Write((UInt32)0); //flags
            packet.Write((UInt16)0); //flags2
            packet.Write((UInt32)0); //time
            Player.O = orientation;
            packet.Write(Player.X);
            packet.Write(Player.Y);
            packet.Write(Player.Z);
            packet.Write(Player.O);
            packet.Write((UInt32)0); //fall time
            SendPacket(packet);
        }
Пример #2
0
        protected void HandleMoveTeleportAck(InPacket packet)
        {
            var packGuid = packet.ReadPackedGuid();

            packet.ReadUInt32();
            var movementFlags      = packet.ReadUInt32();
            var extraMovementFlags = packet.ReadUInt16();
            var time = packet.ReadUInt32();

            Player.X = packet.ReadSingle();
            Player.Y = packet.ReadSingle();
            Player.Z = packet.ReadSingle();
            Player.O = packet.ReadSingle();

            OutPacket result = new OutPacket(WorldCommand.MSG_MOVE_TELEPORT_ACK);

            result.WritePacketGuid(Player.GUID);
            result.Write((UInt32)0);
            result.Write(time);
            SendPacket(result);
        }
Пример #3
0
        protected void HandlerResurrectRequest(InPacket packet)
        {
            var       resurrectorGuid = packet.ReadUInt64();
            OutPacket response        = new OutPacket(WorldCommand.CMSG_RESURRECT_RESPONSE);

            response.Write(resurrectorGuid);
            if (Settings.Default.Behavior.AutoAcceptResurrectRequests)
            {
                response.Write((byte)1);
                SendPacket(response);

                OutPacket result = new OutPacket(WorldCommand.MSG_MOVE_TELEPORT_ACK);
                result.WritePacketGuid(Player.GUID);
                result.Write((UInt32)0);
                result.Write(DateTime.Now.Millisecond);
                SendPacket(result);
            }
            else
            {
                response.Write((byte)0);
                SendPacket(response);
            }
        }
Пример #4
0
        protected void HandleMoveTeleportAck(InPacket packet)
        {
            var packGuid = packet.ReadPackedGuid();

            packet.ReadUInt32();
            var movementFlags      = packet.ReadUInt32();
            var extraMovementFlags = packet.ReadUInt16();
            var time = packet.ReadUInt32();

            Player.X = packet.ReadSingle();
            Player.Y = packet.ReadSingle();
            Player.Z = packet.ReadSingle();
            Player.O = packet.ReadSingle();

            CancelActionsByFlag(ActionFlag.Movement, false);

            OutPacket result = new OutPacket(NetworkOperationCode.MSG_MOVE_TELEPORT_ACK);

            result.WritePacketGuid(Player.GUID);
            result.Write((UInt32)0);
            result.Write(time);
            SendPacket(result);
        }