//--------------------------------------------------------------------------------- // Purpose: called when the plugin is unloaded (turned off) //--------------------------------------------------------------------------------- void CNoCheatZPlugin::Unload ( void ) { BanRequest::GetInstance ()->WriteBansIfNeeded (); if( m_bAlreadyLoaded && SourceSdk::InterfacesProxy::GetCvar () ) { void* inst ( SourceSdk::InterfacesProxy::ICvar_FindVar ( "nocheatz_instance" ) ); if( inst ) SourceSdk::InterfacesProxy::ConVar_SetValue ( inst, false ); } /*PlayerRunCommandHookListener::UnhookPlayerRunCommand(); OnGroundHookListener::UnhookOnGround(); //TeleportHookListener::UnhookTeleport(); SetTransmitHookListener::UnhookSetTransmit(); WeaponHookListener::UnhookWeapon(); ConCommandHookListener::UnhookDispatch();*/ Logger::GetInstance ()->Flush (); SourceSdk::ConVar_Unregister (); if( SourceSdk::InterfacesProxy::m_game == SourceSdk::CounterStrikeGlobalOffensive ) { if( nocheatz_instance ) delete static_cast< SourceSdk::ConVar_csgo* >( nocheatz_instance ); if( ncz_cmd_ptr ) delete static_cast< SourceSdk::ConCommand_csgo* >( ncz_cmd_ptr ); } else { if( nocheatz_instance ) delete static_cast< SourceSdk::ConVar* >( nocheatz_instance ); if( ncz_cmd_ptr ) delete static_cast< SourceSdk::ConCommand* >( ncz_cmd_ptr ); } DestroySingletons (); }
// destructor SingletonManager::~SingletonManager() { DestroySingletons(); }
CNoCheatZPlugin::~CNoCheatZPlugin () { DestroySingletons (); }