CS:Source env_explosions crashes server

Post Reply
legitified
New to forums
New to forums
Posts: 4
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Jan 03, 2014 4:44 pm

CS:Source env_explosions crashes server

Post by legitified »

Server keeps crashing on env_explosion, making the server to restart, it's been going on since the first day. I've downgraded Sourcemod to 1.5.2 to its stable release, ignore the SourceMod version posted here.

I've been given an anti-explosion plugin, although it's stopping the explosion from damaging the players. I want to try and make it deal damage like it used to, but I have no knowledge in coding SourcePawn for SourceMod whatsoever.

Code: Select all

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define PLUGIN_VERSION "1.0.0"

new Handle:g_hMethod = INVALID_HANDLE;

public Plugin:myinfo =
{
    name = "Anti Env Explosions", 
    author = "Panduh (AlliedMods: thetwistedpanda)", 
    description = "Potentially assists in resolving crashes relating to env_explosion entities.", 
    version = PLUGIN_VERSION, 
    url = "http://forums.alliedmods.net"
}

public OnPluginStart()
{
    g_hMethod = CreateConVar("env_explosions_method", "0", "Determines method for handling env_explosion entities. (0 = Nullify Effect, 1 = Kill in OnEntityCreated)", FCVAR_NONE, true, 0.0, true, 1.0);
    AutoExecConfig(true, "env_explosions");
}

public OnEntityCreated(entity, const String:classname[])
{
    if(entity > 0)
    {
        if(StrEqual(classname, "env_explosion"))
            CreateTimer(0.0, Timer_OnEntityCreated, EntIndexToEntRef(entity));
    }
}

public Action:Timer_OnEntityCreated(Handle:owner, any:ref)
{
    new entity = EntRefToEntIndex(ref);
    if(entity != INVALID_ENT_REFERENCE && IsValidEdict(entity))
    {
        if(GetConVarBool(g_hMethod))
            AcceptEntityInput(entity, "Kill");
        else
        {
            SetEntProp(entity, Prop_Data, "m_iMagnitude", 0);
            SetEntProp(entity, Prop_Data, "m_iRadiusOverride", 0);
            SetEntPropFloat(entity, Prop_Data, "m_flDamageForce", 0.0);
            SetEntProp(entity, Prop_Data, "m_nNextThinkTick", -1);
        }
    }
}  
Information on the server.

Intel Xeon E3-1270v3 (Haswell 3.5ghz) node with 4 total processor cores and 32 gigabytes of RAM. OS: Windows
SourceMod 1.5.3-dev+3954, by AlliedModders LLC
[SM] Listing 42 plugins:
01 "Admin File Reader" (1.5.3-dev+3954) by AlliedModders LLC
02 "Admin Help" (1.5.3-dev+3954) by AlliedModders LLC
03 "Admin Menu" (1.5.3-dev+3954) by AlliedModders LLC
04 "AllChat" (1.1.1) by Frenzzy
05 "Anti-Flood" (1.5.3-dev+3954) by AlliedModders LLC
06 "Basic Chat" (1.5.3-dev+3954) by AlliedModders LLC
07 "Basic Comm Control" (1.5.3-dev+3954) by AlliedModders LLC
08 "Basic Commands" (1.5.3-dev+3954) by AlliedModders LLC
09 "Basic Info Triggers" (1.5.3-dev+3954) by AlliedModders LLC
10 "Basic Votes" (1.5.3-dev+3954) by AlliedModders LLC
11 "Client Preferences" (1.5.3-dev+3954) by AlliedModders LLC
12 "Divine Plugin" (1.0) by Bob Loblaw
13 "Fun Commands" (1.5.3-dev+3954) by AlliedModders LLC
14 "Simple GoTo Command" (1.3.4) by BB
15 "Infinite Jumping" (2.15) by Chanz
16 "MapChooser" (1.5.3-dev+3954) by AlliedModders LLC
17 "Nextmap" (1.5.3-dev+3954) by AlliedModders LLC
18 "No Block" (1.0.0.0) by sslice
19 "Map Nominations" (1.5.3-dev+3954) by AlliedModders LLC
20 "PermaMute" (0.1) by Ryan "FLOOR_MASTER" Mannion
21 "Player Commands" (1.5.3-dev+3954) by AlliedModders LLC
22 "Player Respawn" (1.4) by Rogue
23 "Rock The Vote" (1.5.3-dev+3954) by AlliedModders LLC
24 "Simple Chat Processor" (1.0.2) by Simple Plugins
25 "Sound Commands" (1.5.3-dev+3954) by AlliedModders LLC
26 "SourceBans" (1.4.10) by SourceBans Development Team
27 "[Store] Backend" (1.1-alpha) by alongub
28 "[Store] Chat" (1.1.0) by Panduh
29 "[Store] Core" (1.1-alpha) by alongub
30 "[Store] Distributor" (1.1-alpha) by alongub
31 "[Store] Equipment" (1.1-alpha) by alongub
32 "[Store] Gifting" (1.1-alpha) by alongub
33 "[Store] Inventory" (1.1-alpha) by alongub
34 "[Store] Loadout" (1.1-alpha) by alongub
35 "[Store] Logging" (1.1-alpha) by alongub
36 "[Store] Refund" (1.1-alpha) by alongub
37 "[Store] Shop" (1.1-alpha) by alongub
38 "[Store] Titles" (1.1-alpha) by alongub
39 "[Store] Trails" (1.1-alpha) by alongub
40 "TeamSwitch" (1.3) by MistaGee
41 "Updater" (1.1.5) by GoD-Tony
42 "[XIX] Tower Defense Plugin" (1.0.4) by Dark Session and [XIX]
"Automatic Updater" (1.5.3-dev+3954) by AlliedModders LLC: Updates SourceMod gamedata files
"Webternet" (1.5.3-dev+3954) by AlliedModders LLC: Extension for interacting with URLs
"CS Tools" (1.5.3-dev+3954) by AlliedModders LLC: CS extended functionality
"BinTools" (1.5.3-dev+3954) by AlliedModders LLC: Low-level C/C++ Calling API
"SDK Tools" (1.5.3-dev+3954) by AlliedModders LLC: Source SDK Tools
"Top Menus" (1.5.3-dev+3954) by AlliedModders: Creates sorted nested menus
"Client Preferences" (1.5.3-dev+3954) by AlliedModders: Saves client preference settings
"SQLite" (1.5.3-dev+3954) by AlliedModders LLC: SQLite Driver
"SDK Hooks" (1.5.3-dev+3954) by AlliedModders LLC: Source SDK Hooks
"Socket" (3.0.1) by Player: Socket extension for SourceMod
Metamod:Source version 1.10.1-dev
Build ID: 870897dd343038-dev
Loaded As: Valve Server Plugin
Compiled on: Oct 24 2013
Plugin interface version: 15:14
SourceHook version: 5:5
Listing 5 plugins:
[01] SourceMod (1.5.3-dev+3954) by AlliedModders LLC
[02] CS Tools (1.5.3-dev+3954) by AlliedModders LLC
[03] SDK Tools (1.5.3-dev+3954) by AlliedModders LLC
[04] SDK Hooks (1.5.3-dev+3954) by AlliedModders LLC
[05] SteamTools (0.8.3) by Asher Baker (asherkin)
jzservices
New to forums
New to forums
Posts: 1
Joined: Mon Jan 13, 2014 3:45 am

Re: CS:Source env_explosions crashes server

Post by jzservices »

This issue exists on many servers. From what I have been told (from some higher up steam gamer friends) is that it is a linux issue to start with... meaning windows servers don't exhibit the issue. (I dont know, I have only setup linux servers) The other issue is that it deals with models that do not have health set (non-player model of course). (I know this for a fact from reading many crash dumps) So... some maps attach a model and then use the env_explosion or a store system with hats etc are being used. Removing the models would be a solution that works most of the time.

right now your plugin does something similar to this:

Code: Select all

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    new String:Classname[16];
    GetEdictClassname(inflictor, Classname, sizeof(Classname));
    
    if (StrEqual(Classname, "env_fire", false))
    {
        return Plugin_Handled;
    }
    
    else
    {
        return Plugin_Continue;
    }
}  
taken from sourcemod

it might be able to be edited to do this

Code: Select all

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    new String:Classname[16];
    GetEdictClassname(inflictor, Classname, sizeof(Classname));
 
    if(!IsValidEdict(victim)
    {
        return Plugin_Handled;
    }
    
    if (StrEqual(Classname, "env_explosion", false))
    {
        if(IsValidPlayer(victim))
        {
            new hp= (GetClientHealth(victim)-damage);
            if (hp<0)
            {
                ForcePlayerSuicide(victim);
            }
            else
            {
                SetEntityHealth(target, targetHealth);
            }
            return Plugin_Handled;
        }
    }
    
    else
    {
        return Plugin_Continue;
    }
}  

stock IsValidPlayer(client)
{
	if (client > 0 && client <= MaxClients && IsClientInGame(client))
	{
		return true;
	}
	return false;
}

or whatever, just modify your env_explosion search to adjust the clients health, you might not be able to use the on player hurt because the system already calculated the damage -_- its 6 am so im tired. Im working on a fix but got too many other projects for this.

|NotD| OG JZServices
legitified
New to forums
New to forums
Posts: 4
Joined: Fri Jan 03, 2014 4:44 pm

Re: CS:Source env_explosions crashes server

Post by legitified »

jzservices wrote:This issue exists on many servers. From what I have been told (from some higher up steam gamer friends) is that it is a linux issue to start with... meaning windows servers don't exhibit the issue. (I dont know, I have only setup linux servers) The other issue is that it deals with models that do not have health set (non-player model of course). (I know this for a fact from reading many crash dumps) So... some maps attach a model and then use the env_explosion or a store system with hats etc are being used. Removing the models would be a solution that works most of the time.

right now your plugin does something similar to this:

Code: Select all

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    new String:Classname[16];
    GetEdictClassname(inflictor, Classname, sizeof(Classname));
    
    if (StrEqual(Classname, "env_fire", false))
    {
        return Plugin_Handled;
    }
    
    else
    {
        return Plugin_Continue;
    }
}  
taken from sourcemod

it might be able to be edited to do this

Code: Select all

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    new String:Classname[16];
    GetEdictClassname(inflictor, Classname, sizeof(Classname));
 
    if(!IsValidEdict(victim)
    {
        return Plugin_Handled;
    }
    
    if (StrEqual(Classname, "env_explosion", false))
    {
        if(IsValidPlayer(victim))
        {
            new hp= (GetClientHealth(victim)-damage);
            if (hp<0)
            {
                ForcePlayerSuicide(victim);
            }
            else
            {
                SetEntityHealth(target, targetHealth);
            }
            return Plugin_Handled;
        }
    }
    
    else
    {
        return Plugin_Continue;
    }
}  

stock IsValidPlayer(client)
{
	if (client > 0 && client <= MaxClients && IsClientInGame(client))
	{
		return true;
	}
	return false;
}

or whatever, just modify your env_explosion search to adjust the clients health, you might not be able to use the on player hurt because the system already calculated the damage -_- its 6 am so im tired. Im working on a fix but got too many other projects for this.

|NotD| OG JZServices
I wish I knew what you just said here:
or whatever, just modify your env_explosion search to adjust the clients health, you might not be able to use the on player hurt because the system already calculated the damage -_- its 6 am so im tired. Im working on a fix but got too many other projects for this.
Someone gave me that plugin, and is not providing support at all. :|
Post Reply