Raised This Month: $32 Target: $400
 8% 

Console spam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazyRaccon
Junior Member
Join Date: Dec 2018
Old 12-09-2018 , 09:04   Console spam
Reply With Quote #1

Console spam




L 12/09/2018 - 14:49:02: [SM] Exception reported: Handle c8bf07f5 is invalid (error 1)
L 12/09/2018 - 14:49:02: [SM] Blaming: smrpg_effects.smx
L 12/09/2018 - 14:49:02: [SM] Call stack trace:
L 12/09/2018 - 14:49:02: [SM] [0] CloseHandle
L 12/09/2018 - 14:49:02: [SM] [1] Line 248, /home/travis/build/peace-maker/smrpg/build/addons/sourcemod/scripting/include/smlib/general.inc::ClearHandle
L 12/09/2018 - 14:49:02: [SM] [2] Line 39, smrpg_effects/ignite.sp::ResetIgniteClient
L 12/09/2018 - 14:49:02: [SM] [3] Line 81, smrpg_effects.sp::OnClientDisconnect
CrazyRaccon is offline
poachedegg
Junior Member
Join Date: Nov 2018
Location: China
Old 12-09-2018 , 09:53   Re: Console spam
Reply With Quote #2

In short, your plugin want close a invalid handle in Line 39. Maybe like ClearHandle(HandleName); Check if this handle was already close before.

According to the function name, this handle maybe only used to control the ignition state which player is disconnecting. So if you don't mind spam, you can ignore it.

Last edited by poachedegg; 12-09-2018 at 10:04.
poachedegg is offline
CrazyRaccon
Junior Member
Join Date: Dec 2018
Old 12-09-2018 , 10:02   Re: Console spam
Reply With Quote #3

Here is the script code please see



#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <smlib>

#pragma newdecls required
#include <smrpg_effects>
#include <smrpg_sharedmaterials>

#undef REQUIRE_PLUGIN
#include <smrpg_helper>

ConVar g_hCVCreditFireAttacker;

#include "smrpg_effects/rendercolor.sp"
#include "smrpg_effects/freeze.sp"
#include "smrpg_effects/ignite.sp"
#include "smrpg_effects/laggedmovement.sp"

public Plugin myinfo =
{
name = "SM:RPG > Effect Hub",
author = "Peace-Maker",
description = "Central place for effects.",
version = SMRPG_VERSION,
url = "http://www.wcfan.de/"
}

public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
RegPluginLibrary("smrpg_effects");
RegisterFreezeNatives();
RegisterRenderColorNatives();
RegisterIgniteNatives();
RegisterLaggedMovementNatives();

return APLRes_Success;
}

public void OnPluginStart()
{
SMRPG_GC_CheckSharedMaterialsAndSounds();

RegisterFreezeForwards();
RegisterIgniteForwards();
RegisterLaggedMovementForwards();

HookEvent("player_spawn", Event_OnPlayerSpawn);
HookEvent("player_death", Event_OnPlayerDeath);

g_hCVCreditFireAttacker = CreateConVar("smrpg_credit_ignite_attacker", "1", "Credit fire damage to the attacker which ignited the victim?", _, true, 0.0, true, 1.0);
AutoExecConfig(true, "plugin.smrpg_effects");

SetupFreezeData();

// Account for late loading
for(int i=1;i<=MaxClients;i++)
{
if(IsClientInGame(i))
OnClientPutInServer(i);
}
}

public void OnMapStart()
{
PrecacheFreezeSounds();
ReadLimitDamageConfig();
}

public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, Hook_OnTakeDamage);
ResetRenderColorClient(client);
}

public void OnClientDisconnect(int client)
{
ResetRenderColorClient(client);
ResetFreezeClient(client);
ResetIgniteClient(client, true);
ResetLaggedMovementClient(client);
}

/**
* Event callbacks
*/
public void Event_OnPlayerSpawn(Event event, const char[] error, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(!client)
return;

ResetFreezeClient(client);
ResetIgniteClient(client, false);
ApplyDefaultRenderColor(client);
ResetLaggedMovementClient(client);
}

public void Event_OnPlayerDeath(Event event, const char[] error, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(!client)
return;

ResetFreezeClient(client);
ResetIgniteClient(client, false);
ResetLaggedMovementClient(client);
}

/**
* Hook callbacks
*/
public Action Hook_OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3], int damagecustom)
{
Action iRetFreeze = Freeze_OnTakeDamage(victim, attacker, inflictor, damage);
Action iRetIgnite = Ignite_OnTakeDamage(victim, attacker, inflictor, damage, damagetype);
return iRetFreeze > iRetIgnite ? iRetFreeze : iRetIgnite;
}

/**
* Helpers
*/
// IsValidHandle() is deprecated, let's do a real check then...
// By Thraaawn
stock bool IsValidPlugin(Handle hPlugin) {
if(hPlugin == null)
return false;

Handle hIterator = GetPluginIterator();

bool bPluginValid = false;
while(MorePlugins(hIterator)) {
Handle hLoadedPlugin = ReadPlugin(hIterator);
if(hLoadedPlugin == hPlugin) {
bPluginValid = GetPluginStatus(hLoadedPlugin) == Plugin_Running;
break;
}
}

delete hIterator;

return bPluginValid;
}

// This removes a prefix from a string including anything before the prefix.
// This is useful for TF2's tfweapon_ prefix vs. default weapon_ prefix in other sourcegames.
stock void RemovePrefixFromString(const char[] sPrefix, const char[] sInput, char[] sOutput, int maxlen)
{
int iPos = StrContains(sInput, sPrefix, false);
// The prefix isn't in the string, just copy the whole string.
if(iPos == -1)
iPos = 0;
// Skip the prefix and all other stuff before it.
else
iPos += strlen(sPrefix);

// Support for inputstring == outputstring?
char[] sBuffer = new char[maxlen+1];
strcopy(sBuffer, maxlen, sInput[iPos]);

strcopy(sOutput, maxlen, sBuffer);
}
CrazyRaccon is offline
poachedegg
Junior Member
Join Date: Nov 2018
Location: China
Old 12-09-2018 , 10:17   Re: Console spam
Reply With Quote #4

Not in this sp. In smrpg_effects/ignite.sp line 39.

If you really want to call this function when client is disconnecting, You should change

PHP Code:
void ResetIgniteClient(int clientbool bDisconnect)
{
    if(
g_hIgnitePlugin[client] != null && IsClientInGame(client))
        
ExtinguishClient(client);
    
ResetClientIgniteState(client);
    
ClearHandle(g_hExtinguish[client]);
    
    
// Extinguish again a few frames later, so ragdolls don't burn.
    
if(!bDisconnect)
        
g_hExtinguish[client] = CreateTimer(0.2Timer_ExtinguishGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);

to

PHP Code:
void ResetIgniteClient(int clientbool bDisconnect)
{
    if(
g_hIgnitePlugin[client] != null && IsClientInGame(client))
        
ExtinguishClient(client);
    
ResetClientIgniteState(client);
    
    
// Extinguish again a few frames later, so ragdolls don't burn.
    
if(!bDisconnect)
    {
        
ClearHandle(g_hExtinguish[client]);
        
g_hExtinguish[client] = CreateTimer(0.2Timer_ExtinguishGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
    }

You needn't close the extinguish timer when client disconnect beacuse this timer has a self judgment.

same in funciton:
ResetFreezeClient (smrpg_effects/freeze.sp line 75)
ResetLaggedMovementClient (smrpg_effects/laggedmovement.sp line 50 51)
But they don't have param bDisconnect. You can add it by yourself.

Last edited by poachedegg; 12-09-2018 at 10:49.
poachedegg is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode