public void CheckAppBetaPassword(uint appid, string password) { bool completed = false; Action <SteamApps.CheckAppBetaPasswordCallback> cbMethod = (appPassword) => { completed = true; Log.Info("Retrieved {0} beta keys with result: {1}", appPassword.BetaPasswords.Count, appPassword.Result); foreach (var entry in appPassword.BetaPasswords) { AppBetaPasswords[entry.Key] = entry.Value; } }; WaitUntilCallback(() => { callbacks.Subscribe(steamApps.CheckAppBetaPassword(appid, password), cbMethod); }, () => { return(completed); }); }
public Task <bool> CheckAppBetaPassword(uint appid, string password) { var tsc = new TaskCompletionSource <bool>(); IDisposable subscription = null; Action <SteamApps.CheckAppBetaPasswordCallback> cbMethod = (appPassword) => { subscription.Dispose(); DebugLog.WriteLine("Steam3Session", "Retrieved " + appPassword.BetaPasswords.Count + " beta keys with result: " + appPassword.Result); foreach (var entry in appPassword.BetaPasswords) { AppBetaPasswords[entry.Key] = entry.Value; } tsc.SetResult(true); }; subscription = callbacks.Subscribe(steamApps.CheckAppBetaPassword(appid, password), cbMethod); return(tsc.Task); }