Ejemplo n.º 1
0
        private static void OnLoad()
        {
            Persistence.Deserialize(
                FilePath,
                reader =>
            {
                var version = reader.ReadInt();

                switch (version)
                {
                case 0:
                    {
                        var count = reader.ReadInt();

                        for (var i = 0; i < count; ++i)
                        {
                            var invasion = new TownInvasion(reader);

                            InvasionControl.Invasions.Add(invasion);
                        }
                    }
                    break;
                }
            });
        }
Ejemplo n.º 2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0)
            {
                return;
            }

            if (info.ButtonID > 100)
            {
                int i    = info.ButtonID - 101;
                var prop = InvasionControl.Invasions[i];
                from.SendGump(new PropertiesGump(from, prop));
            }
            else if (info.ButtonID >= 0 && info.ButtonID < 100)
            {
                int          i        = info.ButtonID - 1;
                TownInvasion invasion = InvasionControl.Invasions[i];

                invasion.OnStop();
                from.SendMessage("You have deleted the selected invasion!");
            }
        }