本文整理汇总了C++中CSession::Process方法的典型用法代码示例。如果您正苦于以下问题:C++ CSession::Process方法的具体用法?C++ CSession::Process怎么用?C++ CSession::Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSession
的用法示例。
在下文中一共展示了CSession::Process方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XBL_MM_Shutdown
// Finish off and tidy up match making
void XBL_MM_Shutdown( bool processLogon )
{
// We're killing our session, no matter what
session.Delete();
// XDK code to finish this off, while not letting the logon task expire,
// except if we're already leaving live, where we can get into a recursive
// com_error situation:
HRESULT hr;
do
{
if( processLogon && !XBL_PumpLogon() )
return;
hr = session.Process();
} while ( session.IsDeleting() );
}
示例2: XBL_MM_Tick
// run this code every game tick
// will only be called while logged on
//
void XBL_MM_Tick()
{
// VVFIXME - SOF2 re-advertised after some crazy timeout.
// New version just ticks the session object as well, it does nothing if it's not real
HRESULT hr = session.Process();
#ifdef _DEBUG
if ( FAILED( hr ) )
Com_Printf("session.Process() failed: %s\n", getXBLErrorName(hr));
#endif
// The only time we need to do async work on the query is when probing for QoS
if ( query.IsProbing() )
{
query.Process();
}
}
示例3: XBL_MM_Init_Session
// SOF2 had some silly two-stage thing. They stored off the session parms here, then used
// a couple globals to delay advertisement until later. I'm going to try and avoid that
void XBL_MM_Init_Session()
{
// Fill in # of slots. OpenPublic is total slots, minus one for server, minus # reserved for private
session.PrivateFilled = 0;
session.PrivateOpen = sv_privateClients->integer;
session.PublicFilled = (com_dedicated->integer ? 0 : 1); // Non-dedicated server fills a slot
session.PublicOpen = sv_maxclients->integer - (session.PrivateOpen + session.PublicFilled);
session.TotalPlayers = session.PublicFilled;
// Get current map index, and gametype
int index = mapNameToIndex( sv_mapname->string );
if (index == MAP_ARRAY_SIZE)
{
Com_Error( ERR_FATAL, "Bad map name: %s\n", sv_mapname->string );
}
session.CurrentMap = index;
session.GameType = sv_gametype->integer;
// Copy the host's gamertag to the session name
XONLINE_USER* pHostAccount = XBL_GetUserInfo( XBL_GetSelectedAccountIndex() );
WCHAR sessionName[XONLINE_GAMERTAG_SIZE] = { 0 };
if ( pHostAccount )
{
charToWchar( sessionName, pHostAccount->szGamertag );
}
else
{
charToWchar( sessionName, "unknown" );
}
session.SetSessionName( sessionName );
// All other game options:
session.FriendlyFire = g_friendlyFire.integer;
session.JediMastery = g_maxForceRank.integer;
session.SaberOnly = HasSetSaberOnly();
session.Dedicated = com_dedicated->integer;
// Actually create the session. If we don't call Process immediately, it explodes
HRESULT hr = session.Create();
if (hr != S_OK)
{
Com_Error( ERR_DROP, "Failed to create session: 0x%x\n", hr );
}
do
{
if( !XBL_PumpLogon() )
return;
hr = session.Process();
} while ( session.IsCreating() );
// VVFIXME - Better error handling
if ( !session.Exists() )
{
Com_Error( ERR_DROP, "Failed to create session #2: 0x%x\n", hr );
}
// Fix for a bug. Server was using Notification API before advertising, so for
// the first few seconds, had the wrong sessionID, and thus couldn't invite.
// Force an update now:
XBL_F_CheckJoinableStatus( true );
}