Example #1
0
    IEnumerator GetData_numerator(OnDataReceivedCallback onDataReceived)
    {
        string      data = "ERROR";
        IEnumerator e    = DCF.GetUserData(playerUsername, playerPassword); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            Debug.Log("Error: Unknown Error. Please try again later. GetDataProblem");
        }
        else
        {
            //The player's data was retrieved. Goes back to loggedIn UI and displays the retrieved data in the InputField
            data = response;
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
Example #2
0
    IEnumerator GetData(OnDataReceivedCallback onDataReceived)
    {
        string      data = "ERROR";
        IEnumerator e    = DCF.GetUserData(PlayerUsername, PlayerPassword); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            //There was another error. Automatically logs player out. This error message should never appear, but is here just in case.

            PlayerUsername = "";
            PlayerPassword = "";

            Debug.Log("Error: Unknown Error. Please try again later.");
        }
        else
        {
            data = response;
        }
        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
Example #3
0
    /*IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
     *  {
     *          string data = "ERROR";
     *
     *          IEnumerator eeee = DCF.GetUserData(username, password);
     *          while (eeee.MoveNext())
     *          {
     *                  yield return eeee.Current;
     *          }
     *          WWW returnedddd = eeee.Current as WWW;
     *          if (returnedddd.text == "Error")
     *          {
     *                  //Error occurred. For more information of the error, DC.Login could
     *                  //be used with the same username and password
     *                  Debug.Log("Data Upload Error. Could be a server error. To check try again, if problem still occurs, contact us.");
     *          }
     *          else
     *          {
     *                  if (returnedddd.text == "ContainsUnsupportedSymbol")
     *                  {
     *                          //One of the parameters contained a - symbol
     *                          Debug.Log("Get Data Error: Contains Unsupported Symbol '-'");
     *                  }
     *                  else
     *                  {
     *                          //Data received in returned.text variable
     *                          string DataRecieved = returnedddd.text;
     *                          data = DataRecieved;
     *                  }
     *          }
     *
     *          if (onDataReceived != null)
     *                  onDataReceived.Invoke(data);
     *  }
     */

    //edit


    IEnumerator GetDataN(OnDataReceivedCallback onDataReceived)
    {
        IEnumerator e = DCF.GetUserData(LoggedIn_Username, LoggedIn_Password); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            //There was another error. Automatically logs player out. This error message should never appear, but is here just in case.
            Debug.Log("Data Upload(GET) Error. Could be a server error. To check try again, if problem still occurs, contact us.");
        }
        else
        {
            //The player's data was retrieved. Goes back to loggedIn UI and displays the retrieved data in the InputField
            //loadingParent.gameObject.SetActive(false);
            //  loggedInParent.gameObject.SetActive(true);
            //LoggedIn_Data = response;
            Debug.Log("Success Get");

            if (onDataReceived != null)
            {
                onDataReceived.Invoke(response);
            }
        }
    }
    IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
    {
        IEnumerator e = DCF.GetUserData(username, password); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            //There was another error. This error message should never appear, but is here just in case.
            Debug.LogError("Error: Unknown Error. Please try again later.");
        }
        else
        {
            //The player's data was retrieved.
            Debug.Log("Data Retrieval Successful.");
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(response);
        }
    }
    IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
    {
        string data = "ERROR";

        IEnumerator eeee = DCF.GetUserData(username, password);

        while (eeee.MoveNext())
        {
            yield return(eeee.Current);
        }
        WWW returnedddd = eeee.Current as WWW;

        if (returnedddd.text == "Error")
        {
            Debug.Log("Data Upload Error. Could be a server error. To check try again, if problem still occurs, contact us.");
        }
        else
        {
            if (returnedddd.text == "ContainsUnsupportedSymbol")
            {
                Debug.Log("Get Data Error: Contains Unsupported Symbol '-'");
            }
            else
            {
                string DataRecieved = returnedddd.text;
                data = DataRecieved;
            }
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
Example #6
0
    IEnumerator GetData(string playerUsername, string playerPassword, OnDataReceivedCallback onDataReceived)
    {
        IEnumerator e = DCF.GetUserData(playerUsername, playerPassword); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            //There was another error. Automatically logs player out. This error message should never appear, but is here just in case.
            Debug.LogError("Error: Unknown Error. Please try again later.");
            yield return(new WaitForSeconds(5f));
        }
        else
        {
            //The player's data was retrieved. Goes back to loggedIn UI and displays the retrieved data in the InputField

            LoggedIn_Data = response;
            Debug.Log(playerUsername + "'s Data got!: " + LoggedIn_Data);
            if (onDataReceived != null)
            {
                onDataReceived.Invoke(LoggedIn_Data);
            }
            StopCoroutine("GetData");
        }
    }
    IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
    {
        string data = "ERROR";

        IEnumerator e = DCF.GetUserData(username, password);         // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        data = e.Current as string;         // << The returned string from the request

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
Example #8
0
    IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
    {
        string data = "ERROR";

        IEnumerator eeee = DCF.GetUserData(username, password);

        while (eeee.MoveNext())
        {
            yield return(eeee.Current);
        }
        string response = eeee.Current as string;         // << The returned string from the request

        // WWW returnedddd = eeee.Current as WWW;
        // if (returnedddd.text == "Error")
        if (response == "Error")
        {
            //Error occurred. For more information of the error, DC.Login could
            //be used with the same username and password
            Debug.Log("Data Upload Error. Could be a server error. To check try again, if problem still occurs, contact us.");
        }
        else
        {
            // if (returnedddd.text == "ContainsUnsupportedSymbol")
            if (response == "ContainsUnsupportedSymbol")
            {
                //One of the parameters contained a - symbol
                Debug.Log("Get Data Error: Contains Unsupported Symbol '-'");
            }
            else
            {
                //Data received in returned.text variable
                // string DataRecieved = returnedddd.text;
                // data = DataRecieved;

                string DataRecieved = response;
                data = DataRecieved;
            }
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
Example #9
0
    IEnumerator GetData(OnDataReceivedCallback onDataReceived)
    {
        string data = "Error";

        IEnumerator e = DCF.GetUserData(playerUsername, playerPassword); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            //There was another error. Automatically logs player out. This error message should never appear, but is here just in case.
            //ResetAllUIElements();
            playerUsername = "";
            playerPassword = "";
            //loginParent.gameObject.SetActive(true);
            //loadingParent.gameObject.SetActive(false);
            //Login_ErrorText.text = "Error: Unknown Error. Please try again later.";
        }
        else
        {
            string DataRecived = response;
            data = DataRecived;

            //The player's data was retrieved. Goes back to loggedIn UI and displays the retrieved data in the InputField
            //loadingParent.gameObject.SetActive(false);
            //loggedInParent.gameObject.SetActive(true);
            //LoggedIn_DataOutputField.text = response;
        }
        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
    public IEnumerator GetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
    {
        IEnumerator e = DCF.GetUserData(username, password); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            Debug.Log("Data Uploda Error.");
        }
        else
        {
            //...
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(response);
        }
    }
Example #11
0
    /*IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
     * {
     *  string data = "ERROR";
     *
     *  IEnumerator eeee = DCF.GetUserData(username, password);
     *  while (eeee.MoveNext())
     *  {
     *      yield return eeee.Current;
     *  }
     *  WWW returnedddd = eeee.Current as WWW;
     *  if (returnedddd.text == "Error")
     *  {
     *      //Error occurred. For more information of the error, DC.Login could
     *      //be used with the same username and password
     *      Debug.Log("Data Upload Error. Could be a server error. To check try again, if problem still occurs, contact us.");
     *  }
     *  else
     *  {
     *      if (returnedddd.text == "ContainsUnsupportedSymbol")
     *      {
     *          //One of the parameters contained a - symbol
     *          Debug.Log("Get Data Error: Contains Unsupported Symbol '-'");
     *      }
     *      else
     *      {
     *          //Data received in returned.text variable
     *          string DataRecieved = returnedddd.text;
     *          data = DataRecieved;
     *      }
     *  }
     *
     *  if (onDataReceived != null)
     *      onDataReceived.Invoke(data);
     * }
     */

    IEnumerator GetData(string _playerUsername, string _playerPassword, OnDataReceivedCallback onDataReceived)
    {
        IEnumerator e = DCF.GetUserData(_playerUsername, _playerPassword); // << Send request to get the player's data string. Provides the username and password

        while (e.MoveNext())
        {
            yield return(e.Current);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            UserAccount.instance.LogOut();
        }
        else
        {
            //HACER LO QUE SEA CON RESPONSE
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(response);
        }
    }
    IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallback onDataReceived)
    {
        string data = "ERROR";

        IEnumerator eeee = DC.GetUserData(username, password);
        while (eeee.MoveNext())
        {
            yield return eeee.Current;
        }
        WWW returnedddd = eeee.Current as WWW;
        if (returnedddd.text == "Error")
        {
            //Error occurred. For more information of the error, DC.Login could
            //be used with the same username and password
            Debug.Log("Data Upload Error. Could be a server error. To check try again, if problem still occurs, contact us.");
        }
        else
        {
            if (returnedddd.text == "ContainsUnsupportedSymbol")
            {
                //One of the parameters contained a - symbol
                Debug.Log("Get Data Error: Contains Unsupported Symbol '-'");
            }
            else
            {
                //Data received in returned.text variable
                string DataRecieved = returnedddd.text;
                data = DataRecieved;
            }
        }

        if (onDataReceived != null)
            onDataReceived.Invoke(data);
    }