Hello
Today while browsing Marty Sama's website I found something that I think will be useful for those who compile the client source a lot like me
It is to create a bat file to compile without the need to open Visual Studio
I tried it and it was nice as I was facing a problem of the device hanging a lot while working on the compile with the program so I found it useful and it should be published for the benefit of everyone
Note: I do not know if it has been published before or not and I also know that the method is old for sure but I did not know about it
1-
Metin2Client_CompileRelease.bat
2-
Note: This code is for owners of the 2022 version. You can modify the path as you like.
Metin2 Client Kaynağını Visual Studio'yu Açmadan Derlemek
Metin2 özel sunucu geliştirme sürecinde, client kaynak kodlarını derlemek temel adımlardan biridir. Ancak birçok geliştirici, Visual Studio IDE'sini açmadan bu işlemi nasıl yapacağını bilmez. Bu rehberde, Visual Studio arayüzüne girmeden client kaynağını nasıl derleyebileceğinizi adım adım anlatacağız. Bu yöntem özellikle otomasyon ve hızlı geliştirme süreçleri için oldukça faydalıdır.
Gerekli Araçlar
Client kaynağını derlemek için öncelikle aşağıdaki araçlara ihtiyacınız olacaktır:
- Visual Studio Build Tools: Sadece derleme işlemlerini yapmak için yeterlidir. IDE'ye gerek yoktur.
- Windows SDK: Derleme sırasında kullanılan sistem kütüphaneleri.
- CMake (isteğe bağlı): Proje yapılandırması için kullanılabilir.
MSBuild Kullanımı
MSBuild, Microsoft'un derleme motorudur ve Visual Studio kurulumuyla birlikte gelir. Komut satırından doğrudan çağrılabilir. Örneğin, bir .vcxproj dosyası varsa şu komutla derlenebilir:
Bu komut, Release modda ve x64 platformunda client'i derler.
Derleme Hatalarını Önleme
Derleme esnasında hata almanız durumunda şu kontrolleri yapmalısınız:
- Ortam değişkenlerinizde VCINSTALLDIR ve WINDOWSSDKDIR tanımlı mı?
- Doğru platform araç seti (v142 gibi) yüklü mü?
- Gerekli kütüphane dosyaları projede doğru şekilde tanımlanmış mı?
Python Script Entegrasyonu
Metin2 özel sunucularında Python scriptleri, UI Script, Py Root ve diğer sistemlerle entegre çalışır. Client derlemesi sırasında bazı Python betikleri de çalıştırılabilir. Örneğin, derleme sonrası otomatik olarak paketleme işlemi gerçekleştirmek için bir py script yazılabilir. Bu tarz betikler Py GUI arayüzleriyle de desteklenebilir.
Otomatik Derleme Scriptleri
Her seferinde komut satırına yazmak yerine bir batch dosyası oluşturabilirsiniz. Örnek bir script:
Bu script, gerekli ortamı başlatır ve client'i derler. Bu tür scriptler Metin2Dev süreçlerinde oldukça işe yarar.
Derleme Sonrası İşlemler
Başarıyla derlenen client, genellikle pack dosyalarına dönüştürülmek üzere Martysama veya benzeri araçlarla paketlenir. Paketleme işlemi, client'in sunucuya aktarılabilmesi için gereklidir. Paketlenmiş client, auth ve game sunucularıyla uyumlu çalışmalıdır.
Sonuç
Visual Studio IDE'sini açmadan client derlemek, geliştirme sürecini hızlandırabilir. MSBuild ve komut satırı araçları sayesinde, otomatik derleme sistemleri kurmak da mümkündür. Bu yöntem, Metin2 özel sunucu geliştiricileri için büyük kolaylık sağlar ve source edit süreçlerinde daha verimli çalışmanıza olanak tanır.
Compiling Metin2 Client Source Without Opening Visual Studio
In the process of developing Metin2 private servers, compiling client source code is one of the fundamental steps. However, many developers do not know how to perform this process without opening the Visual Studio IDE. In this guide, we will explain step by step how you can compile the client source without entering the Visual Studio interface. This method is especially useful for automation and rapid development processes.
Required Tools
To compile the client source, you will first need the following tools:
- Visual Studio Build Tools: Sufficient just for compilation tasks; no IDE needed.
- Windows SDK: System libraries used during compilation.
- CMake (optional): Can be used for project configuration.
Using MSBuild
MSBuild is Microsoft's build engine and comes with Visual Studio installation. It can be called directly from the command line. For example, if there is a .vcxproj file, it can be compiled using the following command:
This command compiles the client in Release mode on the x64 platform.
Preventing Compilation Errors
If you encounter errors during compilation, check the following:
- Are environment variables VCINSTALLDIR and WINDOWSSDKDIR defined?
- Is the correct platform toolset (like v142) installed?
- Are required library files correctly defined in the project?
Python Script Integration
In Metin2 private servers, Python scripts work integrated with UI Script, Py Root, and other systems. Some Python scripts can also be run during client compilation. For example, a py script can be written to automatically perform packaging after compilation. Such scripts can also be supported with Py GUI interfaces.
Automatic Build Scripts
Instead of typing commands each time, you can create a batch file. An example script:
This script initializes the necessary environment and compiles the client. Such scripts are very useful in Metin2Dev processes.
Post-Compilation Processes
The successfully compiled client is usually packaged into pack files via tools like Martysama or similar. Packaging is necessary for the client to be transferred to the server. The packaged client must be compatible with auth and game servers.
Conclusion
Compiling the client without opening the Visual Studio IDE can speed up the development process. Thanks to MSBuild and command-line tools, setting up automatic build systems is also possible. This method provides significant convenience for Metin2 private server developers and allows more efficient work in source edit processes.
Today while browsing Marty Sama's website I found something that I think will be useful for those who compile the client source a lot like me
It is to create a bat file to compile without the need to open Visual Studio
I tried it and it was nice as I was facing a problem of the device hanging a lot while working on the compile with the program so I found it useful and it should be published for the benefit of everyone
Note: I do not know if it has been published before or not and I also know that the method is old for sure but I did not know about it
1-
Metin2Client_CompileRelease.bat
2-
Kod:
@echo off REM استدعاء بيئة Visual Studio 2022 CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 cd %~dp0 REM msbuild metin2client.sln /property:Configuration=Release /maxcpucount -target:Clean REM msbuild metin2client.sln /property:Configuration=Release /maxcpucount MSBuild.exe metin2client.sln /p:Configuration=Release /p:Platform=Win32 /maxcpucount pause
Note: This code is for owners of the 2022 version. You can modify the path as you like.
Metin2 Client Kaynağını Visual Studio'yu Açmadan Derlemek
Metin2 özel sunucu geliştirme sürecinde, client kaynak kodlarını derlemek temel adımlardan biridir. Ancak birçok geliştirici, Visual Studio IDE'sini açmadan bu işlemi nasıl yapacağını bilmez. Bu rehberde, Visual Studio arayüzüne girmeden client kaynağını nasıl derleyebileceğinizi adım adım anlatacağız. Bu yöntem özellikle otomasyon ve hızlı geliştirme süreçleri için oldukça faydalıdır.
Gerekli Araçlar
Client kaynağını derlemek için öncelikle aşağıdaki araçlara ihtiyacınız olacaktır:
- Visual Studio Build Tools: Sadece derleme işlemlerini yapmak için yeterlidir. IDE'ye gerek yoktur.
- Windows SDK: Derleme sırasında kullanılan sistem kütüphaneleri.
- CMake (isteğe bağlı): Proje yapılandırması için kullanılabilir.
MSBuild Kullanımı
MSBuild, Microsoft'un derleme motorudur ve Visual Studio kurulumuyla birlikte gelir. Komut satırından doğrudan çağrılabilir. Örneğin, bir .vcxproj dosyası varsa şu komutla derlenebilir:
Kod:
msbuild Client.vcxproj /p:Configuration=Release /p:Platform=x64
Bu komut, Release modda ve x64 platformunda client'i derler.
Derleme Hatalarını Önleme
Derleme esnasında hata almanız durumunda şu kontrolleri yapmalısınız:
- Ortam değişkenlerinizde VCINSTALLDIR ve WINDOWSSDKDIR tanımlı mı?
- Doğru platform araç seti (v142 gibi) yüklü mü?
- Gerekli kütüphane dosyaları projede doğru şekilde tanımlanmış mı?
Python Script Entegrasyonu
Metin2 özel sunucularında Python scriptleri, UI Script, Py Root ve diğer sistemlerle entegre çalışır. Client derlemesi sırasında bazı Python betikleri de çalıştırılabilir. Örneğin, derleme sonrası otomatik olarak paketleme işlemi gerçekleştirmek için bir py script yazılabilir. Bu tarz betikler Py GUI arayüzleriyle de desteklenebilir.
Otomatik Derleme Scriptleri
Her seferinde komut satırına yazmak yerine bir batch dosyası oluşturabilirsiniz. Örnek bir script:
Kod:
@echo off[BR][/BR]call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"[BR][/BR]msbuild Client.vcxproj /p:Configuration=Release /p:Platform=x64[BR][/BR]pause
Bu script, gerekli ortamı başlatır ve client'i derler. Bu tür scriptler Metin2Dev süreçlerinde oldukça işe yarar.
Derleme Sonrası İşlemler
Başarıyla derlenen client, genellikle pack dosyalarına dönüştürülmek üzere Martysama veya benzeri araçlarla paketlenir. Paketleme işlemi, client'in sunucuya aktarılabilmesi için gereklidir. Paketlenmiş client, auth ve game sunucularıyla uyumlu çalışmalıdır.
Sonuç
Visual Studio IDE'sini açmadan client derlemek, geliştirme sürecini hızlandırabilir. MSBuild ve komut satırı araçları sayesinde, otomatik derleme sistemleri kurmak da mümkündür. Bu yöntem, Metin2 özel sunucu geliştiricileri için büyük kolaylık sağlar ve source edit süreçlerinde daha verimli çalışmanıza olanak tanır.
Compiling Metin2 Client Source Without Opening Visual Studio
In the process of developing Metin2 private servers, compiling client source code is one of the fundamental steps. However, many developers do not know how to perform this process without opening the Visual Studio IDE. In this guide, we will explain step by step how you can compile the client source without entering the Visual Studio interface. This method is especially useful for automation and rapid development processes.
Required Tools
To compile the client source, you will first need the following tools:
- Visual Studio Build Tools: Sufficient just for compilation tasks; no IDE needed.
- Windows SDK: System libraries used during compilation.
- CMake (optional): Can be used for project configuration.
Using MSBuild
MSBuild is Microsoft's build engine and comes with Visual Studio installation. It can be called directly from the command line. For example, if there is a .vcxproj file, it can be compiled using the following command:
Kod:
msbuild Client.vcxproj /p:Configuration=Release /p:Platform=x64
This command compiles the client in Release mode on the x64 platform.
Preventing Compilation Errors
If you encounter errors during compilation, check the following:
- Are environment variables VCINSTALLDIR and WINDOWSSDKDIR defined?
- Is the correct platform toolset (like v142) installed?
- Are required library files correctly defined in the project?
Python Script Integration
In Metin2 private servers, Python scripts work integrated with UI Script, Py Root, and other systems. Some Python scripts can also be run during client compilation. For example, a py script can be written to automatically perform packaging after compilation. Such scripts can also be supported with Py GUI interfaces.
Automatic Build Scripts
Instead of typing commands each time, you can create a batch file. An example script:
Kod:
@echo off[BR][/BR]call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"[BR][/BR]msbuild Client.vcxproj /p:Configuration=Release /p:Platform=x64[BR][/BR]pause
This script initializes the necessary environment and compiles the client. Such scripts are very useful in Metin2Dev processes.
Post-Compilation Processes
The successfully compiled client is usually packaged into pack files via tools like Martysama or similar. Packaging is necessary for the client to be transferred to the server. The packaged client must be compatible with auth and game servers.
Conclusion
Compiling the client without opening the Visual Studio IDE can speed up the development process. Thanks to MSBuild and command-line tools, setting up automatic build systems is also possible. This method provides significant convenience for Metin2 private server developers and allows more efficient work in source edit processes.
