add initial CS:GO support

This commit is contained in:
RaidMax
2021-06-03 10:51:03 -05:00
parent 9488f754d4
commit be08d49f0a
38 changed files with 873 additions and 197 deletions

View File

@ -45,6 +45,16 @@ namespace SharedLibraryCore.Interfaces
/// </summary>
ParserRegex Time { get; set; }
/// <summary>
/// stores the regex information for the map change game log
/// </summary>
ParserRegex MapChange { get; }
/// <summary>
/// stores the regex information for the map end game log
/// </summary>
ParserRegex MapEnd { get; }
/// <summary>
/// indicates the format expected for parsed guids
/// </summary>

View File

@ -11,7 +11,8 @@
/// <param name="ipAddress">ip address of the server</param>
/// <param name="port">port of the server</param>
/// <param name="password"> password of the server</param>
/// <param name="rconEngine">engine to create the rcon connection to</param>
/// <returns>instance of rcon connection</returns>
IRConConnection CreateConnection(string ipAddress, int port, string password);
IRConConnection CreateConnection(string ipAddress, int port, string password, string rconEngine);
}
}

View File

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SharedLibraryCore.Database.Models;
using static SharedLibraryCore.Server;
namespace SharedLibraryCore.Interfaces
@ -39,8 +37,8 @@ namespace SharedLibraryCore.Interfaces
/// get the list of connected clients from status response
/// </summary>
/// <param name="connection">RCon connection to use</param>
/// <returns>list of clients, current map, and current gametype</returns>
Task<(List<EFClient>, string, string)> GetStatusAsync(IRConConnection connection);
/// <returns><see cref="IStatusResponse"/></returns>
Task<IStatusResponse> GetStatusAsync(IRConConnection connection);
/// <summary>
/// stores the RCon configuration
@ -50,23 +48,29 @@ namespace SharedLibraryCore.Interfaces
/// <summary>
/// stores the game/client specific version (usually the value of the "version" DVAR)
/// </summary>
string Version { get; set; }
string Version { get; }
/// <summary>
/// specifies the game name (usually the internal studio iteration ie: IW4, T5 etc...)
/// </summary>
Game GameName { get; set; }
Game GameName { get; }
/// <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; }
bool CanGenerateLogPath { get; }
/// <summary>
/// specifies the name of the parser
/// </summary>
string Name { get; set; }
string Name { get; }
/// <summary>
/// specifies the type of rcon engine
/// eg: COD, Source
/// </summary>
string RConEngine { get; }
/// <summary>
/// retrieves the value of given dvar key if it exists in the override dict

View File

@ -9,59 +9,69 @@ namespace SharedLibraryCore.Interfaces
/// <summary>
/// stores the command format for console commands
/// </summary>
CommandPrefix CommandPrefixes { get; set; }
CommandPrefix CommandPrefixes { get; }
/// <summary>
/// stores the regex info for parsing get status response
/// </summary>
ParserRegex Status { get; set; }
ParserRegex Status { get; }
/// <summary>
/// stores regex info for parsing the map line from rcon status response
/// </summary>
ParserRegex MapStatus { get; set; }
ParserRegex MapStatus { get; }
/// <summary>
/// stores regex info for parsing the gametype line from rcon status response
/// </summary>
ParserRegex GametypeStatus { get; set; }
ParserRegex GametypeStatus { get; }
/// <summary>
/// stores regex info for parsing hostname line from rcon status response
/// </summary>
ParserRegex HostnameStatus { get; }
/// <summary>
/// stores regex info for parsing max players line from rcon status response
/// </summary>
ParserRegex MaxPlayersStatus { get; }
/// <summary>
/// stores the regex info for parsing get DVAR responses
/// </summary>
ParserRegex Dvar { get; set; }
ParserRegex Dvar { get; }
/// <summary>
/// stores the regex info for parsing the header of a status response
/// </summary>
ParserRegex StatusHeader { get; set; }
ParserRegex StatusHeader { get; }
/// <summary>
/// Specifies the expected response message from rcon when the server is not running
/// </summary>
string ServerNotRunningResponse { get; set; }
string ServerNotRunningResponse { get; }
/// <summary>
/// indicates if the application should wait for response from server
/// when executing a command
/// </summary>
bool WaitForResponse { get; set; }
bool WaitForResponse { get; }
/// <summary>
/// indicates the format expected for parsed guids
/// </summary>
NumberStyles GuidNumberStyle { get; set; }
NumberStyles GuidNumberStyle { get; }
/// <summary>
/// specifies simple mappings for dvar names in scenarios where the needed
/// information is not stored in a traditional dvar name
/// </summary>
IDictionary<string, string> OverrideDvarNameMapping { get; set; }
IDictionary<string, string> OverrideDvarNameMapping { get; }
/// <summary>
/// specifies the default dvar values for games that don't support certain dvars
/// </summary>
IDictionary<string, string> DefaultDvarValues { get; set; }
IDictionary<string, string> DefaultDvarValues { get; }
/// <summary>
/// specifies how many lines can be used for ingame notice
@ -71,11 +81,11 @@ namespace SharedLibraryCore.Interfaces
/// <summary>
/// specifies how many characters can be displayed per notice line
/// </summary>
int NoticeMaxCharactersPerLine { get; set; }
int NoticeMaxCharactersPerLine { get; }
/// <summary>
/// specifies the characters used to split a line
/// </summary>
string NoticeLineSeparator { get; set; }
string NoticeLineSeparator { get; }
}
}

View File

@ -0,0 +1,35 @@
using SharedLibraryCore.Database.Models;
namespace SharedLibraryCore.Interfaces
{
/// <summary>
/// describes the collection of data returned from a status query
/// </summary>
public interface IStatusResponse
{
/// <summary>
/// name of the map
/// </summary>
string Map { get; }
/// <summary>
/// gametype/mode
/// </summary>
string GameType { get; }
/// <summary>
/// server name
/// </summary>
string Hostname { get; }
/// <summary>
/// max number of players
/// </summary>
int? MaxClients { get; }
/// <summary>
/// active clients
/// </summary>
EFClient[] Clients { get; }
}
}