Compare commits

...
13 Commits
Author SHA1 Message Date
Lncvrt 8efad9cf1b Update CDN link 2026-09-24 10:08:36 -07:00
Lncvrt f2fc143c03 fix 3 2026-04-18 12:57:12 -07:00
Lncvrt cc1174f9c7 fix 2 2026-03-24 12:48:13 -07:00
Lncvrt 3088dc63ac fix 2026-03-24 12:44:42 -07:00
Lncvrt 4e02f110cd Revert "yep"
This reverts commit 2e392bdf87.
2026-03-24 12:43:41 -07:00
Lncvrt 2e392bdf87 yep 2026-03-13 12:59:54 -07:00
Lncvrt 9553bb9c61 fix leaderboards 2026-03-03 09:18:00 -07:00
Lncvrt 5ee2dcf2db Update to v2 manifest 2026-02-27 19:21:39 -07:00
Lncvrt d6ad9a01a0 Fix 2026-02-27 18:51:35 -07:00
Lncvrt e259567c62 Oops 2026-02-16 22:45:11 -07:00
Lncvrt 94051c6b55 Make berry dash launcher leaderboards work 2026-02-16 22:43:58 -07:00
Lncvrt 876b1bce08 Make Berry Dash Launcher work again (not supported still) 2026-02-16 22:07:45 -07:00
Lncvrt 65d860e6cb Fix readme 2026-02-16 13:21:47 -07:00
7 changed files with 72 additions and 12 deletions

No files matched your search

+3 -3
View File
@@ -1,8 +1,8 @@
# Berry Dash Server # Berry Dash Server
> [!CAUTION] > [!CAUTION]
> This project has been discarded and a new API is under the Lncvrt Games originization. > This project has been discarded and a new API is under the Lncvrt Games organization.
> >
> You can find the new server API [here](https://github.com/Lncvrt-Games/api). > You can find the new server API [here](https://git.lncvrt.xyz/Lncvrt-Games/api).
Legacy Server Source Code Legacy Server Source Code
@@ -9,7 +9,7 @@ $stmt->close();
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
$topPlayers = []; $topPlayers = [];
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
$id = $row["id"]; $id = $row["id"];
$stmt = $conn1->prepare("SELECT legacy_high_score, save_data FROM userdata WHERE id = ? AND legacy_high_score > 0 LIMIT 1"); $stmt = $conn1->prepare("SELECT legacy_high_score, save_data FROM userdata WHERE id = ? AND legacy_high_score > 0 LIMIT 1");
+2 -2
View File
@@ -4,11 +4,11 @@ setPlainHeader();
$conn0 = newConnection(0); $conn0 = newConnection(0);
$stmt = $conn0->prepare("SELECT downloadUrlVersion FROM launcherversionmanifest WHERE HIDDEN = 0 AND game = 1 ORDER BY place DESC LIMIT 1"); $stmt = $conn0->prepare("SELECT versionName FROM launcherversionmanifest WHERE HIDDEN = 0 AND game = 1 ORDER BY place DESC LIMIT 1");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
$stmt->close(); $stmt->close();
$row = $result->fetch_assoc(); $row = $result->fetch_assoc();
$conn0->close(); $conn0->close();
echo $row["downloadUrlVersion"] ?? 'N/A'; echo $row["versionName"] ?? 'N/A';
+4 -4
View File
@@ -14,14 +14,14 @@ if (
exit; exit;
} }
$post = getPostData(); $post = getPostData();
$request_type = $post['type'] ?? ''; $request_type = $post['type'] ?? (isLauncher() ? '0' : '');
$conn0 = newConnection(0); $conn0 = newConnection(0);
$conn1 = newConnection(1); $conn1 = newConnection(1);
$request_value = ""; $request_value = "";
if ($request_type === "0") { if ($request_type == "0") {
$request_value = "highScore"; $request_value = "highScore";
} else if ($request_type === "1") { } else if ($request_type == "1") {
$request_value = match((int)$post['showType'] ?? 0) { $request_value = match((int)$post['showType'] ?? 0) {
1 => "totalPoisonBerries", 1 => "totalPoisonBerries",
2 => "totalSlowBerries", 2 => "totalSlowBerries",
@@ -32,7 +32,7 @@ if ($request_type === "0") {
7 => "totalAntiBerries", 7 => "totalAntiBerries",
default => "totalNormalBerries" default => "totalNormalBerries"
}; };
} else if ($request_type !== "2" && $request_type !== "3" && $request_type !== "4") { } else if ($request_type != "2" && $request_type != "3" && $request_type != "4") {
exitWithMessage(json_encode([])); exitWithMessage(json_encode([]));
} }
+1 -1
View File
@@ -1,4 +1,4 @@
<?php <?php
require __DIR__ . '/../../incl/util.php'; require __DIR__ . '/../../incl/util.php';
setPlainHeader(); setPlainHeader();
echo "-1"; echo "1.1.0";
+56
View File
@@ -0,0 +1,56 @@
<?php
require __DIR__ . '/../../incl/util.php';
header("Content-Type: application/json");
$conn = newConnection(0);
$stmt = $conn->prepare("SELECT versionName, downloads, place FROM launcherversionmanifest WHERE hidden = 0 AND game = 1 ORDER BY id DESC");
$stmt->execute();
$result_versions = $stmt->get_result();
$versions = array_map(function($row) use ($conn) {
$downloads = json_decode($row['downloads'], true);
$downloads = array_combine(
array_map(fn($k) => match($k) {
'windows-x86' => 'windows',
'windows-x64' => 'windows',
'linux-x64' => 'linux',
'macos-universal' => 'macos',
default => $k
}, array_keys($downloads)),
array_values($downloads)
);
$platforms = array_keys($downloads);
$downloadUrls = [];
foreach ($downloads as $platform => $fileId) {
$cdnStmt = $conn->prepare("SELECT path FROM files WHERE id = ?");
$cdnStmt->bind_param("i", $fileId);
$cdnStmt->execute();
$cdnResult = $cdnStmt->get_result()->fetch_assoc();
$downloadUrls[] = $cdnResult ? "https://archive.org/download/lncvrt-games-archive/" . $cdnResult['path'] : null;
$cdnStmt->close();
}
return [
'id' => $row['place'],
'version' => $row['versionName'],
'displayName' => $row['versionName'],
'platforms' => $platforms,
'downloadUrls' => $downloadUrls,
'executables' => array_map(function($platform) use ($row) {
return match(true) {
in_array($platform, ['windows', 'windows-arm64']) => $row['place'] >= 16 ? 'Berry Dash.exe' : 'Foodie Dash.exe',
$platform === 'macos' => $row['place'] >= 16 ? 'Berry Dash.app' : 'Foodie Dash.app',
$platform === 'linux' => $row['place'] >= 16 ? 'Berry Dash.x86_64' : 'Foodie Dash.x86_64',
in_array($platform, ['android', 'ios']) => null,
default => null
};
}, $platforms)
];
}, $result_versions->fetch_all(MYSQLI_ASSOC));
echo json_encode($versions);
$conn->close();
+5 -1
View File
@@ -27,9 +27,13 @@ function getClientVersion() {
return $_SERVER['HTTP_CLIENTVERSION']; return $_SERVER['HTTP_CLIENTVERSION'];
} }
function isLauncher() {
return ($_SERVER['HTTP_REQUESTER'] == "BerryDashLauncher" && $_SERVER['HTTP_LAUNCHERVERSION'] == "1.1.0");
}
function encrypt($plainText) { function encrypt($plainText) {
include __DIR__.'/../config/encryption.php'; include __DIR__.'/../config/encryption.php';
$key = $SERVER_SEND_TRANSFER_KEY_SPECIFIC[getClientVersion()]; $key = isLauncher() ? $SERVER_SEND_TRANSFER_KEY_SPECIFIC["1.6"] : $SERVER_SEND_TRANSFER_KEY_SPECIFIC[getClientVersion()];
if ($key == null) return; if ($key == null) return;
$iv = random_bytes(16); $iv = random_bytes(16);
$cipher = openssl_encrypt($plainText, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); $cipher = openssl_encrypt($plainText, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);