Compare commits

..

1 Commits

Author SHA1 Message Date
David Markowitz
306d959a83 fix: Release removes password generation for accounts (#1738)
* Release removes password generation

* Update MasterServer.cpp
2025-01-20 13:00:50 -06:00
5 changed files with 10 additions and 10 deletions

View File

@@ -25,14 +25,11 @@ Darkflame Universe is a server emulator and does not distribute any LEGO® Unive
You must use Version 2 if you must run the server under WSL. Not doing so will result in save data loss. You must use Version 2 if you must run the server under WSL. Not doing so will result in save data loss.
* Single player installs now no longer require building the server from source or installing development tools. * Single player installs now no longer require building the server from source or installing development tools.
* Download the [latest windows release](https://github.com/DarkflameUniverse/DarkflameServer/releases) (or whichever release you need) and extract the files into a folder inside your client. Note that this setup is expecting that when double clicking the folder that you put in the same folder as `legouniverse.exe`, the file `MasterServer.exe` is in there. * Download the [latest windows release](https://github.com/DarkflameUniverse/DarkflameServer/releases) (or whichever release you need) and extract the files into a folder inside your client. Note that this setup is expecting that when double clicking the folder that you put in the same folder as `legouniverse.exe`, the file `MasterServer.exe` is in there.
* To connect to the server, either delete the file `boot.cfg` which is found in your LEGO Universe client, rename the file `boot.cfg` to something else or follow the steps [here](#allowing-a-user-to-connect-to-your-server) if you wish to keep the file. * You should be able to see the folder with the server files in the same folder as `legouniverse.exe`.
* If you would like to put the server in a different location, make sure client_location has the full path to the folder with `legouniverse.exe` in it. You can then exclude the `msvc` folder from the image below. * Go into the server files folder and open `sharedconfig.ini`. Find the line that says `client_location` and put `..` after it so the line reads `client_location=..`.
* You should be able to see the folder with the server files in the same folder as `legouniverse.exe`. An example valid configuration is below with the 3 highlighted items.
# <img style="float: left; padding-right: 5px" src="docs/setup.png">
* The inside of the `msvc` folder (or whatever you choose to name this folder) should look something like this
# <img style="float: left; padding-right: 5px" src="docs/valid_server.png">
* To run the server, double-click `MasterServer.exe`. * To run the server, double-click `MasterServer.exe`.
* You will be asked to create an account the first time you run the server. After you have created the account, the server will shutdown and need to be restarted. * You will be asked to create an account the first time you run the server. After you have created the account, the server will shutdown and need to be restarted.
* To connect to the server, either delete the file `boot.cfg` which is found in your LEGO Universe client, rename the file `boot.cfg` to something else or follow the steps [here](#allowing-a-user-to-connect-to-your-server) if you wish to keep the file.
* When shutting down the server, it is highly recommended to click the `MasterServer.exe` window and hold `ctrl` while pressing `c` to stop the server. * When shutting down the server, it is highly recommended to click the `MasterServer.exe` window and hold `ctrl` while pressing `c` to stop the server.
* We are working on a way to make it so when you close the game, the server stops automatically alongside when you open the game, the server starts automatically. * We are working on a way to make it so when you close the game, the server stops automatically alongside when you open the game, the server starts automatically.
* If you are not setting a server up on mac, you can ignore this note * If you are not setting a server up on mac, you can ignore this note

View File

@@ -246,7 +246,8 @@ int main(int argc, char** argv) {
// Regenerate hash based on new password // Regenerate hash based on new password
char salt[BCRYPT_HASHSIZE]; char salt[BCRYPT_HASHSIZE];
char hash[BCRYPT_HASHSIZE]; char hash[BCRYPT_HASHSIZE];
assert(GenerateBCryptPassword(password, 12, salt, hash) == 0); int res = GenerateBCryptPassword(password, 12, salt, hash);
assert(res == 0);
Database::Get()->UpdateAccountPassword(accountId->id, std::string(hash, BCRYPT_HASHSIZE)); Database::Get()->UpdateAccountPassword(accountId->id, std::string(hash, BCRYPT_HASHSIZE));
@@ -284,7 +285,8 @@ int main(int argc, char** argv) {
//Generate new hash for bcrypt //Generate new hash for bcrypt
char salt[BCRYPT_HASHSIZE]; char salt[BCRYPT_HASHSIZE];
char hash[BCRYPT_HASHSIZE]; char hash[BCRYPT_HASHSIZE];
assert(GenerateBCryptPassword(password, 12, salt, hash) == 0); int res = GenerateBCryptPassword(password, 12, salt, hash);
assert(res == 0);
//Create account //Create account
try { try {
@@ -323,7 +325,8 @@ int main(int argc, char** argv) {
char salt[BCRYPT_HASHSIZE]; char salt[BCRYPT_HASHSIZE];
char hash[BCRYPT_HASHSIZE]; char hash[BCRYPT_HASHSIZE];
const auto& cfgPassword = Game::config->GetValue("master_password"); const auto& cfgPassword = Game::config->GetValue("master_password");
GenerateBCryptPassword(!cfgPassword.empty() ? cfgPassword : "3.25DARKFLAME1", 13, salt, hash); int res = GenerateBCryptPassword(!cfgPassword.empty() ? cfgPassword : "3.25DARKFLAME1", 13, salt, hash);
assert(res == 0);
Game::server = new dServer(ourIP, ourPort, 0, maxClients, true, false, Game::logger, "", 0, ServerType::Master, Game::config, &Game::lastSignal, hash); Game::server = new dServer(ourIP, ourPort, 0, maxClients, true, false, Game::logger, "", 0, ServerType::Master, Game::config, &Game::lastSignal, hash);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -24,7 +24,7 @@ dump_folder=
# The location of the client # The location of the client
# Either the folder with /res or with /client and /versions # Either the folder with /res or with /client and /versions
client_location=.. client_location=
# The maximum outgoing bandwidth in bits. If your clients are having # The maximum outgoing bandwidth in bits. If your clients are having
# issues with enemies taking a while to catch up to them, increse this value. # issues with enemies taking a while to catch up to them, increse this value.