public void Dispose() { if(this.DotaClient != null) { this.DotaClient.Dispose(); this.DotaClient = null; } }
private async Task Connect() { var userService = new SteamUserService(); SteamUser userInfo = null; try { userInfo = await userService.GetNextAvailable(); this.DotaClient = new DotaGameClient(userInfo.Username, userInfo.Password, userInfo.Sentry); await this.DotaClient.Connect(); } catch (Exception) { if(userInfo != null) await userService.Trip(userInfo.Id); throw; } }