private void Connect(UserClickedLoginMessage msg, VSPCContext context) { this.context = context; fsdSession = new FSDSession(new ClientProperties("Claus Joergensen Client", new Version(1, 0), 0x5820, "163f6a324730ed0aa1ba30b29148687c"), msg); fsdSession.ServerIdentificationReceived += fsdSession_ServerIdentificationReceived; fsdSession.ClientQueryReceived += fsdSession_ClientQueryReceived; fsdSession.TextMessageReceived += fsdSession_TextMessageReceived; fsdSession.ATCPositionReceived += fsdSession_ATCPositionReceived; fsdSession.PilotPositionReceived += fsdSession_PilotPositionReceived; fsdSession.NetworkError += fsdSession_NetworkError; fsdSession.ProtocolErrorReceived += fsdSession_ProtocolErrorReceived; fsdSession.KillRequestReceived += fsdSession_KillRequestReceived; fsdSession.IgnoreUnknownPackets = true; fsdSession.Connect(msg.Server, 6809); }
private void DoLogon() { if (string.IsNullOrEmpty(comboBoxCallsign.Text)) { MessageBox.Show("Please enter or select a callsign.", "VSPC Login", MessageBoxButton.OK, MessageBoxImage.Information); } else { FSDState = ConnectionState.LogonInProgress; FlightsimState = ConnectionState.LogonInProgress; comboBoxCallsign.IsEnabled = false; buttonConnect.Content = "CONNECTING"; buttonConnect.Foreground = Brushes.Orange; var msg = new UserClickedLoginMessage() { Callsign = comboBoxCallsign.Text, Cid = Properties.Settings.Default.CID, Password = Properties.Settings.Default.Password, Realname = Properties.Settings.Default.Realname, Server = Properties.Settings.Default.Server }; ThreadStart start = () => broker.Publish(msg); new Thread(start).Start(); } }