Ejemplo n.º 1
0
        private static void CMConfig()
        {
            ObjectStates.SetAll(i => ObjectStates[i] = ObjectStateTypes[i].CreateInstanceSafe <LegendState>());

            Array.Sort(
                ObjectStates,
                (l, r) =>
            {
                int result = 0;

                if (l.CompareNull(r, ref result))
                {
                    return(result);
                }

                return(l.SupportedType.CompareTo(r.SupportedType));
            });
        }
Ejemplo n.º 2
0
        private static void CMConfig()
        {
            ObjectStates.SetAll(i => ObjectStates[i] = ObjectStateTypes[i].CreateInstanceSafe <LegendState>());

            Array.Sort(
                ObjectStates,
                (l, r) =>
            {
                int result = 0;

                if (l.CompareNull(r, ref result))
                {
                    return(result);
                }

                return(l.SupportedType.CompareTo(r.SupportedType));
            });

            if (CMOptions.ModuleDebug)
            {
                foreach (LegendState o in ObjectStates)
                {
                    CMOptions.ToConsole("'{0}' handles '{1}'", o.GetType().Name, o.SupportedType.Name);
                }
            }

            CommandUtility.Register("UOFLConfig", Access, e => Config(e.Mobile as PlayerMobile));

            CommandUtility.Register(
                "UOFLUpdate",
                Access,
                e =>
            {
                if (_Updating)
                {
                    e.Mobile.SendMessage(0x22, "Legends is currently updating the database, please wait.");
                    return;
                }

                Update();

                e.Mobile.SendMessage(0x55, "Legends update started...");
            });

            CommandUtility.Register(
                "UOFLCancel",
                Access,
                e =>
            {
                if (!_Updating)
                {
                    e.Mobile.SendMessage(0x22, "Legends is not updating and can't be cancelled.");
                    return;
                }

                Cancel();

                e.Mobile.SendMessage(0x55, "Legends update cancelled.");
            });

            CommandUtility.Register(
                "UOFLForceTotalUpdate",
                Access,
                e =>
            {
                if (_Updating)
                {
                    e.Mobile.SendMessage(0x22, "Legends is already updating.");
                    return;
                }

                Update();

                _TotalUpdate = true;

                e.Mobile.SendMessage(0x55, "Legends update started...");
            });

            CommandUtility.Register(
                "UnbanAll",
                Access,
                e =>
            {
            });
        }