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
Connect to the databases
One MySQL connection reaches the account and player databases. Their names are
substituted into every statement through {accountDb} and {playerDb}.
[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:
SELECTon the account, player, and log databases;INSERTonplayer.item_awardfor items;INSERTandUPDATEonaccount.accountfor creation and currency;CREATEon the account database andSELECT,INSERT,UPDATE,DELETEonaccount.portal_grant_journalfor replay-safe currency delivery.
Choose the real password format
The connector must reproduce the transform used by the base's auth code:
| Value | Use when the game verifies |
|---|---|
argon2id | encoded Argon2id hashes |
bcrypt | bcrypt hashes used by some CMS-era bases |
mysql41 | classic MySQL PASSWORD() hashes (* plus double SHA-1) |
unknown | any 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
- Start the connector and resolve every validation error named in the log.
- Confirm Connected in Admin.
- Run Connector check with a known account name.
- Link that account with its real password.
- If creation is enabled, create an account and log into the game with it.