2012-11-26 18:58:24 +00:00
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Doom 3 BFG Edition GPL Source Code
2012-11-28 15:47:07 +00:00
Copyright ( C ) 1993 - 2012 id Software LLC , a ZeniMax Media company .
2012-11-26 18:58:24 +00:00
2012-11-28 15:47:07 +00:00
This file is part of the Doom 3 BFG Edition GPL Source Code ( " Doom 3 BFG Edition Source Code " ) .
2012-11-26 18:58:24 +00:00
Doom 3 BFG Edition Source Code is free software : you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with Doom 3 BFG Edition Source Code . If not , see < http : //www.gnu.org/licenses/>.
In addition , the Doom 3 BFG Edition Source Code is also subject to certain additional terms . You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code . If not , please request a copy in writing from id Software at the address below .
If you have questions concerning this license or the applicable additional terms , you may contact in writing id Software LLC , c / o ZeniMax Media Inc . , Suite 120 , Rockville , Maryland 20850 USA .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
# pragma hdrstop
2012-12-22 15:18:19 +00:00
# include "precompiled.h"
2012-11-26 18:58:24 +00:00
# include "../framework/Common_local.h"
# include "sys_session_local.h"
// The more the idLobby class needs to call back into this class, the more likely we're doing something wrong, and there is a better way.
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : BecomingHost
2012-11-28 15:47:07 +00:00
This is called when
2012-11-26 18:58:24 +00:00
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
bool idSessionLocalCallbacks : : BecomingHost ( idLobby & lobby )
{
if ( lobby . lobbyType = = idLobby : : TYPE_GAME )
{
if ( sessionLocal - > GetActivePlatformLobby ( ) ! = & lobby )
{
2012-11-26 18:58:24 +00:00
idLib : : Printf ( " BecomingHost: Must be past the party lobby to become host of a game lobby. \n " ) ;
return false ;
}
2012-11-28 15:47:07 +00:00
if ( sessionLocal - > localState = = idSessionLocal : : STATE_INGAME | | sessionLocal - > localState = = idSessionLocal : : STATE_LOADING )
{
2012-11-26 18:58:24 +00:00
// If we are in a game, go back to the lobby before becoming the new host of a game lobby
sessionLocal - > SetState ( idSessionLocal : : STATE_GAME_LOBBY_PEER ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// session mgr housekeeping that would usually be done through the standard EndMatch path
sessionLocal - > EndMatchForMigration ( ) ;
}
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
return true ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : BecameHost
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : BecameHost ( idLobby & lobby )
{
2012-11-26 18:58:24 +00:00
// If we were in the lobby when we switched to host, then set the right state
2012-11-28 15:47:07 +00:00
if ( lobby . lobbyType = = idLobby : : TYPE_PARTY & & sessionLocal - > localState = = idSessionLocal : : STATE_PARTY_LOBBY_PEER )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > SetState ( idSessionLocal : : STATE_PARTY_LOBBY_HOST ) ;
2012-11-28 15:47:07 +00:00
}
else if ( lobby . lobbyType = = idLobby : : TYPE_GAME & & sessionLocal - > localState = = idSessionLocal : : STATE_GAME_LOBBY_PEER )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > SetState ( idSessionLocal : : STATE_GAME_LOBBY_HOST ) ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : BecomingPeer
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
bool idSessionLocalCallbacks : : BecomingPeer ( idLobby & lobby )
{
if ( lobby . lobbyType = = idLobby : : TYPE_GAME )
{
if ( sessionLocal - > localState = = idSessionLocal : : STATE_INGAME | | sessionLocal - > localState = = idSessionLocal : : STATE_LOADING )
{
2012-11-26 18:58:24 +00:00
// Go to the party lobby while we try to connect to the new host
// This isn't totally necessary but we want to end the current game now and go to some screen.
// When the connection goes through or fails will send the session mgr to the appropriate state (game lobby or main menu)
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// What happens if we got the game migration before the party migration?
sessionLocal - > SetState ( sessionLocal - > GetPartyLobby ( ) . IsHost ( ) ? idSessionLocal : : STATE_PARTY_LOBBY_HOST : idSessionLocal : : STATE_PARTY_LOBBY_PEER ) ;
// session mgr housekeeping that would usually be done through the standard EndMatch path
sessionLocal - > EndMatchForMigration ( ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
return true ; // return true tells the session that we want him to tell us when the connects/fails
}
}
return false ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : BecamePeer
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : BecamePeer ( idLobby & lobby )
{
if ( lobby . lobbyType = = idLobby : : TYPE_GAME )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > SetState ( idSessionLocal : : STATE_GAME_LOBBY_PEER ) ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : FailedGameMigration
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : FailedGameMigration ( idLobby & lobby )
{
2012-11-26 18:58:24 +00:00
// We failed to complete a game migration this could happen for a couple reasons:
// -The network invites failed / failed to join migrated session
// -There was nobody to invite
lobby . ResetAllMigrationState ( ) ;
2012-11-28 15:47:07 +00:00
if ( lobby . lobbyType = = idLobby : : TYPE_GAME ) // this check is a redundant since we should only get this CB from the game session
{
2012-11-26 18:58:24 +00:00
sessionLocal - > SetState ( idSessionLocal : : STATE_GAME_LOBBY_HOST ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// Make sure the sessions are joinable again
sessionLocal - > EndSessions ( ) ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : MigrationEnded
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : MigrationEnded ( idLobby & lobby )
{
if ( lobby . migrationInfo . persistUntilGameEndsData . wasMigratedGame )
{
2012-11-26 18:58:24 +00:00
# if 1
2012-11-28 15:47:07 +00:00
if ( lobby . lobbyType = = idLobby : : TYPE_GAME | | ( lobby . lobbyType = = idLobby : : TYPE_PARTY & & session - > GetState ( ) < = idSession : : PARTY_LOBBY ) )
{
2012-11-26 18:58:24 +00:00
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING ) ;
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING_WAITING ) ;
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING_RELAUNCHING ) ;
2012-11-28 15:47:07 +00:00
if ( lobby . GetNumLobbyUsers ( ) < = 1 )
{
if ( MatchTypeHasStats ( lobby . parms . matchFlags ) )
{
2012-11-26 18:58:24 +00:00
common - > Dialog ( ) . AddDialog ( GDM_MIGRATING_FAILED_DISBANDED_STATS , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ; // Game has disbanded
2012-11-28 15:47:07 +00:00
}
else
{
2012-11-26 18:58:24 +00:00
common - > Dialog ( ) . AddDialog ( GDM_MIGRATING_FAILED_DISBANDED , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ; // Game has disbanded
}
2012-11-28 15:47:07 +00:00
}
else
{
2012-11-26 18:58:24 +00:00
//common->Dialog().AddDialog( GDM_MIGRATING_FAILED_CONNECTION, DIALOG_ACCEPT, NULL, NULL, false, "", 0, true ); // Lost connection to game
2012-11-28 15:47:07 +00:00
if ( lobby . lobbyType = = idLobby : : TYPE_GAME & & MatchTypeHasStats ( lobby . parms . matchFlags ) )
{
2012-11-26 18:58:24 +00:00
// This means we came from a public match, so tell them they didn't lose stats
common - > Dialog ( ) . AddDialog ( GDM_HOST_CONNECTION_LOST_STATS , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ; // The connection to the host has been lost. This game will not count towards your ranking.
2012-11-28 15:47:07 +00:00
}
else
{
2012-11-26 18:58:24 +00:00
// This means we came from a private match, just say host quit
common - > Dialog ( ) . AddDialog ( GDM_HOST_CONNECTION_LOST , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ; // The connection to the host has been lost.
}
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
lobby . ResetAllMigrationState ( ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// Make sure the sessions are joinable again
sessionLocal - > EndSessions ( ) ;
}
# else
// If we get here, we migrated from a game
2012-11-28 15:47:07 +00:00
if ( lobby . GetNumLobbyUsers ( ) < = 1 & & lobby . lobbyType = = idLobby : : TYPE_GAME )
{
if ( ! MatchTypeIsJoinInProgress ( lobby . parms . matchFlags ) )
{
2012-11-26 18:58:24 +00:00
// Handles 'soft' failed game migration where we migrated from a game and are now alone
gameDialogMessages_t errorDlg = GDM_INVALID ;
lobby . migrationInfo . persistUntilGameEndsData . hasGameData = false ; // never restart the game if we are by ourselves
2012-11-28 15:47:07 +00:00
if ( lobby . migrationInfo . invites . Num ( ) > 0 )
{
2012-11-26 18:58:24 +00:00
// outstanding invites: migration failed
errorDlg = ( MatchTypeHasStats ( lobby . migrateMsgFlags ) & & ( sessionLocal - > GetFlushedStats ( ) = = false ) ) ? GDM_MIGRATING_FAILED_CONNECTION_STATS : GDM_MIGRATING_FAILED_CONNECTION ;
2012-11-28 15:47:07 +00:00
}
else
{
2012-11-26 18:58:24 +00:00
// there was no one to invite
errorDlg = ( MatchTypeHasStats ( lobby . migrateMsgFlags ) & & ( sessionLocal - > GetFlushedStats ( ) = = false ) ) ? GDM_MIGRATING_FAILED_DISBANDED_STATS : GDM_MIGRATING_FAILED_DISBANDED ;
}
2012-11-28 15:47:07 +00:00
if ( errorDlg ! = GDM_INVALID )
{
2012-11-26 18:58:24 +00:00
common - > Dialog ( ) . AddDialog ( errorDlg , DIALOG_ACCEPT , NULL , NULL , false ) ;
}
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING ) ;
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING_WAITING ) ;
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING_RELAUNCHING ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
FailedGameMigration ( lobby ) ;
}
2012-11-28 15:47:07 +00:00
}
else if ( lobby . lobbyType = = idLobby : : TYPE_PARTY )
{
if ( session - > GetState ( ) < = idSession : : PARTY_LOBBY )
{
2012-11-26 18:58:24 +00:00
// We got dropped the party lobby, let them know what happened
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING ) ;
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING_WAITING ) ;
common - > Dialog ( ) . ClearDialog ( GDM_MIGRATING_RELAUNCHING ) ;
2012-11-28 15:47:07 +00:00
if ( lobby . GetNumLobbyUsers ( ) < = 1 )
{
2012-11-26 18:58:24 +00:00
common - > Dialog ( ) . AddDialog ( GDM_MIGRATING_FAILED_DISBANDED , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ; // Game has disbanded
2012-11-28 15:47:07 +00:00
}
else
{
2012-11-26 18:58:24 +00:00
//common->Dialog().AddDialog( GDM_MIGRATING_FAILED_CONNECTION, DIALOG_ACCEPT, NULL, NULL, false, "", 0, true ); // Lost connection to game
common - > Dialog ( ) . AddDialog ( GDM_HOST_CONNECTION_LOST_STATS , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ;
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
lobby . ResetAllMigrationState ( ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// Make sure the sessions are joinable again
sessionLocal - > EndSessions ( ) ;
}
}
# endif
2012-11-28 15:47:07 +00:00
}
else if ( lobby . GetNumLobbyUsers ( ) < = 1 & & session - > GetState ( ) = = idSession : : PARTY_LOBBY )
{
2012-11-26 18:58:24 +00:00
// If they didn't come from a game, and are by themselves, just show the lobby disband msg
common - > Dialog ( ) . AddDialog ( GDM_LOBBY_DISBANDED , DIALOG_ACCEPT , NULL , NULL , false , " " , 0 , true ) ; // The lobby you were previously in has disbanded
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// Make sure the sessions are joinable again
sessionLocal - > EndSessions ( ) ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : GoodbyeFromHost
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : GoodbyeFromHost ( idLobby & lobby , int peerNum , const lobbyAddress_t & remoteAddress , int msgType )
{
sessionLocal - > GoodbyeFromHost ( lobby , peerNum , remoteAddress , msgType ) ;
2012-11-26 18:58:24 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : AnyPeerHasAddress
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
bool idSessionLocalCallbacks : : AnyPeerHasAddress ( const lobbyAddress_t & remoteAddress ) const
{
return sessionLocal - > GetPartyLobby ( ) . FindAnyPeer ( remoteAddress ) | | sessionLocal - > GetGameLobby ( ) . FindAnyPeer ( remoteAddress ) ;
2012-11-26 18:58:24 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : RecvLeaderboardStats
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : RecvLeaderboardStats ( idBitMsg & msg )
{
2012-11-26 18:58:24 +00:00
// Steam and PS3 just write them as they come per player, they don't need to flush
sessionLocal - > RecvLeaderboardStatsForPlayer ( msg ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : ReceivedFullSnap
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : ReceivedFullSnap ( )
{
2012-11-26 18:58:24 +00:00
// If we received a full snap, then we can transition into the INGAME state
sessionLocal - > numFullSnapsReceived + + ;
2012-11-28 15:47:07 +00:00
if ( sessionLocal - > numFullSnapsReceived < 2 )
{
2012-11-26 18:58:24 +00:00
return ;
}
2012-11-28 15:47:07 +00:00
if ( sessionLocal - > localState ! = idSessionLocal : : STATE_INGAME )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > GetActingGameStateLobby ( ) . QueueReliableMessage ( sessionLocal - > GetActingGameStateLobby ( ) . host , idLobby : : RELIABLE_IN_GAME ) ; // Let host know we are in game now
sessionLocal - > SetState ( idSessionLocal : : STATE_INGAME ) ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : LeaveGameLobby
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : LeaveGameLobby ( )
{
2012-11-26 18:58:24 +00:00
// Make sure we're in the game lobby
2012-11-28 15:47:07 +00:00
if ( session - > GetState ( ) ! = idSession : : GAME_LOBBY )
{
2012-11-26 18:58:24 +00:00
return ;
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// If we're the host of the party, only we are allowed to make this call
2012-11-28 15:47:07 +00:00
if ( sessionLocal - > GetPartyLobby ( ) . IsHost ( ) )
{
2012-11-26 18:58:24 +00:00
return ;
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
sessionLocal - > GetGameLobby ( ) . Shutdown ( ) ;
sessionLocal - > SetState ( idSessionLocal : : STATE_PARTY_LOBBY_PEER ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : PrePickNewHost
This is called when we have determined that we need to pick a new host .
Call PickNewHostInternal to continue on with the host picking process .
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : PrePickNewHost ( idLobby & lobby , bool forceMe , bool inviteOldHost )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > PrePickNewHost ( lobby , forceMe , inviteOldHost ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : PreMigrateInvite
This is called just before we get invited to a migrated session
If we return false , the invite will be ignored
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
bool idSessionLocalCallbacks : : PreMigrateInvite ( idLobby & lobby )
{
2012-11-26 18:58:24 +00:00
return sessionLocal - > PreMigrateInvite ( lobby ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : ConnectAndMoveToLobby
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : ConnectAndMoveToLobby ( idLobby : : lobbyType_t destLobbyType , const lobbyConnectInfo_t & connectInfo , bool waitForPartyOk )
{
2012-11-26 18:58:24 +00:00
2012-11-28 15:47:07 +00:00
// See if we are already in the game lobby
idLobby * lobby = sessionLocal - > GetLobbyFromType ( destLobbyType ) ;
if ( lobby = = NULL )
{
idLib : : Printf ( " RELIABLE_CONNECT_AND_MOVE_TO_LOBBY: Invalid lobby type. \n " ) ;
2012-11-26 18:58:24 +00:00
return ;
}
2012-11-28 15:47:07 +00:00
if ( lobby - > lobbyBackend ! = NULL & & lobby - > lobbyBackend - > IsOwnerOfConnectInfo ( connectInfo ) )
{
idLib : : Printf ( " RELIABLE_CONNECT_AND_MOVE_TO_LOBBY: Already in lobby. \n " ) ;
2012-11-26 18:58:24 +00:00
return ;
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// See if we are in a game, or loading into a game. If so, ignore invites from our party host
2012-11-28 15:47:07 +00:00
if ( destLobbyType = = idLobby : : TYPE_GAME | | destLobbyType = = idLobby : : TYPE_GAME_STATE )
{
if ( GetState ( ) = = idSession : : INGAME | | GetState ( ) = = idSession : : LOADING )
{
idLib : : Printf ( " RELIABLE_CONNECT_AND_MOVE_TO_LOBBY: In a different game, ignoring. \n " ) ;
2012-11-26 18:58:24 +00:00
return ;
}
}
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// End current game lobby
lobby - > Shutdown ( ) ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// waitForPartyOk will be true if the party host wants us to wait for his ok to stay in the lobby
lobby - > waitForPartyOk = waitForPartyOk ;
2012-11-28 15:47:07 +00:00
2012-11-26 18:58:24 +00:00
// Connect to new game lobby
sessionLocal - > ConnectAndMoveToLobby ( * lobby , connectInfo , true ) ; // Consider this an invite if party host told us to connect
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : HandleServerQueryRequest
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : HandleServerQueryRequest ( lobbyAddress_t & remoteAddr , idBitMsg & msg , int msgType )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > HandleServerQueryRequest ( remoteAddr , msg , msgType ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : HandleServerQueryAck
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : HandleServerQueryAck ( lobbyAddress_t & remoteAddr , idBitMsg & msg )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > HandleServerQueryAck ( remoteAddr , msg ) ;
}
extern idCVar net_headlessServer ;
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : HandlePeerMatchParamUpdate
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : HandlePeerMatchParamUpdate ( int peer , int msg )
{
if ( net_headlessServer . GetBool ( ) )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > storedPeer = peer ;
sessionLocal - > storedMsgType = msg ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : CreateLobbyBackend
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
idLobbyBackend * idSessionLocalCallbacks : : CreateLobbyBackend ( const idMatchParameters & p , float skillLevel , idLobbyBackend : : lobbyBackendType_t lobbyType )
{
2012-11-26 18:58:24 +00:00
return sessionLocal - > CreateLobbyBackend ( p , skillLevel , lobbyType ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : FindLobbyBackend
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
idLobbyBackend * idSessionLocalCallbacks : : FindLobbyBackend ( const idMatchParameters & p , int numPartyUsers , float skillLevel , idLobbyBackend : : lobbyBackendType_t lobbyType )
{
2012-11-26 18:58:24 +00:00
return sessionLocal - > FindLobbyBackend ( p , numPartyUsers , skillLevel , lobbyType ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : JoinFromConnectInfo
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
idLobbyBackend * idSessionLocalCallbacks : : JoinFromConnectInfo ( const lobbyConnectInfo_t & connectInfo , idLobbyBackend : : lobbyBackendType_t lobbyType )
{
2012-11-26 18:58:24 +00:00
return sessionLocal - > JoinFromConnectInfo ( connectInfo , lobbyType ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = =
idSessionLocalCallbacks : : DestroyLobbyBackend
= = = = = = = = = = = = = = = = = = = = = = = =
*/
2012-11-28 15:47:07 +00:00
void idSessionLocalCallbacks : : DestroyLobbyBackend ( idLobbyBackend * lobbyBackend )
{
2012-11-26 18:58:24 +00:00
sessionLocal - > DestroyLobbyBackend ( lobbyBackend ) ;
}