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)); } }
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); } }
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)); } }
/*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); } } }
// 데이터 로드(수신) public void GetData(OnDataReceivedCallback onDataReceived) { if (IsLoggedIn) { StartCoroutine(sendGetData(onDataReceived)); } }
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); } }
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 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); } }
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)); } }
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 } }
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 } }
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); } }
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); } }
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); } }
/*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); } }
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); } }
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);
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);