Jump to content

Metin2 Project - How to create à Metin2 private server on virtual machine


Recommended Posts

  • Administrator

spacer.png

 

You too? 😱 You want to create a server for our favorite MMORPG?! You will be able to make your dream come true 😍 ! This guide is exclusively compatible with Metin2 Project. Are you ready? 🙃 Gooo! 😏

 

Install the Virtual Machine

Spoiler

 

Prerequisites

 

Introduction

VirtualBox is virtualization software. A Metin2 Server runs mostly on an operating system called FreeBSD. It's therefore necessary to virtualize a second computer within yours to operate your Metin2 Project Server.

It's the virtualization of a second operating system that consumes resources in processor, RAM and storage on the host system, your computer. If you are using a dedicated server, you will install FreeBSD as the main operating system without using Windows!

The Metin2 Project Virtual Machine is ready to use, it's already preconfigured to be usable, even for a neophyte!

 

Ready? Gooo!

You need to open the « OVA » file by clicking on it, like to open your favorite software. The extension is recognized automatically by Windows and is associated with VirtualBox. You must click on the button « IMPORT » and let VirtualBox work, it imports your Metin2 Project Virtual Machine for your greatest happiness 🥰 !

 

vb_1.png

 

vb_2.png

 

0007.png

 

It has successfully imported your Metin2 Project Virtual Machine!
Congratulations 🙃 !

 

Configure the Virtual Machine

Spoiler

 

Introduction

By default, your Metin2 Project Virtual Machine is partitioned into a local network within your computer. This manipulation consists of making your router and your virtual machine communicate and allowing it access to the Internet network.

 

Ready? Gooo!

 

0007.png

 

You must click on the name of your virtual machine then click on « CONFIGURATION ». A part that is very important, this is where you give your virtual machine the power to connect to the world and control all of us 😱 !

Click on « NETWORK » and choose « BRIDGED ADAPTER » then select the primary network card that your computer uses, « WIFI » or « ETHERNET ». You also have the possibility to modify the various parameters of your virtual machine, such as the RAM, the power of the processor...

 

0008.png

 

Click the « OK » to save the changes.

 

Manage the Virtual Machine

Spoiler

 

Introduction

It's important to know how to manage a virtual machine, starting it and shutting it down are actions that you are likely to perform regularly when managing your Metin2 Project Server.

 

Ready? Gooo!

 

0007.png

 

All you have to do is start your Metin2 Project Virtual Machine 😩 ! For that, it's very simple you have to right click on the name of your virtual machine and it will offer you several choices including: « START » or « CLOSE » when you want to turn it off.

When it has finished starting, you must have this on your screen, you must identify yourself using the identifiers that are available on the topic where you downloaded Metin2 Project, when entering the password it will not be displayed no, this is absolutely normal.

So here you have the main interface between your computer and your virtual machine, it's a bit like your second screen! It must imperatively remain open otherwise it would turn off your computer 🙂 .

 

vb_3.png

 

Trick

It's possible to restart your Metin2 Project Virtual Machine using a command! When you are connected and identified on the VirtualBox interface or using PuTTY, all you have to do is enter the following command then validate with the « ENTER »key on your keyboard:


reboot

 

Retrieve the IP Address

Spoiler

 

Introduction

An IP address is like your postal address, if we don't know it, we can't know where you are. An IP address represents the postal address, the location of your Metin2 Project Virtual Machine on your network.

 

Ready? Gooo!

You will retrieve the address of your virtual machine, it has an address, a home and it does not pay rent! This address, which is exclusively numeric is the IP address, it's specific to each computer, whether physical or virtual. You will be able to connect to the various tools to manage your Metin2 Project private server but also to connect to the game!

 

For that, it's very simple you have to enter the following command in the VirtualBox interface:


ifconfig

In our example, the IP address of the virtual machine is« 192.168.0.21 ».

 

spacer.png

 

Use PuTTY

Spoiler

 

Prerequisites

  • Download the latest version of PuTTY

 

Introduction

PuTTY is an SSH client, it allows you to connect to your FreeBSD Server in SSH. It's more or less similar to a remote control software like AnyDesk or TeamViewer except that it's used in command line! This saves you the uncomfortable interface of VirtualBox. PuTTY being much more ergonomic for copying and pasting commands...

 

Ready? Gooo!

 

001.png

 

  1. Enter the IP address in the field: Host Name (or IP address)
  2. Enter the SSH port in the field: Port (Default: 22)
  3. Enter a name you want in the field: Saved Sessions
  4. Click on the « SAVE » button to save the connection parameters

 

You must double click on the registered server of your choice to initiate a connection. PuTTY will ask you for the username and password of your FreeBSD user, this corresponds to the credentials used on your VirtualBox interface. It may also ask you to confirm the connection to the SSH Server and indicate a security problem, don't panic and click on « YES ».

 

002.png

 

Use EterNexus

Spoiler

 

Prerequisites

 

Introduction

EterNexus is a software which will allow you to decompress and compress the « EIX » and « EPK » archives of the « PACK » folder of your Metin2 Project Client, these archives contain absolutely all the game data, images, texts, models, textures...

 

Ready? Gooo!

You have to extract the files from EterNexus and move them to the « PACK » directory of your Metin2 Project Client. You will find a folder with the same name of the archive that you unzipped in the directory where the archive is located.

To unzip an archive:

 

etx_ext.png

 

EterNexus will recreate a new archive with the same name of the folder and in the same location where the same directory is located.

To compress an archive:

 

etx_pack.png

 

Configure the Metin2 Project Client

Spoiler

 

Prerequisites

  • Download and install the latest version of Notepad++
  • Download and install the latest version of WinRAR

 

Introduction

It's necessary to link your Metin2 Project Client to your Metin2 Project Server, for this we will enter the IP address of your server within the game client configuration.

 

Ready? Gooo!

You must first extract the Metin2 Project Client archive. In order to configure your Metin2 Project Client and link it to your Metin2 Project Virtual Machine, you must configure the IP address within your Metin2 Project Client.

You must extract the archive « ROOT » and you will find a multitude of files there, the one that interests us is « SERVERINFO.PY », it contains all the information about your server, the IP address, the name, the port of access...

 

At the beginning of this file, there is a list of sample servers to guide you through the changes. At the beginning of the file you must find the following block:


SRV_LOCALHOST = {
	'name':'LOCALHOST',
	'host':'127.0.0.1',
	'auth':11002,
	'c1':13001,
	'ids':'10',
}

 

You need to modify the line similar to:


'host':'XXX.XXX.XXX.XXX',

You must replace « XXX.XXX.XXX.XXX » by the IP address of your Metin2 Project Virtual Machine then save the changes. After that, you simply need to compress the « ROOT » archive. This means that when you run the Metin2 Project Client, you will need to select the « LOCALHOST » server.

 

Use Navicat

Spoiler

 

Prerequisites

  • Download and install the latest version of Navicat

 

Introduction

Navicat is a graphical database management and development software suite, it will allow you to manage your databases and the data stored in them. Navicat is not limited to MySQL, it's also able to connect to other SQL Servers such as PostgreSQL, Oracle, SQLite, MariaDB...

As part of Metin2 Project, we use MySQL, the database records and stores all data relating to your Metin2 Project Server, accounts, characters, inventories, state of quests...

 

Ready? Gooo!

To start the configuration of Navicat, you must click on « CONNECTION » then choose « MYSQL », MySQL is the engine of our database used in Metin2 Project.

 

navicat_01.png

 

navicat_02.png

 

Logins are available on the topic where you have downloaded Metin2 Project.

 

  • Enter the name you want in the field: Connection Name
  • Enter the IP address in the field: Host
  • Enter the MySQL port in the field: Port (Default: 3306)
  • Enter the username of a public account in the field: User Name
  • Enter the password associated with your user in the field: Password
  • Check the box: Save password

 

In order to ensure that the connection is established, you can click on the button: « TEST CONNECTION » if you have the message below, everything is good! It only remains to confirm by clicking twice on the buttons: « OK ».

 

navicat_03.png

 

To connect to a MySQL Server, you must double click on the name of the previously added server.

In the left part of Navicat, to see all the data of your Metin2 Project Server you must click on « TABLES ». To open a data table, also double click on it.

 

nv_acc_1.png

 

Create an Account on Metin2 Project

Spoiler

Prerequisites

 

Ready? Gooo!

Creating an account on your Metin2 Project Server is easy, for that we will use Navicat to connect to the MySQL Server. We are going to modify the « ACCOUNT » table, it's located in the « ACCOUNT » database.

 

nv_acc_1.png

 

nv_acc_2.png

 

To manually add an account from Navicat, you must click on the « » at the bottom left and fill in the boxes, these fields are the most important, everything else is optional and will be filled in automatically with the default settings:

 

  • ID: Do not fill, it fills automatically
  • LOGIN: The username of the account we use to connect to the game client
  • PASSWORD: This is the password, which you must first encrypt
  • SOCIAL_ID: This is the code for deleting a character
  • EMAIL: This is the email address of the account
  • CREATE_TIME: Account creation date
  • STATUS: Account status, « OK » or « BLOCK » if he should be banned
  • SECURITYCODE: ?
  • AVAILDT: ?
  • MILEAGE: DC
  • CASH: MD
  • GOLD_EXPIRE: Double Drop Chance for Items
  • SILVER_EXPIRE: 50% More experience
  • SAFEBOX_EXPIRE: More storage space in the Warehouse
  • AUTOLOOT_EXPIRE: A Hand that Automatically Picks Up Yangs
  • FISH_MIND_EXPIRE: The chance of catching a Fish increases
  • MARRIAGE_FAST_EXPIRE: Love points increase faster
  • MONEY_DROP_RATE_EXPIRE: Double Chance of Yang Drop
  • LAST_PLAY: Last login date

 

To encrypt the password, in the URL you have « PASSWORD.PHP=PASSWORD=XXX », you have to replace « XXX » with the password you want to use is copy the content that will be generated.

This ensures that your passwords are not in the clear in your database, a measure of security and confidentiality. Finish by pressing the « ENTREE » key on your keyboard to confirm and save.

 

Assign « GM » permissions

Spoiler

 

Introduction

Adding permissions to a user involves a lot of responsibility, for this we will use Navicat to connect to the MySQL Server. We are going to modify the « GMLIST » table, it's located in the « COMMON » database.

 

nv_acc_3.png

 

nv_acc_4.png

 

To manually add an account from Navicat, you must click on the « » at the bottom left and fill in the boxes:

 

  • MID: Do not fill, it fills automatically
  • MACCOUNT: The account ID the one to use to connect with the game client
  • MNAME: This is the name of the character, it must be strictly identical, if it's not yet existing, it does not matter, the important thing here is to choose a name that will be that of your character
  • MCONTACTIP: The box is empty by default, however some explanations: this allows the rights to be assigned to an account according to the player's IP address, this prevents someone from connecting to the account to take advantage of the accesses, to be avoided if the player to a dynamic IP address
  • MSERVERIP: The box is on « ALL » by default, however some explanations: this is in the case where you have several Metin2 servers running on the same FreeBSD Server, this allows you to assign access to a particular server, it requires adding the server IP in the « GMHOST » table
  • MAUTHORITY: This is the level of access rights in play, you can check the access level of an order from the sources of Metin2
    • GOD: Limited access
    • HIGH_WIZARD: Limited access
    • WIZARD: Limited access
    • LOW_BIZARD: Limited access
    • IMPLEMENTOR: Full access

 

Finish by pressing the « ENTREE » key on your keyboard to confirm and save. You have defined the accesses, you must reload them, two solutions:

 

  • You have an account with an already existing GM character, you must write this in-game command and disconnect / reconnect the concerned account: « /RELOAD A ».
  • You don't have any GM characters, you have to stop and restart the Metin2 Project Server with the Metin2 Project Shell Manager.

 

At this stage, the server has not started, the next start of the Metin2 Project Server will suffice to update your character's accesses.

 

Use WinSCP

Spoiler

 

Prerequisites

  • Download and install the latest version of WinSCP

 

Introduction

WinSCP is a graphical SFTP client for Windows. It uses SSH and is open source. The purpose of this program is to enable secure copying of files between a local computer and a remote computer. You will use it to transfer files to it.

With WinSCP you will be able to explore the content of your Metin2 Project Virtual Machine as if you were on your computer with Windows and its file explorer. You will find there the files of the FreeBSD operating system, the programs which have been installed, but also, most importantly, the files of our Metin2 Project Server.

 

Ready? Gooo!

When you open the program for the first time, it automatically offers you the connection manager:

 

winscp_1.png

 

  • Enter the IP address in the field: Host name
  • Enter the SSH port in the port number: Port number (Default: 22)
  • Enter Username: root: in the field: Username
  • Enter the password for: root: in the field: Password
  • Click on the button: Save...

 

winscp_3.png

 

  • Enter the name you want in the field: Save session as
  • Check the box: Save password (not recommended)
  • Click on the button: OK

 

To initiate the connection, you must double click on the server you have registered. WinSCP will automatically connect with the username and password that have been registered. It may also ask you to confirm the connection to the SFTP Server and announce a security issue, don't panic, click « YES ».

 

winscp_2.png

 

Start the Metin2 Project Server

Spoiler

 

Prerequisites

 

Introduction

Metin2 Project comes with a powerful program, Metin2 Project Shell Manager. It allows you to manage your Metin2 Project Server with ease!

 

Ready? Gooo!

To invoke it, you need to run this command on PuTTY:


cd /usr/m2_project && sh m2sh.sh

 

20434583.png

 

You have a multitude of options available to you that allow you to manage Metin2 Project as simply as possible. Each time you run the above command, you must choose one of these options by entering it and then validating it with the « ENTER » key on your keyboard.

Enter:


103

 

Ready? Gooo!

Spoiler

 

Introduction

It's time for you to materialize in the virtual and wonderful world of Metin2 Project ❤️ ! Enjoy the great and beautiful Metin2 Project adventure...

 

08083338.png

 

 

Made With ☕ and ❤️
spacer.png

  • Love 7

logo_0.png

Link to post
  • ASIKOO changed the title to Metin2 Project - How to create à Metin2 private server on virtual machine

Failed to open a session for the virtual machine Metin2 Project.

Nonexistent host networking interface, name 'Intel(R) Ethernet Connection (2) I219-V' (VERR_INTERNAL_ERROR).

Result Code:E_FAIL (0x80004005)

Component:ConsoleWrap

Interface:IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

????

Link to post
1 hour ago, CoalKid said:

Failed to open a session for the virtual machine Metin2 Project.

Nonexistent host networking interface, name 'Intel(R) Ethernet Connection (2) I219-V' (VERR_INTERNAL_ERROR).

Result Code:E_FAIL (0x80004005)

Component:ConsoleWrap

Interface:IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

????

Open settings for your machine in VirtualBox with (wm must be close)

Go to Network

see this (remove spaces) : h tt ps ://i mgur. com/a/aDZImCN

Replace with your network card and Save

Start virtual machine and enjoy.

Link to post
1 minute ago, CjMt2 said:

Open settings for your machine in VirtualBox with (wm must be close)

Go to Network

see this (remove spaces) : h tt ps ://i mgur. com/a/aDZImCN

Replace with your network card and Save

Start virtual machine and enjoy.

I already fixed that tbh, thank you anyway. Now there seems to be a problem with the Database connection. (1045-Access denied for user root)

Link to post
On 3/27/2021 at 1:55 PM, CoalKid said:

I already fixed that tbh, thank you anyway. Now there seems to be a problem with the Database connection. (1045-Access denied for user root)

1. connect to mysql server with putty in standard console

2. create user from any host in mysql console

3. create rigts for user in mysql console

4. make sure the user has active privileges in mysql console

5. exit from mysql server in mysql console

6. back to standard putty console

Be careful:

'databasename' is the name of your database, repeat this for account, common, hotbackup, log, metin2_runup, player, etc.

'username' is the username of your MySQL or MariaDB user account

'password' is the password required for that username

 

1. $ mysql -u root -p

2. mysql> CREATE USER 'username'@'%' IDENTIFIED BY 'password';
3. mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON databasename.* TO 'username'@'%' IDENTIFIED BY 'password';
4. mysql> FLUSH PRIVILEGES;
5. mysql> QUIT;
6. $

 

Edited by CjMt2
add content
Link to post
  • Administrator
2 hours ago, DEVSIX said:

what's the password? in freebsd?

 

"dev"

  • Love 1

logo_0.png

Link to post
cd /usr/m2_project/2014.1/srcs/server/db/src && gmake clean && gmake depend && gmake db && ls ../../../output
...
       [ GENERATING ] db_debug
ld: error: unable to find library -lsql
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:88: ../../../output/db_debug] Error 1

Tis is after import Virtual Machine - Kraizy Updated Edition.ova image and change only to static ip and keyboard in rc.conf , root pwd .

 

With CC = clang++-devel I have ld:error but with CC = c++ I have

       [ GENERATING ] db_debug
       [ GENERATING ] db_stripped

 

Edited by CjMt2
fix
Link to post

Hey I followed the tutorial, and whenever I try to start the server (103) using the Metin2 Project Shell Manager, after its suposed to be started, I try to check state (402) and I get this:

State Printscreen

Am I missing something ? I'm pretty sure I followed all the steps correctly, but the server doest not start and the logs are all empty.

 

EDIT:

I also tried to manually execute the commands from  Metin2 Project Shell Manager, starting with booting the db, and I get teh following error:

Database start error

 

Edited by Wooz
Added more information
Link to post
14 minutes ago, Wooz said:

Hey I followed the tutorial, and whenever I try to start the server (103) using the Metin2 Project Shell Manager, after its suposed to be started, I try to check state (402) and I get this:

State Printscreen

Am I missing something ? I'm pretty sure I followed all the steps correctly, but the server doest not start and the logs are all empty.

 

EDIT:

I also tried to manually execute the commands from  Metin2 Project Shell Manager, starting with booting the db, and I get teh following error:

Database start error

 

So, db source not compile and existent db is unusable .... hmmm ... this files is trash?

Link to post
27 minutes ago, Wooz said:

Hey I followed the tutorial, and whenever I try to start the server (103) using the Metin2 Project Shell Manager, after its suposed to be started, I try to check state (402) and I get this:

State Printscreen

Am I missing something ? I'm pretty sure I followed all the steps correctly, but the server doest not start and the logs are all empty.

 

EDIT:

I also tried to manually execute the commands from  Metin2 Project Shell Manager, starting with booting the db, and I get teh following error:

Database start error

 

Ok I managed to fix it.

I just  cleaned and recompiled all the source using  Metin2 Project Shell Manager commands, and the server started OK.
Must be something with this VM Image not having everything correctly compiled.

Should add this information to the tutorial, or upload a new VM Image @ASIKOO.

  • Good 1
Link to post

Is there a simple sha registration form (php script) suitable with mysql 8 from this server?

$pass="asikoo";
$hash = uniqid(sha1($pass), TRUE);
echo $hash;
not return

*98E1AE238461FEB88F0B9F447BDA292CDFC3AA99

 

Edited by CjMt2
add
Link to post
  • Administrator
43 minutes ago, CjMt2 said:

Is there a simple sha registration form (php script) suitable with mysql 8 from this server?

 

UPPER(CONCAT('*', SHA1(UNHEX(SHA1(___my___password___)))))

you can use this instead of the old PASSWORD() function.
I don't have a full page.

On 4/4/2021 at 7:08 PM, Wooz said:

Ok I managed to fix it.

I just  cleaned and recompiled all the source using  Metin2 Project Shell Manager commands, and the server started OK.
Must be something with this VM Image not having everything correctly compiled.

Should add this information to the tutorial, or upload a new VM Image @ASIKOO.

I had to forget to recompile everything... Thank you I will correct in the next version.

logo_0.png

Link to post
6 minutes ago, ASIKOO said:

 

UPPER(CONCAT('*', SHA1(UNHEX(SHA1(___my___password___)))))

you can use this instead of the old PASSWORD() function.

Tankyou but

$pass="asikoo";
$hash = UPPER(CONCAT('*', SHA1(UNHEX(SHA1($pass)))));
echo $hash;

return

PHP Fatal error: Uncaught Error: Call to undefined function UPPER()

Link to post
  • Administrator
Just now, CjMt2 said:

Tankyou but

$pass="asikoo";
$hash = UPPER(CONCAT('*', SHA1(UNHEX(SHA1($pass)))));
echo $hash;

return

PHP Fatal error: Uncaught Error: Call to undefined function UPPER()

it's a MySQL query (not php)

logo_0.png

Link to post
8 minutes ago, ASIKOO said:

it's a MySQL query (not php)

INSERT INTO `account` (`id`, `login`, `password`, `social_id`) VALUES ( NULL, 'ajflhmws', UCASE(CONCAT('*', SHA1(UNHEX(SHA1('asikoo'))))), '1234567')

return

*98E1AE238461FEB88F0B9F447BDA292CDFC3AA99

tankyou

  • Good 1
Link to post

This is from my auth server (compiled game_debug from source):

...
Apr  6 22:26:22.511710 :: Cube_Init locale/france/cube.txt
Apr  6 22:26:22.515996 :: Blend_Item_init locale/france/blend.txt 
Apr  6 22:26:22.540655 :: [PackageCryptInfo] . is not crypt file. pass!
Apr  6 22:26:22.540687 :: [PackageCryptInfo] .. is not crypt file. pass!
SYSERR: Apr  6 22:26:54.340195 :: hupsig: SIGHUP, SIGINT, SIGTERM signal has been received. shutting down.
Apr  6 22:26:54.340366 :: <shutdown> Starting...
Apr  6 22:26:54.340423 :: Queries 0
Apr  6 22:26:54.340453 :: <shutdown> Destroying CArenaManager...
Apr  6 22:26:54.340485 :: <shutdown> Destroying COXEventManager...
...

All channels (cores) is up with same game_debug, just auth is down

Update:

pkg remove cryptopp && cd /usr/ports/security/cryptopp/ && make install clean

and auth is up and running

Edited by CjMt2
solution
Link to post

When I pass from map 1 to map 2 (on the red kingdom) can pass through the portal but when I come from map2 on map1 I can no longer pass through the portal.
I know I have to go to /usr/m2_project/2014.1/resources/locale/france/map but I don't know what the name is for map2 so I can't check npc.txt.
Also, I don't know what is vnum or another keyword to look for in mob_proto to find that portal.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.