Ejemplo n.º 1
0
void CScriptRMI::RegisterCVars()
{
	pLogRMIEvents = REGISTER_INT(
		"net_log_remote_methods", 0, VF_DUMPTODISK,
		"Log remote method invocations");
	pDisconnectOnError = REGISTER_INT(
		"net_disconnect_on_rmi_error", 0, VF_DUMPTODISK,
		"Disconnect remote connections on script exceptions during RMI calls");
}
Ejemplo n.º 2
0
bool CPersistantDebug::Init()
{
	// Init CVars
	m_pETLog = REGISTER_INT("cl_ETLog",0,VF_DUMPTODISK,"Logging (0=off, 1=editor.log, 2=editor.log + AIlog.log)");
	m_pETHideAll = REGISTER_INT("cl_ETHideAll",0,VF_DUMPTODISK,"Hide all tags (overrides all other options)");
	m_pETHideBehaviour = REGISTER_INT("cl_ETHideBehaviour",0,VF_DUMPTODISK,"Hide AI behavior tags");
	m_pETHideReadability = REGISTER_INT("cl_ETHideReadability",0,VF_DUMPTODISK,"Hide AI readability tags");
	m_pETHideAIDebug = REGISTER_INT("cl_ETHideAIDebug",0,VF_DUMPTODISK,"Hide AI debug tags");
	m_pETHideFlowgraph = REGISTER_INT("cl_ETHideFlowgraph",0,VF_DUMPTODISK,"Hide tags created by flowgraph");
	m_pETHideScriptBind = REGISTER_INT("cl_ETHideScriptBind",0,VF_DUMPTODISK,"Hide tags created by Lua script");
	m_pETFontSizeMultiplier = REGISTER_FLOAT("cl_ETFontSizeMultiplier",1.0f,VF_DUMPTODISK,"Global font size multiplier");
	m_pETMaxDisplayDistance = REGISTER_FLOAT("cl_ETMaxDisplayDistance",-2.0f,VF_DUMPTODISK,"Max display distance");
	m_pETColorOverrideEnable = REGISTER_INT("cl_ETColorOverrideEnable",0,VF_DUMPTODISK,"Global color override");
	m_pETColorOverrideR = REGISTER_FLOAT("cl_ETColorOverrideR",1.0f,VF_DUMPTODISK,"Global color override (RED)");
	m_pETColorOverrideG = REGISTER_FLOAT("cl_ETColorOverrideG",1.0f,VF_DUMPTODISK,"Global color override (GREEN)");
	m_pETColorOverrideB = REGISTER_FLOAT("cl_ETColorOverrideB",1.0f,VF_DUMPTODISK,"Global color override (BLUE)");

	m_pVisualConsole = REGISTER_INT_CB("VisualConsole", 0, VF_NULL, "writes console to screen", VisualLogCallback);
	if(m_pVisualConsole)
	{
		m_pVisualConsoleSubStr = REGISTER_STRING("VisualConsoleSubStr", "", VF_NULL, "writes console to screen if it matches substr");
	}

	Reset();

	return true;
}
void
onlp_snmp_platform_init(void)
{
    /**
     * This is the base of the platform:general:system tree
     */
    onlp_sys_info_t si;
    if(onlp_sys_info_get(&si) >= 0) {

#define REGISTER_STR(_index, _field)                                    \
        do {                                                            \
            platform_string_register(_index, #_field, (char*)si.onie_info._field); \
        } while(0)

#define REGISTER_INT(_index, _field)                                    \
        do {                                                            \
            platform_int_register(_index, #_field, si.onie_info._field); \
        } while(0)

        REGISTER_STR(1, product_name);
        REGISTER_STR(2, part_number);
        REGISTER_STR(3, serial_number);
        char* mstring = aim_fstrdup("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
                                    si.onie_info.mac[0], si.onie_info.mac[2], si.onie_info.mac[3],
                                    si.onie_info.mac[3], si.onie_info.mac[4], si.onie_info.mac[5]);
        platform_string_register(4, "mac", mstring);
        aim_free(mstring);

        REGISTER_INT(5,  mac_range);
        REGISTER_STR(6,  manufacturer);
        REGISTER_STR(7,  manufacture_date);
        REGISTER_STR(8,  vendor);
        REGISTER_STR(9,  platform_name);
        REGISTER_INT(10, device_version);
        REGISTER_STR(11, label_revision);
        REGISTER_STR(12, country_code);
        REGISTER_STR(13, diag_version);
        REGISTER_STR(14, service_tag);
        REGISTER_STR(15, onie_version);
    }
}
Ejemplo n.º 4
0
//------------------------------------------------------------------------
// Constructor
CPlaylistActivityTracker::CPlaylistActivityTracker()
    :	m_nKnownPlaylists( 0 )
    , m_state( eATS_Idle )
    , m_timeUntilNextAction( -1.0f )
{
    m_serverNameCVar = REGISTER_STRING( "g_playlistActivity_server", k_defaultPlaylistActivityServerName, 0, "Usage: g_playlistActivity_server <ip or hostname>\n" );
    m_serverPortCVar = REGISTER_INT( "g_playlistActivity_port", k_defaultPlaylistActivityServerPort, 0, "Usage: g_playlistActivity_port <port>\n" );

    for( int i = 0; i < eRTT_MaxCount; i++ )
    {
        m_downloadableResources[ i ] = NULL;
    }
}
Ejemplo n.º 5
0
bool CEditorGame::Init(ISystem *pSystem,IGameToEditorInterface *pGameToEditorInterface)
{
	assert(pSystem);

	SSystemInitParams startupParams;
	startupParams.bEditor = true;
	startupParams.pSystem = pSystem;
	startupParams.bExecuteCommandLine=false;		// in editor we do it later - after other things are initialized

	m_pGameStartup = CreateGameStartup();

	m_pGame = m_pGameStartup->Init(startupParams);

	if (!m_pGame)
	{
		return false;
	}

	IGameFramework* pGameFramework = m_pGame->GetIGameFramework();
	if ( pGameFramework != NULL )
	{
		pGameFramework->InitEditor( pGameToEditorInterface );
	}

	InitUIEnums(pGameToEditorInterface);

	gEnv->bServer = true;
	gEnv->bMultiplayer = false;

#if !defined(XENON) && !defined(PS3) && !defined(GRINGO)
	gEnv->SetIsClient(true);
#endif

	m_bUsingMultiplayerGameRules = false;

	s_pEditorGameMode = REGISTER_INT( "net_gamemode", 0, 0, "Should editor connect a new client?");
	s_pEditorGameMode->SetOnChangeCallback(&OnChangeEditorMode);

	SetGameMode(false);

	REGISTER_COMMAND( "net_reseteditorclient", ResetClient, 0, "Resets player and gamerules!" );

	ConfigureNetContext(true);
		
	return true;
}
// Description:
//
// Arguments:
//
// Return:
//
void CVisualLog::InitCVars()
{
	m_pCVVisualLog = REGISTER_INT( "cl_visualLog", 0, 0, "Enables Visual Logging." );
	m_pCVVisualLogFolder = REGISTER_STRING( "cl_visualLogFolder", "VisualLog", 0, "Specifies sub folder to write logs to." );
	m_pCVVisualLogImageFormat = REGISTER_STRING( "cl_visualLogImageFormat", "bmp", 0, "Specifies file format of captured files (jpg, bmp)." );
	m_pCVVisualLogImageScale = REGISTER_FLOAT( "cl_visualLogImageScale", 128, 0, "Image size. [0-1] = scale value. >1 = actual pixels for image width" );

	assert(gEnv->pConsole);
	PREFAST_ASSUME(gEnv->pConsole);
	m_pCV_capture_frames = gEnv->pConsole->GetCVar("capture_frames");
	m_pCV_capture_file_format = gEnv->pConsole->GetCVar("capture_file_format");
	m_pCV_capture_frame_once = gEnv->pConsole->GetCVar("capture_frame_once");
	m_pCV_capture_file_name = gEnv->pConsole->GetCVar("capture_file_name");

	CRY_ASSERT( m_pCV_capture_frames );
	CRY_ASSERT( m_pCV_capture_file_format );
	CRY_ASSERT( m_pCV_capture_frame_once );
	CRY_ASSERT( m_pCV_capture_file_name );
}
Ejemplo n.º 7
0
void CVar::Init( struct IConsole *pConsole )
{
	assert(gEnv->pConsole);
	PREFAST_ASSUME(gEnv->pConsole);

	REGISTER_COMMAND("es_dump_entities", (ConsoleCommandFunc)DumpEntities, 0, "Dumps current entities and their states!");
	REGISTER_COMMAND("es_dump_entity_classes_in_use", (ConsoleCommandFunc)DumpEntityClassesInUse, 0, "Dumps all used entity classes");
	REGISTER_COMMAND("es_compile_area_grid", (ConsoleCommandFunc)CompileAreaGrid, 0, "Trigger a recompile of the area grid");
	REGISTER_COMMAND("es_dump_bookmarks", (ConsoleCommandFunc)DumpEntityBookmarks, 0, "Dumps information about all bookmarked entities");
	REGISTER_COMMAND("es_AudioListenerOffset", (ConsoleCommandFunc)SetAudioListenerOffsets, 0,
		"Sets by how much the audio listener offsets its position and rotation in regards to its entity.\n"
		"Usage: es_AudioListenerOffset PosX PosY PosZ RotX RotY RotZ\n");

	REGISTER_CVAR( es_SortUpdatesByClass, 0, 0, "Sort entity updates by class (possible optimization)" );
	pDebug = REGISTER_INT("es_debug",0,VF_CHEAT,
		"Enable entity debugging info\n"
		"Usage: es_debug [0/1]\n"
		"Default is 0 (on).");
	pCharacterIK = REGISTER_INT("p_CharacterIK",1,VF_CHEAT,
		"Toggles character IK.\n"
		"Usage: p_characterik [0/1]\n"
		"Default is 1 (on). Set to 0 to disable inverse kinematics.");	
	pEntityBBoxes = REGISTER_INT("es_bboxes",0,VF_CHEAT,
		"Toggles entity bounding boxes.\n"
		"Usage: es_bboxes [0/1]\n"
		"Default is 0 (off). Set to 1 to display bounding boxes.");
	pEntityHelpers = REGISTER_INT("es_helpers",0,VF_CHEAT,
		"Toggles helpers.\n"
		"Usage: es_helpers [0/1]\n"
		"Default is 0 (off). Set to 1 to display entity helpers.");
	pProfileEntities = REGISTER_INT("es_profileentities",0,VF_CHEAT,
		"Usage: es_profileentities 1,2,3\n"
		"Default is 0 (off).");
/*	pUpdateInvisibleCharacter = REGISTER_INT("es_UpdateInvisibleCharacter",0,VF_CHEAT,
		"Usage: \n"
		"Default is 0 (off).");
	pUpdateBonePositions = REGISTER_INT("es_UpdateBonePositions",1,VF_CHEAT,
		"Usage: \n"
		"Default is 1 (on).");
*/	pUpdateScript = REGISTER_INT("es_UpdateScript",1,VF_CHEAT,
		"Usage: es_UpdateScript [0/1]\n"
		"Default is 1 (on).");
	pUpdatePhysics = REGISTER_INT("es_UpdatePhysics",1,VF_CHEAT,
		"Toggles updating of entity physics.\n"
		"Usage: es_UpdatePhysics [0/1]\n"
		"Default is 1 (on). Set to 0 to prevent entity physics from updating.");
	pUpdateAI = REGISTER_INT("es_UpdateAI",1,VF_CHEAT,
		"Toggles updating of AI entities.\n"
		"Usage: es_UpdateAI [0/1]\n"
		"Default is 1 (on). Set to 0 to prevent AI entities from updating.");
	pUpdateEntities = REGISTER_INT("es_UpdateEntities",1,VF_CHEAT,
		"Toggles entity updating.\n"
		"Usage: es_UpdateEntities [0/1]\n"
		"Default is 1 (on). Set to 0 to prevent all entities from updating.");
	pUpdateCollision= REGISTER_INT("es_UpdateCollision",1,VF_CHEAT,
		"Toggles updating of entity collisions.\n"
		"Usage: es_UpdateCollision [0/1]\n"
		"Default is 1 (on). Set to 0 to disable entity collision updating.");
	pUpdateContainer= REGISTER_INT("es_UpdateContainer",1,VF_CHEAT,
		"Usage: es_UpdateContainer [0/1]\n"
		"Default is 1 (on).");
	pUpdateTimer = REGISTER_INT("es_UpdateTimer",1,VF_CHEAT,
		"Usage: es_UpdateTimer [0/1]\n"
		"Default is 1 (on).");
	pUpdateCollisionScript = REGISTER_INT("es_UpdateCollisionScript",1,VF_CHEAT,
		"Usage: es_UpdateCollisionScript [0/1]\n"
		"Default is 1 (on).");
	pVisCheckForUpdate = REGISTER_INT("es_VisCheckForUpdate",1,VF_CHEAT,
		"Usage: es_VisCheckForUpdate [0/1]\n"
		"Default is 1 (on).");
	pMinImpulseVel = REGISTER_FLOAT("es_MinImpulseVel",0.0f,VF_CHEAT,
		"Usage: es_MinImpulseVel 0.0");
	pImpulseScale = REGISTER_FLOAT("es_ImpulseScale",0.0f,VF_CHEAT,
		"Usage: es_ImpulseScale 0.0");
	pMaxImpulseAdjMass = REGISTER_FLOAT("es_MaxImpulseAdjMass",2000.0f,VF_CHEAT,
		"Usage: es_MaxImpulseAdjMass 2000.0");
	pDebrisLifetimeScale = REGISTER_FLOAT("es_DebrisLifetimeScale",1.0f,0,
		"Usage: es_DebrisLifetimeScale 1.0");
	pSplashThreshold = REGISTER_FLOAT("es_SplashThreshold",1.0f,VF_CHEAT,
		"minimum instantaneous water resistance that is detected as a splash"
		"Usage: es_SplashThreshold 200.0");
	pSplashTimeout = REGISTER_FLOAT("es_SplashTimeout",3.0f,VF_CHEAT,
		"minimum time interval between consecutive splashes"
		"Usage: es_SplashTimeout 3.0");
	pHitCharacters = REGISTER_INT("es_HitCharacters",1,0,
		"specifies whether alive characters are affected by bullet hits (0 or 1)");
	pHitDeadBodies = REGISTER_INT("es_HitDeadBodies",1,0,
		"specifies whether dead bodies are affected by bullet hits (0 or 1)");
	pCharZOffsetSpeed = REGISTER_FLOAT("es_CharZOffsetSpeed",2.0f,VF_DUMPTODISK,
		"sets the character Z-offset change speed (in m/s), used for IK");

	pNotSeenTimeout = REGISTER_INT("es_not_seen_timeout", 30, VF_DUMPTODISK,
		"number of seconds after which to cleanup temporary render buffers in entity");
	pDebugNotSeenTimeout = REGISTER_INT("es_debug_not_seen_timeout", 0, VF_DUMPTODISK,
		"if true, log messages when entities undergo not seen timeout");

	pEnableFullScriptSave = REGISTER_INT("es_enable_full_script_save",0,
		VF_DUMPTODISK,"Enable (experimental) full script save functionality");
	
	pLogCollisions = REGISTER_INT("es_log_collisions",0,0,"Enables collision events logging" );
	REGISTER_CVAR(es_DebugTimers,0,VF_CHEAT,
		"This is for profiling and debugging (for game coders and level designer)\n"
		"By enabling this you get a lot of console printouts that show all entities that receive OnTimer\n"
		"events - it's good to minimize the call count. Certain entities might require this feature and\n"
		"using less active entities can often be defined by the level designer.\n"
		"Usage: es_DebugTimers 0/1");
	REGISTER_CVAR(es_DebugFindEntity,0,VF_CHEAT,"" );
	REGISTER_CVAR(es_DebugEvents,0,VF_CHEAT,"Enables logging of entity events" );
	REGISTER_CVAR(es_DisableTriggers,0,0,"Disable enter/leave events for proximity and area triggers");
	REGISTER_CVAR(es_DrawProximityTriggers,0,0,
		"Shows Proximity Triggers.\n"
		"Usage: es_DrawProximityTriggers [0-255].  The parameter sets the transparency (alpha) level.\n"
		"Value 1 will be changed to 70.\n"
		"Default is 0 (off)\n");

	REGISTER_CVAR(es_DebugEntityUsage,0,0,
		"Draws information to the screen to show how entities are being used, per class, including total, active and hidden counts and memory usage"
		"\nUsage: es_DebugEntityUsage update_rate"
		"\nupdate_rate - Time in ms to refresh memory usage calculation or 0 to disable");
	REGISTER_CVAR(es_DebugEntityUsageFilter,"",0,"Filter entity usage debugging to classes which have this string in their name");

	REGISTER_CVAR(es_EnablePoolUse,-1,0,
		"Force toggle the use of entity pools on/off.\n"
		"Usage: es_EnablePoolUse 1\n"
		"Default is -1, or normal behavior. 0 forces system off. 1 forces system on.");

	REGISTER_CVAR(es_DebugPool,0,0,"Enable debug drawing of entity pools");
	REGISTER_CVAR(es_TestPoolSignatures,0,VF_CHEAT,"Enable signature testing on entity classes the first time they're prepared from an entity pool");
	REGISTER_CVAR(es_DebugPoolFilter,"",0,"Filter entity pool debugging for just this pool and draw more info about it");

	REGISTER_CVAR(es_LayerSaveLoadSerialization, 0, VF_CHEAT, 
		"Switches layer entity serialization: \n" 
		"0 - serialize all \n"
		"1 - automatically ignore entities on disabled layers \n"
		"2 - only ignore entities on non-save layers.");
	REGISTER_CVAR(es_LayerDebugInfo, 0, VF_CHEAT, 
		"Render debug info on active layers: \n"
		"0 - inactive \n"
		"1 - active brush layers \n"
		"2 - all layer info \n"
		"3 - all layer and all layer pak info");
	REGISTER_CVAR(es_SaveLoadUseLUANoSaveFlag, 0, VF_CHEAT, "Save&Load optimization : use lua flag to not serialize entities, for example rigid bodies.");
	
	REGISTER_CVAR(es_ClearPoolBookmarksOnLayerUnload, 1, VF_CHEAT, "Clear pool bookmarks when a layer is unloaded (saves memory and makes smaller saves)");
	pUpdateType = REGISTER_INT_CB("es_updateType", CComponentEventDistributer::EEventUpdatePolicy_UseDistributer, VF_CHEAT, "Defines how we update type for the entities", OnUpdateTypeChange);

	pDrawAreas = REGISTER_INT("es_DrawAreas",0,VF_CHEAT,"Enables drawing of Areas" );
	pDrawAreaGrid = REGISTER_INT("es_DrawAreaGrid",0,VF_CHEAT,"Enables drawing of Area Grid" );
	pDrawAreaDebug = REGISTER_INT("es_DrawAreaDebug",0,VF_CHEAT,"Enables debug drawing of Areas, set 2 for log details" );
	pDrawAudioProxyZRay = REGISTER_INT("es_DrawAudioProxyZRay",0,VF_CHEAT,"Enables drawing of Z ray on check for Z visibility" );

	REGISTER_CVAR(es_UsePhysVisibilityChecks, 1, 0,
		"Activates physics quality degradation and forceful sleeping for invisible and faraway entities" );
	REGISTER_CVAR(es_MaxPhysDist, 300.0f, 0,
		"Physical entities farther from the camera than this are forcefully deactivated" );
	REGISTER_CVAR(es_MaxPhysDistCloth, 300.0f, 0,
		"Cloth entities farther from the camera than this are forcefully deactivated" );
	REGISTER_CVAR(es_MaxPhysDistInvisible, 40.0f, 0,
		"Invisible physical entities farther from the camera than this are forcefully deactivated" );
	REGISTER_CVAR(es_FarPhysTimeout, 4.0f, 0,
		"Timeout for faraway physics forceful deactivation" );

  pMotionBlur = gEnv->pConsole->GetCVar("r_MotionBlur");
	pSysSpecLight = gEnv->pConsole->GetCVar("sys_spec_light");
	if (pSysSpecLight && gEnv->IsEditor())
		pSysSpecLight->SetOnChangeCallback( OnSysSpecLightChange );

 	REGISTER_CVAR(es_debugEntityLifetime,0,0,
		"Debug entities creation and deletion time" );

	REGISTER_COMMAND("es_debugAnim", (ConsoleCommandFunc)EnableDebugAnimText, 0, "Debug entity animation (toggle on off)");

  REGISTER_CVAR(es_EntityUpdatePosDelta, 0.1f, 0,
    "Indicates the position delta by which an entity must move before the AreaManager updates position relevant data.\n"
    "Default: 0.1 (10 cm)");

	REGISTER_CVAR(es_debugDrawEntityIDs, 0, VF_CHEAT,
		"Displays the EntityId of all entities.\n"
		"Default is 0 (off), any other number enables it.\n"
		"Note: es_debug must be set to 1 also (or else the EntityId won't be displayed)");
}