Jump to content

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


Recommended Posts

  • Premium
13 hours ago, Mind Rapist said:

NOTICE

 

I would like to thank all of y'all once again for the tremendous support to this project. I was absent from the scene for many years before I started co-developing it with the guys and when I saw it it peaked my interest. When I tried it for the first time my thoughts were something like

After solving one, then the next, then the next, most of them with your help, I started seeing the potential this unique design has to offer so I decided to contribute more, in any way that I possibly can.

This source is almost 12 years old and it has more redundancies than necessities, technologies from 10+ years back and so far nothing has changed. I believe that this project is here to become the first of many changes around the scene.

UPDATES:

I know that our latest merges have incomplete parts such as macro leftovers. I have posted a temporary download link with the fixed files but the reason that I haven't pushed another PR to be merged yet is because I am also working on a messenger bug that I discovered. It's a small bug but I wanna push it all together.

Other than the correct files and the invisibility + messenger fixes, you can expect tiny little improvements such as activating dragonstone alchemy decks with CTRL+C/D, the shaman horse hitting fix, movable autopotions throughout the inventory while activated (no idea why they were locked in the first place) and possibly a few more. These fixes are small so it will not be considered a major update.

Again, sorry for the inconveniece and I appreciate your patience. If you are actively developing these files please take eatly push from Friday as an example and test everything thouroughly, always, otherwise you see how messy it can get later.

I also appreciate any help/contribution in advance regarding solving the messenger bug as well as other little persistent bugs that I'm facing.

As always thank you and I'll keep you posted 🙂

On 12/19/2025 at 9:41 PM, Mind Rapist said:

New PR's uploaded for both sources!

What's updated:

  • @ Mali's reversed real-time character level updates for both game view and in-game windows for all viewing characters (e.g., Guild window). Affects both sources
  • @tw1x1's brand NEW completely custom fix for auto-reverting POS_FIGHTING back to POS_STANDING after 10 seconds of battle inactivity. What this means:
    • fresh start for functions checking for == POS_STANDING or != POS_FIGHTING
    • the logout countdown ALWAYS reverts to 3 seconds after character disengages battle
    • some pulse incompatibility issues/differences between localhost and VPS instances have been noticed and addressed successfully
    • tests performed and successfully reverted:
      • The character hits another character
      • The character gets hit by another character
      • The character hits a monster/stone
      • The character gets hit by a monster
      • The character uses an aggressive skill on another character
      • The character uses an aggressive skill on a monster/stone
      • An aggressive skill is being used on the character
      • A boss uses an aggressive skill on the character
    • All tests were performed without any entity ending up dead and the fix works successfully
    • Does not affect already handled position states (defeating a monster, etc...)
    • Affects the server source
    • In simple words: one hit was enough to render the character in constant fighting position until the time they disconnected/died. Not anymore. A small yet powerful fix that adds consistency to the gameplay experience and provides real-time state updates for the server.

Test as soon as it's merged and share your feedback!

Open two clients, mount one, start attacking on the spot, and watch the character move around on the other screen like a bee around a dandelion.

Edited by TAUMP


 

  • Active+ Member
21 minutes ago, TAUMP said:

Open two clients, mount one, start attacking on the spot, and watch the character move around on the other screen like a bee around a dandelion.

Not in my clients. Tested with a male warrior holding a Soul Stealing Blade+9 on a mount with seal vnum 71126 and attack speed of 138.

I would love to hear more about it though.

  • Please make sure that this bug is happening on a freshly cloned repo (client and sources) or without any modification regarding mounting, battle or anything relevant. A bonus step would be to test in a source without any of last Friday's updates!
  • Post any syserrs or logs you think could be related
  • Post every step you took in order for someone to reproduce this bug and figure out more
  • Honorable Member

New PRs have been merged, the mentioned build errors shouldn't exist anymore.

  • Metin2 Dev 1
  • Love 1

992404397646696589.png
Former C++ Developer at Gameloft on DML
Join my Discord: Distraught Labs

  • Active+ Member

Throw me a baby shower cause I can't stop pushing! 🫄

New PRs submitted!

What to expect after the merge:

  • No more macros/macro leftovers
  • The invisibility (/in) fixes I shared earlier this week are included in the client source.
  • Messenger removals:
    • Solved a bug that wouldn't let the deletion go through if both players were not online
    • Solved a bug that would show the deletion ChatPacket to both characters.
  • Shaman mounted hits bug when attack speed was at extreme levels is now fixed (credits to @ Ikarus_)
  • Casting speed is now calculated in the skill cooltimes in the UI (fix by @ Sonitex)
  • HP/SP values are not affected by Max HP/SP changes due to status point upgrades, alchemy, equipment with bonus, etc... Tested with mount that gives HP of 20000 as a bonus, with equipment of total of 45000 HP in bonuses and various other scenarios. Warrior's Dash also doesn't reduce HP.
    Are there better ways to do it? Most probably... Does it work? Oh yeah! Feel free to provide corrections and improvements 🙏
  • Fixed a bug that killed the target without emptying their HP with the /kill command
  • Fixed a bug that would show everyone the same ChatPacket message regardless of their party role when an attempt to be removed from the team would occur. Several other ChatPacket improvements and slight dungeon logic improvements regarding removals from parties while in dungeons.
    Translations updated only for English
  • Auto potions are now movable within inventory pages while active. As a failsafe, they are disabled automatically before being dropped to the ground.
  • VIT/INT/STR/DEX reset scrolls now reset the selected stat at the character's initial value (based on character job) instead of 1. Translations updated for all languages! (Used G Translate so please review -- reset_status._50_say, reset_status._70_say). I also updated reset_scroll._40_say to say "initial values" instead of "1".
  • constInfo now provides the QUICKSLOT_MAX_NUM
  • When dragging an item that already exists in the taskbar from any window to a taskbar quickslot other than its own, if the new slot is not empty, the items are swapped, not replaced
  • When using a skill, the logout countdown is cancelled. Same for the victim of the skill (if any)
  • Dragonsoul alchemy decks can be toggled with your keyboard (CTRL+C for the first one, CTRL+D for the second)
  • The install.py script only generates and links the package folder in non-Windows environments as some people reported issues starting the server with that folder in Windows.
  • AND LAST BUT NOT LEAST
    Spoiler

    That's it see ya in the next one!

    Have a merry friggin Xmas! 🎄

  • Metin2 Dev 2
  • Love 5
2 hours ago, Mind Rapist said:

Throw me a baby shower cause I can't stop pushing! 🫄

New PRs submitted!

What to expect after the merge:

  • No more macros/macro leftovers
  • The invisibility (/in) fixes I shared earlier this week are included in the client source.
  • Messenger removals:
    • Solved a bug that wouldn't let the deletion go through if both players were not online
    • Solved a bug that would show the deletion ChatPacket to both characters.
  • Shaman mounted hits bug when attack speed was at extreme levels is now fixed (credits to @ Ikarus_)
  • Casting speed is now calculated in the skill cooltimes in the UI (fix by @ Sonitex)
  • HP/SP values are not affected by Max HP/SP changes due to status point upgrades, alchemy, equipment with bonus, etc... Tested with mount that gives HP of 20000 as a bonus, with equipment of total of 45000 HP in bonuses and various other scenarios. Warrior's Dash also doesn't reduce HP.
    Are there better ways to do it? Most probably... Does it work? Oh yeah! Feel free to provide corrections and improvements 🙏
  • Fixed a bug that killed the target without emptying their HP with the /kill command
  • Fixed a bug that would show everyone the same ChatPacket message regardless of their party role when an attempt to be removed from the team would occur. Several other ChatPacket improvements and slight dungeon logic improvements regarding removals from parties while in dungeons.
    Translations updated only for English
  • Auto potions are now movable within inventory pages while active. As a failsafe, they are disabled automatically before being dropped to the ground.
  • VIT/INT/STR/DEX reset scrolls now reset the selected stat at the character's initial value (based on character job) instead of 1. Translations updated for all languages! (Used G Translate so please review -- reset_status._50_say, reset_status._70_say). I also updated reset_scroll._40_say to say "initial values" instead of "1".
  • constInfo now provides the QUICKSLOT_MAX_NUM
  • When dragging an item that already exists in the taskbar from any window to a taskbar quickslot other than its own, if the new slot is not empty, the items are swapped, not replaced
  • When using a skill, the logout countdown is cancelled. Same for the victim of the skill (if any)
  • Dragonsoul alchemy decks can be toggled with your keyboard (CTRL+C for the first one, CTRL+D for the second)
  • The install.py script only generates and links the package folder in non-Windows environments as some people reported issues starting the server with that folder in Windows.
  • AND LAST BUT NOT LEAST
      Hide contents

    That's it see ya in the next one!

    Have a merry friggin Xmas! 🎄

Wanna hear some criticism for Christmas ? I think that the removal of macros was a bad idea because it was easier to track what was/is/will be changed in the source code for people that already did changes or only want to apply partial changes to it.Also having macros in the client while missing them on the server looks kinda messy.If the macros are removed at least add some comments named changenr1,2,3 where changes are applied.And have a documentation in project description about which one does what.Looks more organised and also in case something goes wrong with a fix or fix for fix and some bugs appear it'a easier to keep track and fix them.Given the rythm that the pr is updated in the last time it's becoming harder and harder to keep track of the changes comparing. Nevertheless , thank you for the contribution and Merry Christmas!

  • Love 1
  • Active+ Member

Complimentary updates for MR-3 patch:

In addition to the changes in the message above, the following have been implemented:

  • Safeguards for auto potions: the item(s) disables automatically when:
    • It is part of an accepted trade
    • It is placed from the inventory to safebox
    • It is part of the items list of a private shop when it opens
    • It is being sold to an NPC
  • .gitattributes file added to enforce locale encodings to both server and client projects.

ATTENTION

   If you are pushing at your own private repo(s), it is vitally important that you change the default file encodings in the server project inside the new .gitattributes.

At the moment locale_string.txt and translate.lua are configured to UTF-8 because we are using the English versions as defaults. If your default locale is different please edit the server's .gitattributes accordingly.

Also in order to avoid push errors to your repos, it is very important to Save translation files with the correct encoding! Saving in a different encoding than the forced one inside .gitattributes may result in push errors.

  • Good 1
  • Love 2
  • Active+ Member

FOR THOSE OF YOU THAT PULLED THE LATEST VERSION

 

If you pulled the latest version for server-src please note that the logout cancellation in char_skill.cpp may cause core crashes. An update will be pushed in the next hours or tomorrow that fixes the issue. Until then it is recommended to comment out or remove the faulty code.

Thank you for understanding

  • Metin2 Dev 2
  • Active+ Member

IT IS FINALLY HERE...

 

New PRs merged from multiple contributors

Please make sure that you READ TO THE END!!!

 

What's changed:

  • Smart early exit depending on terrain garbage collector being empty for better CPU optimization
  • Minor TCP fixes and optimizations for FreeBSD environments
  • PK mode fixed! Hostile mode does not activate Free mode when activated by players with negative karma. In addition, a player from the same Guild cannot attack the character in any PK mode except Free. Client responds accordingly to all cases and updates!
  • Logout countdown cancellation due to skill use/being the victim of another player's skill no longer crashes the core and is simplified and optimized
  • Several MSE files wrongly pointing to JPG files have been corrected to point at DDS files instead, fixing several syserr entries on loading.
  • Additional auto potion safeguards have been added in the root pack so the item always deactivates before trading or being placed in the safebox.

 

And last but not least...

 

.png

 

A fully Unicode client source is finally here!

Features:

  • Multiple charsets can be rendered without ever changing locale settings in cfg files!
  • Type with multiple keyboards in one go! The text fields no longer erase your typed string when changing keyboard language. "бля... Αβγδέ! So happy to be here!" is finally possible in a single message!
  • مرحبا العربية! Arabic and RTL support is here. Client smartly responds to selected locale and independently adapts to typing keyboard! That means auto-switching from LTR -> RTL when changing keyboard to Arabic, and the opposite when changing from Arabic to any other keyboard, regardless of the selected UI locale!

  • Items in hyperlinks are always loaded from the viewer's client! This has been an issue even to official servers. Here, both hyperlinks and tooltips will always be in your selected locale!

  • All client and server translation files (locale_game.txt, locale_interface.txt, locale_string.txt and translate.lua) for all languages are now in UTF-8.

  • CTRL+<key> functionality in text fields:

    • CTRL+A: select all text

    • CTRL+C: copy selected text

    • CTRL+X: cut selected text

    • CTRL+V: paste copied text (from inside or outside the game)

    • CTRL+Z: undo last character/paste

    • CTRL+Y: redo last character/paste undone with CTRL+Z

 

ATTENTION!

 

The Unicode update will be completed in patches! Expect bugs in early stages! DO NOT UPDATE BEFORE BACKING UP YOUR CURRENT VERSION!

There are tons of things to be added on every aspect of the Unicode update, but what is mentioned above works.

Expect server full conversion to UTF-8 in the upcoming updates

 

How to help us:

Some locale_string.txt translations have been modified/added for all languages due to improvements. We don't speak all languages.

Right now we need translations for 14 new/changed strings for:

  • 🇨🇿
  • 🇩🇪    DONE!
  • 🇩🇰
  • 🇺🇸    DONE!
  • 🇪🇸
  • 🇫🇷
  • 🇬🇷    DONE!
  • 🇭🇺
  • 🇮🇹    DONE!
  • 🇳🇱
  • 🇵🇱    DONE!
  • 🇵🇹    DONE!
  • 🇷🇴    DONE!
  • 🇷🇺
  • 🇹🇷    DONE!

If you are willing to give us 120 seconds of your time to translate the strings for one of the missing languages, find me in the Discord server!

 

Additionally, we haven't been able to find correctly formatted locale_string.txt and translate.lua for Arabic. We would appreciate any contribution for the missing files!

 

This is just the beginning for a complete, fully optimized and unbugged, multi-directional Unicode client!

This is the first of many patches and more will follow soon.

I said it before and I'mma say it again: amazing things are on the way.

 

Thank you for supporting us and our work! 🙏

 

Wanna be a more active part of the development of these amazing files? Check out our Discord server! (unless you are alergic to having fun while devving)

Unicode patch(es) brought to you entirely by @tw1x1

Edited by Mind Rapist
  • Active+ Member
10 minutes ago, ErLullo said:

DirectX 9 is older. It's okay to use 9 EX.

Actually I am exploring a bug that may or may not be related to the current version of DirectX used. I'll keep you posted as I will further explore the bug.

  • Love 1
6 hours ago, Andi said:

I recommend delete DirectX 9 Ex and change with DirectX 9 ☺️

What’s the scientific reason behind this? 😆

🖥️ SysAdmin — Government (HU)
🛠️ Freelance Metin2 Dev • DevOps
🐧 FreeBSD / Linux | 🛡️ Security & WAF | 🚀 Performance | 🔥 Firewalls | ⚙ Automation
Open to work - Contact me on Discord @matteo_r

  • Active+ Member
3 hours ago, Matteo said:

What’s the scientific reason behind this? 😆

Visual effects on the buff skills' actions are not visible. The constant effects around the character are visible but the animation that happens around the character's feet for example when the Shaman performs the buff are not visible. In TMP4 files it's fine. I checked and fixed some MSE files pointing to JPG instead od DDS but made no difference... Which makes me suspect DX9 EX (emphasis on SUSPECT). This is the bug that I'm gonna be currently working on and even though I don't know where to start from I will try to find it and push a patch ASAP. Every bit of info is helpful and deeply appreciated!

Edited by Mind Rapist
34 minutes ago, Mind Rapist said:

Visual effects on the buff skills' actions are not visible. The constant effects around the character are visible but the animation that happens around the character's feet for example when the Shaman performs the buff are not visible. In TMP4 files it's fine. I checked and fixed some MSE files pointing to JPG instead od DDS but made no difference... Which makes me suspect DX9 EX (emphasis on SUSPECT). This is the bug that I'm gonna be currently working on and even though I don't know where to start from I will try to find it and push a patch ASAP. Every bit of info is helpful and deeply appreciated!

Probably is related to DX9Ex... probably due to some ground effect. You can tra to add a tiny offset(?)

  • Active+ Member
59 minutes ago, ErLullo said:

Probably is related to DX9Ex... probably due to some ground effect. You can tra to add a tiny offset(?)

Currently I'm tracing through the chain of functions to find it when I do I'll play around with it and I'll find a proper fix 🙂 thanks for the tip though!

 

UPDATE:

DX9 EX is NOT responsible for the missing effects! The issue is in the Stealth/Invisibility fix. Without it everything works perfectly. I will push an updated version soon!

Edited by Mind Rapist
  • Love 2
  • Active+ Member
18 hours ago, Mind Rapist said:

Currently I'm tracing through the chain of functions to find it when I do I'll play around with it and I'll find a proper fix 🙂 thanks for the tip though!

 

UPDATE:

DX9 EX is NOT responsible for the missing effects! The issue is in the Stealth/Invisibility fix. Without it everything works perfectly. I will push an updated version soon!

Another update regarding this issue: invisibility fixes are not responsible for this. This issue seems to be happening by default only in Debug mode. I'll push a fix as soon as I have it

 

UPDATE:

Issue has been identified. I am working on a fix about a game's original bug (visual only) so I will not be pushing yet. In the meantime, if anyone wants to enable target visual effects on skills remove/comment out these 2 #ifndef _DEBUG's inside RaceMotionDataEvent.h like this:

Spoiler
...
  
			dwEffectIndex = GetCaseCRC32(strEffectFileName.c_str(), strEffectFileName.length());
//#ifndef _DEBUG
			CEffectManager::Instance().RegisterEffect(strEffectFileName.c_str());
//#endif

			return true;
		}
	} TMotionEventDataEffectToTarget;

...
  
			dwFlyIndex = GetCaseCRC32(strFlyFileName.c_str(), strFlyFileName.length());

//#ifndef _DEBUG
			// Register Fly
			CFlyingManager::Instance().RegisterFlyingData(strFlyFileName.c_str());
//#endif

			return true;
		}
	} TMotionEventDataFly;

	// Attacking
	typedef struct SMotionEventDataAttack : public SMotionEventData

 

 

Edited by Mind Rapist
  • Love 1

In the previous setup, manual macro definitions were added via add_compile_definitions for the Debug, RelWithDebInfo, and Release configurations. However, Visual Studio already defines the _DEBUG macro automatically in Debug builds, and additionally defining DEBUG in CMake caused a mismatch: the code checks for _DEBUG, while DEBUG was being defined, resulting in the expected behavior not being triggered. Similarly, the _DISTRIBUTE macro was bound individually to specific configurations, which made it appear inactive in some cases and introduced the risk of being forgotten when new build configurations were added. For these reasons, all manual add_compile_definitions statements were removed, relying instead on the standard macros provided by the compiler. This change eliminates ambiguity and conflicts between build configurations, making Debug and Release behaviors clearer, more predictable, and easier to maintain.

image

 

 

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Active+ Member

New PR requested

What to expect:

  • Several MSEs wrongly pointing at JPG files now point to DDS
  • Started renaming files with space ( ) before their extensions and reconfiguring their implementation
  • @ Distraught's bug fix for rendering effects in semi-transparent meshes has been implemented (for anyone that may need it)
  • FlyTarget effects register in Debug mode normally
  • Fix for a Ymir original: all clients now view FlyTarget effects rendered on the buffer when buffer casts a buff on a non-player/enemy instance. Credits to @tw1x1 🙏
  • Love 3

Hi all, 
I tried latest client code but on Villo2 after the portal (from Villo1) usually there are a lot of girls mobs but now is totally empty.
I compiled the client using the command on the github page.
Something wrong on my side?

PS: Is not a problem of Villo2, also Villo1 is same. If you hurt a metin of sorrow only some tiger appaer and not the typical big ammount of monster.

PSS: No more dogs on Villo1 AHAHAHA

Thanks a lot

Edited by ErLullo
Also Villo1

Client update Python 2.7 to 3.14.2


spacer.png

PR requested

This is the hidden content, please
 
This is the hidden content, please


This is the hidden content, please

This is the hidden content, please

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 6
  • Think 1
  • Good 1
  • Love 13
  • Active+ Member
On 12/25/2025 at 12:12 PM, Krawbber said:

Wanna hear some criticism for Christmas ? I think that the removal of macros was a bad idea because it was easier to track what was/is/will be changed in the source code for people that already did changes or only want to apply partial changes to it.Also having macros in the client while missing them on the server looks kinda messy.If the macros are removed at least add some comments named changenr1,2,3 where changes are applied.And have a documentation in project description about which one does what.Looks more organised and also in case something goes wrong with a fix or fix for fix and some bugs appear it'a easier to keep track and fix them.Given the rythm that the pr is updated in the last time it's becoming harder and harder to keep track of the changes comparing. Nevertheless , thank you for the contribution and Merry Christmas!

Appreciate the Xmas feedback 😄

The removal of macros was a collective decision by the maintainers and the currently active developers to keep the code cleaner. Macro usage is being replaced with comments like you suggested from the ongoing patches after the one with the final macro leftover removals in the client source.

A signature of the developer that applied the changes or/and the update name would be ideal for tracking changes to compare with previous backups (e.g., // MR-X: Update name/functionality).

Tracking changes is also available in the official Github repos under the merged PRs section. This may not be instant (in-code) but the UI does a better job than simple comments so if someone wants to check changes both these ways are available.

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

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.