Example #1
0
CSPAnalyst::~CSPAnalyst()
{
	IGameFramework *pGF = g_pGame->GetIGameFramework();

	if(m_bEnabled)
		pGF->GetIGameplayRecorder()->UnregisterListener(this);

	pGF->GetILevelSystem()->RemoveListener(this);
	pGF->UnregisterListener(this);
}
void CEditorGame::SetGameRules()
{
	IGameFramework *pGameFramework = g_pGame->GetIGameFramework();
	IConsole *pConsole = gEnv->pConsole;
	const char *szGameRules = NULL;
	const char *szLevelName = pConsole->GetCVar("sv_map")->GetString();
	ILevelInfo *pLevelInfo = pGameFramework->GetILevelSystem()->GetLevelInfo(szLevelName);

	if (pLevelInfo)
	{
		szGameRules = pLevelInfo->GetDefaultGameRules();
	}

	if (!szGameRules)
	{
		szGameRules = s_pEditorGame->m_bUsingMultiplayerGameRules ? "DeathMatch" : "SinglePlayer";
	}

	pGameFramework->GetIGameRulesSystem()->CreateGameRules(szGameRules);
	pConsole->GetCVar("sv_gamerules")->Set(szGameRules);
}
Example #3
0
CSPAnalyst::CSPAnalyst() : m_bEnabled(false), m_bChainLoad(false)
{
    IGameFramework *pGF = g_pGame->GetIGameFramework();
    pGF->GetILevelSystem()->AddListener(this);
    pGF->RegisterListener(this, "CSPAnalyst", eFLPriority_Game);
}