From 17a617f4bc3bb7dbbac6d995811fa2cbf3545db5 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Thu, 22 Jan 2026 19:27:46 -0700 Subject: [PATCH] I completely forgot to commit this, great --- Assets/Scripts/LatestVersionText.cs | 4 ++-- Assets/Scripts/Other/Endpoints.cs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/LatestVersionText.cs b/Assets/Scripts/LatestVersionText.cs index 9baa89c..770ce31 100644 --- a/Assets/Scripts/LatestVersionText.cs +++ b/Assets/Scripts/LatestVersionText.cs @@ -42,12 +42,12 @@ public class LatestVersionText : MonoBehaviour async void GetLatestVersion() { - using UnityWebRequest request = UnityWebRequest.Get(SensitiveInfo.SERVER_DATABASE_PREFIX + "getLatestVersion.php"); + using UnityWebRequest request = UnityWebRequest.Get(Endpoints.LATEST_VERSION_ENDPOINT); request.SetRequestHeader("Requester", "BerryDashClient"); request.SetRequestHeader("ClientVersion", Application.version); request.SetRequestHeader("ClientPlatform", Application.platform.ToString()); await request.SendWebRequest(); - if (request.result != UnityWebRequest.Result.Success) + if (request.downloadHandler.text == null) { latest = "-1"; } diff --git a/Assets/Scripts/Other/Endpoints.cs b/Assets/Scripts/Other/Endpoints.cs index bea809c..67abcfa 100644 --- a/Assets/Scripts/Other/Endpoints.cs +++ b/Assets/Scripts/Other/Endpoints.cs @@ -1,14 +1,18 @@ public class Endpoints { public static readonly string BASE_URL = "http://localhost:3342/api"; - public static readonly string LEADERBOARDS_ENDPOINT = BASE_URL + "/berrydash/leaderboards"; + public static readonly string BERRYDASH_ENDPOINT = BASE_URL + "/berrydash"; + public static readonly string LATEST_VERSION_ENDPOINT = BERRYDASH_ENDPOINT + "/latest-version"; + public static readonly string LEADERBOARDS_ENDPOINT = BERRYDASH_ENDPOINT + "/leaderboards"; public static readonly string LEADERBOARDS_SCORE_ENDPOINT = LEADERBOARDS_ENDPOINT + "/score"; public static readonly string LEADERBOARDS_BERRY_ENDPOINT = LEADERBOARDS_ENDPOINT + "/berry"; public static readonly string LEADERBOARDS_COIN_ENDPOINT = LEADERBOARDS_ENDPOINT + "/coin"; public static readonly string LEADERBOARDS_LEGACY_ENDPOINT = LEADERBOARDS_ENDPOINT + "/legacy"; public static readonly string LEADERBOARDS_TOTAL_ENDPOINT = LEADERBOARDS_ENDPOINT + "/total"; - public static readonly string PROFILE_ENDPOINT = BASE_URL + "/berrydash/profile"; + public static readonly string PROFILE_ENDPOINT = BERRYDASH_ENDPOINT + "/profile"; public static readonly string PROFILE_POSTS_ENDPOINT = PROFILE_ENDPOINT + "/posts"; - public static readonly string ACCOUNT_ENDPOINT = BASE_URL + "/berrydash/account"; + public static readonly string ACCOUNT_ENDPOINT = BERRYDASH_ENDPOINT + "/account"; + public static readonly string ACCOUNT_LOGIN_ENDPOINT = ACCOUNT_ENDPOINT + "/login"; + public static readonly string ACCOUNT_REGISTER_ENDPOINT = ACCOUNT_ENDPOINT + "/register"; public static readonly string ACCOUNT_SAVE_ENDPOINT = ACCOUNT_ENDPOINT + "/save"; } \ No newline at end of file