Commits

Didrole committed 3fbce02

Improved Test Platform.

  • Participants
  • Parent commits c8536b3

Comments (0)

Files changed (1)

File Test Platform/main.cpp

 	}
 	
 	HSteamPipe hPipe;
-	HSteamUser hUser = pClientEngine->CreateGlobalUser( &hPipe );
+	HSteamUser hUser = pClientEngine->CreateLocalUser(&hPipe, k_EAccountTypeIndividual);
 	if ( !hUser || !hPipe )
 	{
 		fprintf(stderr, "Unable to create the global user.\n");
 		fprintf(stderr, "Unable to get the client user interface.\n");
 		pClientEngine->ReleaseUser(hPipe, hUser);
 		pClientEngine->BReleaseSteamPipe(hPipe);
+		pClientEngine->BShutdownIfAllPipesClosed();
 		return 1;
 	}
 	
 		fprintf(stderr, "Unable to get the client friends interface.\n");
 		pClientEngine->ReleaseUser(hPipe, hUser);
 		pClientEngine->BReleaseSteamPipe(hPipe);
+		pClientEngine->BShutdownIfAllPipesClosed();
 		return 1;
 	}
 	
 
 	while ( true )
 	{
-		if ( Steam_BGetCallback( hPipe, &callBack ) )
+		while ( Steam_BGetCallback( hPipe, &callBack ) )
 		{
 			switch (callBack.m_iCallback)
 			{
 
 					pClientEngine->ReleaseUser(hPipe, hUser);
 					pClientEngine->BReleaseSteamPipe(hPipe);
+					pClientEngine->BShutdownIfAllPipesClosed();
 
 					return 1;
 				}
 							{
 								pClientFriends->SetPersonaState( k_EPersonaStateOffline );
 								pClientUser->LogOff();
+
+								while(pClientUser->GetLogonState() == k_ELogonStateLoggingOff)
+								{
+									#ifdef _WIN32
+											Sleep(100);
+									#else
+											usleep(100000);
+									#endif
+								}
+
 								pClientEngine->ReleaseUser(hPipe, hUser);
 								pClientEngine->BReleaseSteamPipe(hPipe);
+								pClientEngine->BShutdownIfAllPipesClosed();
 
 								return 0;
 							}
 		}
 
 #ifdef _WIN32
-		Sleep(10);
+		Sleep(100);
 #else
-		usleep(10000);
+		usleep(100000);
 #endif
 	}