IEnumerator CreateAccount() { if (!ActiveFromEmail) { #if (UNITY_STANDALONE || UNITY_EDITOR_WIN || UNITY_EDITOR_OSX) && (!UNITY_WEBPLAYER && !UNITY_WEBGL && !UNITY_ANDROID && !UNITY_IOS) string sends = RegisterUrl + "?" + "firstname=" + firstName.text.Trim() + "&lastname=" + lastName.text.Trim() + "&age=" + Age.text.Trim() + "&country=" + Country.text.Trim() + "&username="******"&email=" + Email.text.Trim() + "&password="******"&mac=" + info.Trim() + "&secure=" + securePassword.Trim(); #endif #if UNITY_WEBGL || UNITY_WEBPLAYER || UNITY_ANDROID || UNITY_IOS string sends = RegisterUrl + "?" + "firstname=" + firstName.text.Trim() + "&lastname=" + lastName.text.Trim() + "&age=" + Age.text.Trim() + "&country=" + Country.text.Trim() + "&username="******"&email=" + Email.text.Trim() + "&password="******"&mac=1&secure=" + securePassword.Trim(); #endif WWW php_query = new WWW(sends); yield return(php_query); string result = RemoveExceptNumber(php_query.text.Trim()); // remove weird char in our text if (result == "1") { GetLoginCanvas.ToggleCanvas("login"); } else { WarningMSG.text = php_query.text; } } else { #if (UNITY_STANDALONE || UNITY_EDITOR_WIN || UNITY_EDITOR_OSX) && (!UNITY_WEBPLAYER && !UNITY_WEBGL && !UNITY_ANDROID && !UNITY_IOS) string sends = RegisterUrl + "?" + "firstname=" + firstName.text.Trim() + "&lastname=" + lastName.text.Trim() + "&age=" + Age.text.Trim() + "&country=" + Country.text.Trim() + "&username="******"&email=" + Email.text.Trim() + "&password="******"&mac=" + info.Trim() + "&secure=" + securePassword.Trim() + "&activate=1"; #endif #if UNITY_WEBGL || UNITY_WEBPLAYER || UNITY_ANDROID || UNITY_IOS string sends = RegisterUrl + "?" + "firstname=" + firstName.text.Trim() + "&lastname=" + lastName.text.Trim() + "&age=" + Age.text.Trim() + "&country=" + Country.text.Trim() + "&username="******"&email=" + Email.text.Trim() + "&password="******"&mac=1&secure=" + securePassword.Trim() + "&activate=1"; #endif Debug.Log(sends); WWW php_query = new WWW(sends); yield return(php_query); string result = RemoveExceptNumber(php_query.text.Trim()); // remove weird char in our text if (result == "1") { GetLoginCanvas.ToggleCanvas("login"); } else { WarningMSG.text = php_query.text; Debug.Log(php_query.text); } } }
IEnumerator Query_Php(string type) { if (type == "Active") { WWW query = new WWW(activeURL + "?" + "code=" + Code.text + "&secure=" + securePassword); yield return(query); if (query.text.Trim() == "1") { GetLoginCanvas.ToggleCanvas("login"); } else { WarningMSG.text = query.text; } } else if (type == "Resend") { string getTempAccount = PlayerPrefs.GetString("TempUser"); WWW query = new WWW(resendURL + "?" + "username="******"&secure=" + securePassword); yield return(query); if (query.text.Trim() == "1") { WarningMSG.color = Color.green; WarningMSG.text = "Send Code To your Email"; } else { WarningMSG.color = Color.red; WarningMSG.text = query.text; } } }
IEnumerator Query_Account() { #if (UNITY_STANDALONE || UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_ANDROID) && (!UNITY_WEBPLAYER && !UNITY_WEBGL && !UNITY_ANDROID && !UNITY_IOS) WWW checkBanned = new WWW(checkBannedUrl + "?" + "mac=" + info.Trim() + "&secureid=" + SecureKey); #endif #if UNITY_WEBGL || UNITY_WEBPLAYER || UNITY_ANDROID || UNITY_IOS WWW checkBanned = new WWW(checkBannedUrl + "?" + "ip=1&secureid=" + SecureKey); #endif WarningMsg.text = "Check White User... "; yield return(checkBanned); //Debug.Log (checkBanned.text); string result = RemoveExceptNumber(checkBanned.text.Trim()); // remove weird char in our text if (result == "1" || result == "3") { // if (checkBanned.text.Trim () == "1" || checkBanned.text.Trim () == "3") { WWW query = new WWW(LoginUrl + "?" + "username="******"&password="******"&secureid=" + SecureKey); WarningMsg.text = "Please Wait ... "; yield return(query); string[] split = query.text.Split(','); if (RemoveExceptNumber(split[0].Trim()) == "1") { PlayerPrefs.SetInt("userID", int.Parse(split [1].Trim())); PlayerPrefs.SetString("firstname", split [2].Trim()); PlayerPrefs.SetString("lastname", split [3].Trim()); PlayerPrefs.SetString("country", split [4].Trim()); PlayerPrefs.SetString("username", split [5].Trim()); PlayerPrefs.SetInt("age", int.Parse(split [6].Trim())); PlayerPrefs.SetString("email", split [7].Trim()); // After Login do what you want ex. load new scene ... Application.LoadLevel(1); } else if (RemoveExceptNumber(split [0].Trim()) == "2") { PlayerPrefs.SetString("TempUser", userName.text.Trim()); GetLoginCanvas.ToggleCanvas("active"); } else { WarningMsg.text = split [0]; } } else if (result == "2") { WarningMsg.text = "BANNED"; } else if (result == "3") { WarningMsg.text = "Please Fill All Field"; } else { WarningMsg.text = checkBanned.text; } }
IEnumerator Query_php() { WWW query = new WWW(UrlSendCode + "?email=" + email.text + "&secure=" + securePassword); yield return(query); if (query.text.Trim() == "1") { GetLoginCanvas.ToggleCanvas("reset"); } else { WarningMsg.text = query.text; } }
IEnumerator Query_Php() { WWW query = new WWW(ResetUrl + "?" + "code=" + Code.text + "&password="******"&secure=" + securePassword); yield return(query); if (query.text.Trim() == "1") { GetLoginCanvas.ToggleCanvas("login"); } else { WarningMsg.text = query.text; } }