123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701 |
- #undef private
- #undef protected
- #include "win32/win_achievements.h"
- #include "win32/win_signin.h"
- #include "sys_lobby_backend.h"
- #include "sys_lobby.h"
- class idSaveGameProcessorNextMap;
- class idSaveGameProcessorSaveGame;
- class idSaveGameProcessorLoadGame;
- class idSaveGameProcessorDelete;
- class idSaveGameProcessorEnumerateGames;
- class idLobbyStub : public idLobbyBase {
- public:
- virtual bool IsHost() const { return false; }
- virtual bool IsPeer() const { return false; }
- virtual bool HasActivePeers() const { return false; }
- virtual int GetNumLobbyUsers() const { return 0; }
- virtual int GetNumActiveLobbyUsers() const { return 0; }
- virtual bool IsLobbyUserConnected( int index ) const { return false; }
- virtual lobbyUserID_t GetLobbyUserIdByOrdinal( int userIndex ) const { return lobbyUserID_t(); }
- virtual int GetLobbyUserIndexFromLobbyUserID( lobbyUserID_t lobbyUserID ) const { return -1; }
- virtual void SendReliable( int type, idBitMsg & msg, bool callReceiveReliable = true, peerMask_t sessionUserMask = MAX_UNSIGNED_TYPE( peerMask_t ) ) {}
- virtual void SendReliableToLobbyUser( lobbyUserID_t lobbyUserID, int type, idBitMsg & msg ) {}
- virtual void SendReliableToHost( int type, idBitMsg & msg ) {}
- virtual const char * GetLobbyUserName( lobbyUserID_t lobbyUserID ) const { return "INVALID"; }
- virtual void KickLobbyUser( lobbyUserID_t lobbyUserID ) {}
- virtual bool IsLobbyUserValid( lobbyUserID_t lobbyUserID ) const { return false; }
- virtual bool IsLobbyUserLoaded( lobbyUserID_t lobbyUserID ) const { return false; }
- virtual bool LobbyUserHasFirstFullSnap( lobbyUserID_t lobbyUserID ) const { return false; }
- virtual void EnableSnapshotsForLobbyUser( lobbyUserID_t lobbyUserID ) {}
- virtual int GetLobbyUserSkinIndex( lobbyUserID_t lobbyUserID ) const { return 0; }
- virtual bool GetLobbyUserWeaponAutoReload( lobbyUserID_t lobbyUserID ) const { return false; }
- virtual bool GetLobbyUserWeaponAutoSwitch( lobbyUserID_t lobbyUserID ) const { return false; }
- virtual int GetLobbyUserLevel( lobbyUserID_t lobbyUserID ) const { return 0; }
- virtual int GetLobbyUserQoS( lobbyUserID_t lobbyUserID ) const { return 0; }
- virtual int GetLobbyUserTeam( lobbyUserID_t lobbyUserID ) const { return 0; }
- virtual bool SetLobbyUserTeam( lobbyUserID_t lobbyUserID, int teamNumber ) { return false; }
- virtual int GetLobbyUserPartyToken( lobbyUserID_t lobbyUserID ) const { return 0; }
- virtual idPlayerProfile * GetProfileFromLobbyUser( lobbyUserID_t lobbyUserID ) { return NULL; }
- virtual idLocalUser * GetLocalUserFromLobbyUser( lobbyUserID_t lobbyUserID ) { return NULL; }
- virtual int GetNumLobbyUsersOnTeam( int teamNumber ) const { return 0; }
- virtual int PeerIndexFromLobbyUser( lobbyUserID_t lobbyUserID ) const { return -1; }
- virtual int GetPeerTimeSinceLastPacket( int peerIndex ) const { return 0; }
- virtual int PeerIndexForHost() const { return -1; }
- virtual lobbyUserID_t AllocLobbyUserSlotForBot( const char * botName ) { return lobbyUserID_t(); }
- virtual void RemoveBotFromLobbyUserList( lobbyUserID_t lobbyUserID ) {}
- virtual bool GetLobbyUserIsBot( lobbyUserID_t lobbyUserID ) const { return false; }
- virtual const char * GetHostUserName() const { return "INVALID"; }
- virtual const idMatchParameters & GetMatchParms() const { return fakeParms; }
- virtual bool IsLobbyFull() const { return false; }
- virtual bool EnsureAllPeersHaveBaseState() { return false; }
- virtual bool AllPeersInGame() const { return false; }
- virtual int GetNumConnectedPeers() const { return 0; }
- virtual int GetNumConnectedPeersInGame() const { return 0; }
- virtual int PeerIndexOnHost() const { return -1; }
- virtual bool IsPeerDisconnected( int peerIndex ) const { return false; }
- virtual bool AllPeersHaveStaleSnapObj( int objId ) { return false; }
- virtual bool AllPeersHaveExpectedSnapObj( int objId ) { return false; }
- virtual void RefreshSnapObj( int objId ) {}
- virtual void MarkSnapObjDeleted( int objId ) {}
- virtual void AddSnapObjTemplate( int objID, idBitMsg & msg ) {}
- virtual void DrawDebugNetworkHUD() const {}
- virtual void DrawDebugNetworkHUD2() const {}
- virtual void DrawDebugNetworkHUD_ServerSnapshotMetrics( bool draw ) {}
- private:
- idMatchParameters fakeParms;
- };
- class idSessionLocal : public idSession {
- friend class idLeaderboards;
- friend class idStatsSession;
- friend class idLobbyBackend360;
- friend class idLobbyBackendPS3;
- friend class idSessionLocalCallbacks;
- friend class idPsnAsyncSubmissionLookupPS3_TitleStorage;
- friend class idNetSessionPort;
- friend class lobbyAddress_t;
-
- protected:
-
-
-
-
- enum state_t {
- STATE_PRESS_START,
- STATE_IDLE,
- STATE_PARTY_LOBBY_HOST,
- STATE_PARTY_LOBBY_PEER,
- STATE_GAME_LOBBY_HOST,
- STATE_GAME_LOBBY_PEER,
- STATE_GAME_STATE_LOBBY_HOST,
- STATE_GAME_STATE_LOBBY_PEER,
- STATE_CREATE_AND_MOVE_TO_PARTY_LOBBY,
- STATE_CREATE_AND_MOVE_TO_GAME_LOBBY,
- STATE_CREATE_AND_MOVE_TO_GAME_STATE_LOBBY,
- STATE_FIND_OR_CREATE_MATCH,
- STATE_CONNECT_AND_MOVE_TO_PARTY,
- STATE_CONNECT_AND_MOVE_TO_GAME,
- STATE_CONNECT_AND_MOVE_TO_GAME_STATE,
- STATE_BUSY,
-
- STATE_LOADING,
- STATE_INGAME,
- NUM_STATES
- };
- enum connectType_t {
- CONNECT_NONE = 0,
- CONNECT_DIRECT = 1,
- CONNECT_FIND_OR_CREATE = 2,
- };
- enum pendingInviteMode_t {
- PENDING_INVITE_NONE = 0,
- PENDING_INVITE_WAITING = 1,
- PENDING_SELF_INVITE_WAITING = 2,
- };
- struct contentData_t {
- bool isMounted;
- idStrStatic<128> displayName;
- idStrStatic< MAX_OSPATH > packageFileName;
- idStrStatic< MAX_OSPATH > rootPath;
- int dlcID;
- };
- public:
- idSessionLocal();
- virtual ~idSessionLocal();
- void InitBaseState();
- virtual bool IsPlatformPartyInLobby();
-
- virtual int GetNumContentPackages() const;
- virtual int GetContentPackageID( int contentIndex ) const;
- virtual const char * GetContentPackagePath( int contentIndex ) const;
- virtual int GetContentPackageIndexForID( int contentID ) const;
- virtual bool GetSystemMarketplaceHasNewContent() const { return marketplaceHasNewContent; }
- virtual void SetSystemMarketplaceHasNewContent( bool hasNewContent ) { marketplaceHasNewContent = hasNewContent; }
-
- virtual void CreatePartyLobby( const idMatchParameters & parms_ );
- virtual void FindOrCreateMatch( const idMatchParameters & parms );
- virtual void CreateMatch( const idMatchParameters & parms_ );
- virtual void CreateGameStateLobby( const idMatchParameters & parms_ );
- virtual void UpdatePartyParms( const idMatchParameters & parms_ );
- virtual void UpdateMatchParms( const idMatchParameters & parms_ );
- virtual void StartMatch();
- virtual void SetSessionOption( sessionOption_t option ) { sessionOptions |= option; }
- virtual void ClearSessionOption( sessionOption_t option ) { sessionOptions &= ~option; }
- virtual sessionState_t GetBackState();
- virtual void Cancel();
- virtual void MoveToPressStart();
- virtual void FinishDisconnect();
- virtual bool ShouldShowMigratingDialog() const;
- virtual bool IsCurrentLobbyMigrating() const;
- virtual bool IsLosingConnectionToHost() const;
-
-
- virtual bool WasMigrationGame() const;
- virtual bool ShouldRelaunchMigrationGame() const;
- virtual bool GetMigrationGameData( idBitMsg & msg, bool reading );
- virtual bool GetMigrationGameDataUser( lobbyUserID_t lobbyUserID, idBitMsg & msg, bool reading );
- virtual bool WasGameLobbyCoalesced() const { return gameLobbyWasCoalesced; }
-
- virtual int GetLoadingID() { return loadingID; }
- virtual bool IsAboutToLoad() const { return GetGameLobby().IsLobbyActive() && GetGameLobby().startLoadingFromHost; }
- virtual bool GetMatchParamUpdate( int &peer, int &msg );
- virtual int GetInputRouting( int inputRouting[ MAX_INPUT_DEVICES ] );
- virtual void EndMatch( bool premature=false );
- virtual void MatchFinished();
- virtual void QuitMatch();
- virtual void QuitMatchToTitle();
- virtual void LoadingFinished();
- virtual void Pump();
- virtual void ProcessSnapAckQueue();
- virtual sessionState_t GetState() const;
- virtual const char * GetStateString() const ;
-
- virtual void SendUsercmds( idBitMsg & msg );
- virtual void SendSnapshot( idSnapShot & ss );
- virtual const char * GetPeerName( int peerNum );
- virtual const char * GetLocalUserName( int i ) const { return signInManager->GetLocalUserByIndex( i )->GetGamerTag(); }
- virtual void UpdateSignInManager();
- virtual idPlayerProfile * GetProfileFromMasterLocalUser();
- virtual void PrePickNewHost( idLobby & lobby, bool forceMe, bool inviteOldHost );
- virtual bool PreMigrateInvite( idLobby & lobby );
-
-
-
- virtual float GetTitleStorageFloat( const char * name, float defaultFloat ) const { return titleStorageVars.GetFloat( name, defaultFloat ); }
- virtual int GetTitleStorageInt( const char * name, int defaultInt ) const { return titleStorageVars.GetInt( name, defaultInt ); }
- virtual bool GetTitleStorageBool( const char * name, bool defaultBool ) const { return titleStorageVars.GetBool( name, defaultBool ); }
- virtual const char * GetTitleStorageString( const char * name, const char * defaultString ) const { return titleStorageVars.GetString( name, defaultString ); }
- virtual bool GetTitleStorageFloat( const char * name, float defaultFloat, float & out ) const { return titleStorageVars.GetFloat( name, defaultFloat, out ); }
- virtual bool GetTitleStorageInt( const char * name, int defaultInt, int & out ) const { return titleStorageVars.GetInt( name, defaultInt, out ); }
- virtual bool GetTitleStorageBool( const char * name, bool defaultBool, bool & out ) const { return titleStorageVars.GetBool( name, defaultBool, out ); }
- virtual bool GetTitleStorageString( const char * name, const char * defaultString, const char ** out ) const { return titleStorageVars.GetString( name, defaultString, out ); }
- virtual bool IsTitleStorageLoaded() { return titleStorageLoaded; }
-
-
-
- virtual voiceState_t GetLobbyUserVoiceState( lobbyUserID_t lobbyUserID );
- virtual voiceStateDisplay_t GetDisplayStateFromVoiceState( voiceState_t voiceState ) const;
- virtual void ToggleLobbyUserVoiceMute( lobbyUserID_t lobbyUserID );
- virtual void SetActiveChatGroup( int groupIndex );
- virtual void UpdateMasterUserHeadsetState();
-
-
-
- virtual bool StartOrContinueBandwidthChallenge( bool forceStart );
- virtual void DebugSetPeerSnaprate( int peerIndex, int snapRateMS );
- virtual float GetIncomingByteRate();
-
-
-
- virtual void HandleBootableInvite( int64 lobbyId = 0 ) = 0;
- virtual void ClearBootableInvite() = 0;
- virtual void ClearPendingInvite() = 0;
- virtual bool HasPendingBootableInvite() = 0;
- virtual void SetDiscSwapMPInvite( void * parm ) = 0;
- virtual void * GetDiscSwapMPInviteParms() = 0;
- virtual bool IsDiscSwapMPInviteRequested() const { return inviteInfoRequested; }
- bool GetFlushedStats() { return flushedStats; }
- void SetFlushedStats( bool _flushedStats ) { flushedStats = _flushedStats; }
-
-
-
-
-
- virtual void OnLocalUserSignin( idLocalUser * user );
- virtual void OnLocalUserSignout( idLocalUser * user );
-
- virtual void OnMasterLocalUserSignout();
- virtual void OnMasterLocalUserSignin();
-
- virtual void OnLocalUserProfileLoaded( idLocalUser * user );
-
-
-
- virtual void Initialize() = 0;
- virtual void Shutdown() = 0;
- virtual void InitializeSoundRelatedSystems() = 0;
- virtual void ShutdownSoundRelatedSystems() = 0;
- virtual void PlatformPump() = 0;
- virtual void InviteFriends() = 0;
- virtual void InviteParty() = 0;
- virtual void ShowPartySessions() = 0;
- virtual bool ProcessInputEvent( const sysEvent_t * ev ) = 0;
-
- virtual int NumServers() const = 0;
- virtual void ListServers( const idCallback & callback ) = 0;
- virtual void ListServersCommon();
- virtual void CancelListServers() = 0;
- virtual void ConnectToServer( int i ) = 0;
- virtual const serverInfo_t * ServerInfo( int i ) const = 0;
- virtual const idList< idStr > * ServerPlayerList( int i );
- virtual void ShowServerGamerCardUI( int i ) = 0;
- virtual void HandleServerQueryRequest( lobbyAddress_t & remoteAddr, idBitMsg & msg, int msgType ) = 0;
- virtual void HandleServerQueryAck( lobbyAddress_t & remoteAddr, idBitMsg & msg ) = 0;
-
- virtual bool IsSystemUIShowing() const = 0;
- virtual void SetSystemUIShowing( bool show ) = 0;
- virtual void ShowSystemMarketplaceUI() const = 0;
- virtual void ShowLobbyUserGamerCardUI( lobbyUserID_t lobbyUserID ) = 0;
-
- virtual void LeaderboardUpload( lobbyUserID_t lobbyUserID, const leaderboardDefinition_t * leaderboard, const column_t * stats, const idFile_Memory * attachment = NULL ) = 0;
- virtual void LeaderboardDownload( int sessionUserIndex, const leaderboardDefinition_t * leaderboard, int startingRank, int numRows, const idLeaderboardCallback & callback ) = 0;
- virtual void LeaderboardDownloadAttachment( int sessionUserIndex, const leaderboardDefinition_t * leaderboard, int64 attachmentID ) = 0;
-
- virtual void SetLobbyUserRelativeScore( lobbyUserID_t lobbyUserID, int relativeScore, int team ) = 0;
- virtual void LeaderboardFlush() = 0;
-
-
-
- virtual saveGameHandle_t SaveGameSync( const char * name, const saveFileEntryList_t & files, const idSaveGameDetails & description );
- virtual saveGameHandle_t SaveGameAsync( const char * name, const saveFileEntryList_t & files, const idSaveGameDetails & description );
- virtual saveGameHandle_t LoadGameSync( const char * name, saveFileEntryList_t & files );
- virtual saveGameHandle_t EnumerateSaveGamesSync();
- virtual saveGameHandle_t EnumerateSaveGamesAsync();
- virtual saveGameHandle_t DeleteSaveGameSync( const char * name );
- virtual saveGameHandle_t DeleteSaveGameAsync( const char * name );
- virtual bool IsSaveGameCompletedFromHandle( const saveGameHandle_t & handle ) const { return saveGameManager->IsSaveGameCompletedFromHandle( handle ); }
- virtual void CancelSaveGameWithHandle( const saveGameHandle_t & handle ) { GetSaveGameManager().CancelWithHandle( handle ); }
- virtual const saveGameDetailsList_t & GetEnumeratedSavegames() const { return saveGameManager->GetEnumeratedSavegames(); }
- virtual bool IsEnumerating() const;
- virtual saveGameHandle_t GetEnumerationHandle() const;
- virtual void SetCurrentSaveSlot( const char * slotName ) { currentSaveSlot = slotName; }
- virtual const char * GetCurrentSaveSlot() const { return currentSaveSlot.c_str(); }
-
- void OnSaveCompleted( idSaveLoadParms * parms );
- void OnLoadCompleted( idSaveLoadParms * parms );
- void OnDeleteCompleted( idSaveLoadParms * parms );
- void OnEnumerationCompleted( idSaveLoadParms * parms );
-
- virtual bool IsDLCAvailable( const char * mapName );
- virtual bool LoadGameCheckDiscNumber( idSaveLoadParms & parms );
- bool LoadGameCheckDescriptionFile( idSaveLoadParms & parms );
-
- virtual void EnumerateDownloadableContent() = 0;
- void DropClient( int peerNum, int session );
- protected:
- float GetUpstreamDropRate() { return upstreamDropRate; }
- float GetUpstreamQueueRate() { return upstreamQueueRate; }
- int GetQueuedBytes() { return queuedBytes; }
-
-
-
- void HandleLobbyControllerState( int lobbyType );
- virtual void UpdatePendingInvite();
- bool HandleState();
-
- idLobby & GetPartyLobby() { return partyLobby; }
- const idLobby & GetPartyLobby() const { return partyLobby; }
- idLobby & GetGameLobby() { return gameLobby; }
- const idLobby & GetGameLobby() const { return gameLobby; }
-
-
-
-
- idLobby & GetGameStateLobby() { return gameStateLobby; }
- const idLobby & GetGameStateLobby() const { return gameStateLobby; }
- idLobby & GetActingGameStateLobby();
- const idLobby & GetActingGameStateLobby() const;
-
-
-
- idLobby * GetActivePlatformLobby();
- const idLobby * GetActivePlatformLobby() const;
-
- idLobby * GetLobbyFromType( idLobby::lobbyType_t lobbyType );
- virtual idLobbyBase & GetPartyLobbyBase() { return partyLobby; }
- virtual idLobbyBase & GetGameLobbyBase() { return gameLobby; }
- virtual idLobbyBase & GetActingGameStateLobbyBase() { return GetActingGameStateLobby(); }
- virtual idLobbyBase & GetActivePlatformLobbyBase();
- virtual idLobbyBase & GetLobbyFromLobbyUserID( lobbyUserID_t lobbyUserID );
- void SetState( state_t newState );
- bool HandlePackets();
- void HandleVoiceRestrictionDialog();
- void SetDroppedByHost( bool dropped ) { droppedByHost = dropped; }
- bool GetDroppedByHost() { return droppedByHost; }
- public:
- int storedPeer;
- int storedMsgType;
- protected:
- static const char * stateToString[ NUM_STATES ];
- state_t localState;
- uint32 sessionOptions;
- connectType_t connectType;
- int connectTime;
- idLobby partyLobby;
- idLobby gameLobby;
- idLobby gameStateLobby;
- idLobbyStub stubLobby;
- int currentID;
- class idVoiceChatMgr * voiceChat;
- int lastVoiceSendtime;
- bool hasShownVoiceRestrictionDialog;
- pendingInviteMode_t pendingInviteMode;
- int pendingInviteDevice;
- lobbyConnectInfo_t pendingInviteConnectInfo;
- bool isSysUIShowing;
- idDict titleStorageVars;
- bool titleStorageLoaded;
- int showMigratingInfoStartTime;
- int nextGameCoalesceTime;
- bool gameLobbyWasCoalesced;
- int numFullSnapsReceived;
-
- bool flushedStats;
- int loadingID;
- bool inviteInfoRequested;
- idSaveGameProcessorSaveFiles * processorSaveFiles;
- idSaveGameProcessorLoadFiles * processorLoadFiles;
- idSaveGameProcessorDelete * processorDelete;
- idSaveGameProcessorEnumerateGames * processorEnumerate;
- idStr currentSaveSlot;
- saveGameHandle_t enumerationHandle;
-
-
-
- bool State_Party_Lobby_Host();
- bool State_Party_Lobby_Peer();
- bool State_Game_Lobby_Host();
- bool State_Game_Lobby_Peer();
- bool State_Game_State_Lobby_Host();
- bool State_Game_State_Lobby_Peer();
- bool State_Loading();
- bool State_InGame();
- bool State_Find_Or_Create_Match();
- bool State_Create_And_Move_To_Party_Lobby();
- bool State_Create_And_Move_To_Game_Lobby();
- bool State_Create_And_Move_To_Game_State_Lobby();
- bool State_Connect_And_Move_To_Party();
- bool State_Connect_And_Move_To_Game();
- bool State_Connect_And_Move_To_Game_State();
- bool State_Finalize_Connect();
- bool State_Busy();
-
-
-
- static const int MAX_CONTENT_PACKAGES = 16;
- idStaticList<contentData_t, MAX_CONTENT_PACKAGES> downloadedContent;
- bool marketplaceHasNewContent;
- class idQueuePacket {
- public:
- byte data[ idPacketProcessor::MAX_FINAL_PACKET_SIZE ];
- lobbyAddress_t address;
- int size;
- int time;
- bool dedicated;
- idQueueNode<idQueuePacket> queueNode;
- };
- idBlockAlloc< idQueuePacket, 64, TAG_NETWORKING > packetAllocator;
- idQueue< idQueuePacket,&idQueuePacket::queueNode > sendQueue;
- idQueue< idQueuePacket,&idQueuePacket::queueNode > recvQueue;
- float upstreamDropRate;
- int upstreamDropRateTime;
- float upstreamQueueRate;
- int upstreamQueueRateTime;
- int queuedBytes;
- int waitingOnGameStateMembersToLeaveTime;
- int waitingOnGameStateMembersToJoinTime;
- void TickSendQueue();
- void QueuePacket( idQueue< idQueuePacket,&idQueuePacket::queueNode > & queue, int time, const lobbyAddress_t & to, const void * data, int size, bool dedicated );
- bool ReadRawPacketFromQueue( int time, lobbyAddress_t & from, void * data, int & size, bool & outDedicated, int maxSize );
- void SendRawPacket( const lobbyAddress_t & to, const void * data, int size, bool dedicated );
- bool ReadRawPacket( lobbyAddress_t & from, void * data, int & size, bool & outDedicated, int maxSize );
- void ConnectAndMoveToLobby( idLobby & lobby, const lobbyConnectInfo_t & connectInfo, bool fromInvite );
- void GoodbyeFromHost( idLobby & lobby, int peerNum, const lobbyAddress_t & remoteAddress, int msgType );
- void WriteLeaderboardToMsg( idBitMsg & msg, const leaderboardDefinition_t * leaderboard, const column_t * stats );
- void SendLeaderboardStatsToPlayer( lobbyUserID_t lobbyUserID, const leaderboardDefinition_t * leaderboard, const column_t * stats );
- void RecvLeaderboardStatsForPlayer( idBitMsg & msg );
- const leaderboardDefinition_t * ReadLeaderboardFromMsg( idBitMsg & msg, column_t * stats );
- bool RequirePersistentMaster();
-
- virtual idNetSessionPort & GetPort( bool dedicated = false ) = 0;
- virtual idLobbyBackend * CreateLobbyBackend( const idMatchParameters & p, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType ) = 0;
- virtual idLobbyBackend * FindLobbyBackend( const idMatchParameters & p, int numPartyUsers, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType ) = 0;
- virtual idLobbyBackend * JoinFromConnectInfo( const lobbyConnectInfo_t & connectInfo , idLobbyBackend::lobbyBackendType_t lobbyType ) = 0;
- virtual void DestroyLobbyBackend( idLobbyBackend * lobby ) = 0;
- virtual void PumpLobbies() = 0;
- virtual bool GetLobbyAddressFromNetAddress( const netadr_t & netAddr, lobbyAddress_t & outAddr ) const = 0;
- virtual bool GetNetAddressFromLobbyAddress( const lobbyAddress_t & lobbyAddress, netadr_t & outNetAddr ) const = 0;
- void HandleDedicatedServerQueryRequest( lobbyAddress_t & remoteAddr, idBitMsg & msg, int msgType );
- void HandleDedicatedServerQueryAck( lobbyAddress_t & remoteAddr, idBitMsg & msg );
- void ClearMigrationState();
-
- void EndMatchInternal( bool premature=false );
-
- void MatchFinishedInternal();
- void EndMatchForMigration();
- void MoveToPressStart( gameDialogMessages_t msg );
-
- void SendVoiceAudio();
- void HandleOobVoiceAudio( const lobbyAddress_t & from, const idBitMsg & msg );
- void SetVoiceGroupsToTeams();
- void ClearVoiceGroups();
-
- void StartSessions();
- void EndSessions();
- void SetLobbiesAreJoinable( bool joinable );
- void MoveToMainMenu();
- bool WaitOnLobbyCreate( idLobby & lobby );
- bool DetectDisconnectFromService( bool cancelAndShowMsg );
- void HandleConnectionFailed( idLobby & lobby, bool wasFull );
- void ConnectToNextSearchResultFailed( idLobby & lobby );
- bool HandleConnectAndMoveToLobby( idLobby & lobby );
- void VerifySnapshotInitialState();
- void ComputeNextGameCoalesceTime();
- void StartLoading();
- bool ShouldHavePartyLobby();
- void ValidateLobbies();
- void ValidateLobby( idLobby & lobby );
- void ReadTitleStorage( void * buffer, int bufferLen );
- bool ReadDLCInfo( idDict & dlcInfo, void * buffer, int bufferLen );
- idSessionCallbacks * sessionCallbacks;
- int offlineTransitionTimerStart;
- bool droppedByHost;
- };
- class idSessionLocalCallbacks : public idSessionCallbacks {
- public:
- idSessionLocalCallbacks( idSessionLocal * sessionLocal_ ) { sessionLocal = sessionLocal_; }
- virtual idLobby & GetPartyLobby() { return sessionLocal->GetPartyLobby(); }
- virtual idLobby & GetGameLobby() { return sessionLocal->GetGameLobby(); }
- virtual idLobby & GetActingGameStateLobby() { return sessionLocal->GetActingGameStateLobby(); }
- virtual idLobby * GetLobbyFromType( idLobby::lobbyType_t lobbyType ) { return sessionLocal->GetLobbyFromType( lobbyType ); }
- virtual int GetUniquePlayerId() const { return sessionLocal->currentID++; }
- virtual idSignInManagerBase & GetSignInManager() { return *sessionLocal->signInManager; }
- virtual void SendRawPacket( const lobbyAddress_t & to, const void * data, int size, bool useDirectPort ) { sessionLocal->SendRawPacket( to, data, size, useDirectPort ); }
-
- virtual bool BecomingHost( idLobby & lobby );
- virtual void BecameHost( idLobby & lobby );
- virtual bool BecomingPeer( idLobby & lobby );
- virtual void BecamePeer( idLobby & lobby );
- virtual void FailedGameMigration( idLobby & lobby );
- virtual void MigrationEnded( idLobby & lobby );
- virtual void GoodbyeFromHost( idLobby & lobby, int peerNum, const lobbyAddress_t & remoteAddress, int msgType );
- virtual uint32 GetSessionOptions() { return sessionLocal->sessionOptions; }
- virtual bool AnyPeerHasAddress( const lobbyAddress_t & remoteAddress ) const;
- virtual idSession::sessionState_t GetState() const { return sessionLocal->GetState(); }
- virtual void ClearMigrationState() { GetPartyLobby().ResetAllMigrationState(); GetGameLobby().ResetAllMigrationState(); }
- virtual void EndMatchInternal( bool premature=false ) { sessionLocal->EndMatchInternal( premature ); }
- virtual void RecvLeaderboardStats( idBitMsg & msg );
- virtual void ReceivedFullSnap();
- virtual void LeaveGameLobby();
-
- virtual void PrePickNewHost( idLobby & lobby, bool forceMe, bool inviteOldHost );
- virtual bool PreMigrateInvite( idLobby & lobby );
- virtual void HandleOobVoiceAudio( const lobbyAddress_t & from, const idBitMsg & msg ) { sessionLocal->HandleOobVoiceAudio( from, msg ); }
- virtual void ConnectAndMoveToLobby( idLobby::lobbyType_t destLobbyType, const lobbyConnectInfo_t & connectInfo, bool waitForPartyOk );
- virtual idVoiceChatMgr * GetVoiceChat() { return sessionLocal->voiceChat; }
- virtual void HandleServerQueryRequest( lobbyAddress_t & remoteAddr, idBitMsg & msg, int msgType );
- virtual void HandleServerQueryAck( lobbyAddress_t & remoteAddr, idBitMsg & msg );
- virtual void HandlePeerMatchParamUpdate( int peer, int msg );
- virtual idLobbyBackend * CreateLobbyBackend( const idMatchParameters & p, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType );
- virtual idLobbyBackend * FindLobbyBackend( const idMatchParameters & p, int numPartyUsers, float skillLevel, idLobbyBackend::lobbyBackendType_t lobbyType );
- virtual idLobbyBackend * JoinFromConnectInfo( const lobbyConnectInfo_t & connectInfo , idLobbyBackend::lobbyBackendType_t lobbyType );
- virtual void DestroyLobbyBackend( idLobbyBackend * lobby );
- idSessionLocal * sessionLocal;
- };
|