public RootSteamViewModel() { _root = SteamRoot.Instance; NewFriendIp = "192.168.1.101"; NewFriendPort = 41650; _root.Libraries.CollectionChanged += Libraries_CollectionChanged; if (GamePipe.Properties.Settings.Default.Friends != null) { foreach (var friend in GamePipe.Properties.Settings.Default.Friends) { try { AddFriend(friend); } catch (Exception ex) { GamePipeLib.Utils.Logging.Logger.Error("Failed to restore friend: " + friend, ex); } } } }
public void CloseHost() { if (_hosting == true) { try { Host.Close(); _Host = null; _hostThread.Abort(); SteamRoot.DropInstanceForThreadId(_hostThread.ManagedThreadId); _hostThread = new Thread(StartHosting) { IsBackground = true }; _hosting = false; } catch (Exception ex) { GamePipeLib.Utils.Logging.Logger.Error("Close Host failed due to exception:", ex); System.Windows.MessageBox.Show("Close Host failed due to exception:\n" + ex.Message, "", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Exclamation, System.Windows.MessageBoxResult.OK); } } }
public GameProviderService() { _rootSteam = SteamRoot.Instance; }