CREATE_GAME_ACCOUNT
Self-service account creation from the portal
Optional, and owner-controlled
This capability enables the Self-service account creation module. An owner who prefers accounts to be created only in-game or through their own launcher can switch the module off while the capability stays implemented — see Player modules.
| Result | Meaning |
|---|---|
CREATED | Account inserted successfully |
ALREADY_EXISTS | Account name is already in use |
INVALID_NAME | Account name violates the pack's rules |
TEMPORARY_FAILURE | The operation could not be completed |
Handle the duplicate-key error even if you check for an existing account first: two players can
claim the same name in the gap between the check and the insert, and that collision is
ALREADY_EXISTS, not a fault.
The account name arrives already lower-cased. Forgeport caps both name and password at 14 characters, the classic client's field length — a longer value would be silently truncated at the login screen and the account would appear not to work.
Implementing it
String createGameAccount(String accountName, String password) throws Exception;The interface default returns TEMPORARY_FAILURE, so leave CREATE_GAME_ACCOUNT out of
capabilities() until you have written this.
Hash the password exactly as your login server does — the same code path as
VERIFY_GAME_CREDENTIALS, because an account created
with a different hash is one nobody can log into. The aCis example accepts ^[a-z0-9]{4,45}$,
hashes with BCrypt.hashPw, and inserts login and password into accounts.
Create one from the portal and log into the game with it
Connector check does not create an account — a created account lingers, and the check has no way to undo it. So this is the one capability with no automated proof at all, and it is also the one where being wrong is invisible: a connector verifying its own hash against its own query proves only that it agrees with itself, which is exactly what a wrong password format does too.
Once per pack, create an account from the portal and log into the game with it, through to
character selection. Until you have, treat this and VERIFY_GAME_CREDENTIALS as unconfirmed.