Esempio n. 1
0
        private static void OnEncode0xB0_0xDD(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(3, SeekOrigin.Begin);
            var serial = reader.ReadInt32();

            reader.Seek(pos, SeekOrigin.Begin);

            if (serial <= 0)
            {
                return;
            }

            SuperGump g;

            lock (_GlobalLock)
            {
                g = GlobalInstances.GetValue(serial);
            }

            if (g != null && !g.Compiled)
            {
                g.Refresh(true);
            }
        }
Esempio n. 2
0
        private static void OnEncode0xB0_0xDD(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(3, SeekOrigin.Begin);
            var serial = reader.ReadInt32();

            reader.Seek(pos, SeekOrigin.Begin);

            if (serial <= 0)
            {
                return;
            }

            var cg = state.Gumps.FirstOrDefault(o => o != null && o.Serial == serial);

            if (cg == null || cg is SuperGump)
            {
                var g = cg as SuperGump;

                if (g == null)
                {
                    lock (_GlobalLock)
                    {
                        g = GlobalInstances.GetValue(serial);
                    }
                }

                if (g != null && !g.Compiled)
                {
                    g.Refresh(true);
                }

                return;
            }

            if (CoreGumpSend != null && state.Mobile != null)
            {
                Timer.DelayCall(m => CoreGumpSend(m, cg), state.Mobile);
            }
        }