Jump to content

Rename lib folder & compile python library


Recommended Posts

  • Bot

Hello guys!
I wanna rename lib folder, but I know that this folder is loaded by system.py and binary.


In binary I've found only one record which containt "lib" so I replaced it.

bool CheckPythonLibraryFilenames()
{
	for (int i = 0; *sc_apszPythonLibraryFilenames[i] != '\n'; ++i)
	{
		std::string stFilename = "NameOfTheFolder\\";
		stFilename += sc_apszPythonLibraryFilenames[i];

		if (_access(stFilename.c_str(), 0) != 0)
		{
			return false;
		}

		MoveFile(stFilename.c_str(), stFilename.c_str());
	}

	return true;
}

Then in system.py:

sys.path.append("NameOfTheFolder")

 

But client crashes immediately after launch.

Does anybody know where to edit next?

english_banner.gif

Link to comment
Share on other sites

  • Bot

Here are my steps what I've done:

Client/UserInterface.cpp:

bool CheckPythonLibraryFilenames()
{
	for (int i = 0; *sc_apszPythonLibraryFilenames[i] != '\n'; ++i)
	{
		std::string stFilename = "NameOfTheFolder\\";
		stFilename += sc_apszPythonLibraryFilenames[i];

		if (_access(stFilename.c_str(), 0) != 0)
		{
			return false;
		}

		MoveFile(stFilename.c_str(), stFilename.c_str());
	}

	return true;
}

Root/System.py:

sys.path.append("NameOfTheFolder")

Extern/include/Python-2.7/pyconfig.h:

#ifndef PYTHONPATH
#	define PYTHONPATH ".\\DLLs;.\\NameOfTheFolder;.\\NameOfTheFolder\\plat-win;.\\NameOfTheFolder\\lib-tk"
#endif

Python-2.7.13/PC/pyconfig.h:

#ifndef PYTHONPATH
#	define PYTHONPATH ".\\DLLs;.\\NameOfTheFolder;.\\NameOfTheFolder\\plat-win;.\\NameOfTheFolder\\lib-tk"
#endif


I withdraw compiled python27_d.dll and python27_d.lib from Python-2.7.13\PCbuild\amd64 and I do those things:
python27_d.dll ranem to python27.dll and input to client folder
python27_d.lib input to extern\lib

When I try to start client, it gives me this error:
eda1e50d0bede0a1cad474dca8a68e22.png


What am I doing wrong?

Edited by Metin2 Dev
Core X - External 2 Internal

english_banner.gif

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.