How to Compile Metin2 Server Source (Src) via Putty?
After adding in-game systems, bug solutions or making changes at the kernel (game/db) level on your Metin2 PVP server, you need to recompile (build) your source codes on your FreeBSD server for these changes to be reflected in the game. In this guide, you will learn the steps to compile game and db without errors.
1. Uploading Required Source Files to the Server
Before starting the compilation process, you need to transfer the source files you edited on your computer to the correct directory on the server:
- Connect to your server with Filezilla or WinSCP program.
- The main directory usually used
/usr/src/Go to the folder. - belongs to your game Server Source Upload your folder (containing game and db source codes) here. The folder name is usually
mainline,srcorserverCheck that it is.
2. Accessing and Cleaning the Source Directory with Putty
Residual files from the old compilation may cause faulty builds of new systems or conflicts during compilation. That's why cleaning must be done before each new build:
- Open the Putty program and connect to your server as root.
- Change to the directory where your game source file is located (Sample directory):
cd /usr/src/server/game/src - To clean up old build remnants, run this command:
gmake clean
3. Compiling Game and DB Files
After the cleaning process is completed, you can run the compilation commands one by one. The process may take several minutes depending on the performance of your server:
- Game Compilation: While in the same directory (game/src), start the compilation by issuing the following command:
gmake -j4
*(Note: -j4 speeds up compilation by using all 4 cores of the server. You can change it according to your server processor.) - DB Compilation: After the game compilation is completed, switch to the db directory:
cd ../../db/src - First do cleanup for the DB:
gmake clean - Then start the DB build:
gmake -j4
4. Importing Compiled Files to the Game
When the compilation process is completed without any errors (without giving an error), there will be a new green color in the folder.gameanddbYour binary files will be created. You can add these files to the main directory where the game is run (Usually/usr/game/share/binor to the relevant bin folder used by your files) and set its permissions 777 After doing this, you can start your server.
This article is specially prepared for PvPServer.