// Construction public CBrowseLobbyAddRemoveMessage( CLobbySummary new_lobby, ELobbyID removed_lobby ) : base() { Lobbies = new List< CLobbySummary >(); if ( new_lobby != null ) { Lobbies.Add( new_lobby ); } RemovedLobby = removed_lobby; }
public CLobbySummary Create_Summary() { CLobbySummary summary = new CLobbySummary(); summary.Initialize( ID, LobbyState.Config, CreationTime, Creator, (uint) LobbyState.PlayerCount, (uint) LobbyState.ObserverCount ); return summary; }
// Methods // Public interface public void Add_Summary( CLobbySummary summary ) { Lobbies.Add( summary ); }
private static void Build_Browse_Lobby_Message_Samples( List< CNetworkMessage > message_list ) { message_list.Add( new CStartBrowseLobbyRequest( EGameModeType.Two_Players, ELobbyMemberType.Player, true ) ); CLobbyConfig lobby_config = new CLobbyConfig(); lobby_config.Initialize( "Pimps", EGameModeType.Two_Players, false, "BigPimpin" ); CStartBrowseLobbyResponse browse_response = new CStartBrowseLobbyResponse( EMessageRequestID.Invalid, EStartBrowseResult.Success ); for ( int i = 0; i < 10; i++ ) { CLobbySummary lobby_summary = new CLobbySummary(); lobby_summary.Initialize( ELobbyID.Invalid, lobby_config, DateTime.Now, EPersistenceID.Invalid, 2, 2 ); browse_response.Add_Summary( lobby_summary ); } message_list.Add( browse_response ); message_list.Add( new CEndBrowseLobbyMessage() ); message_list.Add( new CBrowseNextLobbySetRequest() ); message_list.Add( new CBrowsePreviousLobbySetRequest() ); CCursorBrowseLobbyResponse cursor_response = new CCursorBrowseLobbyResponse( EMessageRequestID.Invalid, ECursorBrowseResult.Success ); for ( int i = 0; i < 10; i++ ) { CLobbySummary lobby_summary = new CLobbySummary(); lobby_summary.Initialize( ELobbyID.Invalid, lobby_config, DateTime.Now, EPersistenceID.Invalid, 2, 2 ); cursor_response.Add_Summary( lobby_summary ); } message_list.Add( cursor_response ); CLobbySummary summary = new CLobbySummary(); summary.Initialize( ELobbyID.Invalid, lobby_config, DateTime.Now, EPersistenceID.Invalid, 1, 4 ); message_list.Add( new CBrowseLobbyAddRemoveMessage( summary, ELobbyID.Invalid ) ); CLobbySummaryDelta summary_delta = new CLobbySummaryDelta(); summary_delta.Initialize( ELobbyID.Invalid, 4, 1 ); message_list.Add( new CBrowseLobbyDeltaMessage( summary_delta ) ); }
private void Add_Summary( CLobbySummary summary ) { m_WatchedLobbies.Add( summary.ID, summary ); CClientPlayerInfoManager.Instance.Begin_Player_Listen( summary.Creator, EPlayerListenReason.Browsed_Lobby_Creator ); }