Metin2

Configure the Metin2 connector

Adapt portal.toml to the databases and password format of your base

portal.toml is the complete configuration and must sit beside the connector. The generated file is a working reference for old-metin2 TMP4 40250, with every base-dependent line marked CHECK.

File layout

portal-connector-metin2-1.0.0.mjs
portal.toml

Connect to the databases

One MySQL connection reaches the account and player databases. Their names are substituted into every statement through {accountDb} and {playerDb}.

portal.toml
[database]
host = "127.0.0.1"
port = 3306
user = "metin2"
password = "PUT_THE_PASSWORD_HERE"
accountDb = "account"
playerDb = "player"

Database names must contain only letters, digits, _, or $ because they are used as SQL identifiers. This supports postfixed schemas without editing every query.

Grant the connector user only what enabled features use:

  • SELECT on the account, player, and log databases;
  • INSERT on player.item_award for items;
  • INSERT and UPDATE on account.account for creation and currency;
  • CREATE on the account database and SELECT, INSERT, UPDATE, DELETE on account.portal_grant_journal for replay-safe currency delivery.

Choose the real password format

The connector must reproduce the transform used by the base's auth code:

ValueUse when the game verifies
argon2idencoded Argon2id hashes
bcryptbcrypt hashes used by some CMS-era bases
mysql41classic MySQL PASSWORD() hashes (* plus double SHA-1)
unknownany format you have not verified

unknown disables account verification and creation rather than creating an account the game rejects.

Read the auth code; do not infer from the base's age

A wrong format can make portal linking fail for every player and can create unusable accounts. Verify one existing account and one newly created account by logging into the game.

The generated verification query treats status <> 'OK' as disabled. Account creation includes datetime columns explicitly because zero-date defaults are rejected by modern MySQL. social_id is the client delete code; adapt the fixed value and tell players how your server uses it.

Queries and parameters

Each query present enables its matching feature. Required placeholders such as @account, @limit, and @term are validated at startup. Remove a query if your base cannot answer it safely.

{accountDb} and {playerDb} are identifier substitutions. Values beginning with @ are bound parameters and must not be replaced with string concatenation.

Verify

  1. Start the connector and resolve every validation error named in the log.
  2. Confirm Connected in Admin.
  3. Run Connector check with a known account name.
  4. Link that account with its real password.
  5. If creation is enabled, create an account and log into the game with it.

On this page