Beispiel #1
0
//--------------------------------------------------------------------------------------
// Name: JoinSession()
// Desc: Join the session
//--------------------------------------------------------------------------------------
GS_BOOL SessionSrv::JoinSession()
{
#if defined(_XBOX) || defined(_XENON)
 	if (m_hSession == INVALID_HANDLE_VALUE)
		return FALSE;

    // Join the session
	CTaskID id = 0;
    GS_DWORD ret = XSessionJoinRemote(
        m_hSession,
		SignIn::GetUserNum(),
		SignIn::GetXUIDArray(),
		SignIn::GetIsPrivateArray(),
        Master::G()->GetTaskMgr()->AddTask(EGSTaskType_SessionJoin,this,&id) );
	Master::G()->GetTaskMgr()->StartTask(id,ret);

    if( ret != ERROR_IO_PENDING )
    {
        Master::G()->Log( "XSessionJoinRemote failed with error %d", ret );
        
		return FALSE;
    }

#endif
    return TRUE;
}
//-----------------------------------------------------------------------------
//	Purpose: Join remote users to a session
//-----------------------------------------------------------------------------
int	CXboxSystem::SessionJoinRemote( XboxHandle_t hSession, uint nUserCount, const XUID *pXuids, const bool *pPrivateSlots, bool bAsync, AsyncHandle_t *pAsyncHandle )
{
	XOVERLAPPED *pOverlapped = NULL;

	if ( bAsync )
	{
		AsyncResult_t *pResult = InitializeAsyncResult( &pAsyncHandle );
		pOverlapped = &pResult->overlapped;
	}

	return XSessionJoinRemote( hSession, nUserCount, pXuids, (BOOL*)pPrivateSlots, pOverlapped );
}