本文整理汇总了C++中CSession::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ CSession::Update方法的具体用法?C++ CSession::Update怎么用?C++ CSession::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSession
的用法示例。
在下文中一共展示了CSession::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XBL_MM_RemovePlayer
// decrement the player count advertised on this session
//
DWORD XBL_MM_RemovePlayer( bool usePrivateSlot )
{
if(!logged_on || !session.Exists())
return -1;
// The value we're given only tells us if they were eligble for a private slot when
// they joined, but they may have actually ended up in a public slot. As such, this
// can get pretty wacky. Oh well.
if ( usePrivateSlot && session.PrivateFilled )
{
session.PrivateFilled--;
session.PrivateOpen++;
session.TotalPlayers--;
}
else
{
if ( session.PublicFilled )
{
session.PublicFilled--;
session.PublicOpen++;
session.TotalPlayers--;
}
else
{
assert( 0 );
}
}
session.Update();
return 0;
}
示例2: XBL_MM_AddPlayer
// increment the player count advertised on this session
//
DWORD XBL_MM_AddPlayer( bool usePrivateSlot )
{
if (!logged_on || !session.Exists())
return -1;
// SOF2 had a really bad system that checked for server's friends. We do what
// MS says is good - all invites/joins go into private, everyone else goes public.
if( usePrivateSlot && session.PrivateOpen )
{
session.PrivateFilled++;
session.PrivateOpen--;
session.TotalPlayers++;
}
else
{
// Either joined via matchmaking, or we don't have any more private slots
// Give them a public slot.
if ( session.PublicOpen )
{
session.PublicFilled++;
session.PublicOpen--;
session.TotalPlayers++;
}
else
{
assert( 0 );
}
}
session.Update();
return 0;
}
示例3: XBL_MM_Update_Session
void XBL_MM_Update_Session()
{
// VVFIXME - Do we need to ensure that slot counts are right?
// Our gamertag hasn't changed (I hope) so we leave that alone.
// 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;
// All other game options:
session.FriendlyFire = g_friendlyFire.integer;
session.JediMastery = g_maxForceRank.integer;
session.SaberOnly = HasSetSaberOnly();
session.Dedicated = com_dedicated->integer;
// Update the advertised session info
session.Update();
}