2020-11-19 21:48:25 -05:00
|
|
|
|
using System;
|
|
|
|
|
using SharedLibraryCore.Interfaces;
|
2019-01-26 21:33:37 -05:00
|
|
|
|
using SharedLibraryCore.RCon;
|
2020-06-16 18:16:12 -04:00
|
|
|
|
using System.Collections.Generic;
|
2020-01-15 19:43:52 -05:00
|
|
|
|
using System.Globalization;
|
2019-01-26 21:33:37 -05:00
|
|
|
|
|
|
|
|
|
namespace IW4MAdmin.Application.RconParsers
|
|
|
|
|
{
|
2019-02-02 20:40:37 -05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// generic implementation of the IRConParserConfiguration
|
|
|
|
|
/// allows script plugins to generate dynamic RCon configurations
|
|
|
|
|
/// </summary>
|
2020-04-21 18:34:00 -04:00
|
|
|
|
public class DynamicRConParserConfiguration : IRConParserConfiguration
|
2019-01-26 21:33:37 -05:00
|
|
|
|
{
|
|
|
|
|
public CommandPrefix CommandPrefixes { get; set; }
|
2020-04-01 15:11:56 -04:00
|
|
|
|
public ParserRegex Status { get; set; }
|
|
|
|
|
public ParserRegex MapStatus { get; set; }
|
2020-08-05 10:30:02 -04:00
|
|
|
|
public ParserRegex GametypeStatus { get; set; }
|
2020-04-01 15:11:56 -04:00
|
|
|
|
public ParserRegex Dvar { get; set; }
|
2020-04-17 16:05:16 -04:00
|
|
|
|
public ParserRegex StatusHeader { get; set; }
|
2020-01-13 17:51:16 -05:00
|
|
|
|
public string ServerNotRunningResponse { get; set; }
|
2019-02-03 21:47:05 -05:00
|
|
|
|
public bool WaitForResponse { get; set; } = true;
|
2020-01-15 19:43:52 -05:00
|
|
|
|
public NumberStyles GuidNumberStyle { get; set; } = NumberStyles.HexNumber;
|
2020-06-16 18:16:12 -04:00
|
|
|
|
public IDictionary<string, string> OverrideDvarNameMapping { get; set; } = new Dictionary<string, string>();
|
|
|
|
|
public IDictionary<string, string> DefaultDvarValues { get; set; } = new Dictionary<string, string>();
|
2020-11-17 19:24:54 -05:00
|
|
|
|
public int NoticeMaximumLines { get; set; } = 8;
|
|
|
|
|
public int NoticeMaxCharactersPerLine { get; set; } = 50;
|
2020-11-19 21:48:25 -05:00
|
|
|
|
public string NoticeLineSeparator { get; set; } = Environment.NewLine;
|
2020-04-01 15:11:56 -04:00
|
|
|
|
|
|
|
|
|
public DynamicRConParserConfiguration(IParserRegexFactory parserRegexFactory)
|
|
|
|
|
{
|
|
|
|
|
Status = parserRegexFactory.CreateParserRegex();
|
|
|
|
|
MapStatus = parserRegexFactory.CreateParserRegex();
|
2020-08-05 10:30:02 -04:00
|
|
|
|
GametypeStatus = parserRegexFactory.CreateParserRegex();
|
2020-04-01 15:11:56 -04:00
|
|
|
|
Dvar = parserRegexFactory.CreateParserRegex();
|
2020-04-17 16:05:16 -04:00
|
|
|
|
StatusHeader = parserRegexFactory.CreateParserRegex();
|
2020-04-01 15:11:56 -04:00
|
|
|
|
}
|
2019-01-26 21:33:37 -05:00
|
|
|
|
}
|
|
|
|
|
}
|