using System;
using System.Threading;
using System.Threading.Tasks;
using static SharedLibraryCore.Server;
namespace SharedLibraryCore.Interfaces
{
public interface IRConParser
{
///
/// stores the RCon configuration
///
IRConParserConfiguration Configuration { get; set; }
///
/// stores the game/client specific version (usually the value of the "version" DVAR)
///
string Version { get; }
///
/// specifies the game name (usually the internal studio iteration ie: IW4, T5 etc...)
///
Game GameName { get; }
///
/// indicates if the game supports generating a log path from DVAR retrieval
/// of fs_game, fs_basepath, g_log
///
bool CanGenerateLogPath { get; }
///
/// specifies the name of the parser
///
string Name { get; }
///
/// specifies the type of rcon engine
/// eg: COD, Source
///
string RConEngine { get; }
///
/// indicates that the game does not log to the mods folder (when mod is loaded),
/// but rather always to the fs_basegame directory
///
bool IsOneLog { get; }
///
/// retrieves the value of a given DVAR
///
/// type of DVAR expected (string, int, float etc...)
/// RCon connection to retrieve with
/// name of DVAR
/// default value to return if dvar retrieval fails
///
///
Task> GetDvarAsync(IRConConnection connection, string dvarName, T fallbackValue = default, CancellationToken token = default);
///
/// set value of DVAR by name
///
/// RCon connection to use
/// name of DVAR to set
/// value to set DVAR to
///
///
Task SetDvarAsync(IRConConnection connection, string dvarName, object dvarValue, CancellationToken token = default);
///
/// executes a console command on the server
///
/// RCon connection to use
/// console command to execute
///
///
Task ExecuteCommandAsync(IRConConnection connection, string command, CancellationToken token = default);
///
/// get the list of connected clients from status response
///
/// RCon connection to use
///
///
///
///
Task GetStatusAsync(IRConConnection connection, CancellationToken token = default);
///
/// retrieves the value of given dvar key if it exists in the override dict
/// otherwise returns original
///
/// name of dvar key
///
string GetOverrideDvarName(string dvarName);
///
/// retrieves the configuration value of a dvar key for
/// games that do not support the given dvar
///
/// dvar key name
///
T GetDefaultDvarValue(string dvarName);
///
/// determines the amount of time to wait for the command to respond
///
/// name of command being executed
///
TimeSpan? OverrideTimeoutForCommand(string command);
}
}