Jump to content

Recommended Posts

Welcome to the Metin2 Modern Base Source project! This initiative aims to revamp and modernize the existing Metin2 source code, making it easier to edit, maintain, and extend across various platforms, including Visual Studio (2008-2022) and FreeBSD (9.3-14x).

Metin2 Modern Base Source:

  • based on all branches (added missing sutff)
  • Compiling on Windows
  • Compiling on FreeBSD


Why Modernize?

While Metin2 has a rich history and a dedicated community, many existing source codes are over a decade old. By updating the codebase, we can:

  • Improve code readability and maintainability.
  • Enhance performance and security.
  • Ensure compatibility with modern C++ standards (C++20).
  • Provide a more user-friendly experience for developers.
  • Key Improvements

One of the goals of this project is to replace outdated functions like sprintf with safer and more modern alternatives. For example, we can use std::ostringstream or std::format (introduced in C++20) to handle string formatting in a more type-safe and efficient manner.

Example: Modern String Formatting

Instead of using sprintf, which can lead to buffer overflows, consider the following modern C++ approach using std::ostringstream:
 

#include <sstream>
#include <string> 
  std::string formatString(int value) { 
    std::ostringstream oss; oss << "Value: " << value; return oss.str(); 
  }

Or with C++20 std::format:

#include <format>
 #include <string> 
  
  std::string formatString(int value) { 
  return std::format("Value: {}", value); 
  }

Contribute to the Project

We invite developers of all skill levels to contribute to the Metin2 Modern Base Source project. Whether you're a seasoned programmer or just starting out, your contributions can make a difference. Here are some ways you can help:

  • Code Improvements: Help us refactor and modernize the existing codebase.
  • Documentation: Assist in writing clear documentation to make it easier for new developers to get started.
  • Bug Fixes: Identify and fix bugs within the code.
  • Feature Requests: Suggest new features or enhancements that could improve the project.

Getting Started:

  • Make Changes: Implement your improvements or fixes.
  • Submit a Pull Request: Share your changes with the community for review.


    Github: 
    This is the hidden content, please
  • Metin2 Dev 128
  • Eyes 7
  • Flame 3
  • Good 21
  • muscle 2
  • Love 4
  • Love 70
Link to comment
https://metin2.dev/topic/33271-metin2-modern-base-source/
Share on other sites

  • Forum Moderator

Hello,

While I praise such decision, I can't help but to be at best slightly skeptical. First of all, your ambition to have it run on both FreeBSD 9.3 and 14.0X as well as Visual Studio 2008 and 2022 is simply not possible and there is no reason to provide any supports for an OS that reached EOF in 2016 and which had no minor (or security!) updates in more than 10 years. Having possibly unsafe code running on a program in a 10yo OS would be the least of my issues if I am about stability and security.

What's more, if you expect to use C++20 features such as std::format, you for sure will have to ditch VS2008 which supports only C++03 and FreeBSD 9.X which afaik had only support for GCC 4.2. Which was already slightly outdated when we first got the sources in our hands.

Second point is that, if you need to support Linux, you will have to do more than porting and have to change the entire network stack, which will quickly become a duplicate of the following project, which is somewhat kept up to date and which started off TMP4's sources, which are the best free sources available and contains necessary fixes here and there.

What's more, and it comes from someone who spent the last 10 years updating sources as a pastime: As long as you will want to modernize the sources, you will find a never-ending rabbit hole and be shocked to see literal code from the USSR into the game and how much boilerplate code has been written by the different dev team and it will often become a full on rewrite of basically anything, from Network Stack to Logging, to even strings themselves and to the use of CMake to make it compile basically anywhere without having to maintain horrendous solutions files or Makefile.

Now that is being said, I really enjoy that you take such actions and provide your enthusiasm and work for free for the community. But considering the current state of things, between the full Quantum Core revival and the Exynox's project, I think it would be the best to join Exynox's in a separate branch in which you will modernize even more the already modernized sources that he provides. It will, in my opinion, avoid redundancy and a split in the work load and the community will be able to directly have the best open source option available.

Keep it up and welcome!

  • Metin2 Dev 2
  • Lmao 1
  • Good 3
  • muscle 1
  • Love 5

Gurgarath
coming soon
My Services

Link to comment
https://metin2.dev/topic/33271-metin2-modern-base-source/#findComment-168449
Share on other sites

  • Active Member
5 hours ago, Gurgarath said:

Hello,

While I praise such decision, I can't help but to be at best slightly skeptical. FirstВо-первых, ваши амбиции по запуску на FreeBSD 9.3 и 14.0X, а также на Visual Studio 2008 и 2022 просто неосуществимы, и нет никаких причин предоставлять поддержку ОС, которая перестала обновляться в 2016 году и не получала никаких незначительных (или важных!) обновлений более 10 лет. g possibly unsafe code running on a program in a 10yo OS would be the least of my issues if I am about stability and security.

What's more, if you expect to use C++20 features such as std::format, you for sure will have to ditch VS2008 which supports only C++03 and FreeBSD 9.X which afaik had only support for GCC 4.2. Which was already slightly outdated when we first got the sources in our hands.

Second point is that, if you need to support Linux, you will have to do more than porting and have to change the entire network stack, which will quickly become a duplicate of the following project, which is somewhat kept up to date and which started off TMP4's sources, which are the best free sources available and contains necessary fixes here and there.

What's more, and it comes from someone who spent the last 10 years updating sources as a pastime: As long as you will want to modernize the sources, you will find a never-ending rabbit hole and be shocked to see literal code from the USSR into the game and how much boilerplate code has been written by the different dev team and it will often become a full on rewrite of basically anything, from Network Stack to Logging, to even strings themselves and to the use of CMake to make it compile basically anywhere without having to maintain horrendous solutions files or Makefile.

Now that is being said, I really enjoy that you take such actions and provide your enthusiasm and work for free for the community. But considering the current state of things, between the full Quantum Core revival and the Exynox's project, I think it would be the best to join Exynox's in a separate branch in which you will modernize even more the already modernized sources that he provides. It will, in my opinion, avoid redundancy and a split in the work load and the community will be able to directly have the best open source option available.

Keep it up and welcome!

"code from the USSR" LMAO 🤣

Edited by Helia01
  • kekw 3
  • Lmao 1
Link to comment
https://metin2.dev/topic/33271-metin2-modern-base-source/#findComment-168463
Share on other sites

  • Forum Moderator
23 hours ago, Helia01 said:

"code from the USSR" LMAO 🤣

gost.c (ГОСТ 28147-89) joined the chat. I was baffled too when I first saw it 😭

  • kekw 1

Gurgarath
coming soon
My Services

Link to comment
https://metin2.dev/topic/33271-metin2-modern-base-source/#findComment-168470
Share on other sites

  • Active Member
9 minutes ago, Gurgarath said:

gost.c (ГОСТ 28147-89) joined the chat. I was baffled too when I first saw it 😭

If I'm not mistaken, the reason ГОСТ 28147-89 / Magma was used in the source is probably due to the fact that in the early 2000s, when the first bricks of the M2 source code were laid down, the USA was just releasing its strong encryption algorithms from under embargo: https://en.wikipedia.org/wiki/Export_of_cryptography_from_the_United_States

At the time, using GOST (which is basically DES after a 1 week vacation in Sochi) would have made a lot of sense due to it being a freely available algorithm.

Still, this is a testament to how fast things are changes and how maintaining a "modern codebase" is a sisyphean task - there will always be some new language feature or design pattern by each and every passing year, which means having to always update the code and never be finished. Just look at the JavaScript landscape - just one more new framework bro, this will fix everything.

That being said, updating the codebase to some common sense 21st century technology such as smart pointers and UTF-8 is very much needed for a project which is basically a hodge-podge of C & C++ and a thousand coding styles.

  • Metin2 Dev 1
  • Love 5
Link to comment
https://metin2.dev/topic/33271-metin2-modern-base-source/#findComment-168471
Share on other sites

  • 1 year later...
On 2024/12/1 at PM3点54分, Eclipse Shade said:

欢迎来到 Metin2 现代基础源代码项目该计划旨在改进和现代化现有的Metin2 源代码,使其更容易在各种平台上进行编辑、维护和扩展,包括Visual Studio (2008-2022) 和 FreeBSD (9.3-14x)。

Metin2 现代基地来源:

  • 基于所有分支(添加了缺失的内容)
  • 在 Windows 上编译
  • 在 FreeBSD 上编译


为什么要现代化?

虽然 Metin2 拥有悠久的历史和活跃的社区,但许多现有的源代码已经超过十年。通过更新代码库,我们可以:

  • 提高代码的可读性和可维护性。
  • 提升性能和安全性。
  • 确保与现代 C++ 标准(C++20)兼容。
  • 为开发者提供更友好的用户体验。
  • 主要改进

该项目的目标之一是用更安全、更现代的替代方案来替换像 sprintf 这样过时的函数。例如,我们可以使用 std::ostringstream 或 std::format(C++20 中引入)以更类型安全、更高效的方式处理字符串格式化。

示例:现代字符串格式化

与其使用可能导致缓冲区溢出的 sprintf,不如考虑使用以下使用 std::ostringstream 的现代 C++ 方法:
 

 
      
  

或者使用 C++20 std::format:

 
  

为项目做贡献

我们诚邀所有技能水平的开发者参与Metin2 Modern Base Source 项目。无论您是经验丰富的程序员还是编程新手,您的贡献都至关重要。以下是一些您可以提供帮助的方式:

  • 代码改进:请帮助我们重构和现代化现有代码库。
  • 文档编写:协助编写清晰的文档,以便新开发人员更容易上手。
  • 漏洞修复:识别并修复代码中的漏洞。
  • 功能请求:提出可以改进项目的新功能或改进建议。

入门:

  • 做出改变:实施您的改进或修复。
  • 提交 Pull Request:与社区分享您的更改以供审核。GitHub


    : 

    隐藏内容

    • 对此帖文做出反应即可查看隐藏内容。

共同学习 一起进步 

  • Good 1
Link to comment
https://metin2.dev/topic/33271-metin2-modern-base-source/#findComment-175372
Share on other sites

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.