Fix refresh login menu & login menu error messages
This commit is contained in:
@@ -43,8 +43,6 @@ public class AccountLogin : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||
if (response != "-1")
|
||||
{
|
||||
if (response == "-999")
|
||||
{
|
||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Server error while fetching data", Color.red);
|
||||
@@ -60,7 +58,7 @@ public class AccountLogin : MonoBehaviour
|
||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Encryption/decryption issues", Color.red);
|
||||
return;
|
||||
}
|
||||
else if (response == "-2")
|
||||
else if (response == "-1")
|
||||
{
|
||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Incorrect username or password", Color.red);
|
||||
}
|
||||
@@ -93,9 +91,4 @@ public class AccountLogin : MonoBehaviour
|
||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Unknown server response", Color.red);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Internal login server error", Color.red);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ public class AccountRefreshLogin : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||
if (response != "-1")
|
||||
{
|
||||
if (response == "-999")
|
||||
{
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "Server error while fetching data", Color.red);
|
||||
@@ -57,30 +55,17 @@ public class AccountRefreshLogin : MonoBehaviour
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "Encryption/decryption issues", Color.red);
|
||||
return;
|
||||
}
|
||||
else if (response == "-2")
|
||||
else if (response == "-1")
|
||||
{
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "Incorrect username or password", Color.red);
|
||||
}
|
||||
else if (response.Split(":")[0] == "1")
|
||||
else if (response == "1")
|
||||
{
|
||||
string[] array = response.Split(':');
|
||||
string session = array[1];
|
||||
string userName = array[2];
|
||||
int userId = int.Parse(array[3]);
|
||||
PlayerPrefs.SetString("gameSession", session);
|
||||
PlayerPrefs.SetString("userName", userName);
|
||||
PlayerPrefs.SetInt("userId", userId);
|
||||
AccountHandler.instance.SwitchPanel(0);
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "", Color.red);
|
||||
}
|
||||
else
|
||||
{
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "Unknown server response", Color.red);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "Internal login server error", Color.red);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user