void HandleRemoteConnect(object Sender, ValuedEventArgs <string> E) { try { var client = NetworkContext.CreateClient(E.Value, GameData.OnlinePort); var lobby = client.MakePlayerContext(GameData.Player).MakeLobbyContext(); if (lobby != null) { OnConnectionSetup(this, new ValuedEventArgs <MatchLobbyContext>(lobby)); } else { _ConnectionPane.SetError("Failed to join lobby"); client.Close(); } } catch { _ConnectionPane.SetError("Failed to establish connection"); } }