示例#1
0
//---------------------------------------------------------------------------------
// 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 ();
}
示例#2
0
// destructor
SingletonManager::~SingletonManager()
{
	DestroySingletons();
}
示例#3
0
CNoCheatZPlugin::~CNoCheatZPlugin ()
{
	DestroySingletons ();
}