当前位置: 首页>>代码示例>>C++>>正文


C++ CSession::IsCreating方法代码示例

本文整理汇总了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 );
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:64,代码来源:XBLive_MM.cpp


注:本文中的CSession::IsCreating方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。