Ejemplo n.º 1
0
    IEnumerator SendGetDataRequest(OnDataReceivedCallBack OnDataReceived)
    {
        string data = "Error";

        IEnumerator e = DCF.GetUserData(LoggedInUserName, LoggedInUserPassword); // << 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("Login error");
        }
        else
        {
            string DataRecieved = response;
            data = DataRecieved;
        }
        if (OnDataReceived != null)
        {
            OnDataReceived.Invoke(data);
        }
    }
Ejemplo n.º 2
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);
        }
    }
    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);
        }
        string response = e.Current as string; // << The returned string from the request

        if (response == "Error")
        {
            Debug.Log("Data Upload Error. Could be a server error. To check try again, if problem still occurs, contact us.");
        }
        else
        {
            data = response;
        }

        if (onDataReceived != null)
        {
            onDataReceived.Invoke(data);
        }
    }
Ejemplo n.º 4
0
    IEnumerator sendGetDataRequest(string username, string password, OnDataReceivedCallBack callBack)
    {
        string data = "ERROR";

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

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

        if (returnedddd == "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 == "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;
                data = DataRecieved;
            }
        }

        if (callBack != null)
        {
            callBack.Invoke(data);
        }
    }