Beispiel #1
0
        public static void Initialize()
        {
            Enabled = ServerConfiguration.GetOrUpdateSetting("questSystem.enableMLQuests", Core.ML);

            if (!Enabled)
            {
                return;
            }

            if (AutoGenerateNew)
            {
                foreach (MLQuest quest in Quests.Values)
                {
                    if (quest?.Deserialized == false)
                    {
                        quest.Generate();
                    }
                }
            }

            MLQuestPersistence.EnsureExistence();

            CommandSystem.Register("MLQuestsInfo", AccessLevel.Administrator, MLQuestsInfo_OnCommand);
            CommandSystem.Register("SaveQuest", AccessLevel.Administrator, SaveQuest_OnCommand);
            CommandSystem.Register("SaveAllQuests", AccessLevel.Administrator, SaveAllQuests_OnCommand);
            CommandSystem.Register("InvalidQuestItems", AccessLevel.Administrator, InvalidQuestItems_OnCommand);

            TargetCommands.Register(new ViewQuestsCommand());
            TargetCommands.Register(new ViewContextCommand());

            EventSink.QuestGumpRequest += EventSink_QuestGumpRequest;
        }
        public static void Configure()
        {
            var enabled = ServerConfiguration.GetOrUpdateSetting("connectuo.enabled", true);
            var token   = ServerConfiguration.GetOrUpdateSetting("connectuo.token", "");

            if (enabled)
            {
                try
                {
                    if (!string.IsNullOrWhiteSpace(token))
                    {
                        if (token.Length != _connectUOTokenLength * 2)
                        {
                            throw new Exception("Invalid length for ConnectUO token");
                        }

                        _token = GC.AllocateUninitializedArray <byte>(_connectUOTokenLength);
                        token.ToUpperInvariant().GetBytes(_token);
                    }
                }
                catch
                {
                    Utility.PushColor(ConsoleColor.Red);
                    Console.WriteLine("ConnectUO token could not be parsed");
                    Console.WriteLine("Make sure modernuo.json is properly configured");
                    Utility.PopColor();
                    _token = null;
                }

                FreeshardProtocol.Register(0xC0, false, PollInfo);
            }
        }
Beispiel #3
0
 public static void Configure()
 {
     Enabled        = ServerConfiguration.GetOrUpdateSetting("crashGuard.enabled", true);
     SaveBackup     = ServerConfiguration.GetOrUpdateSetting("crashGuard.saveBackup", true);
     RestartServer  = ServerConfiguration.GetOrUpdateSetting("crashGuard.restartServer", true);
     GenerateReport = ServerConfiguration.GetOrUpdateSetting("crashGuard.generateReport", true);
 }
Beispiel #4
0
    public static void ConfigureTimerPool()
    {
        _poolCapacity    = ServerConfiguration.GetOrUpdateSetting("timer.initialPoolCapacity", 1024);
        _maxPoolCapacity = ServerConfiguration.GetOrUpdateSetting("timer.maxPoolCapacity", _poolCapacity * 16);

        RefillPool(_poolCapacity, out var head, out var tail);
        ReturnToPool(_poolCapacity, head, tail);
    }
 public static void Configure()
 {
     MaxAccountsPerIP    = ServerConfiguration.GetOrUpdateSetting("accountHandler.maxAccountsPerIP", 1);
     AutoAccountCreation =
         ServerConfiguration.GetOrUpdateSetting("accountHandler.enableAutoAccountCreation", true);
     PasswordCommandEnabled =
         ServerConfiguration.GetOrUpdateSetting("accountHandler.enablePlayerPasswordCommand", false);
 }
Beispiel #6
0
        public static void Initialize()
        {
            Enabled = ServerConfiguration.GetOrUpdateSetting("ethics.enable", false);

            if (Enabled)
            {
                EventSink.Speech += EventSink_Speech;
            }
        }
Beispiel #7
0
        public static void Configure()
        {
            var enabled = ServerConfiguration.GetOrUpdateSetting("uogateway.enabled", true);

            if (enabled)
            {
                FreeshardProtocol.Register(0xFE, false, QueryCompactShardStats);
                FreeshardProtocol.Register(0xFF, false, QueryExtendedShardStats);
            }
        }
        public static void Configure()
        {
            CurrentAlgorithm =
                ServerConfiguration.GetOrUpdateSetting("accountSecurity.encryptionAlgorithm", PasswordProtectionAlgorithm.Argon2);

            if (CurrentAlgorithm < PasswordProtectionAlgorithm.SHA2)
            {
                throw new Exception($"Security: {CurrentAlgorithm} is obsolete and not secure. Do not use it.");
            }
        }
Beispiel #9
0
 public static void Configure()
 {
     EnableFastwalkPrevention = ServerConfiguration.GetOrUpdateSetting("movement.enableFastWalkPrevention", EnableFastwalkPrevention);
     MaxSteps = ServerConfiguration.GetOrUpdateSetting("movement.maxSteps", MaxSteps);
     FastwalkExemptionLevel = ServerConfiguration.GetOrUpdateSetting("movement.fastwalkExemptionLevel", FastwalkExemptionLevel);
     WalkFootDelay          = ServerConfiguration.GetOrUpdateSetting("movement.delay.walkFoot", WalkFootDelay);
     RunFootDelay           = ServerConfiguration.GetOrUpdateSetting("movement.delay.runFoot", RunFootDelay);
     WalkMountDelay         = ServerConfiguration.GetOrUpdateSetting("movement.delay.walkMount", WalkMountDelay);
     RunMountDelay          = ServerConfiguration.GetOrUpdateSetting("movement.delay.runMount", RunMountDelay);
 }
Beispiel #10
0
        public static void Initialize()
        {
            Enabled         = ServerConfiguration.GetOrUpdateSetting("vetRewards.enable", true);
            SkillCapRewards = ServerConfiguration.GetOrUpdateSetting("vetRewards.skillCapRewards", true);
            RewardInterval  = ServerConfiguration.GetOrUpdateSetting("vetRewards.rewardInterval", TimeSpan.FromDays(30.0));

            if (Enabled)
            {
                EventSink.Login += EventSink_Login;
            }
        }
 static AccountPrompt()
 {
     AutoCreateDefaultOwnerAccount =
         ServerConfiguration.GetOrUpdateSetting("accountPrompt.autoCreateDefaultOwnerAccount", true);
     DefaultOwnerAcctName =
         ServerConfiguration.GetOrUpdateSetting("accountPrompt.defaultOwnerAcctName", "owner");
     DefaultOwnerAcctPassword =
         ServerConfiguration.GetOrUpdateSetting("accountPrompt.defaultOwnerAcctPassword", "owner");
     DefaultOwnerPlayerName =
         ServerConfiguration.GetOrUpdateSetting("accountPrompt.defaultOwnerPlayerName", "owner");
 }
Beispiel #12
0
 public static void Configure()
 {
     m_DetectClientRequirement = ServerConfiguration.GetOrUpdateSetting("clientVerification.enable", true);
     m_OldClientResponse       =
         ServerConfiguration.GetOrUpdateSetting("clientVerification.oldClientResponse", OldClientResponse.Kick);
     m_AgeLeniency      = ServerConfiguration.GetOrUpdateSetting("clientVerification.ageLeniency", TimeSpan.FromDays(10));
     m_GameTimeLeniency = ServerConfiguration.GetOrUpdateSetting(
         "clientVerification.gameTimeLeniency",
         TimeSpan.FromHours(25)
         );
     KickDelay = ServerConfiguration.GetOrUpdateSetting("clientVerification.kickDelay", TimeSpan.FromSeconds(20.0));
 }
Beispiel #13
0
        public static void Initialize()
        {
            CommandSystem.Prefix = ServerConfiguration.GetOrUpdateSetting("commandsystem.prefix", "[");

            Register("Go", AccessLevel.Counselor, Go_OnCommand);

            Register("DropHolding", AccessLevel.Counselor, DropHolding_OnCommand);

            Register("GetFollowers", AccessLevel.GameMaster, GetFollowers_OnCommand);

            Register("ClearFacet", AccessLevel.Administrator, ClearFacet_OnCommand);

            Register("Where", AccessLevel.Counselor, Where_OnCommand);

            Register("AutoPageNotify", AccessLevel.Counselor, APN_OnCommand);
            Register("APN", AccessLevel.Counselor, APN_OnCommand);

            Register("Animate", AccessLevel.GameMaster, Animate_OnCommand);

            Register("Cast", AccessLevel.Counselor, Cast_OnCommand);

            Register("Stuck", AccessLevel.Counselor, Stuck_OnCommand);

            Register("Help", AccessLevel.Player, Help_OnCommand);

            Register("Save", AccessLevel.Administrator, Save_OnCommand);

            Register("Move", AccessLevel.GameMaster, Move_OnCommand);
            Register("Client", AccessLevel.Counselor, Client_OnCommand);

            Register("SMsg", AccessLevel.Counselor, StaffMessage_OnCommand);
            Register("SM", AccessLevel.Counselor, StaffMessage_OnCommand);
            Register("S", AccessLevel.Counselor, StaffMessage_OnCommand);

            Register("BCast", AccessLevel.GameMaster, BroadcastMessage_OnCommand);
            Register("BC", AccessLevel.GameMaster, BroadcastMessage_OnCommand);
            Register("B", AccessLevel.GameMaster, BroadcastMessage_OnCommand);

            Register("Bank", AccessLevel.GameMaster, Bank_OnCommand);

            Register("Echo", AccessLevel.Counselor, Echo_OnCommand);

            Register("Sound", AccessLevel.GameMaster, Sound_OnCommand);

            Register("ViewEquip", AccessLevel.GameMaster, ViewEquip_OnCommand);

            Register("Light", AccessLevel.Counselor, Light_OnCommand);
            Register("Stats", AccessLevel.Counselor, Stats_OnCommand);

            Register("SpeedBoost", AccessLevel.Counselor, SpeedBoost_OnCommand);
        }
Beispiel #14
0
        public static void Configure()
        {
            MinRequired = ServerConfiguration.GetSetting("clientVerification.minRequired", (ClientVersion)null);
            MaxRequired = ServerConfiguration.GetSetting("clientVerification.maxRequired", (ClientVersion)null);

            _enable = ServerConfiguration.GetOrUpdateSetting("clientVerification.enable", true);
            _invalidClientResponse =
                ServerConfiguration.GetOrUpdateSetting("clientVerification.invalidClientResponse", InvalidClientResponse.Kick);
            _ageLeniency      = ServerConfiguration.GetOrUpdateSetting("clientVerification.ageLeniency", TimeSpan.FromDays(10));
            _gameTimeLeniency = ServerConfiguration.GetOrUpdateSetting(
                "clientVerification.gameTimeLeniency",
                TimeSpan.FromHours(25)
                );
            KickDelay = ServerConfiguration.GetOrUpdateSetting("clientVerification.kickDelay", TimeSpan.FromSeconds(20.0));
        }
Beispiel #15
0
        public static void Initialize()
        {
            m_DetectClientRequirement = ServerConfiguration.GetOrUpdateSetting("clientVerification.enable", true);
            m_OldClientResponse       =
                ServerConfiguration.GetOrUpdateSetting("clientVerification.oldClientResponse", OldClientResponse.Kick);
            m_AgeLeniency      = ServerConfiguration.GetOrUpdateSetting("clientVerification.ageLeniency", TimeSpan.FromDays(10));
            m_GameTimeLeniency = ServerConfiguration.GetOrUpdateSetting(
                "clientVerification.gameTimeLeniency",
                TimeSpan.FromHours(25)
                );
            KickDelay = ServerConfiguration.GetOrUpdateSetting("clientVerification.kickDelay", TimeSpan.FromSeconds(20.0));

            EventSink.ClientVersionReceived += EventSink_ClientVersionReceived;

            if (m_DetectClientRequirement)
            {
                var path = Core.FindDataFile("client.exe", false);

                if (File.Exists(path))
                {
                    var info = FileVersionInfo.GetVersionInfo(path);

                    if (info.FileMajorPart != 0 || info.FileMinorPart != 0 || info.FileBuildPart != 0 ||
                        info.FilePrivatePart != 0)
                    {
                        Required = new ClientVersion(
                            info.FileMajorPart,
                            info.FileMinorPart,
                            info.FileBuildPart,
                            info.FilePrivatePart
                            );
                    }
                }
            }

            if (Required != null)
            {
                Utility.PushColor(ConsoleColor.White);
                Console.WriteLine(
                    "Restricting client version to {0}. Action to be taken: {1}",
                    Required,
                    m_OldClientResponse
                    );
                Utility.PopColor();
            }
        }
Beispiel #16
0
        public static void Configure()
        {
            var tempArchivePath = ServerConfiguration.GetSetting("autoArchive.tempArchivePath", "temp");

            _tempArchivePath = PathUtility.GetFullPath(tempArchivePath);

            var backupPath = ServerConfiguration.GetOrUpdateSetting("autoArchive.backupPath", "Backups");

            BackupPath          = PathUtility.GetFullPath(backupPath);
            AutomaticBackupPath = Path.Combine(BackupPath, "Automatic");

            var archivePath = ServerConfiguration.GetOrUpdateSetting("autoArchive.archivePath", "Archives");

            ArchivePath = PathUtility.GetFullPath(archivePath);

            var useLocalArchives = ServerConfiguration.GetOrUpdateSetting("autoArchive.archiveLocally", true);

            _enablePruning = ServerConfiguration.GetOrUpdateSetting("autoArchive.enableArchivePruning", true);

            _compressionFormat = ServerConfiguration.GetOrUpdateSetting("autoArchive.compressionFormat", CompressionFormat.Zstd);

            if (useLocalArchives)
            {
                Archive = AutoArchiveLocally;
            }

            if (_enablePruning)
            {
                Prune = PruneBackups;
            }

            // Restores an archive file placed in the Saves folder. Supports all compression formats.
            RestoreFromArchive();

            DateTimeOffset now  = Core.Now;
            var            date = now.Date;

            _nextHourlyArchive  = date.AddHours(now.Hour);
            _nextDailyArchive   = date;
            _nextMonthlyArchive = date.AddDays(1 - now.Day);

            // Do a local archive rollup & prune
            AutoArchiveLocally();
        }
Beispiel #17
0
        public static void Configure()
        {
            /* Here we configure all maps. Some notes:
             *
             * 1) The first 32 maps are reserved for core use.
             * 2) Map 0x7F is reserved for core use.
             * 3) Map 0xFF is reserved for core use.
             * 4) Changing or removing any predefined maps may cause server instability.
             */

            RegisterMap(0, 0, 0, 7168, 4096, 4, "Felucca", MapRules.FeluccaRules);
            RegisterMap(1, 1, 1, 7168, 4096, 0, "Trammel", MapRules.TrammelRules);
            RegisterMap(2, 2, 2, 2304, 1600, 1, "Ilshenar", MapRules.TrammelRules);
            RegisterMap(3, 3, 3, 2560, 2048, 1, "Malas", MapRules.TrammelRules);
            RegisterMap(4, 4, 4, 1448, 1448, 1, "Tokuno", MapRules.TrammelRules);
            RegisterMap(5, 5, 5, 1280, 4096, 1, "TerMur", MapRules.TrammelRules);

            RegisterMap(0x7F, 0x7F, 0x7F, Map.SectorSize, Map.SectorSize, 1, "Internal", MapRules.Internal);

            /* Example of registering a custom map:
             * RegisterMap( 32, 0, 0, 6144, 4096, 3, "Iceland", MapRules.FeluccaRules );
             *
             * Defined:
             * RegisterMap( <index>, <mapID>, <fileIndex>, <width>, <height>, <season>, <name>, <rules> );
             *  - <index> : An unreserved unique index for this map
             *  - <mapID> : An identification number used in client communications. For any visible maps, this value must be from 0-5
             *  - <fileIndex> : A file identification number. For any visible maps, this value must be from 0-5
             *  - <width>, <height> : Size of the map (in tiles)
             *  - <season> : Season of the map. 0 = Spring, 1 = Summer, 2 = Fall, 3 = Winter, 4 = Desolation
             *  - <name> : Reference name for the map, used in props gump, get/set commands, region loading, etc
             *  - <rules> : Rules and restrictions associated with the map. See documentation for details
             */

            // Using this requires the old mapDif files to be present. Only needed to support Clients < 6.0.0.0
            TileMatrixPatch.Enabled = ServerConfiguration.GetOrUpdateSetting("maps.enableTileMatrixPatches", !Core.SE);

            MultiComponentList.PostHSFormat =
                ServerConfiguration.GetOrUpdateSetting(
                    "maps.enablePostHSMultiComponentFormat",
                    true
                    ); // OSI Client Patch 7.0.9.0
        }
Beispiel #18
0
        public static void Initialize()
        {
            Address    = ServerConfiguration.GetOrUpdateSetting("serverListing.address", "(-null-)");
            AutoDetect = ServerConfiguration.GetOrUpdateSetting("serverListing.autoDetect", true);
            ServerName = ServerConfiguration.GetOrUpdateSetting("serverListing.serverName", "ModernUO");

            if (Address == null)
            {
                if (AutoDetect)
                {
                    AutoDetection();
                }
            }
            else
            {
                Resolve(Address, out m_PublicAddress);
            }

            EventSink.ServerList += EventSink_ServerList;
        }
Beispiel #19
0
 public static void Configure()
 {
     Enabled = ServerConfiguration.GetOrUpdateSetting("chat.enabled", false);
 }
Beispiel #20
0
 public static void Configure()
 {
     ThreadCreateTime   = ServerConfiguration.GetOrUpdateSetting("bulletinboards.creationTimeDelay", TimeSpan.FromMinutes(2.0));
     ThreadDeletionTime = ServerConfiguration.GetOrUpdateSetting("bulletinboards.expireDuration", TimeSpan.FromHours(6.0));
     ThreadReplyTime    = ServerConfiguration.GetOrUpdateSetting("bulletinboards.replyDelay", TimeSpan.FromSeconds(30.0));
 }
Beispiel #21
0
 public static void Configure()
 {
     Enabled         = ServerConfiguration.GetOrUpdateSetting("vetRewards.enable", true);
     SkillCapRewards = ServerConfiguration.GetOrUpdateSetting("vetRewards.skillCapRewards", true);
     RewardInterval  = ServerConfiguration.GetOrUpdateSetting("vetRewards.rewardInterval", TimeSpan.FromDays(30.0));
 }
Beispiel #22
0
 public static void Configure()
 {
     Address    = ServerConfiguration.GetOrUpdateSetting("serverListing.address", null);
     AutoDetect = ServerConfiguration.GetOrUpdateSetting("serverListing.autoDetect", true);
     ServerName = ServerConfiguration.GetOrUpdateSetting("serverListing.serverName", "ModernUO");
 }
Beispiel #23
0
 public static void Configure()
 {
     Enabled      = ServerConfiguration.GetOrUpdateSetting("ipLimiter.enable", true);
     SocketBlock  = ServerConfiguration.GetOrUpdateSetting("ipLimiter.blockAtConnection", true);
     MaxAddresses = ServerConfiguration.GetOrUpdateSetting("ipLimiter.maxConnectionsPerIP", 10);
 }
Beispiel #24
0
 public static void Configure()
 {
     Enabled = ServerConfiguration.GetOrUpdateSetting("testCenter.enable", false);
 }
Beispiel #25
0
 static NewWorldPrompt()
 {
     AutoSetupNewWorld =
         ServerConfiguration.GetOrUpdateSetting("newWorldPrompt.autoSetup", false);
 }
 public static void Configure()
 {
     Enabled = ServerConfiguration.GetOrUpdateSetting("accountAttackLimiter.enable", true);
 }
Beispiel #27
0
 public static void Configure()
 {
     Enabled = ServerConfiguration.GetOrUpdateSetting("questSystem.enableMLQuests", Core.ML);
 }
 public static void Initialize()
 {
     ExtendedStatus = ServerConfiguration.GetOrUpdateSetting("extendedStatus", false);
 }
 static OutgoingPacketInterceptor()
 {
     RewriteOutgoingMessagesToAscii =
         ServerConfiguration.GetOrUpdateSetting("outgoingPacketInterceptor.rewriteMessagesToAscii", true);
 }