Jump to content

Recommended Posts

Ey. I was adding a specular system and i noticed my client is crashing for this specific line with no error sysrr

 

cfg.Set(cfg.SAVE_CHARACTER_SLOT, "slot_{}".format(name), self.slot)

 

I added to the client source the PythonConfig.h, PythonConfig.cpp and PythonConfigModule.cpp as it required to work properly. I got no errors at compiling the client ejecutable itself. I really dont know if the problem is in the module itself or the code syntax of Set.

PyObject* poModule = Py_InitModule("cfg", s_methods);

Im getting some errors to compile the debug version for some reason, so my theory is that the game is reading the module (cuz no sysrr) but the syntax or the code itself didnt work. As u can expect, i just know the basic, that's is why im asking there

 

This is the code of Set

Spoiler

PyObject* cfgSet(PyObject* poSelf, PyObject* poArgs)
{
    unsigned char bType;
    if (!PyTuple_GetByte(poArgs, 0, &bType))
        return Py_BuildException();

    char* szKey;
    if (!PyTuple_GetString(poArgs, 1, &szKey))
        return Py_BuildException();

    char* szValue;
    int iValue;

    CPythonConfig& rkConfig = CPythonConfig::Instance();

    if (PyTuple_GetString(poArgs, 2, &szValue))
    {
        rkConfig.Write((CPythonConfig::EClassTypes)bType, szKey, szValue);
    }
    else if (PyTuple_GetInteger(poArgs, 2, &iValue))
    {
        rkConfig.Write((CPythonConfig::EClassTypes)bType, szKey, iValue);
    }
    else
        return Py_BuildException();

    return Py_BuildNone();
}

im i missing something?¿

Link to comment
https://metin2.dev/topic/30690-crash-with-no-sysrr/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.