private void ProcessSessionInformation(SessionListInformationPacket obj) { // All we need to do is update the model _viewModel.SessionsAvailable = obj.GameSessions; if (_view.FlowController.WebControl.IsDocumentReady) { _view.UpdateView(); } }
/// <summary> /// Sends a specific user a list of currently active sessions in the lobby. /// </summary> /// <param name="user">The user to send all the sessions to</param> public void SendUserUpdatedSession(User user, GameSession session) { var stubList = new List <GameSession>(); stubList.Add(session); var packet = new SessionListInformationPacket(stubList); ClientNetworkManager.Instance.SendPacket(packet, user.Connection); }
private void ProcessSessionInformation(SessionListInformationPacket obj) { // Clear the old list lstSessions.DataSource = null; lstSessions.Items.Clear(); lstSessions.DataSource = obj.GameSessions; _sessions = obj.GameSessions; UpdateSessionView(); }
/// <summary> /// Sends a specific user a list of currently active sessions in the lobby. /// </summary> /// <param name="user">The user to send all the sessions to</param> public void SendUserSessions(User user) { var packet = new SessionListInformationPacket(Sessions.ToList()); ClientNetworkManager.Instance.SendPacket(packet, user.Connection); }