void SetLoggingMode(LogSaveMode logSaveMode, string replaceString) { if (logSaveMode == LogSaveMode.Unknown) { throw new InvalidOperationException("Unknown is not valid Wurm config value"); } string replaceValue = replaceString; if (logSaveMode == LogSaveMode.Never) { replaceValue += "0"; } if (logSaveMode == LogSaveMode.OneFile) { replaceValue += "1"; } if (logSaveMode == LogSaveMode.Monthly) { replaceValue += "2"; } if (logSaveMode == LogSaveMode.Daily) { replaceValue += "3"; } RewriteFile(replaceString + @"\d", replaceValue); }
void Refresh() { lock (locker) { var result = configReader.ReadValues(); customTimerSource = result.CustomTimerSource; execSource = result.ExecSource; keyBindSource = result.KeyBindSource; autoRunSource = result.AutoRunSource; ircLoggingType = result.IrcLoggingType; otherLoggingType = result.OtherLoggingType; eventLoggingType = result.EventLoggingType; skillGainRate = result.SkillGainRate; noSkillMessageOnAlignmentChange = result.NoSkillMessageOnAlignmentChange; noSkillMessageOnFavorChange = result.NoSkillMessageOnFavorChange; saveSkillsOnQuit = result.SaveSkillsOnQuit; timestampMessages = result.TimestampMessages; HasBeenRead = true; } onConfigChanged.Trigger(); }
public WurmLogs(DirectoryInfo logsDir, Platform targetPlatform) { this.logsDir = logsDir; this.targetPlatform = targetPlatform; LogSaveMode = LogSaveMode.Daily; }
public void SetIrcLoggingMode(LogSaveMode logSaveMode) { SetLoggingMode(logSaveMode, "irc_log_rotation="); }
public void SetOtherLoggingMode(LogSaveMode logSaveMode) { SetLoggingMode(logSaveMode, "other_log_rotation="); }
public void SetEventLoggingMode(LogSaveMode logSaveMode) { SetLoggingMode(logSaveMode, "event_log_rotation="); }
public void SetOtherLoggingMode(LogSaveMode logSaveMode) { this.SetLoggingMode(logSaveMode, "other_log_rotation="); }
public void SetIrcLoggingMode(LogSaveMode logSaveMode) { this.SetLoggingMode(logSaveMode, "irc_log_rotation="); }
public void SetEventLoggingMode(LogSaveMode logSaveMode) { this.SetLoggingMode(logSaveMode, "event_log_rotation="); }
void SetLoggingMode(LogSaveMode logSaveMode, string replaceString) { if (logSaveMode == LogSaveMode.Unknown) { throw new InvalidOperationException("Unknown is not valid Wurm config value"); } string replaceValue = replaceString; if (logSaveMode == LogSaveMode.Never) { replaceValue += "0"; } if (logSaveMode == LogSaveMode.OneFile) { replaceValue += "1"; } if (logSaveMode == LogSaveMode.Monthly) { replaceValue += "2"; } if (logSaveMode == LogSaveMode.Daily) { replaceValue += "3"; } this.RewriteFile(replaceString + @"\d", replaceValue); }
void Refresh() { lock (locker) { var result = this.configReader.ReadValues(); this.customTimerSource = result.CustomTimerSource; this.execSource = result.ExecSource; this.keyBindSource = result.KeyBindSource; this.autoRunSource = result.AutoRunSource; this.ircLoggingType = result.IrcLoggingType; this.otherLoggingType = result.OtherLoggingType; this.eventLoggingType = result.EventLoggingType; this.skillGainRate = result.SkillGainRate; this.noSkillMessageOnAlignmentChange = result.NoSkillMessageOnAlignmentChange; this.noSkillMessageOnFavorChange = result.NoSkillMessageOnFavorChange; this.saveSkillsOnQuit = result.SaveSkillsOnQuit; this.timestampMessages = result.TimestampMessages; this.HasBeenRead = true; } onConfigChanged.Trigger(); }