Jump to content

[M2Dev] Advanced Files To Build Your Server: Src & Server Files & Client [x64 / DX9Ex / CMake / Python3.14 / FreeType / XChaCha20-Poly1305]


Recommended Posts

4 hours ago, veylor01 said:

first of all thank you for that great release and your effort. but idk if im to stupid to setup the files. i have got everything running but i cant connect to the server with my client. i have noticed processes arent running with my stop.py script. i have set up user mt2 and everything should be fine with the db.

start.py:
spacer.png

 

stop.py:

spacer.png

Be sare about host when you specify an USER on mariadb. Try to create the same username, with same password and same privileges but one with '%' and one with 'localhost'.

  • Active+ Member
7 hours ago, veylor01 said:

first of all thank you for that great release and your effort. but idk if im to stupid to setup the files. i have got everything running but i cant connect to the server with my client. i have noticed processes arent running with my stop.py script. i have set up user mt2 and everything should be fine with the db.

start.py:
spacer.png

 

stop.py:

spacer.png

That usually means that the pid process was not found by the stop script. After the stop gives you this do "ps" in the terminal and see if you still have the channel and db processes running. You can kill them manually from the terminal using their pid's and start the server again.

The other case would be that your channels are crashing. In that case check for core files, although if that was the case, the stop script would not be able to find the crashed pid, not all of them.

See what is left open in your ps list after executing the stop script.

1 hour ago, Mind Rapist said:

That usually means that the pid process was not found by the stop script. After the stop gives you this do "ps" in the terminal and see if you still have the channel and db processes running. You can kill them manually from the terminal using their pid's and start the server again.

The other case would be that your channels are crashing. In that case check for core files, although if that was the case, the stop script would not be able to find the crashed pid, not all of them.

See what is left open in your ps list after executing the stop script.

 

this is what i get with ps:
spacer.png

 

db syserr:

[2025-12-30 23:30:27.190] [error] [int Start()()] TABLE_POSTFIX not configured use default
[2025-12-30 23:30:30.207] [error] [int CClientManager::Process()()] FDWATCH: peer null in event: ident 20
[2025-12-30 23:30:31.256] [error] [int CClientManager::Process()()] FDWATCH: peer null in event: ident 20
[2025-12-30 23:30:32.240] [error] [int CClientManager::Process()()] FDWATCH: peer null in event: ident 20
[2025-12-30 23:30:33.266] [error] [int CClientManager::Process()()] FDWATCH: peer null in event: ident 20
[2025-12-30 23:31:35.333] [error] [int CClientManager::Process()()] FDWATCH: peer null in event: ident 19
[2025-12-30 23:31:36.057] [error] [void hupsig(int)()] SIGHUP, SIGINT, SIGTERM signal has been received. shutting down.

 

channel1 core1 syserr:

[2025-12-30 23:30:29.229] [error] [int pid_init()()] 
Start of pid: 2118

[2025-12-30 23:30:29.924] [error] [bool ITEM_MANAGER::ReadEtcDropItemFile(const char *)()] No such an item (name: Èò»ö ´ó±â+)
[2025-12-30 23:30:29.924] [error] [void CInputDB::Boot(const char *)()] cannot load ETCDropItem: locale/english/etc_drop_item.txt
[2025-12-30 23:30:29.926] [error] [void xmas::SpawnEventHelper(bool)()] cannot get map base position 1
[2025-12-30 23:30:29.926] [error] [void xmas::SpawnEventHelper(bool)()] cannot get map base position 3
[2025-12-30 23:30:29.926] [error] [void xmas::SpawnEventHelper(bool)()] cannot get map base position 23
[2025-12-30 23:30:29.926] [error] [void xmas::SpawnEventHelper(bool)()] cannot get map base position 43
[2025-12-30 23:30:30.185] [error] [void pid_deinit()()] 
End of pid

 

file etc_drop_item.txt looks legit. i compared it even with the one from the tmp files, which work perfectly fine.

everything should work but obviously it dosent

  • Active+ Member
7 minutes ago, veylor01 said:
[2025-12-30 23:30:29.924] [error] [void CInputDB::Boot(const char *)()] cannot load ETCDropItem: locale/english/etc_drop_item.txt

Please make sure you update your server project to the latest version as we got rid of some invisible non-unicode characters in txt configuration files

  • Active+ Member
13 minutes ago, Cyna said:

I have a question. Do they run on BSD 14? And is there a tutorial on how to compile everything?

Running successfully on any modern FreeBSD version. I personally used 14.3-RELEASE when I got started with this and since December 2nd I've been using 15.0-RELEASE without any issues. No tutorials are available for these specific files but I can send over a quick little guide I made for another person that explains how to get started with FreeBSD (specifically for this project), what to install and how.

After you're done configuring your instance git clone the server and server-src projects, build server-src and distribute the binaries into their respective directories. Then run the install.py script, make.py from quests and start your server for the first time

  • Active+ Member

Year ain't done yet...

New PR's merged!

What's new:

  • Improved BiDi and Arabic support
  • Fix assertion failure in GetMeshPointer by correcting mesh index validation

  • Removed conflict between 2 players with negative karma in PK Hostile mode. You can now kick eachother's butts when you are both negative without activating Free mode 🥋

  • Added EventFlag-based quest enable/disable system

    • Implemented EventFlag system to control quest availability:

      • Added IsEventFlagSet() to check if EventFlag exists in questmanager

      • Added EventFlag checks in ExecuteQuestScript() for per-quest control

      • Added EventFlag checks in HandleEvent() for NPC-based quest control

      • Added EventFlag checks in OnChat() for chat-based quest control

    • Usage:

      • Enable/disable specific quest: /event quest_<questname>_enabled 0/1

      • Enable/disable all NPC quests: /event quest_npc_<vnum>_enabled 0/1

      • Enable/disable all quests globally: /event quests_global_enabled 0/1

  • Started working on clinet-server sync fix. It's in early stages!

  • Added handshake timeout protection

  • Fixed SEQUENCE packet mismatching in packet validation

  • Modernized AsyncSQL codebase

  • Reworked 4 maps:

    • Fire land:

      • Updated Large Map from the GF official patches

      • Updated the map from the GF official patches. The Fireland Guard is now approachable through the official bridge (he was in the middle of a lava river before). His background is the castle gate for the Razador dungeon, just like the official

    • Ice mountain:

      • Updated Large Map from the GF official patches

      • Updated the map from the GF official patches. The Ice dungeon guard now exists in the map along with the castle gate for the Nemere dungeon (missing but coming soon)

    • Threeway (A2):

      • Updated Large Map from the GF official patches

      • Added the gate for the Grotto of Exile behind Koe Pung so that it matches the official and to resolve terrain flickerin
      • Rotated Seon-Pyeong so he faces the incoming player (was facing the wall)
    • Milgyo:
      • Updated Large Map from the GF official patche

      • Updated the terrain around the Devil's Catacomb to match the official "burned feel and vibe" and to resolve poorly transitioned terrains between grass and dirt

      • Repositioned the Guard so he is at the center of the entrance

      • Rotated Lee-Chung so he faces the player (was facing the wall/trees)

 

And now I'm accepting bets (Crypto only): will our amazing team manage to push another awesome update before this year ends??? 😂

Appreciate y'all for another amazing year (even if I came at the end of it)!

Edited by Mind Rapist
  • Metin2 Dev 1
  • Love 7

Has anyone tested the bow recently?
Sequence: Bow attack 2-3 attacks, then movement = log out.
If this is still happening for you, I'll be happy to post the fix as a thank you for your work.
I'm already using a heavily modified version.

  • Active+ Member
10 hours ago, DerUranov97 said:

Has anyone tested the bow recently?
Sequence: Bow attack 2-3 attacks, then movement = log out.
If this is still happening for you, I'll be happy to post the fix as a thank you for your work.
I'm already using a heavily modified version.

Had a report like that some days back and tested it with latest clean file versions, I didn't have this issue personally. Anyone else having this?

22 hours ago, Mind Rapist said:

Had a report like that some days back and tested it with latest clean file versions, I didn't have this issue personally. Anyone else having this?

I will test this with a ninja

On 12/30/2025 at 1:08 PM, veylor01 said:

first of all thank you for that great release and your effort. but idk if im to stupid to setup the files. i have got everything running but i cant connect to the server with my client. i have noticed processes arent running with my stop.py script. i have set up user mt2 and everything should be fine with the db.

start.py:
spacer.png

 

stop.py:

spacer.png

For anyone facing the same issues: Instead of manually uploading your server and src files (e.g. via WinSCP), try cloning the repository directly with Git. This prevents formatting errors (like wrong line endings) and ensures that file permissions are set correctly. This solved the problem for me, and now everything works perfectly.

  • Love 1
On 1/2/2026 at 10:51 PM, Mind Rapist said:

Had a report like that some days back and tested it with latest clean file versions, I didn't have this issue personally. Anyone else having this?

I cannot replicate this issue using latest files.. do you have some idea?

  • Active+ Member
6 minutes ago, ErLullo said:

I cannot replicate this issue using latest files.. do you have some idea?

Well the bug was found in :

On 1/2/2026 at 12:51 PM, DerUranov97 said:

a heavily modified version

so probably not a clean version issue. Still a share of the fix for future reference would be appreciated 🙂

The fix for the bow, in case it crashes for you. my .md

Still in current src.

## Problem
Beim Bogenangriff kann der Client crashen, wenn das Ziel während/kurz nach dem Schuss gelöscht wird (z.B. `HEADER_GC_DEAD` / `HEADER_GC_CHARACTER_DEL`) und danach ein Anim-Event (`OnSetFlyTarget`) noch auf einen ungültigen Target-Pointer zugreift.

---

## Dateien
- `PythonPlayerEventHandler.h`
- `PythonPlayerEventHandler.cpp`

---

## Schritt 1: Header patchen
Öffne:
- `PythonPlayerEventHandler.h`

Ersetze in `CPythonPlayerEventHandler` die Klasse `CNormalBowAttack_FlyEventHandler_AutoClear` (inkl. Member) durch:

```cpp
class CNormalBowAttack_FlyEventHandler_AutoClear : public IFlyEventHandler
{
	public:
		CNormalBowAttack_FlyEventHandler_AutoClear() : m_pParent(nullptr), m_pInstMain(nullptr), m_dwTargetVID(0) {}
		virtual ~CNormalBowAttack_FlyEventHandler_AutoClear() {}

		void Set(CPythonPlayerEventHandler * pParent, CInstanceBase * pInstMain, CInstanceBase * pInstTarget);
		void SetTarget(CInstanceBase* pInstTarget);

		virtual void OnSetFlyTarget();
		virtual void OnShoot(DWORD dwSkillIndex);

		virtual void OnNoTarget() { /*Tracenf("Shoot : target?");*/ }
		virtual void OnExplodingOutOfRange() { /*...*/ }
		virtual void OnExplodingAtBackground() { /*...*/ }
		virtual void OnExplodingAtAnotherTarget(DWORD dwSkillIndex, DWORD dwVID);
		virtual void OnExplodingAtTarget(DWORD dwSkillIndex);

	protected:
		CPythonPlayerEventHandler * m_pParent;
		CInstanceBase * m_pInstMain;
		DWORD m_dwTargetVID;
		TPixelPosition m_kPPosTarget;
} m_NormalBowAttack_FlyEventHandler_AutoClear;

 

Crash cause.
The handler stores a raw CInstanceBase* m_pInstTarget for bow targets. When the target is deleted, the pointer becomes dangling. Later animation or OnSetFlyTarget events dereference freed memory and crash.

Fix effect.
The fix removes the raw pointer and tracks m_dwTargetVID and TPixelPosition m_kPPosTarget, initialized to zero. The target is revalidated or resolved by VID and position before use, preventing use-after-free and stopping crashes when the target disappears mid-flight.

Edited by DerUranov97
  • Love 1

Hey, how do I enable the standard syserr.txt for the generated Release build here? Currently, it's only in the Debug build.

Edited by poszukiw
11 hours ago, poszukiw said:

Hey, how do I enable the standard syserr.txt for the generated Release build here? Currently, it's only in the Debug build.

Try this, I have to try too

 

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

On 1/9/2026 at 12:20 PM, ErLullo said:

Try this, I have to try too

 

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

Thanks, but that didn't change anything. Still, syserr.txt doesn't populate on the Release version.

On 1/11/2026 at 7:08 PM, poszukiw said:

Thanks, but that didn't change anything. Still, syserr.txt doesn't populate on the Release version.

This is not a CMake issue. In Metin sources syserr() is usually compiled out in Release builds via macros (NDEBUG, DEBUG, logging guards).

Debug works because logging macros are enabled, but in Release syserr() is either empty or redirected to stderr without opening syserr.txt.

To fix it you must:

Spoiler

force-enable logging macros in Release or

modify syserr macro so it always writes or

manually freopen("syserr.txt", "a", stderr) in Release.

Simply setting -DCMAKE_BUILD_TYPE=Release will never enable syserr.txt by itself.

 syserr.txt not populating in Release build

This is not a CMake issue.

In Metin2 sources, syserr() / error logging is compiled out or redirected in Release builds.

Setting only:

Bash

cmake -DCMAKE_BUILD_TYPE=Release

will never enable syserr.txt by itself.

In Release, errors usually go to stderr, but stderr is not redirected to a file.

🙅🔧 Fix (force syserr.txt in Release) 🔨😏

Add one of the following at the very beginning of server startup (e.g. in main()):

1. Option - simple & effective

Cpp

#ifndef DEBUG

freopen("syserr.txt", "a", stderr);

#endif

2. Option - with error checking

Cpp

#ifndef DEBUG

FILE* f = freopen("syserr.txt", "a", stderr);

if (!f) {

    perror("freopen syserr.txt failed");

}

#endif

3. Option production-safe (no buffering)

Cpp

#ifndef DEBUG

FILE* f = fopen("syserr.txt", "a");

if (f) {

    dup2(fileno(f), fileno(stderr));

    setvbuf(stderr, NULL, _IONBF, 0);

}

#endif

 

⚠️ Test ⚠️

Clean build directory

Build release

Start server

Trigger an error

syserr.txt will now populate in release

 

Good luck ✨❕

Edited by VegaS™
added spoiler..
  • Metin2 Dev 1
On 1/11/2026 at 5:08 PM, poszukiw said:

Thanks, but that didn't change anything. Still, syserr.txt doesn't populate on the Release version.

Mate, in Debug.cpp comment macros for distribute / debug from traceerror, etc.

 

Funcs are self explanatory.

  • Metin2 Dev 1
  • Love 1

Hello ☺️

I created VDI for using everyone 🥳

Server with source location are in folder /root/

This is the hidden content, please

This is the hidden content, please

Download Center

This is the hidden content, please

This is the hidden content, please

 

  • Metin2 Dev 11
  • Cry 1
  • Good 1
  • Love 7

  

i pull latest client resource,when i start game, client crash,tips :Run - <type 'exceptions.AttributeError'>:'SelectCharacterWindow' object has no attribute 'dlgQuestion'  what' wrong?

11 hours ago, bigpanda0797 said:

i pull latest client resource,when i start game, client crash,tips :Run - <type 'exceptions.AttributeError'>:'SelectCharacterWindow' object has no attribute 'dlgQuestion'  what' wrong?

sovled!!!

  • Active+ Member
36 minutes ago, Sz3cA said:

Hello, I am a beginner programmer in the world of Metin2. Can anyone tell me how to obtain the .txt files to pack dumpproto into the client?

Hey dude go to the server project in share/conf and you will find item/mob_names/proto.txt there. The default is English so if you only wanna make one item/mob_proto files for the client and not in English rename item/mob_names into item/mob_names_en.txt and then rename your desired names_<lang> into item/mob_names.txt

Hope this helped

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.