diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 1c10a7c6..960810db 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -331,10 +332,17 @@ void process_login_bb(shared_ptr s, shared_ptr c, auto l = s->license_manager->verify_bb(cmd.username, cmd.password); c->set_license(l); } catch (const exception& e) { - u16string message = u"Login failed: " + decode_sjis(e.what()); - send_message_box(c, message.c_str()); - c->should_disconnect = true; - return; + if (!s->allow_unregistered_users) { + u16string message = u"Login failed: " + decode_sjis(e.what()); + send_message_box(c, message.c_str()); + c->should_disconnect = true; + return; + } else { + shared_ptr l = LicenseManager::create_license_bb( + fnv1a32(cmd.username), cmd.username, cmd.password, true); + s->license_manager->add(l); + c->set_license(l); + } } try { diff --git a/system/config.example.json b/system/config.example.json index bbc3b74a..4dc3f40f 100644 --- a/system/config.example.json +++ b/system/config.example.json @@ -141,10 +141,13 @@ }, // By default, the server only allows users who are registered in the license - // file to connect. By enabling this option, all non-BB users will be allowed - // to connect. This option has no effect for Blue Burst clients; they are - // always required to be registered before connecting. Keep in mind that - // unregistered users cannot be banned! + // file to connect. By enabling this option, all users will be allowed to + // connect. Each time a user connects with an unregistered license (serial + // number / access key combination, or username/password combination on BB), a + // temporary license is created for them, which lasts until the server is + // shut down. This license is not saved to the license file. For BB, player + // and account data is still saved on the server, even for users with + // temporary licenses. "AllowUnregisteredUsers": false, // User to run the server as. If present, newserv will attempt to switch to