MarkLogStart() static private method

static private MarkLogStart ( ) : void
return void
コード例 #1
0
ファイル: Config.cs プロジェクト: TheDireMaster/fCraft
        internal static void ApplyConfig()
        {
            Logger.SplittingType = (LogSplittingType)Enum.Parse(typeof(LogSplittingType), Settings[ConfigKey.LogMode], true);
            Logger.MarkLogStart();

            Player.RelayAllUpdates = GetBool(ConfigKey.RelayAllBlockUpdates);
            if (GetBool(ConfigKey.NoPartialPositionUpdates))
            {
                Session.FullPositionUpdateInterval = 0;
            }
            else
            {
                Session.FullPositionUpdateInterval = Session.FullPositionUpdateIntervalDefault;
            }

            // chat colors
            Color.Sys          = Color.Parse(Settings[ConfigKey.SystemMessageColor]);
            Color.Say          = Color.Parse(Settings[ConfigKey.SayColor]);
            Color.Help         = Color.Parse(Settings[ConfigKey.HelpColor]);
            Color.Announcement = Color.Parse(Settings[ConfigKey.AnnouncementColor]);
            Color.PM           = Color.Parse(Settings[ConfigKey.PrivateMessageColor]);
            Color.IRC          = Color.Parse(Settings[ConfigKey.IRCMessageColor]);
            Color.Me           = Color.Parse(Settings[ConfigKey.MeColor]);
            Color.Warning      = Color.Parse(Settings[ConfigKey.WarningColor]);

            // default class
            if (!ConfigKey.DefaultRank.IsBlank())
            {
                if (RankManager.ParseRank(Settings[ConfigKey.DefaultRank]) != null)
                {
                    RankManager.DefaultRank = RankManager.ParseRank(Settings[ConfigKey.DefaultRank]);
                }
                else
                {
                    RankManager.DefaultRank = RankManager.LowestRank;
                    Logger.Log("Config.ApplyConfig: Could not parse DefaultRank; assuming that the lowest rank ({0}) is the default.",
                               LogType.Warning, RankManager.DefaultRank.Name);
                }
            }
            else
            {
                RankManager.DefaultRank = RankManager.LowestRank;
            }

            // antispam
            Player.SpamChatCount    = GetInt(ConfigKey.AntispamMessageCount);
            Player.SpamChatTimer    = GetInt(ConfigKey.AntispamInterval);
            Player.AutoMuteDuration = TimeSpan.FromSeconds(GetInt(ConfigKey.AntispamMuteDuration));

            // scheduler settings
            Server.MaxUploadSpeed   = GetInt(ConfigKey.UploadBandwidth);
            Server.PacketsPerSecond = GetInt(ConfigKey.BlockUpdateThrottling);
            Server.TicksPerSecond   = 1000 / (float)GetInt(ConfigKey.TickInterval);

            // rank to patrol
            World.RankToPatrol = RankManager.ParseRank(ConfigKey.PatrolledRank.GetString());

            // IRC delay
            IRC.SendDelay = GetInt(ConfigKey.IRCDelay);

            BuildingCommands.MaxUndoCount = GetInt(ConfigKey.MaxUndo);

            if (!Paths.IgnoreMapPathConfigKey && GetString(ConfigKey.MapPath).Length > 0)
            {
                if (Paths.TestDirectory("MapPath", GetString(ConfigKey.MapPath), true))
                {
                    Paths.MapPath = Path.GetFullPath(GetString(ConfigKey.MapPath));
                    Logger.Log("Maps are stored at: {0}", LogType.SystemActivity, Paths.MapPath);
                }
            }

            AutoRankManager.CheckAutoRankSetting();
        }