Esempio n. 1
0
    bool GetUserFromBD(MySqlConnection connection, string user, string password)
    {
        MySqlCommand command = connection.CreateCommand();

        command.CommandText = "SELECT user,password FROM login WHERE user ='******'" + "AND password ='******'";
        MySqlDataReader data = command.ExecuteReader();

        while (data.Read())
        {
            if ((string)data["user"] == user)
            {
                if ((string)data["password"] == password)
                {
                    //Debug.Log("user: "******" - "+ "Password: " + password);
                    GameSettings2.TempUser(user);
                    GameSettings2.TempPassword(password);
                    //GameSettings2.TempEmail(_email);
                    return(true);
                }
                return(false);
            }
        }
        data.Close();
        data = null;
        return(false);
    }
Esempio n. 2
0
    public void Start()
    {
        //DontDestroyOnLoad(gameObject);
        Application.runInBackground = true; // this must run in background or it will drop connection if not focussed.

        //ChatPanel.gameObject.SetActive(false);
        ConnectingLabel.SetActive(false);
        UserName = GameSettings2.LoadTempUser();

        if (string.IsNullOrEmpty(UserName))
        {
            UserName = GameSettings2.LoadTempUser();
        }

        bool _AppIdPresent = string.IsNullOrEmpty(PhotonNetwork.PhotonServerSettings.ChatAppID);

        this.missingAppIdErrorPanel.SetActive(_AppIdPresent);
        if (string.IsNullOrEmpty(PhotonNetwork.PhotonServerSettings.ChatAppID))
        {
            Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
            return;
        }

        Connect();
    }
Esempio n. 3
0
 public static void InitateConection()
 {
     tempUser     = GameSettings2.LoadTempUser();
     tempPassword = GameSettings2.LoadTempPassword();
     //pega o dono
     GetIDFromBd(_connection, tempUser, tempPassword);
     //pega o slot
     GetSlotData(_connection, _ownerChar);
 }
Esempio n. 4
0
    public void Start()
    {
        this.chatNewComponent = FindObjectOfType <ChatGui>();
        string prefsName = GameSettings2.LoadTempUser();

        if (!string.IsNullOrEmpty(prefsName))
        {
            this.idInput.text = prefsName;
        }
    }
Esempio n. 5
0
 void Start()
 {
     PlayerCharacter.Instance.Awake();
     PlayerCharacter.Instance.GetComponent <Player_Controler>().enabled = true;
     PlayerCharacter.Instance.GetComponent <PlayerHUD>().enabled        = true;
     PlayerCharacter.Instance.Name = GameSettings2.LoadName();
     GameSettings2.LoadName();
     GameSettings2.LoadAttributes();
     GameSettings2.LoadVitals();
     GameSettings2.LoadSkills();
 }
Esempio n. 6
0
    public static void LoadOwnerData()
    {
        string tempUser     = GameSettings2.LoadTempUser();
        string tempPassword = GameSettings2.LoadTempPassword();

        //ConectBd(_source);

        GetIDFromBd(_connection, tempUser, tempPassword);

        GetSlotData(_connection, _ownerChar);

        GetCharacterData(_connection, _ownerChar, _charSlot);
    }
Esempio n. 7
0
 //Cria o personagem, salva seus dados, e preferencias
 private void DisplayCreatButton()
 {
     if (GUI.Button(new Rect(Screen.width / 2 - 50, statStartingPos + (16 * LINE_HIGH), 100, LINE_HIGH), "Next"))
     {
         UpDateCurVitalValues();
         GameSettings2.SaveName(PlayerCharacter.Instance.Name);
         GameSettings2.SaveAttributes(PlayerCharacter.Instance.primaryAttribute);
         GameSettings2.SaveVitals(PlayerCharacter.Instance.vital);
         GameSettings2.SaveSkills(PlayerCharacter.Instance.skills);
         Debug.Log(player);
         //player.GetComponent<Inventory>().enabled = true;
     }
 }