From 85fff884ec872e96973449958572d75444b7eab6 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Wed, 31 Dec 2025 16:08:48 -0700 Subject: [PATCH] Update to current files --- README.md | 33 +-- config/general.php | 6 - database.sql | 305 ----------------------- database/backported/.htaccess | 1 + database/canLoadClient.php | 21 +- database/changeAccountPassword.php | 1 - database/changeAccountUsername.php | 17 +- database/deleteAccountProfileMessage.php | 1 - database/deleteChatroomMessage.php | 1 - database/editChatroomMessage.php | 1 - database/getAccountProfile.php | 1 - database/getAccountProfileMessages.php | 1 - database/getChatroomMessages.php | 9 +- database/getLatestVersion.php | 3 +- database/getMarketplaceIcons.php | 1 - database/getTopPlayers.php | 19 +- database/launcher/latest.php | 3 +- database/launcher/versions.php | 13 +- database/loadAccount.php | 17 +- database/loginAccount.php | 44 ++-- database/registerAccount.php | 36 ++- database/reportChatroomMessage.php | 1 - database/saveAccount.php | 41 ++- database/sendChatroomMessage.php | 9 +- database/uploadAccountProfileMessage.php | 1 - database/uploadMarketplaceIcon.php | 1 - database/voteAccountProfileMessage.php | 1 - incl/util.php | 32 --- 28 files changed, 92 insertions(+), 528 deletions(-) delete mode 100644 config/general.php delete mode 100644 database.sql create mode 100644 database/backported/.htaccess mode change 100755 => 100644 database/launcher/latest.php mode change 100755 => 100644 database/launcher/versions.php diff --git a/README.md b/README.md index b90f323..5ef3bd1 100644 --- a/README.md +++ b/README.md @@ -2,37 +2,10 @@ > [!CAUTION] > This project has moved to the Lncvrt Games originization. -> You can find the new repository [here](https://github.com/Lncvrt-Games/servers) +> You can find the new repository [here](https://github.com/Lncvrt-Games/servers). +> NOTE: This is also the branch that is being modified so it can continue to work for 1.8.2 and lower. +> Find old branch [here](https://github.com/BerryDash/server/tree/main) --- This is the new rewritten server source code for Berry Dash. - -## Setup - -> [!CAUTION] -> Do not share any keys with anybody, and store them safely on your computer. -> Encryption keys are meant to increase the security of the game and prevent cheaters. - -1. Upload the files on a webserver -2. Import database.sql into a MySQL/MariaDB database -3. Configure everything in `config/` folder (use `python3 genkeys.py` for `encryption.php`) -4. Use `git clone https://github.com/BerryDash/source.git` to clone the client and configure `Assets/Scripts/SensitiveInfo.cs` - -**Note:** - -When configuring keys in the client, `SERVER_RECEIVE_TRANSFER_KEY` will the key `SERVER_SEND_TRANSFER_KEY` from the server, and the other way around too. - -If this isn't configured properly, you will not be able to make requests to the server you have setup. - -Example: - -```cs -public static readonly string SERVER_DATABASE_PREFIX = "https://berrydash.lncvrt.xyz/database/"; -public static readonly string SERVER_RECEIVE_TRANSFER_KEY = "02b3c624552588ba0929e43fbad36221"; // This would be `SERVER_SEND_TRANSFER_KEY` from the server -public static readonly string SERVER_SEND_TRANSFER_KEY = "d4269db023de05fd59bf05378fa57324"; // This would be `SERVER_RECEIVE_TRANSFER_KEY` from the server -public static readonly string BAZOOKA_MANAGER_KEY = "19387a0e6b861e79d38657d0059bce8c"; -public static readonly string BAZOOKA_MANAGER_FILE_KEY = "7fb47db04d9babf42ee3713289516208"; -``` - -In conclusion: `SERVER_RECEIVE_TRANSFER_KEY` and `SERVER_SEND_TRANSFER_KEY` are swapped between client and server. This may be changed in the future. diff --git a/config/general.php b/config/general.php deleted file mode 100644 index 3081763..0000000 --- a/config/general.php +++ /dev/null @@ -1,6 +0,0 @@ -prepare(" diff --git a/database/getLatestVersion.php b/database/getLatestVersion.php index f1f38a8..fb761ec 100644 --- a/database/getLatestVersion.php +++ b/database/getLatestVersion.php @@ -1,5 +1,4 @@ execute(); $result_versions = $stmt->get_result(); $versions = array_map(fn($row) => ['id' => $row['id'], 'version' => $row['version'], 'releaseDate' => $row['releaseDate'], 'displayName' => empty($row['displayName']) ? $row['version'] : $row['displayName'], 'platforms' => json_decode($row['platforms']), 'downloadUrls' => json_decode($row['downloadUrls']), 'executables' => json_decode($row['executables']), 'category' => $row['category']], $result_versions->fetch_all(MYSQLI_ASSOC)); -$stmt = $conn->prepare("SELECT * FROM launchercategories ORDER BY id DESC"); -$stmt->execute(); - -$result_categories = $stmt->get_result(); -$rows = $result_categories->fetch_all(MYSQLI_ASSOC); - -$categories = []; -foreach ($rows as $row) { - $categories[$row['id']] = $row['name']; -} - -echo json_encode(["versions" => $versions, "categories" => $categories]); +echo json_encode($versions); $conn->close(); \ No newline at end of file diff --git a/database/loadAccount.php b/database/loadAccount.php index 84fda37..d47ebe2 100644 --- a/database/loadAccount.php +++ b/database/loadAccount.php @@ -1,17 +1,14 @@