void ReaderHandlerRegister(string text, string username, SqlRegisterCallback callback) { RegisterCommandLog command = RegisterCommandLog.none; string[] lines = text.Split('|'); RegisterResponse registerReponse = new RegisterResponse(); if (RegisterCommandLog.TryParse(lines[0].Substring(0, lines[0].IndexOf(':')), out command)) { registerReponse.command = command; registerReponse.userName = username; } callback(registerReponse); }
IEnumerator SQLRegister(string username, string password, string email, SqlRegisterCallback callback) { WWWForm form = new WWWForm(); //URL Command string URL = registerURL + "username="******"&password="******"&email=" + email; UnityWebRequest download = UnityWebRequest.Post(URL, form); //Send Request download.SendWebRequest(); //Waiting for response while (!download.isDone) { yield return(new WaitForSeconds(0.2f)); } //Read response ReaderHandlerRegister(download.downloadHandler.text, username, callback); }
public void Register(string _userName, string _password, string _email, SqlRegisterCallback callback) { StartCoroutine(SQLRegister(_userName, _password, _email, callback)); }