szGabu / Left4SendProxy

Repository and compiled binaries of TheByKotik's sendproxy. Left 4 Dead 2 only.
GNU General Public License v3.0
7 stars 3 forks source link

Extension keeps crashing server #2

Open blueblur0730 opened 4 days ago

blueblur0730 commented 4 days ago

Hello. I'm currently using Ubuntu 20.04, game: left4dead2 2.2.4.1, sourcemod version 1.11-6964, metamod version 1.11.0-dev+1155. By the first time I use this extension I noticed it was failed to load because my OS is lack of glibc 2.34, so I followed the instructions below to install the newest library:

The istallation was successful. Then I restarted the machine and ran the game, the game kept crashing and restarting, by removeing the sendproxy extention the server could successfully start up, which makes me kinda confused. I've checked sm error log, console log, none of them logged any information why the server crashes. But here is one of the most recent accelerator dump: B7YX-S7HS-UKC4 which indicates: sendproxy.ext.2.l4d2.so + 0x13825. Should I use a newer version of my OS or is there something wrong with the extension binary?

blueblur0730 commented 4 days ago

By more testing I found it was actually my plugin's problem. If I not load this code the server could normally run with the extension loaded. I have never use this extention before, here is what I wrote:

public void OnEntityCreated(int entity, const char[] sClassName)
{
    if (!IsValidEntity(entity))
        return;

    if (strcmp(sClassName, "vgui_screen") == 0)
    {
        SendProxy_Hook(entity, "m_nPanelName", Prop_Int, SendProxy_OnPanelNameChanged);
        PrintToServer("vgui_screen Entity created: %d, %s", entity, sClassName);
    }
}

public void OnEntityDestroyed(int entity)
{
    if (!IsValidEntity(entity))
        return;

    char sClassName[64];
    GetEntityClassname(entity, sClassName, sizeof(sClassName));

    if (strcmp(sClassName, "vgui_screen") == 0)
    {
        SendProxy_Unhook(entity, "m_nPanelName", SendProxy_OnPanelNameChanged);
        PrintToServer("vgui_screen Entity destroyed: %d, %s", entity, sClassName);
    }
}

Action SendProxy_OnPanelNameChanged(const int iEntity, const char[] cPropName, int &iValue, const int iElement, const int iClient)
{
    PrintToServer("SendProxy_OnPanelNameChanged: %d, %s, %d, %d, %d", iEntity, cPropName, iValue, iElement, iClient);

    return Plugin_Continue;
}

Shouldn't I hook this property or this entity?