Esempio n. 1
0
    public IEnumerator LoginToServer(string username, string password)
    {
        WWWForm formData = new WWWForm();

        formData.AddField("QueryType", "loginuser");
        formData.AddField("Username", username);
        formData.AddField("Password", password);
        UnityWebRequest www = UnityWebRequest.Post("http://avcmediasystems.ro/test/gameyfire/GameyFire_ServerService.php", formData);

        www.downloadHandler = new DownloadHandlerBuffer();
        yield return(www.Send());

        if (!www.isError)
        {
            JSONDataClass jsonTxt = JSON_UtilityClass.DecodeJSON(www.downloadHandler.text);
            UserDataClass.UserID    = JSON_UtilityClass.ParseIntFromString(jsonTxt.id);
            UserDataClass.FirstName = jsonTxt.FirstName;
            UserDataClass.LastName  = jsonTxt.LastName;
            UserDataClass.Username  = jsonTxt.Username;
            UserDataClass.Usermail  = jsonTxt.Mail;
            UserDataClass.Password  = jsonTxt.Password;

            //StartCoroutine(DownloadPersonaListFromServer());
        }
    }
Esempio n. 2
0
 public void InitPersonaListFromJSONArray(List <JSONDataClass> jsonArray)
 {
     if (jsonArray.Count > 0)
     {
         ClearUserPersonaList();
     }
     foreach (JSONDataClass tempJson in jsonArray)
     {
         UserDataClass.UserPersonas.Add(CreatePersona(JSON_UtilityClass.ParseIntFromString(tempJson.id), tempJson.PersonaName, tempJson.PersonaDesc));
     }
 }
Esempio n. 3
0
 public void InitSkillListFromJSONArray(List <JSONDataClass> jsonArray)
 {
     if (jsonArray.Count > 0)
     {
         ClearPersonaSkillList();
     }
     foreach (JSONDataClass tempJson in jsonArray)
     {
         PersonaDataClass.PersonaSkills.Add(CreateSkill(JSON_UtilityClass.ParseIntFromString(tempJson.id), tempJson.SkillName, tempJson.SkillRating));
     }
 }