Jump to content

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


Recommended Posts

On 2/4/2026 at 12:46 AM, stingy7 said:

Yes, I've already fixed it, thank you. I just have the problem that now, when I select a character, the client closes.

did u able to fix this issue? I have the same exact problem.

  • Active+ Member

Hey there stranger, it's been a while...

New PR's submitted and MERGED

and it's a long one!

 

Been a whole lot of 2 weeks since I posted an update here and although most of y'all are in our Discord group, here is what changed in the past couple of weeks...

 

.png

Now who saw that coming?

Crypto++ is completely gone! 😱

  • Crypto++ was replaced with LibSodium XChaCha-Poly1305. Say goodbye to heavy loads of code dependencies for a tiny fraction of implementations! LibSodium is a lighter and more modern approach to encrypting packets and it's here to stay!

 

.png

 

Breaking changes to the way Packets and Network works!

Client <-> Server, P2P and Server <-> DB interactions are lightning fast compared to the speed so far!

  • Packet Format + Buffer System + Memory Safety has been improved. Packets now use the namespece format and can be called as:
    GC::<Name>
    CG::<Name>
    GG::<Name>
    GD::<Name>
    DG::<Name>
  • All raw "buffer_t / LPBUF / new[]/delete[]" patterns replaced with a single RingBuffer class
  • Way more stuff changed in a 5-phase update for the client and the server
    SEE REPOSITORY README's FOR A FULL CHANGELOG!

 

One of the most exciting ones yet, the first ever files to have integrated DDoS protection!

.png

 

The server source has now the first steps of preventing a DDoS/flood attack integrated in the source!

The serverfiles come now with pre-configured firewalls (ipfw for FreeBSD, iptables for Linux, no availability for Windows (debug environment only))

Configuration (conf/game.txt)

  • firewall_enable: Defaults to 0, enables/disables the firewall manager (0=off, 1=on)
  • firewall_tcp_syn_limit: Defaults to 500, configures the max new TCP SYN connections/sec per port
  • firewall_tcp_syn_burst (Linux only): Defaults to 1000, sets the SYN burst allowance before rate limiting kicks in

Find the full instructions and usage in the README file of the server-src project!

This is still on development and will be completed in the upcoming days!

Huge shoutout to @tw1x1 for this amazing update!

 

Say something nice, we got

.png

FreeType! It's finally here!

FreeType intregration gives a more modern feel to the UI and opens up possibilities for a lot of planned changes such as the Emoji update (coming soon) 👍

Huge shoutout to @tw1x1 for this beautiful update!

 

Other stuff that changed

  • Cleaned up a lot of dead code (FOR_GERMANY14/15, Monarch, SpeedServer, Over9Refine, DBString GreetMessage, exp_table_euckr, Alpha Fog, Themida, and so many more)
  • Realtime countdowns for affects (not buffs/debuffs), accessory and belt ores, unique items and costumes
  • All tooltip elements centered
  • Fixed the percentage calculations for mob drops (mob drops will be adjusted in upcoming updates)
  • Mark upload fixes (thanks @tw1x1)
  • PackMaker improvements
  • Deformation improvements
  • Refine window fixed (thanks @suntrustdev)
  • Item and Mob names load directly from the client (thanks @tw1x1)
  • Unicode and BiDi improvements (thanks @tw1x1)
  • Translated mob names for all locales for all mobs inside the Red Dragon Fortress and Nemere's Watchtower dungeons
  • POINT's synched between server and client
  • Splash attacks live-follow the target if they move from the casting point

 

More updates are coming soon! Stay tuned and join the Discord server for more!

Edited by Mind Rapist
  • Metin2 Dev 2
  • Love 8
  • Honorable Member

UPDATE

  • Python 2.7 upgraded to Python 3.14 with JIT enabled
  • Lib folder removed from client, python libs are built into the binary

 

Performance benchmark between Python versions:

spacer.png

[Source: https://lost.co.nz/articles/sixteen-years-of-python-performance/]

This benchmark was done with a pretty similar use case to Metin2.

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 2
  • Flame 1
  • Love 7

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

  • Active+ Member
On 2/9/2026 at 11:07 AM, Distraught said:

UPDATE

  • Python 2.7 upgraded to Python 3.14 with JIT enabled
  • Lib folder removed from client, python libs are built into the binary

I had a banner for it anw thank you for this! 😄

Also the Installation Guide for all projects is now complete and has been uploaded as part of the README files in each repo.

For those of you who need instructions to install the files please follow the guides in the following order:

  1. This is the hidden content, please
  2. This is the hidden content, please
  3. This is the hidden content, please
  4. This is the hidden content, please
Edited by Mind Rapist
  • Metin2 Dev 52
  • Think 1
  • Good 8
  • muscle 1
  • Love 2
  • Love 22
  • Premium

I noticed that the lua version is still the original one.
Unfortunately, support has been discontinued, but I hope it will be updated soon.

Edited by flatik
  • Eyes 3

c++latest, latest libs...

  • Honorable Member
4 minutes ago, troacari said:

Wait a sec, are you telling me this huge improvements are free and came with full source and svfiles??? 
 

What year is this?

Yes. I wanted to do a big community project and this is what it has become.

Edited by Distraught
  • Love 8

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

  • Active+ Member
1 hour ago, troacari said:

Wait a sec, are you telling me this huge improvements are free and came with full source and svfiles??? 
 

What year is this?

Our mission is to give everyone free and open source access to an unbugged and fully modernized source using the latest technologies and practices.

Any developer can sell their code and systems in their own terms but when it comes to a fully modernized base to get started they deserve the latest technologies for free. This is a community that is still alive after more than a decade and it is each and everyone's right to begin properly. Up to y'all what you're gonna do with it after cloning but that's our mission so far 🙂

  • Love 10

You guys are awesome.

I just set everything up (just followed the readme tutorials) and everything works perfectly. FreeBSD 15.0 and Windows. Everything works without any problems. I'm thrilled.

Now I just need to build a program that saves me all the cmd commands to speed up the workflow, then I can get started tinkering right away. Big THANKS.

  • Love 1
  • Active+ Member
12 hours ago, RexT said:

You guys are awesome.

I just set everything up (just followed the readme tutorials) and everything works perfectly. FreeBSD 15.0 and Windows. Everything works without any problems. I'm thrilled.

Now I just need to build a program that saves me all the cmd commands to speed up the workflow, then I can get started tinkering right away. Big THANKS.

That's a pretty good idea! Feeling like sharing here when you're done?

The source looks nice, but the timelaps between updates also suggest that your main guy tw1x is killing Cursor or Claude doing those big things, what distraught did is marvelous, but letting everyone implementing all those stuff untested will make the source unstable, that if it is not already. Is better to provide a big update test it fix it, then go to the other one. Alaric gave the best example with the bug at the skills caused by this fast “development” . The advanced part becomes useless if the source becomes unstable. Also anti-DDoS thing is a joke.

Edited by HAMLET
  • Metin2 Dev 1
  • kekw 2
  • Good 1
3 hours ago, Mind Rapist said:

That's a pretty good idea! Feeling like sharing here when you're done?

Sure, maybe you can share some ideas what should be included? Right now im thinking of:


1. Windows Env

1.1 Start/Stop channels (without VS Debug)

1.2 Clear logs

2. FreeBSD Env

2.1 Start/Stop channels

2.2 Bin compile

2.2.3 Move bin/check symlinks/check chmod

2.4 QC

2.5 Clear logs

3. Client

3.1 Move bin to client

3.2 Start client

3.3 Pack client(all/folder)

3.4 Pack protos (optional auto move protos to locale folder)

Edited by RexT
  • Love 1
  • Honorable Member
12 hours ago, HAMLET said:

The source looks nice, but the timelaps between updates also suggest that your main guy tw1x is killing Cursor or Claude doing those big things, what distraught did is marvelous, but letting everyone implementing all those stuff untested will make the source unstable, that if it is not already. Is better to provide a big update test it fix it, then go to the other one. Alaric gave the best example with the bug at the skills caused by this fast “development” . The advanced part becomes useless if the source becomes unstable. Also anti-DDoS thing is a joke.

I'm closing the addition of new updates to the files for some time and I'll only accept bugfixes. When the files are stable again, we'll do the new updates to it more organized with monthly meetings.

  • Confused 1
  • Good 1
  • Love 2

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

  • Active+ Member

You're not gonna believe what just happened!

New PR's merged!

As of last night, the following bug fixes have been implemented into the source:

  • The affects/text tail not rendering in dungeons and other specific maps has been addressed
  • Integer division compatibility for Python 3.14 across the entire root pack. Solves numerous issues such as the button centering problem in the target board, dragon stone grade not appearing in tooltips and more
  • Removed locale.count_prefix from a quest as it is an empty object and prevents the quest from printing further text after it
  • Addressed a bug when quests refresh after completing or canceling a quest, the letters do not appear on top of the NPC/item dialog curtain anymore
  • Dragon stones countdown fixed: the item's realtime countdown now starts automatically without the need for "first hover" after login in order to initiate it. Works perfectly in all states and situations!
  • Minor translation improvements
  • Several missing item icons added
  • Flush issue caused by the Python upgrade

And of course we have some new feats!

  • Packet dump has FINALLY its own log file! New log structure generated by your clients:
    • log.txt: what you know and love
    • syserr.txt: what you know and hate, minus the annoying packet dumps!
    • packetdump.txt: yes it is what the name says
    • pdlog.txt: everything together! logs + errors + packet dumps
  • Console outputs in client debug are now colored!
    • logs: nothing changed
    • errors: In red color
    • packet dumps: in their normal color, just dimmed so your eyes can focus on logs easier
  • New log type: TraceTemp(f/n/fn) This was added as many devs like to place temporary logs when working on something. WIth a unique name like this in the codebase, you can easily track it in all the places you implemented it and remove it when you don't need it anymore. It also comes with a blue background inside the console so it stands out from everything else. This is also exported into python via the C++ API.
    C++ callables:
    • TraceTemp
    • TraceTempf
    • TraceTempn
    • TraceTempfn

          Python callable: TempTrace

  • Verified and ensured poison consistency with the official. Changes: the poison now has increased infliction chance in lower level targets. The formula for this is the reverse of poison_level_adjust (now public) divided by 2 for the increased chance. Didn't have an official formula so feel free to improve if you know more about it.
  • Verified and ensured fire consistency with the official. Changes: the fire affect cannot kill, instead it stops when HP is dropped to 1. The fire affect also inflicts 20% less damage when applied on the Powerful Ice Witch (1192)
  • Some code clean up in the sources

 

IMPORTANT

 

Multiple bugs are still in place and the active developers are working hard to fix them. Some of them are new and are not yet synced with our Trello board. If you'd love to help out in solving them and providing a better file system to the community contact one of the active developers in our server for more information!

  • Metin2 Dev 2
  • Love 7

Good work, really. But it should be clear to everyone that this is only a basic version, there are bugs in it, and of course, a lot of it is only possible thanks to AI.

Don't add too many updates, take it slow, test for stability, throw in a BOT and auth test stresser, because right now it doesn't look good. 

  • Love 3
  • Active+ Member

I would like to wish happy birthday to everyone in this community that have their birthday today! 🥳 Speaking of birthdays...

New PR's merged!

These days it's all about bug fixes so here is some of them:

  • Firewall removed along with some code cleanup (thank you @tw1x1 🙏)
  • The Legendary Diamond Dragonsoul inventory has been fixed (thank you @suntrustdev 🙏)
  • The Guild window clickable areas have been adjusted, no more dead clicks!
  • Minimum level safeguards have been added to the serverside regarding Dragonsoul Alchemy qualification.
  • The forgotten "Remove from Guild" target board button is back and fully functional (thank you @suntrustdev 🙏)
  • Trees and leaves improvements (thank you @ Koray 🙏)
  • The specular isolation bug has been addressed using @ TAUMP's amazing fix (thanks for this release dude!). Tested for all bugs mentioned in the topic and the fix is fully valid and functional!
  • Minor translation improvements for items and additions.
  • Fixed togglable slots staying activated after dying.
  • Fixed realtime countdown for the Alchemy affect(s) requiring a first manual hover by the player after adding time to an equipped Dragon Stone item while affect is active. The countdown method has also been reworked so it doesn't use checks in 500ms-intervals anymore.
  • Fixed item swapping while inventory has no free space (thank you @suntrustdev)
  • TempTracen support for Python has been added.
  • USE_AFFECT flag now allows affect overwritting if the new affect is of the same type and index as the old one and provides greater value than the old one (Potion of Attack +15 can overwrite the existing affect from Potion of Attack +10 for example).
  • MALL_ATT_SPEED affect has been added to the client and therefore the affect icon is now visible.
  • Refine window now sorts empty Spirit Stone slots (from Broken Stones) to the end of the list, displaying the item exactly the way it will be if the refinement is successful.
  • Spirit Stone attachment window now displays the attributes of the item, displaying it exactly the way it will be if the refinement is successful.

 

These may be small fixes in first glance but they are all in a days work. The unbugging road ahead is still too much and we appreciate every bit of help we can have so we can have a completely bug-free base available for everyone. Once all current bugs are addressed there are some minor improvements planned, but bugs are the priority!

Thanks to everyone that made this update possible as well as the next updates to come. 🙏

  • Love 6
  • Active+ Member

You know what? Y'all in here are so good at WANTING THINGS!

This is bugged, that's broken, let's do it like this and this and that! OMG!

You are just SO GOOD AT IT!

 

Thankfully we're good at listening 😉

(Bet you clicked on this and expected to see a fight :kekw:)

 

New PR's submitted, then MERGED and then submitted some more!

Here are some amazing fixes and improvements that just got out of the oven 🍳:

  • Fixed the DoRefineWithScroll that was behaving like a Blacksmith.
  • Fixed the horse affect icons not showing up (thanks @ onurcan488 🙏)!
  • Fixed the password field in the login so it ignores copying/cutting. Pasting continues to working as usual! (thanks @suntrustdev 🙏)
  • Fixed a little bug in the level checking for Dragonsoul qualification
  • Fixed Arabic crashing on loading.
  • Fixed Brazilian crashing on loading.
  • Fixed Arabic font being too big. Fixed Brazilian's font as well while we're at it!
  • Fixed Arabic loading background image being pushed to the right of the screen!
  • Fixed login info loading. (thanks Alaric! 🙏)
  • Fixed the Guild Maps following you everywhere in Atlas! (thanks @suntrustdev 🙏)
  • Fixed pack loading. (thanks @suntrustdev 🙏)
  • Fixed DumpProto (thanks @ErLullo 🙏)

And as I said in the beginning here are some improvements for y'all as well:

  • NEW: Dialogs and Popups support multilined translation strings (\n, /n)! The Python scripts auto-trims these instances (if found) off of spaces and append new lines automatically, updating the dialog/popup's height also automatically! Button(s) also auto-adjust padding based on the number of lines. No visual difference when translations do not contain new lines! Test it now with our
  • NEW: Refine dialog messages work like the official (conditional warning and failed message based on refinement type used - NPC/Scroll/Stone). Uses Dialogs/Popups with new lines!
  • NEW: Renamed *SpeedTree*X8 to *SpeedTree*X (thanks @ onurcan488 🙏)
  • NEW: Text highlighting exposed to Python! Uses start and end text coordinates! Selection clearing also available!

And here is what's pending for merging:

  • Coming soon: Penetration visual effect enabled
  • Coming soon: ALL affects show realtime countdowns, titles and are wrapped in tooltips! Includes all skills' buffs/debuffs/potion affects and permanent affects such as the Exorcism Scroll, Medal of the Dragon, etc... (countdown does not apply)
  • Coming soon: Lots of more fixes and improvements!

Wanna be a part of the development? Join our server and keep track of our progress in Trello! Submit a PR when you're ready!

A huge shoutout to all these devs that work hard on the bugs and the improvements of these files on a daily basis! 🙏

Edited by Mind Rapist
  • Love 2

Hey,
how do I change the keys for packing the client's pack folder?
Is there only one key here?:
PackLib/config.h:
constexpr std::array<uint8_t, PACK_KEY_SIZE> PACK_KEY = {
0x00,0x11,0x22,0x33, 0x44,0x55,0x66,0x77,
0x88,0x99,0xAA,0xBB, 0xCC,0xDD,0xEE,0xFF,
0x01,0x23,0x45,0x67, 0x89,0xAB,0xCD,0xEF,
0xFE,0xDC,0xBA,0x98, 0x76,0x54,0x32,0x10
};

If so, is it enough to just create a sequence of numbers up to 255 and convert it to hexadecimal format?

Or do I need to do something more?

  • Active+ Member

EXCITING NEWS!

Yall waited for it and its here! The first live VPS for testing is open to the public! Acknowledgements:

  • The server is for testing only, no real progress can be maintained
  • There is no item shop
  • The server may unexpectedly restart/shutdown without any warnings or we may withdraw access to it after completing the tests until the next tests
  • Every new account can only receive one GM character for testing
  • Each person can receive one account
  • You character/progress/items may be deleted at any time for no given reason, basically anything can change its just a testing server

The goal is to monitor bugs and fixes and give you the ability to perform tests through social interactions that otherwise you may not have thought of doing or it would be just too boring. How to gain access:

  • PM me or @tw1x1 (in Discord) with your desired username and password.
  • When your account is created we will give you the OK message with the IP for serverinfo
  • Once we see that you have created a character someone will give you GM rights. You will need to relog for the rights to take effect.

 

Our first test objective: Networking/Packets

Tester's mission: do anything you can think of that requires client <-> server communication, no specific actions needed, but do a lot of different stuff so we test thouroughly!

  • Love 1
  • Honorable Member

As sadly many people with massive AI usage pushed a lot of things I take back the merge rights to only myself.

The next weeks I'll go through all the past merges and check through those codes, to get this project back to a good state.

 

Edited by Distraught
  • Metin2 Dev 3
  • Good 2
  • Love 8

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

  • Contributor
40 minutes ago, Distraught said:

As sadly many people with massive AI usage pushed a lot of things I take back the merge rights to only myself.

The next weeks I'll go through all the past merges and check through those codes, to get this project back to a good state.

 

Already mentioned this in private, but these people should be banned from pushing to the project and have their PRs reverted or checked one by one. The entire project turned into a fucking joke and AI should've been banned ever since I pointed it out in Mind Rapist's first PR, which was many months ago.

There are PRs there that touch half of the source and there's no explanation for why, how, or even what they're supposed to address. Literal dumps of "found this somewhere, looks smart" code.

  • Metin2 Dev 2
  • Good 5
  • muscle 1
  • Love 4

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.