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;
            }

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

            reader.Seek(3, SeekOrigin.Begin);
            int serial = reader.ReadInt32();

            reader.Seek(pos, SeekOrigin.Begin);

            if (serial < 0 || !GlobalInstances.ContainsKey(serial))
            {
                return;
            }

            SuperGump gump = GlobalInstances[serial];

            if (!gump.Compiled)
            {
                gump.Refresh(true);
            }
        }
Esempio n. 2
0
        public static T CreateInstance <T>()
        {
            var t = typeof(T);

            if (GlobalInstances.ContainsKey(t))
            {
                return((T)GlobalInstances[t]);
            }

            return((T)CreateObject(t, new Dictionary <Type, object>()));
        }