Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// Purpose: called when the plugin is unloaded (turned off)
//-----------------------------------------------------------------------------
void CSourcePython::Unload( void )
{
	Msg(MSG_PREFIX "Unloading...\n");
	
	DevMsg(1, MSG_PREFIX "Unhooking all functions...\n");
	GetHookManager()->UnhookAllFunctions();
	
	DevMsg(1, MSG_PREFIX "Shutting down python...\n");
	g_PythonManager.Shutdown();

	DevMsg(1, MSG_PREFIX "Clearing all commands...\n");
	ClearAllCommands();

	DevMsg(1, MSG_PREFIX "Unregistering ConVar...\n");
	ConVar_Unregister( );

	// New in CSGO...
#ifdef ENGINE_CSGO
	DevMsg(1, MSG_PREFIX "Disconnecting interfaces...\n");
	DisconnectInterfaces();
#else
	DevMsg(1, MSG_PREFIX "Disconnecting tier2 libraries...\n");
	DisconnectTier2Libraries( );

	DevMsg(1, MSG_PREFIX "Disconnecting tier1 libraries...\n");
	DisconnectTier1Libraries( );
#endif

	DevMsg(1, MSG_PREFIX "Resetting cache notifier...\n");
	modelcache->SetCacheNotify(m_pOldMDLCacheNotifier);

	Msg(MSG_PREFIX "Unloaded successfully.\n");
}
Ejemplo n.º 2
0
bool PreloadCmdProcessor::Execute(PlayListItem* pItem)
{
    if (!pItem)
    {
        zDebug("PreloadCmdProcessor::Execute(): Clear all pre-loaded items!!!\n");
        ClearAllCommands();
        return true;
    }

    while (m_PreloadList.size() >= MAX_PRELOADED_ITEM_COUNTS)
        ReleaseTopItemFromList();

    HLSClip* pClip = new HLSClip(m_IoPlugin, pItem,
                                 m_strUserAgent.empty()
                                 ? NULL
                                 : m_strUserAgent.c_str());
    CAutoLock autoLock(&m_CritSec);
    if (pClip->GetHandle()) m_PreloadList.push_back(pClip);
    else pClip->Release();

    std::map<PlayListItem*, CEvent*>::iterator itorSync = m_CmdSyncList.find(pItem);
    if (itorSync != m_CmdSyncList.end())
    {
        if (itorSync->second) itorSync->second->Set();
        m_CmdSyncList.erase(itorSync);
    }
    return true;
}
Ejemplo n.º 3
0
//---------------------------------------------------------------------------------
// Purpose: called when the plugin is unloaded (turned off)
//---------------------------------------------------------------------------------
void CSourcePython::Unload( void )
{
	gameeventmanager->RemoveListener( this ); // make sure we are unloaded from the event system
	ClearAllCommands();
	ConVar_Unregister( );

	g_PythonManager.Shutdown();

	// New in CSGO...
#if( SOURCE_ENGINE >= 3 )
	DisconnectInterfaces();
#else
	DisconnectTier2Libraries( );
	DisconnectTier1Libraries( );
#endif
}
Ejemplo n.º 4
0
//-----------------------------------------------------------------------------
// Purpose: called when the plugin is unloaded (turned off)
//-----------------------------------------------------------------------------
void CSourcePython::Unload( void )
{
	gameeventmanager->RemoveListener( this ); // make sure we are unloaded from the event system
	ClearAllCommands();
	ConVar_Unregister( );

	g_PythonManager.Shutdown();

	// New in CSGO...
#ifdef ENGINE_CSGO
	DisconnectInterfaces();
#else
	DisconnectTier2Libraries( );
	DisconnectTier1Libraries( );
#endif

	g_pHookMngr->UnhookAllFunctions();
}
Ejemplo n.º 5
0
PreloadCmdProcessor::~PreloadCmdProcessor()
{
    ClearAllCommands();
}