I completely forgot to commit this, great
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user