DarkstarProject / darkstar

DEPRECATED - FFXI Server Emulator - See Project Topaz
https://github.com/project-topaz/topaz
GNU General Public License v3.0
455 stars 549 forks source link

Add config flag to dis/allow new accounts #6425

Open Kreidos opened 4 years ago

Kreidos commented 4 years ago

There are surely people hosting private servers for themselves or their friends who would prefer not have open registrations. True, the chance of someone port scanning you, finding your server, and logging in is minimal but most other server emulators offer an option to disable registration entirely. This PR adds that capability.

Adds new flag "account_creation" (true/false) in login_darkstar.conf file which permits new accounts to be created. Defaults to true. A one-line warning will also show at dsconnect startup if this flag is set False, as this could be a cause of issues or confusion if someone had done so inadvertently or had forgotten they'd done so.

Considerations: If account creation is disabled, dsconnect will always return 0x04 ERROR_CREATE, which is visibly shown as "Username is taken" in xiloader. As xiloader only recognizes 4 status codes, this was the most suitable available. I considered adding a new 0x05 status to the xiloader code, but this would have no effect on existing installations and old versions or xiloader would show no feedback at all when attempting to create. Discussion on whether this function should use a new xiloader status code is welcomed.