コード例 #1
0
ファイル: debug_client.cpp プロジェクト: AzyxWare/ryzom
void displayNetDebug ()
{
	CInterfaceManager	*pIM= CInterfaceManager::getInstance();
	float lineStep = ClientCfg.DebugLineStep;
	float line;

	// Initialize Pen //
	//----------------//
	// Create a shadow when displaying a text.
	TextContext->setShaded(true);
	// Set the font size.
	TextContext->setFontSize(ClientCfg.DebugFontSize);
	// Set the text color
	TextContext->setColor(ClientCfg.DebugFontColor);


	// BOTTOM RIGHT //
	//--------------//
	TextContext->setHotSpot(UTextContext::BottomRight);
	line = 0.f;
	// Database Synchronisation counter
	// Local Counter
	uint	val= pIM->getLocalSyncActionCounter() ;
	val&= pIM->getLocalSyncActionCounterMask();
	TextContext->printfAt(1.f, line, "Local Counter: %d", val);
	line += lineStep;
	// Inventory Counter
	val= pIM->getDbProp("SERVER:INVENTORY:COUNTER")->getValue32();
	val&= pIM->getLocalSyncActionCounterMask();
	TextContext->printfAt(1.f, line, "INVENTORY:COUNTER: %d", val);
	line += lineStep;
	// Exchange Counter
	val= pIM->getDbProp("SERVER:EXCHANGE:COUNTER")->getValue32();
	val&= pIM->getLocalSyncActionCounterMask();
	TextContext->printfAt(1.f, line, "EXCHANGE:COUNTER: %d", val);
	line += lineStep;
	// Programme Counter
	val= pIM->getDbProp("SERVER:TARGET:CONTEXT_MENU:COUNTER")->getValue32();
	val&= pIM->getLocalSyncActionCounterMask();
	TextContext->printfAt(1.f, line, "TARGET:CONTEXT_MENU:COUNTER: %d", val);
	line += lineStep;
	// User Counter
	val= pIM->getDbProp("SERVER:USER:COUNTER")->getValue32();
	val&= pIM->getLocalSyncActionCounterMask();
	TextContext->printfAt(1.f, line, "USER:COUNTER: %d", val);
	line += lineStep;
	line += lineStep;

	// SPhrase Execution Synchronisation Counter
	CSPhraseManager		*pPM= CSPhraseManager::getInstance();
	// Next action
	uint	srvVal= pIM->getDbProp(PHRASE_DB_COUNTER_NEXT)->getValue32();
	uint	locVal= pPM->getPhraseNextExecuteCounter() ;
	srvVal&= PHRASE_EXECUTE_COUNTER_MASK;
	locVal&= PHRASE_EXECUTE_COUNTER_MASK;
	TextContext->printfAt(1.f, line, "NextAction  (loc/srv): %d/%d", locVal, srvVal);
	line += lineStep;
	// CycleAction
	srvVal= pIM->getDbProp(PHRASE_DB_COUNTER_CYCLE)->getValue32();
	locVal= pPM->getPhraseCycleExecuteCounter();
	srvVal&= PHRASE_EXECUTE_COUNTER_MASK;
	locVal&= PHRASE_EXECUTE_COUNTER_MASK;
	TextContext->printfAt(1.f, line, "CycleAction (loc/srv): %d/%d", locVal, srvVal);
	line += lineStep;


	// BOTTOM MIDDLE //
	//--------------//
	TextContext->setHotSpot(UTextContext::BottomLeft);
	float	xUser= 0.3f;
	float	xWatched= 0.5f;
	// Display information about the debug entity slot.
	if(WatchedEntitySlot != CLFECOMMON::INVALID_SLOT)
	{
		line = 0.f;
		TextContext->printfAt(xWatched, line, "Watched");
		line += lineStep;
		// Get a pointer on the target.
		CEntityCL *watchedEntity = EntitiesMngr.entity(WatchedEntitySlot);
		if(watchedEntity)
			watchedEntity->displayDebugPropertyStages(xWatched, line, lineStep);
	}
	// Display information about the user
	if(UserEntity)
	{
		line = 0.f;
		TextContext->printfAt(xUser, line, "User");
		line += lineStep;
		UserEntity->displayDebugPropertyStages(xUser, line, lineStep);
	}

}