void Left4Downtown::SDK_OnUnload() { gameconfs->CloseGameConfigFile(g_pGameConf); gameconfs->CloseGameConfigFile(g_pGameConfSDKTools); playerhelpers->RemoveClientListener(&g_Left4DowntownTools); playerhelpers->UnregisterCommandTargetProcessor(&g_Left4DowntownTools); #ifdef USE_PLAYERSLOTS_PATCHES //go back to normal old asm PlayerSlots::Unpatch(); #endif AddonsDisabler::Unpatch(); g_PatchManager.UnregisterAll(); forwards->ReleaseForward(g_pFwdOnSpawnSpecial); forwards->ReleaseForward(g_pFwdOnSpawnTank); forwards->ReleaseForward(g_pFwdOnSpawnWitch); forwards->ReleaseForward(g_pFwdOnSpawnWitchBride); forwards->ReleaseForward(g_pFwdOnClearTeamScores); forwards->ReleaseForward(g_pFwdOnSetCampaignScores); forwards->ReleaseForward(g_pFwdOnFirstSurvivorLeftSafeArea); forwards->ReleaseForward(g_pFwdOnGetScriptValueInt); forwards->ReleaseForward(g_pFwdOnGetScriptValueFloat); forwards->ReleaseForward(g_pFwdOnGetScriptValueString); forwards->ReleaseForward(g_pFwdOnTryOfferingTankBot); forwards->ReleaseForward(g_pFwdOnMobRushStart); forwards->ReleaseForward(g_pFwdOnSpawnITMob); forwards->ReleaseForward(g_pFwdOnSpawnMob); forwards->ReleaseForward(g_pFwdOnShovedBySurvivor); forwards->ReleaseForward(g_pFwdOnGetCrouchTopSpeed); forwards->ReleaseForward(g_pFwdOnGetRunTopSpeed); forwards->ReleaseForward(g_pFwdOnGetWalkTopSpeed); forwards->ReleaseForward(g_pFwdOnHasConfigurableDifficulty); forwards->ReleaseForward(g_pFwdOnGetSurvivorSet); forwards->ReleaseForward(g_pFwdOnFastGetSurvivorSet); forwards->ReleaseForward(g_pFwdOnGetMissionVersusBossSpawning); forwards->ReleaseForward(g_pFwdOnCThrowActivate); forwards->ReleaseForward(g_pFwdOnStartMeleeSwing); forwards->ReleaseForward(g_pFwdOnUseHealingItems); forwards->ReleaseForward(g_pFwdOnFindScavengeItem); forwards->ReleaseForward(g_pFwdOnSendInRescueVehicle); forwards->ReleaseForward(g_pFwdOnChangeFinaleStage); forwards->ReleaseForward(g_pFwdOnEndVersusModeRound); forwards->ReleaseForward(g_pFwdOnEndVersusModeRound_Post); forwards->ReleaseForward(g_pFwdOnSelectTankAttack); forwards->ReleaseForward(g_pFwdOnRevived); forwards->ReleaseForward(g_pFwdOnWaterMove); forwards->ReleaseForward(g_pFwdOnPlayerStagger); forwards->ReleaseForward(g_pFwdOnTerrorWeaponHit); forwards->ReleaseForward(g_pFwdAddonsDisabler); }
void L4D2Tools::SDK_OnUnload() { gameconfs->CloseGameConfigFile(g_pGameConf); gameconfs->CloseGameConfigFile(g_pGameConfSDKTools); playerhelpers->RemoveClientListener(&g_L4D2Tools); playerhelpers->UnregisterCommandTargetProcessor(&g_L4D2Tools); g_PatchManager.UnregisterAll(); forwards->ReleaseForward(g_pFwdOnSpawnSpecial); forwards->ReleaseForward(g_pFwdOnSpawnTank); forwards->ReleaseForward(g_pFwdOnSpawnWitch); forwards->ReleaseForward(g_pFwdOnSpawnWitchBride); forwards->ReleaseForward(g_pFwdOnFirstSurvivorLeftSafeArea); forwards->ReleaseForward(g_pFwdOnGetScriptValueInt); forwards->ReleaseForward(g_pFwdOnGetScriptValueFloat); forwards->ReleaseForward(g_pFwdOnGetScriptValueString); forwards->ReleaseForward(g_pFwdOnTryOfferingTankBot); forwards->ReleaseForward(g_pFwdOnMobRushStart); forwards->ReleaseForward(g_pFwdOnSpawnITMob); forwards->ReleaseForward(g_pFwdOnSpawnMob); forwards->ReleaseForward(g_pFwdOnGetCrouchTopSpeed); forwards->ReleaseForward(g_pFwdOnGetRunTopSpeed); forwards->ReleaseForward(g_pFwdOnGetWalkTopSpeed); forwards->ReleaseForward(g_pFwdOnHasConfigurableDifficulty); forwards->ReleaseForward(g_pFwdOnCThrowActivate); forwards->ReleaseForward(g_pFwdOnStartMeleeSwing); forwards->ReleaseForward(g_pFwdOnSendInRescueVehicle); forwards->ReleaseForward(g_pFwdOnChangeFinaleStage); forwards->ReleaseForward(g_pFwdOnSelectSequence); forwards->ReleaseForward(g_pFwdOnRevived); forwards->ReleaseForward(g_pFwdOnPlayerStagger); forwards->ReleaseForward(g_pFwdOnHealBegin); forwards->ReleaseForward(g_pFwdOnUseHealingItems); forwards->ReleaseForward(g_pFwdOnUseHealingItemsPost); forwards->ReleaseForward(g_pFwdOnFindScavengeItem); forwards->ReleaseForward(g_pFwdOnWitchAttackUpdate); forwards->ReleaseForward(g_pFwdOnWitchKillIncapVictim); forwards->ReleaseForward(g_pFwdOnWitchRetreat); forwards->ReleaseForward(g_pFwdOnInfectedAlertUpdate); forwards->ReleaseForward(g_pFwdOnInfectedAttackUpdate); forwards->ReleaseForward(g_pFwdOnSmokerAttackUpdate); forwards->ReleaseForward(g_pFwdOnBoomerAttackUpdate); forwards->ReleaseForward(g_pFwdOnHunterAttackUpdate); forwards->ReleaseForward(g_pFwdOnSpitterAttackUpdate); forwards->ReleaseForward(g_pFwdOnJockeyAttackUpdate); forwards->ReleaseForward(g_pFwdOnChargerAttackUpdate); forwards->ReleaseForward(g_pFwdOnTankAttackUpdate); forwards->ReleaseForward(g_pFwdOnSurvivorUseObjectUpdate); }
void Left4Downtown::SDK_OnAllLoaded() { SM_GET_LATE_IFACE(BINTOOLS, g_pBinTools); SM_GET_LATE_IFACE(SDKTOOLS, g_pSDKTools); if (!g_pBinTools || !g_pSDKTools) { L4D_DEBUG_LOG("Failed to load bintools or failed to load sdktools"); return; } IServer *server = g_pSDKTools->GetIServer(); L4D_DEBUG_LOG("Address of IServer is %p", server); //reading out server->GetName() we consistently seem to get (the same?) //garbage characters. this is possibly causing a crash on windows servers //when a player connects. so lets not read the server name :( //L4D_DEBUG_LOG("Server name is %s", server->GetName()); g_pServer = server; InitializeValveGlobals(); g_AddonsEclipse.InstallChangeCallback(::OnAddonsEclipseChanged); AddonsDisabler::AddonsEclipse = g_AddonsEclipse.GetInt(); #ifdef USE_PLAYERSLOTS_PATCHES /* allow more than 8 players in l4d if l4d_maxplayers is not -1 also if +maxplayers or -maxplayers is not the default value (8) */ g_MaxPlayers.InstallChangeCallback(::OnMaxPlayersChanged); /* read the +-maxplayers from command line */ /*commenting out the code below seems to not make it crash during connection to my NFO START HERE */ ICommandLine *cmdLine = CommandLine_Tier0(); int maxplayers = -1; L4D_DEBUG_LOG("Command line is: %s", cmdLine->GetCmdLine()); maxplayers = cmdLine->ParmValue("+maxplayers", -1); L4D_DEBUG_LOG("Command line +maxplayers is: %d", maxplayers); if(maxplayers == -1) { maxplayers = cmdLine->ParmValue("-maxplayers", -1); } /* end here */ PlayerSlots::MaxPlayers = maxplayers; #endif /* detour the witch/spawn spawns */ //automatically will unregister/cleanup themselves when the ext is unloaded g_PatchManager.Register(new AutoPatch<Detours::SpawnSpecial>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnTank>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnWitch>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnWitchBride>()); g_PatchManager.Register(new AutoPatch<Detours::ClearTeamScores>()); g_PatchManager.Register(new AutoPatch<Detours::SetCampaignScores>()); g_PatchManager.Register(new AutoPatch<Detours::FirstSurvivorLeftSafeArea>()); g_PatchManager.Register(new AutoPatch<Detours::GetScriptValueInt>()); g_PatchManager.Register(new AutoPatch<Detours::GetScriptValueFloat>()); g_PatchManager.Register(new AutoPatch<Detours::GetScriptValueString>()); g_PatchManager.Register(new AutoPatch<Detours::TryOfferingTankBot>()); g_PatchManager.Register(new AutoPatch<Detours::MobRushStart>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnITMob>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnMob>()); g_PatchManager.Register(new AutoPatch<Detours::ShovedBySurvivor>()); g_PatchManager.Register(new AutoPatch<Detours::GetCrouchTopSpeed>()); g_PatchManager.Register(new AutoPatch<Detours::GetRunTopSpeed>()); g_PatchManager.Register(new AutoPatch<Detours::GetWalkTopSpeed>()); g_PatchManager.Register(new AutoPatch<Detours::HasConfigurableDifficulty>()); g_PatchManager.Register(new AutoPatch<Detours::GetSurvivorSet>()); g_PatchManager.Register(new AutoPatch<Detours::FastGetSurvivorSet>()); g_PatchManager.Register(new AutoPatch<Detours::GetMissionVersusBossSpawning>()); g_PatchManager.Register(new AutoPatch<Detours::CThrowActivate>()); g_PatchManager.Register(new AutoPatch<Detours::StartMeleeSwing>()); g_PatchManager.Register(new AutoPatch<Detours::UseHealingItems>()); g_PatchManager.Register(new AutoPatch<Detours::FindScavengeItem>()); g_PatchManager.Register(new AutoPatch<Detours::SendInRescueVehicle>()); g_PatchManager.Register(new AutoPatch<Detours::ChangeFinaleStage>()); g_PatchManager.Register(new AutoPatch<Detours::EndVersusModeRound>()); g_PatchManager.Register(new AutoPatch<Detours::SelectWeightedSequence>());//for SelectTankAttack g_PatchManager.Register(new AutoPatch<Detours::Revived>()); g_PatchManager.Register(new AutoPatch<Detours::WaterMove>()); g_PatchManager.Register(new AutoPatch<Detours::PlayerStagger>()); g_PatchManager.Register(new AutoPatch<Detours::TerrorWeaponHit>()); g_PatchManager.Register(new AutoPatch<Detours::CTerrorGameRules>()); g_PatchManager.Register(new AutoPatch<Detours::CBaseServer>()); //new style detours that create/destroy the forwards themselves g_PatchManager.Register(new AutoPatch<Detours::IsFinale>()); g_PatchManager.Register(new AutoPatch<Detours::OnEnterGhostState>()); #ifdef USE_PLAYERSLOTS_PATCHES g_PatchManager.Register(new AutoPatch<Detours::ServerPlayerCounts>()); #endif }
void L4D2Tools::SDK_OnAllLoaded() { SM_GET_LATE_IFACE(BINTOOLS, g_pBinTools); SM_GET_LATE_IFACE(SDKTOOLS, g_pSDKTools); if (!g_pBinTools || !g_pSDKTools) { L4D_DEBUG_LOG("Failed to load bintools or failed to load sdktools"); return; } IServer *server = g_pSDKTools->GetIServer(); L4D_DEBUG_LOG("Address of IServer is %p", server); //reading out server->GetName() we consistently seem to get (the same?) //garbage characters. this is possibly causing a crash on windows servers //when a player connects. so lets not read the server name :( //L4D_DEBUG_LOG("Server name is %s", server->GetName()); g_pServer = server; InitializeValveGlobals(); /* detour the witch/spawn spawns */ //automatically will unregister/cleanup themselves when the ext is unloaded g_PatchManager.Register(new AutoPatch<Detours::SpawnSpecial>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnTank>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnWitch>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnWitchBride>()); g_PatchManager.Register(new AutoPatch<Detours::FirstSurvivorLeftSafeArea>()); g_PatchManager.Register(new AutoPatch<Detours::GetScriptValueInt>()); g_PatchManager.Register(new AutoPatch<Detours::GetScriptValueFloat>()); g_PatchManager.Register(new AutoPatch<Detours::GetScriptValueString>()); g_PatchManager.Register(new AutoPatch<Detours::TryOfferingTankBot>()); g_PatchManager.Register(new AutoPatch<Detours::MobRushStart>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnITMob>()); g_PatchManager.Register(new AutoPatch<Detours::SpawnMob>()); g_PatchManager.Register(new AutoPatch<Detours::GetCrouchTopSpeed>()); g_PatchManager.Register(new AutoPatch<Detours::GetRunTopSpeed>()); g_PatchManager.Register(new AutoPatch<Detours::GetWalkTopSpeed>()); g_PatchManager.Register(new AutoPatch<Detours::HasConfigurableDifficulty>()); g_PatchManager.Register(new AutoPatch<Detours::CThrowActivate>()); g_PatchManager.Register(new AutoPatch<Detours::StartMeleeSwing>()); g_PatchManager.Register(new AutoPatch<Detours::SendInRescueVehicle>()); g_PatchManager.Register(new AutoPatch<Detours::ChangeFinaleStage>()); g_PatchManager.Register(new AutoPatch<Detours::SelectSequence>());//for SelectTankAttack g_PatchManager.Register(new AutoPatch<Detours::Revived>()); g_PatchManager.Register(new AutoPatch<Detours::PlayerStagger>()); g_PatchManager.Register(new AutoPatch<Detours::HealBegin>()); g_PatchManager.Register(new AutoPatch<Detours::UseHealingItems>()); g_PatchManager.Register(new AutoPatch<Detours::FindScavengeItem>()); g_PatchManager.Register(new AutoPatch<Detours::WitchAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::WitchKillIncapVictim>()); g_PatchManager.Register(new AutoPatch<Detours::WitchRetreat>()); g_PatchManager.Register(new AutoPatch<Detours::InfectedAlertUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::InfectedAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::SmokerAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::BoomerAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::HunterAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::SpitterAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::JockeyAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::ChargerAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::TankAttackUpdate>()); g_PatchManager.Register(new AutoPatch<Detours::SurvivorUseObjectUpdate>()); //new style detours that create/destroy the forwards themselves g_PatchManager.Register(new AutoPatch<Detours::OnEnterGhostState>()); }