mirror of
https://github.com/smyalygames/monopoly.git
synced 2025-05-18 06:14:10 +02:00
Merge branch 'master' of https://github.com/smyalygames/monopoly
This commit is contained in:
commit
1e0fb19fe0
@ -27,4 +27,10 @@ CREATE TABLE pwdreset (
|
||||
pwd_selector TEXT NOT NULL, #Where the selector is stored in plaintext
|
||||
pwd_token LONGTEXT NOT NULL, #Where the hashed token is stored
|
||||
pwd_expires TEXT NOT NULL #When the token expires
|
||||
);
|
||||
|
||||
CREATE TABLE money_spent(
|
||||
user_id int(11) PRIMARY KEY NOT NULL,
|
||||
user_spent int(11) NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES users(user_id)
|
||||
);
|
@ -9,6 +9,7 @@ using Newtonsoft.Json;
|
||||
|
||||
class LoginInformation
|
||||
{
|
||||
public int id;
|
||||
public string user;
|
||||
public bool success;
|
||||
public string errors;
|
||||
@ -24,12 +25,13 @@ public class Login : MonoBehaviour
|
||||
private bool CheckIsEmpty() //This checks if the strings are empty.
|
||||
{
|
||||
var strings = new List<string> {username.text, password.text}; //This puts all of the text boxes into an array.
|
||||
string check = ""; //This is used for the check, the ZWSP is TMP's way of identifying nothing as null.
|
||||
string check = ""; //This is used for the check, the ZWSP is TMP's way of identifying nothing as null.
|
||||
if (strings.Contains(check)) //If any of the inputs are null.
|
||||
{
|
||||
//Debug.Log("yes");
|
||||
return true;
|
||||
}
|
||||
|
||||
//Debug.Log("false");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -84,16 +86,15 @@ public class Login : MonoBehaviour
|
||||
{
|
||||
string status = www.downloadHandler.text; //This downloads the data from the server.
|
||||
LoginInformation information = JsonConvert.DeserializeObject<LoginInformation>(status); //This deserializes the JSON string to a class.
|
||||
|
||||
Debug.Log(status);
|
||||
|
||||
if (information.success) //If the user has successfully logged in.
|
||||
{
|
||||
UserManager.userID = information.id;
|
||||
UserManager.username = information.user; //This sets the logged in username.
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene(1); //Loads the menu scene.
|
||||
}
|
||||
|
||||
InteractableForm(true); // This enables the form again.
|
||||
}
|
||||
|
||||
InteractableForm(true); // This enables the form again.
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using UnityEngine;
|
||||
|
||||
public static class UserManager
|
||||
{
|
||||
public static int userID;
|
||||
public static string username;
|
||||
|
||||
public static bool LoggedIn => username != null;
|
||||
|
@ -14,6 +14,7 @@ public class MainMenu : MonoBehaviour
|
||||
private string existingCards;
|
||||
|
||||
void Start() {
|
||||
Debug.Log("User ID: " + UserManager.userID);
|
||||
Debug.Log("Username: " + UserManager.username);
|
||||
if (!PropertiesHandler.CheckPropertyExists()) //Checks if the properties file doesn't exist.
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user