本文整理汇总了C++中CSession::IsCreating方法的典型用法代码示例。如果您正苦于以下问题:C++ CSession::IsCreating方法的具体用法?C++ CSession::IsCreating怎么用?C++ CSession::IsCreating使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSession
的用法示例。
在下文中一共展示了CSession::IsCreating方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}