private void ConnectSteam() { if (_steam != null && ( _steam.Connecting || _steam.LoggedIn )) return; if ( _settings.globalSteamEnable) { _steam = new Steam(); _steam.OnGuardCode += new EventHandler<EventArgs>(_steam_OnGuardCode); _steam.OnLoginError += new EventHandler<EventArgs>(_steam_OnLoginError); _steam.OnLogon += new EventHandler<SteamAPI.SteamEvent>(_steam_OnLogon); _steam.OnMessage += new EventHandler<SteamAPI.SteamEvent>(_steam_OnMessage); if (String.IsNullOrEmpty(_settings.steamLogin) || String.IsNullOrEmpty(_settings.steamPassword)) return; if( !_steam.LoggedIn && !_steam.Connecting) _steam.Connect(_settings.steamLogin, _settings.steamPassword, String.Empty, _settings.steamToken); } }
private void DisconnectSteam() { if (_steam != null && !_steam.Disconnecting) { _steam.Stop(); _steam = null; } }