Esempio n. 1
0
LTBOOL CGlobalMgr::Init()
{
    if (!m_DebrisMgr.Init())
	{
		ShutdownWithError("DebrisMgr", DEBRISMGR_DEFAULT_FILE);
        return LTFALSE;
	}

	UBER_ASSERT( m_pFXButeMgr, "Failed to allocate m_pFXButeMgr" );
    if (!m_pFXButeMgr->Init())
	{
		ShutdownWithError("FXButeMgr", FXBMGR_DEFAULT_FILE);
        return LTFALSE;
	}

    if (!m_SoundFilterMgr.Init())
	{
		ShutdownWithError("SoundFilterMgr", SFM_DEFAULT_FILE);
        return LTFALSE;
	}

	// Get the singleton instance of the weapon mgr and intialize it.
	if( !g_pWeaponMgr )
	{
		CWeaponMgr& weaponMgr = CWeaponMgr::Instance( );
		if (!weaponMgr.Init())
		{
			ShutdownWithError("WeaponMgr", WEAPON_DEFAULT_FILE);
			return LTFALSE;
		}
	}

	//the surfaces need to be initialized before the models, because models contain
	//surfaces
    if (!m_SurfaceMgr.Init())
	{
		ShutdownWithError("SurfaceMgr", SRFMGR_DEFAULT_FILE);
        return LTFALSE;
	}

	// Get the singleton instance of the weapon mgr and intialize it.
	if( !g_pModelButeMgr )
	{
		CModelButeMgr& modelButeMgr = CModelButeMgr::Instance( );
		if (!modelButeMgr.Init())
		{
			ShutdownWithError("ModelButeMgr", MBMGR_DEFAULT_FILE);
			return LTFALSE;
		}
	}

	if (!m_SkillsButeMgr.Init())
	{
		ShutdownWithError("SkillsButeMgr", SMGR_DEFAULT_FILE);
        return LTFALSE;
	}

	if( !m_SoundButeMgr.Init() )
	{
		ShutdownWithError( "SoundButeMgr", SOUND_BUTES_DEFAULT_FILE );
		return LTFALSE;
	}

    if (!m_DTButeMgr.Init())
	{
		ShutdownWithError("DTButeMgr", DTMGR_DEFAULT_FILE);
        return LTFALSE;
	}
	
    return LTTRUE;
}
Esempio n. 2
0
LTBOOL CGlobalServerMgr::Init()
{
	if( !g_pGameServerShell )
		return LTFALSE;

	m_pServerSoundMgr = new CServerSoundMgr;
	m_pServerSoundMgr->Init();

    // Since Client & Server are the same on PS2, we only need to do this once (when called by the client)
    if (!CGlobalMgr::Init()) 
		return LTFALSE;

    m_pAIButeMgr = new CAIButeMgr;
	m_pAIButeMgr->Init();

    m_pAIGoalButeMgr = new CAIGoalButeMgr;
	m_pAIGoalButeMgr->Init();

    m_pAttachButeMgr = new CAttachButeMgr;
	m_pAttachButeMgr->Init();

    m_pServerButeMgr = new CServerButeMgr;
	m_pServerButeMgr->Init();

    m_pAnimationMgrList = new CAnimationMgrList;
	m_pAnimationMgrList->Init();

	m_pPropTypeMgr = new CPropTypeMgr;
	m_pPropTypeMgr->Init();

	m_pIntelMgr = new CIntelMgr;
	m_pIntelMgr->Init();

	m_pKeyMgr = new CKeyMgr;
	m_pKeyMgr->Init();
    	
	m_pSearchItemMgr = new CSearchItemMgr;
	m_pSearchItemMgr->Init();
    	

        CRelationMgr::GetGlobalRelationMgr()->Init();

	m_pGadgetTargetMgr = new CGadgetTargetMgr;
	m_pGadgetTargetMgr->Init();

	m_pCommandButeMgr = new CCommandButeMgr;
	m_pCommandButeMgr->Init();

	m_pInventoryButeMgr = new CInventoryButeMgr;
	m_pInventoryButeMgr->Init();

	m_pTransitionMgr = debug_new( CTransitionMgr );
	if( !m_pTransitionMgr )
		return LTFALSE;

	
	if( g_pGameServerShell->ShouldUseRadar() )
	{
		// Get the singleton instance of the radar type mgr and initialize it...
		if( !g_pRadarTypeMgr )
		{
			CRadarTypeMgr &RadarTypeMgr = CRadarTypeMgr::Instance();
			if( !RadarTypeMgr.Init() )
			{
				ShutdownWithError( "RadarTypeMgr", RTMGR_DEFAULT_FILE );
				return LTFALSE;
			}
		}
	}
	
	if( !g_pActivateTypeMgr )
	{
		CActivateTypeMgr &ActivateTypeMgr = CActivateTypeMgr::Instance();
		ActivateTypeMgr.Init();
	}
	
	if( !g_pTriggerTypeMgr )
	{
		CTriggerTypeMgr & TriggerTypeMgr = CTriggerTypeMgr::Instance();
		TriggerTypeMgr.Init();
	}

    return LTTRUE;
}