Ejemplo n.º 1
0
        override public PositionUpdate Decode_OP_NPCMoveUpdate(byte[] UpdatePacket)
        {
            PositionUpdate PosUpdate = new PositionUpdate();

            BitStream bs = new BitStream(UpdatePacket, (uint)UpdatePacket.Length);

            PosUpdate.SpawnID = bs.readUInt(16);

            UInt32 Unknown = bs.readUInt(16);

            UInt32 VFlags = bs.readUInt(6);

            PosUpdate.p.y = (float)bs.readInt(19) / (float)(1 << 3);

            PosUpdate.p.x = (float)bs.readInt(19) / (float)(1 << 3);

            PosUpdate.p.z = (float)bs.readInt(19) / (float)(1 << 3);

            PosUpdate.p.heading = (float)bs.readInt(12) / (float)(1 << 3);

            PosUpdate.HighRes = true;

            return PosUpdate;
        }
Ejemplo n.º 2
0
        public override List<PositionUpdate> GetHighResolutionMovementUpdates()
        {
            List<PositionUpdate> Updates = new List<PositionUpdate>();

            List<byte[]> UpdatePackets = GetPacketsOfType("OP_NPCMoveUpdate", PacketDirection.ServerToClient);

            foreach (byte[] UpdatePacket in UpdatePackets)
            {
                PositionUpdate PosUpdate = new PositionUpdate();

                BitStream bs = new BitStream(UpdatePacket, 13);

                PosUpdate.SpawnID = bs.readUInt(16);

                UInt32 VFlags = bs.readUInt(6);

                PosUpdate.p.y = (float)bs.readInt(19) / (float)(1 << 3);

                PosUpdate.p.x = (float)bs.readInt(19) / (float)(1 << 3);

                PosUpdate.p.z = (float)bs.readInt(19) / (float)(1 << 3);

                PosUpdate.p.heading = (float)bs.readInt(12) / (float)(1 << 3);

                Updates.Add(PosUpdate);
            }

            return Updates;
        }
Ejemplo n.º 3
0
        public void ExploreNPCMoveUpdate(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            BitStream bs = new BitStream(Buffer.Buffer, Buffer.Length());

            UInt32 SpawnID = bs.readUInt(16);

            UInt32 Unknown = bs.readUInt(16);

            UInt32 VFlags = bs.readUInt(6);

            float y = (float)bs.readInt(19) / (float)(1 << 3);

            float x = (float)bs.readInt(19) / (float)(1 << 3);

            float z = (float)bs.readInt(19) / (float)(1 << 3);

            float heading = (float)bs.readInt(12) / (float)(1 << 3);

            OutputStream.WriteLine("Spawn: {0} Flags: {1}, XYZ: {2}, {3}, {4}, Heading: {5}", SpawnID, VFlags, x, y, z, heading);
        }