Fix possible issues with requests
This commit is contained in:
@@ -29,8 +29,10 @@ public class AccountChangePassword : MonoBehaviour
|
|||||||
|
|
||||||
async void ChangePassword()
|
async void ChangePassword()
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = false;
|
||||||
if (changePasswordNewPasswordInput.text != changePasswordRetypeNewPasswordInput.text)
|
if (changePasswordNewPasswordInput.text != changePasswordRetypeNewPasswordInput.text)
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changePasswordStatusText, "Passwords do not match", Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, "Passwords do not match", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -46,27 +48,32 @@ public class AccountChangePassword : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changePasswordStatusText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changePasswordStatusText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changePasswordStatusText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changePasswordStatusText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changePasswordStatusText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,5 +91,6 @@ public class AccountChangePassword : MonoBehaviour
|
|||||||
Tools.UpdateStatusText(changePasswordStatusText, (string)jsonResponse["message"], Color.red);
|
Tools.UpdateStatusText(changePasswordStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
changePasswordBackButton.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,7 @@ public class AccountChangeUsername : MonoBehaviour
|
|||||||
|
|
||||||
async void ChangeUsername()
|
async void ChangeUsername()
|
||||||
{
|
{
|
||||||
|
changeUsernameBackButton.interactable = false;
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("oldusername", changeUsernameCurrentUsernameInput.text);
|
dataForm.AddField("oldusername", changeUsernameCurrentUsernameInput.text);
|
||||||
dataForm.AddField("newusername", changeUsernameNewUsernameInput.text);
|
dataForm.AddField("newusername", changeUsernameNewUsernameInput.text);
|
||||||
@@ -39,27 +40,32 @@ public class AccountChangeUsername : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
changeUsernameBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changeUsernameStatusText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(changeUsernameStatusText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
changeUsernameBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changeUsernameStatusText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(changeUsernameStatusText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
changeUsernameBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changeUsernameStatusText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(changeUsernameStatusText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
changeUsernameBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changeUsernameStatusText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(changeUsernameStatusText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
changeUsernameBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(changeUsernameStatusText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(changeUsernameStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -77,5 +83,6 @@ public class AccountChangeUsername : MonoBehaviour
|
|||||||
Tools.UpdateStatusText(changeUsernameStatusText, (string)jsonResponse["message"], Color.red);
|
Tools.UpdateStatusText(changeUsernameStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
changeUsernameBackButton.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ using System.Numerics;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
@@ -46,6 +45,7 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
{
|
{
|
||||||
loggedInLoadButton.interactable = false;
|
loggedInLoadButton.interactable = false;
|
||||||
loggedInSaveButton.interactable = false;
|
loggedInSaveButton.interactable = false;
|
||||||
|
loggedInBackButton.interactable = false;
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("username", BazookaManager.Instance.GetAccountName());
|
dataForm.AddField("username", BazookaManager.Instance.GetAccountName());
|
||||||
dataForm.AddField("token", BazookaManager.Instance.GetAccountSession());
|
dataForm.AddField("token", BazookaManager.Instance.GetAccountSession());
|
||||||
@@ -67,27 +67,42 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
loggedInLoadButton.interactable = true;
|
||||||
|
loggedInSaveButton.interactable = true;
|
||||||
|
loggedInBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loggedInText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(loggedInText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
loggedInLoadButton.interactable = true;
|
||||||
|
loggedInSaveButton.interactable = true;
|
||||||
|
loggedInBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loggedInText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(loggedInText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
loggedInLoadButton.interactable = true;
|
||||||
|
loggedInSaveButton.interactable = true;
|
||||||
|
loggedInBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loggedInText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(loggedInText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
loggedInLoadButton.interactable = true;
|
||||||
|
loggedInSaveButton.interactable = true;
|
||||||
|
loggedInBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loggedInText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(loggedInText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
loggedInLoadButton.interactable = true;
|
||||||
|
loggedInSaveButton.interactable = true;
|
||||||
|
loggedInBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loggedInText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(loggedInText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -105,6 +120,7 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
}
|
}
|
||||||
loggedInLoadButton.interactable = true;
|
loggedInLoadButton.interactable = true;
|
||||||
loggedInSaveButton.interactable = true;
|
loggedInSaveButton.interactable = true;
|
||||||
|
loggedInBackButton.interactable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async void LoadAccount()
|
async void LoadAccount()
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -29,6 +28,7 @@ public class AccountLogin : MonoBehaviour
|
|||||||
|
|
||||||
async void SubmitLogin()
|
async void SubmitLogin()
|
||||||
{
|
{
|
||||||
|
loginBackButton.interactable = false;
|
||||||
if (loginUsernameInput.text == string.Empty || loginPasswordInput.text == string.Empty)
|
if (loginUsernameInput.text == string.Empty || loginPasswordInput.text == string.Empty)
|
||||||
{
|
{
|
||||||
Tools.UpdateStatusText(loginPanelStatusText, "All input fields must be filled", Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, "All input fields must be filled", Color.red);
|
||||||
@@ -46,27 +46,32 @@ public class AccountLogin : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
loginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loginPanelStatusText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
loginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loginPanelStatusText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
loginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loginPanelStatusText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
loginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loginPanelStatusText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
loginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(loginPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -97,5 +102,6 @@ public class AccountLogin : MonoBehaviour
|
|||||||
Tools.UpdateStatusText(loginPanelStatusText, (string)jsonResponse["message"], Color.red);
|
Tools.UpdateStatusText(loginPanelStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
loginBackButton.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,7 @@ public class AccountRefreshLogin : MonoBehaviour
|
|||||||
|
|
||||||
async void RefreshLogin()
|
async void RefreshLogin()
|
||||||
{
|
{
|
||||||
|
refreshLoginBackButton.interactable = false;
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("username", refreshLoginUsernameInput.text);
|
dataForm.AddField("username", refreshLoginUsernameInput.text);
|
||||||
dataForm.AddField("password", refreshLoginPasswordInput.text);
|
dataForm.AddField("password", refreshLoginPasswordInput.text);
|
||||||
@@ -38,27 +39,32 @@ public class AccountRefreshLogin : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
refreshLoginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(refreshLoginStatusText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(refreshLoginStatusText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
refreshLoginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(refreshLoginStatusText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(refreshLoginStatusText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
refreshLoginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(refreshLoginStatusText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(refreshLoginStatusText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
refreshLoginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(refreshLoginStatusText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(refreshLoginStatusText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
refreshLoginBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(refreshLoginStatusText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(refreshLoginStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -78,5 +84,6 @@ public class AccountRefreshLogin : MonoBehaviour
|
|||||||
Tools.UpdateStatusText(refreshLoginStatusText, (string)jsonResponse["message"], Color.red);
|
Tools.UpdateStatusText(refreshLoginStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
refreshLoginBackButton.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,7 @@ public class AccountRegister : MonoBehaviour
|
|||||||
|
|
||||||
async void SubmitRegister()
|
async void SubmitRegister()
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = false;
|
||||||
if (
|
if (
|
||||||
registerUsernameInput.text == string.Empty ||
|
registerUsernameInput.text == string.Empty ||
|
||||||
registerEmailInput.text == string.Empty ||
|
registerEmailInput.text == string.Empty ||
|
||||||
@@ -41,16 +42,19 @@ public class AccountRegister : MonoBehaviour
|
|||||||
registerRetypePasswordInput.text == string.Empty
|
registerRetypePasswordInput.text == string.Empty
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "All input fields must be filled", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "All input fields must be filled", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (registerEmailInput.text != registerRetypeEmailInput.text)
|
if (registerEmailInput.text != registerRetypeEmailInput.text)
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Emails don't match", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Emails don't match", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (registerPasswordInput.text != registerRetypePasswordInput.text)
|
if (registerPasswordInput.text != registerRetypePasswordInput.text)
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Passwords don't match", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Passwords don't match", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -65,27 +69,32 @@ public class AccountRegister : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
registerBackButton.interactable = true;
|
||||||
Tools.UpdateStatusText(registerPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -101,5 +110,6 @@ public class AccountRegister : MonoBehaviour
|
|||||||
Tools.UpdateStatusText(registerPanelStatusText, (string)jsonResponse["message"], Color.red);
|
Tools.UpdateStatusText(registerPanelStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
registerBackButton.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,6 +50,7 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
async Task HandleMessageSubmit()
|
async Task HandleMessageSubmit()
|
||||||
{
|
{
|
||||||
if (!sendButton.interactable) return;
|
if (!sendButton.interactable) return;
|
||||||
|
backButton.interactable = false;
|
||||||
var text = messageInputField.text.Clone() as string;
|
var text = messageInputField.text.Clone() as string;
|
||||||
messageInputField.text = string.Empty;
|
messageInputField.text = string.Empty;
|
||||||
if (string.IsNullOrEmpty(text))
|
if (string.IsNullOrEmpty(text))
|
||||||
@@ -68,26 +69,31 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Server error while fetching data");
|
ShowStatus("Server error while fetching data");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Client version too outdated to access servers");
|
ShowStatus("Client version too outdated to access servers");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Encryption/decryption issues");
|
ShowStatus("Encryption/decryption issues");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Can't send requests on self-built instance");
|
ShowStatus("Can't send requests on self-built instance");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -105,6 +111,7 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
ShowStatus((string)jsonResponse["message"]);
|
ShowStatus((string)jsonResponse["message"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
backButton.interactable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowStatus(string content)
|
void ShowStatus(string content)
|
||||||
|
|||||||
@@ -46,27 +46,32 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Failed to make HTTP request");
|
ShowStatus("Failed to make HTTP request");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Server error while fetching data");
|
ShowStatus("Server error while fetching data");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Client version too outdated to access servers");
|
ShowStatus("Client version too outdated to access servers");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Encryption/decryption issues");
|
ShowStatus("Encryption/decryption issues");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
backButton.interactable = true;
|
||||||
ShowStatus("Can't send requests on self-built instance");
|
ShowStatus("Can't send requests on self-built instance");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,27 +96,42 @@ public class IconMarketplaceUploadIcon : MonoBehaviour
|
|||||||
await request.SendWebRequest();
|
await request.SendWebRequest();
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
|
uploadButton.interactable = true;
|
||||||
|
backButton.interactable = true;
|
||||||
|
selectButton.interactable = true;
|
||||||
Tools.UpdateStatusText(statusText, "Failed to make HTTP request", Color.red);
|
Tools.UpdateStatusText(statusText, "Failed to make HTTP request", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
if (response == "-999")
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
|
uploadButton.interactable = true;
|
||||||
|
backButton.interactable = true;
|
||||||
|
selectButton.interactable = true;
|
||||||
Tools.UpdateStatusText(statusText, "Server error while fetching data", Color.red);
|
Tools.UpdateStatusText(statusText, "Server error while fetching data", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-998")
|
else if (response == "-998")
|
||||||
{
|
{
|
||||||
|
uploadButton.interactable = true;
|
||||||
|
backButton.interactable = true;
|
||||||
|
selectButton.interactable = true;
|
||||||
Tools.UpdateStatusText(statusText, "Client version too outdated to access servers", Color.red);
|
Tools.UpdateStatusText(statusText, "Client version too outdated to access servers", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-997")
|
else if (response == "-997")
|
||||||
{
|
{
|
||||||
|
uploadButton.interactable = true;
|
||||||
|
backButton.interactable = true;
|
||||||
|
selectButton.interactable = true;
|
||||||
Tools.UpdateStatusText(statusText, "Encryption/decryption issues", Color.red);
|
Tools.UpdateStatusText(statusText, "Encryption/decryption issues", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-996")
|
else if (response == "-996")
|
||||||
{
|
{
|
||||||
|
uploadButton.interactable = true;
|
||||||
|
backButton.interactable = true;
|
||||||
|
selectButton.interactable = true;
|
||||||
Tools.UpdateStatusText(statusText, "Can't send requests on self-built instance", Color.red);
|
Tools.UpdateStatusText(statusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user