Пример #1
0
 public void GetUserData(OnDataReceivedCallback onDataReceived)
 {
     if (UserAccountManager.IsLoggedIn)
     {
         StartCoroutine(GetData(onDataReceived));
     }
 }
 public void GetData(OnDataReceivedCallback onDataReceived)
 {
     if (IsLoggedIn)
     {
         StartCoroutine(sendGetDataRequest(LoggedIn_Username, LoggedIn_Password, onDataReceived));
     }
 }
Пример #3
0
 public void GetData(OnDataReceivedCallback onDataReceived)
 {
     if (IsLoggedIn)
     {
         StartCoroutine(GetData_numerator(onDataReceived));
     }
 }
    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);
        }
    }
    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);
        }
    }
Пример #6
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);
        }
    }
 public void GetData(OnDataReceivedCallback onDataReceived)
 {
     if (isLoggedIn)
     {
         StartCoroutine(GetDataRequest(playerUsername, playerPassword, onDataReceived));
     }
 }
Пример #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;
     *          }
     *          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);
            }
        }
    }
Пример #9
0
 // 데이터 로드(수신)
 public void GetData(OnDataReceivedCallback onDataReceived)
 {
     if (IsLoggedIn)
     {
         StartCoroutine(sendGetData(onDataReceived));
     }
 }
Пример #10
0
    IEnumerator sendGetData(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("sendGetData Error");
        }
        else
        {
            //The player's data was retrieved. Goes back to loggedIn UI and displays the retrieved data in the InputField
            Debug.Log("sendGetData Success");
        }

        LoggedIn_Data = response;

        if (onDataReceived != null)
        {
            onDataReceived(response);
        }
    }
Пример #11
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");
        }
    }
Пример #12
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);
        }
    }
Пример #13
0
 public void ReceiveData(OnDataReceivedCallback onDataReceived)
 {
     if (IsLoggedIn)
     {
         //Called when the player hits 'Get Data' to retrieve the data string on their account. Switches UI to 'Loading...' and starts coroutine to get the players data string from the server
         StartCoroutine(GetData(LoggedIn_Username, LoggedIn_Password, onDataReceived));
     }
 }
Пример #14
0
 public void GetData(OnDataReceivedCallback onDataReceived)
 { //called when the 'Get Data' button on the data part is pressed
     if (IsLoggedIn)
     {
         //ready to send request
         StartCoroutine(sendGetDataRequest(LoggedIn_Username, LoggedIn_Password, onDataReceived)); //calls function to send get data request
     }
 }
Пример #15
0
 public void GetData(OnDataReceivedCallback onDataReceived)
 {
     //Called when the player hits 'Get Data' to retrieve the data string on their account. Switches UI to 'Loading...' and starts coroutine to get the players data string from the server
     if (isLoggedIn)
     {
         StartCoroutine(GetData_numerator(onDataReceived));
     }
 }
    public void GetData(OnDataReceivedCallback onDataReceived)
    {
        //called when the 'Get Data' button on the data part is pressed

        if (IsLoggedIn)
        {
            //ready to send request
            StartCoroutine(sendGetDataRequest(LoggedIn_Username, LoggedIn_Password, onDataReceived)); //calls function to send get data request
        }
    }
Пример #17
0
    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);
        }
    }
Пример #18
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);
        }
    }
Пример #19
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);
        }
    }
Пример #20
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);
        }
    }
Пример #21
0
    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);
        }
    }
Пример #22
0
 public void LoggedIn_LoadDataButtonPressed(OnDataReceivedCallback onDataReceived)
 {
     StartCoroutine(GetData(onDataReceived));
 }
 internal static extern void RealTimeEventListenerHelper_SetOnDataReceivedCallback(
     HandleRef self,
      /* from(RealTimeEventListenerHelper_OnDataReceivedCallback_t) */ OnDataReceivedCallback callback,
      /* from(void *) */ IntPtr callback_arg);
 internal static extern void RealTimeEventListenerHelper_SetOnDataReceivedCallback(
     HandleRef self,
     /* from(RealTimeEventListenerHelper_OnDataReceivedCallback_t) */ OnDataReceivedCallback callback,
     /* from(void *) */ IntPtr callback_arg);
Пример #25
0
 public void LoadorGetData(OnDataReceivedCallback onDataReceived)
 {
     StartCoroutine(GetData(onDataReceived));
 }
    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);
    }
 internal static extern void RealTimeEventListenerHelper_SetOnDataReceivedCallback(HandleRef self, OnDataReceivedCallback callback, IntPtr callback_arg);