update parsers to include game name

prompt to enter log path if game doesn't generate
This commit is contained in:
RaidMax
2019-02-05 18:02:45 -06:00
parent f3290cf066
commit 044991272f
18 changed files with 70 additions and 131 deletions

View File

@ -38,10 +38,15 @@ namespace SharedLibraryCore.Configuration
if (selection.Item1 > 0)
{
RConParserVersion = selection.Item2;
if (!rconParsers[selection.Item1 - 1].CanGenerateLogPath)
{
Console.WriteLine(loc["SETUP_SERVER_NO_LOG"]);
ManualLogPath = Utilities.PromptString(loc["SETUP_SERVER_LOG_PATH"]);
}
}
parserVersions = eventParsers.Select(_parser => _parser.Version).ToArray();
Console.WriteLine($"{IPAddress}:{Port}");
selection = Utilities.PromptSelection($"{loc["SETUP_SERVER_EVENT_PARSER_VERSION"]} ({IPAddress}:{Port})", $"{loc["SETUP_PROMPT_DEFAULT"]} (Call of Duty)", null, parserVersions);
if (selection.Item1 > 0)

View File

@ -1,4 +1,6 @@
namespace SharedLibraryCore.Interfaces
using static SharedLibraryCore.Server;
namespace SharedLibraryCore.Interfaces
{
public interface IEventParser
{
@ -15,6 +17,15 @@
/// </summary>
/// <returns>Game directory prefix</returns>
IEventParserConfiguration Configuration { get; set; }
/// <summary>
/// stores the game/client specific version (usually the value of the "version" DVAR)
/// </summary>
string Version { get; set; }
/// <summary>
/// specifies the game name (usually the internal studio iteration ie: IW4, T5 etc...)
/// </summary>
Game GameName { get; set; }
}
}

View File

@ -51,5 +51,16 @@ namespace SharedLibraryCore.Interfaces
/// stores the game/client specific version (usually the value of the "version" DVAR)
/// </summary>
string Version { get; set; }
/// <summary>
/// specifies the game name (usually the internal studio iteration ie: IW4, T5 etc...)
/// </summary>
Game GameName { get; set; }
/// <summary>
/// indicates if the game supports generating a log path from DVAR retrieval
/// of fs_game, fs_basepath, g_log
/// </summary>
bool CanGenerateLogPath { get; set; }
}
}

View File

@ -9,10 +9,6 @@ namespace SharedLibraryCore.Interfaces
/// </summary>
CommandPrefix CommandPrefixes { get; set; }
/// <summary>
/// optionally stores the game name type
/// </summary>
Server.Game GameName { get; set; }
/// <summary>
/// stores the regex info for parsing get status response
/// </summary>
ParserRegex Status { get; set; }

View File

@ -17,14 +17,16 @@ namespace SharedLibraryCore
{
public enum Game
{
UKN,
IW3,
IW4,
IW5,
T4,
T5,
T5M,
T6M,
COD = -1,
UKN = 0,
IW3 = 1,
IW4 = 2,
IW5 = 3,
IW6 = 4,
T4 = 5,
T5 = 6,
T6 = 7,
T7 = 8
}
public Server(IManager mgr, ServerConfiguration config)
@ -51,12 +53,6 @@ namespace SharedLibraryCore
public long EndPoint => Convert.ToInt64($"{IP.Replace(".", "")}{Port}");
//Returns current server IP set by `net_ip` -- *STRING*
public String GetIP()
{
return IP;
}
//Returns current server port set by `net_port` -- *INT*
public int GetPort()
{

View File

@ -367,16 +367,11 @@ namespace SharedLibraryCore
return Game.T4;
}
if (gameName.Contains("COD_T5_S"))
if (gameName.Contains("T5"))
{
return Game.T5;
}
if (gameName.Contains("T5M"))
{
return Game.T5M;
}
if (gameName.Contains("IW5"))
{
return Game.IW5;
@ -384,7 +379,7 @@ namespace SharedLibraryCore
if (gameName.Contains("COD_T6_S"))
{
return Game.T6M;
return Game.T6;
}
return Game.UKN;