private void LClientOnOnDataRecieved(object sender , Skylabs.Lobby.Client.DataRecType type , object data) { if (type == Skylabs.Lobby.Client.DataRecType.HostedGameReady) { var port = data as Int32?; if (port != null) { EndHostGame((int)port); return; } EndHostGame(-1); } }
private void LobbyClientOnOnDataRecieved(object sender, Skylabs.Lobby.Client.DataRecType type, object data) { Dispatcher.BeginInvoke(new Action(()=> { switch(type) { case Skylabs.Lobby.Client.DataRecType.FriendList: break; case Skylabs.Lobby.Client.DataRecType.MyInfo: break; case Skylabs.Lobby.Client.DataRecType.GameList: break; case Skylabs.Lobby.Client.DataRecType.HostedGameReady: break; case Skylabs.Lobby.Client.DataRecType.GamesNeedRefresh: break; case Skylabs.Lobby.Client.DataRecType.Announcement: var d = data as Dictionary<String , String>; if(d != null) MessageBox.Show(d["Message"] , d["Subject"] , MessageBoxButton.OK , MessageBoxImage.Exclamation); break; } tbStatus.Text = Program.LobbyClient.CustomStatus; switch(Program.LobbyClient.Status) { case UserStatus.Unknown: rgStatus.LargeImageSource = bOfflineStatus.LargeImageSource; break; case UserStatus.Offline: rgStatus.LargeImageSource = bOfflineStatus.LargeImageSource; break; case UserStatus.Online: rgStatus.LargeImageSource = bOnlineStatus.LargeImageSource; break; case UserStatus.Away: rgStatus.LargeImageSource = bAwayStatus.LargeImageSource; break; case UserStatus.DoNotDisturb: rgStatus.LargeImageSource = bBusyStatus.LargeImageSource; break; case UserStatus.Invisible: rgStatus.LargeImageSource = bOfflineStatus.LargeImageSource; break; } Prefs.Nickname = Program.LobbyClient.Me.User.User; } )); }
private void LoginFinished(Skylabs.Lobby.Client.LoginResult success, DateTime banEnd, string message) { if (_inLoginDone) return; _inLoginDone = true; Trace.TraceInformation("Login finished."); if (_loginTimer != null) { _loginTimer.Dispose(); _loginTimer = null; } Dispatcher.Invoke((Action) (() => { Program.LauncherWindow.Closing -= LauncherWindowClosing; _isLoggingIn = false; StopSpinning(); switch (success) { case Skylabs.Lobby.Client.LoginResult.Success: SimpleConfig.WriteValue("Password", cbSavePassword.IsChecked == true ? passwordBox1.Password.Encrypt() : ""); SimpleConfig.WriteValue("Username", textBox1.Text); SimpleConfig.WriteValue("Nickname",textBox1.Text); Program.MainWindow = new Windows.Main(); Program.MainWindow.Show(); Application.Current.MainWindow = Program.MainWindow; Program.LauncherWindow.Close(); break; case Skylabs.Lobby.Client.LoginResult.Banned: DoErrorMessage("You have been banned until " + banEnd.ToShortTimeString() + " on " + banEnd.ToShortDateString()); break; case Skylabs.Lobby.Client.LoginResult.Failure: DoErrorMessage("Login Failed: " + message); break; } _inLoginDone = false; }), new object[] {}); }
void LobbyClientOnLoginComplete(object sender, Skylabs.Lobby.Client.LoginResults results) { switch (results) { case Skylabs.Lobby.Client.LoginResults.ConnectionError: Dispatcher.Invoke(new Action(() => { UpdateLoginStatus(""); _isLoggingIn = false; DoErrorMessage("Could not connect to the server."); StopSpinning(); })); break; case Skylabs.Lobby.Client.LoginResults.Success: LoginFinished(Skylabs.Lobby.Client.LoginResult.Success, DateTime.Now,""); break; case Skylabs.Lobby.Client.LoginResults.Failure: LoginFinished(Skylabs.Lobby.Client.LoginResult.Failure, DateTime.Now,"Username/Password Incorrect."); break; } _isLoggingIn = false; }
private void LobbyClientOnOnDataRecieved(object sender, Skylabs.Lobby.Client.DataRecType type, object data) { Dispatcher.Invoke(new Action(()=> { tbStatus.Text = Program.LobbyClient.CustomStatus; switch(Program.LobbyClient.Status) { case UserStatus.Unknown: rgStatus.LargeImageSource = bOfflineStatus.LargeImageSource; break; case UserStatus.Offline: rgStatus.LargeImageSource = bOfflineStatus.LargeImageSource; break; case UserStatus.Online: rgStatus.LargeImageSource = bOnlineStatus.LargeImageSource; break; case UserStatus.Away: rgStatus.LargeImageSource = bAwayStatus.LargeImageSource; break; case UserStatus.DoNotDisturb: rgStatus.LargeImageSource = bBusyStatus.LargeImageSource; break; case UserStatus.Invisible: rgStatus.LargeImageSource = bOfflineStatus.LargeImageSource; break; } SimpleConfig.WriteValue("Nickname", Program.LobbyClient.Me.User.User); } )); }
private void LobbyClient_OnLoginComplete(object sender, Skylabs.Lobby.LoginResults results) { Log.InfoFormat("Lobby Login Complete {0}", results); _xmppLoginResult = results; _xmppLoginEvent.Set(); }
void lobbyClient_OnFriendRequest(Skylabs.Lobby.User u) { //Reload_List(); Dispatcher.Invoke(new Action(Reload_List)); }
void lobbyClient_OnGameHostEvent(Skylabs.Lobby.HostedGame g) { Reload_Game_List(); }
private void lobbyClient_OnUserStatusChanged(Skylabs.Lobby.UserStatus eve, Skylabs.Lobby.User u) { RefreshList(); }