diff --git a/SharedLibraryCore/Utilities.cs b/SharedLibraryCore/Utilities.cs index dfd859064..6d5dfde11 100644 --- a/SharedLibraryCore/Utilities.cs +++ b/SharedLibraryCore/Utilities.cs @@ -728,6 +728,12 @@ namespace SharedLibraryCore { return await server.RconParser.GetDvarAsync(server.RemoteConnection, dvarName, fallbackValue, token); } + + public static async Task> GetDvarAsync(this Server server, string dvarName, + T fallbackValue = default) + { + return await GetDvarAsync(server, dvarName, fallbackValue, default); + } public static async Task> GetMappedDvarValueOrDefaultAsync(this Server server, string dvarName, string infoResponseName = null, IDictionary infoResponse = null, @@ -757,11 +763,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 ExecuteCommandAsync(this Server server, string commandName, CancellationToken token = default) { return await server.RconParser.ExecuteCommandAsync(server.RemoteConnection, commandName, token); } + + public static async Task ExecuteCommandAsync(this Server server, string commandName) + { + return await ExecuteCommandAsync(server, commandName, default); + } public static Task GetStatusAsync(this Server server, CancellationToken token) {