add back helper methods without cancellation token for plugins

This commit is contained in:
RaidMax 2022-03-02 08:29:15 -06:00
parent 55b0caf900
commit e6e56d8d14

View File

@ -729,6 +729,12 @@ namespace SharedLibraryCore
return await server.RconParser.GetDvarAsync(server.RemoteConnection, dvarName, fallbackValue, token);
}
public static async Task<Dvar<T>> GetDvarAsync<T>(this Server server, string dvarName,
T fallbackValue = default)
{
return await GetDvarAsync(server, dvarName, fallbackValue, default);
}
public static async Task<Dvar<T>> GetMappedDvarValueOrDefaultAsync<T>(this Server server, string dvarName,
string infoResponseName = null, IDictionary<string, string> infoResponse = null,
T overrideDefault = default, CancellationToken token = default)
@ -758,11 +764,21 @@ namespace SharedLibraryCore
await server.RconParser.SetDvarAsync(server.RemoteConnection, dvarName, dvarValue, token);
}
public static async Task SetDvarAsync(this Server server, string dvarName, object dvarValue)
{
await SetDvarAsync(server, dvarName, dvarValue, default);
}
public static async Task<string[]> ExecuteCommandAsync(this Server server, string commandName, CancellationToken token = default)
{
return await server.RconParser.ExecuteCommandAsync(server.RemoteConnection, commandName, token);
}
public static async Task<string[]> ExecuteCommandAsync(this Server server, string commandName)
{
return await ExecuteCommandAsync(server, commandName, default);
}
public static Task<IStatusResponse> GetStatusAsync(this Server server, CancellationToken token)
{
return server.RconParser.GetStatusAsync(server.RemoteConnection, token);