The preferred IDE in order to develop and debug the server is [CLion](https://www.jetbrains.com/clion/),
baked by the fine Czech folks at JetBrains. Educational licenses are available if you're elligible.
1. Make sure you install all the dependencies mentioned in the "Build the binaries yourself" section.
2. Inside a WSL environment, a remote SSH one or directly on a Linux machine, just
clone this repository and open it with CLion.
3. Set up "Run/Debug Configurations" of the "CMake Application" type for
the `db`, `auth`, and `game` services, using the "db" target for the former and
the "game" target for the latter two. Make sure each service has its own working
directory with all the required configuration and game files.
4. Optionally, add a "Compound" configuration containing these three configurations
in order to start them at once.
5. Of course, you'll need a MySQL 5.x database, Valgrind and any other development
goodies you wish. Also, a lot of time.
## 3. Improvements
### Major improvements
- The binaries run on 64-bit Linux with the network stack being partially rewritten in Libevent.
- CMake build system mainly based on `vcpkg`. Docker-friendly architectural approach.
- HackShield and other proprietary binaries were successfully _yeeted_, the project only has open-source dependencies.
- Included gamefiles from [TMP4's server files](https://metin2.dev/topic/27610-40250-reference-serverfile-client-src-15-available-languages/) (2023.08.05 version).
### Minor improvements
- Removed unused functionalities (time bombs, activation servers, other Korean stuff)
- Switched to the [effolkronium/random PRNG](https://github.com/effolkronium/random) instead of the standard C functions.
- Network settings are manually configurable through the `PUBLIC_IP`, `PUBLIC_BIND_IP`, `INTERNAL_IP`, `INTERNAL_BIND_IP` settings in the `game.conf` file. (Might need further work)
- Fixed various bugs caused by the migration of the codebase to 64-bit (some C/C++ data types have different lengths based on the CPU architecture)
- Fixed buffer overruns and hardcoded limits in the MAP_ALLOW parsing routines.
- Fixed quest server timers cancellation bug which could cause a server crash - [(thread)](https://metin2.dev/topic/25142-core-crash-when-cancelling-server-timers/).
- Fixed buffer overruns and integer overflows in SQL queries.
- Use the [fmt](https://fmt.dev/latest/index.html) library for safe and modern string formatting.
- Handle kernel signals (SIGTERM, SIGHUP etc.) for gracefully shutting down the game server.
- Improve memory safety.
- Use fixed width integer types instead of Microsoft-style typedefs.
- Convert C-style strings to C++ `std::string`.
- Perform static and runtime analysis.
- Find and implement other fitting improvements from projects such as [Vanilla's core](https://metin2.dev/topic/14770-vanilla-core-latest-r71480/), [TMP's serverfiles](https://metin2.dev/topic/27610-40250-reference-serverfile-client-src-15-available-languages/).