Ejemplo n.º 1
0
        /// <summary>
        ///     Forces the compilation of a new Item based ObjectPropertyList and sends it to the specified Mobile
        /// </summary>
        /// <param name="to">Mobile viewer, the Mobile viewing the OPL</param>
        /// <param name="item"></param>
        public static void SendPropertiesTo(Mobile to, Item item)
        {
            if (to == null || item == null)
            {
                return;
            }

            ObjectPropertyList opl = null;

            try
            {
                opl = item.GetOPL(to);

                if (opl != null)
                {
                    to.Send(opl);
                }
            }
            finally
            {
                if (opl != null)
                {
                    opl.Release();
                }
            }
        }
Ejemplo n.º 2
0
        private static void OnEncode0xD6(NetState state, PacketReader reader, ref byte[] buffer, ref int length)
        {
            if (state == null || reader == null || buffer == null || length < 0)
            {
                return;
            }

            var pos = reader.Seek(0, SeekOrigin.Current);

            reader.Seek(5, SeekOrigin.Begin);

            var serial = reader.ReadInt32();

            reader.Seek(pos, SeekOrigin.Begin);

            var ent = World.FindEntity(serial);

            if (ent == null)
            {
                return;
            }

            ObjectPropertyList opl = null;

            try
            {
                opl = ent.GetOPL(state.Mobile);

                if (opl != null)
                {
                    buffer = opl.Compile(state.CompressionEnabled, out length);
                }
            }
            finally
            {
                if (opl != null)
                {
                    opl.Release();
                }
            }
        }
Ejemplo n.º 3
0
        public static void Release( ref ObjectPropertyList p )
        {
            if ( p != null )
                p.Release();

            p = null;
        }