Welcome to GEMENTAR TOUR PUO V2 Development Documentation. Enjoy your stay!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:menu_scripts_code [2022/08/01 16:02] – [PasswordChange.cs] adminwiki:menu_scripts_code [2022/08/04 11:05] (current) – removed admin
Line 1: Line 1:
-{{ :wiki:getusers.php_6_.png?nolink&600 |}} 
- 
-====== PasswordChange.cs ====== 
- 
-<code CSharp | Full Script> 
-using System.Collections; 
-using System.Collections.Generic; 
-using UnityEngine; 
-using UnityEngine.Networking; 
-using TMPro; 
- 
-public class PasswordChange : MonoBehaviour 
-{ 
-    public TMP_InputField current_password; 
-    public TMP_InputField new_password; 
-    public TMP_InputField new_password_confirm; 
-    public TextMeshProUGUI username; 
- 
-    public PopUpSystem popUp; 
- 
-    public void ButtonChangePassword() 
-    { 
-        if (new_password.text != new_password_confirm.text) 
-        { 
-            popUp.OpenPopUp("ERROR!", "new password didn't match"); 
-            return; 
-        } 
- 
-        if (new_password.text.Length <= 6) 
-        { 
-            popUp.OpenPopUp("ERROR!", "Field cannot be empty"); 
-        } 
- 
-        if (current_password.text == "" || new_password.text == "" || new_password_confirm.text == "") 
-        { 
-            popUp.OpenPopUp("ERROR!", "Field cannot be empty"); 
-            return; 
-        } 
- 
-        StartCoroutine(Upload()); 
-    } 
- 
-    IEnumerator Upload() 
-    { 
-        WWWForm form = new WWWForm(); 
-        form.AddField("playerUsername", username.text); 
-        form.AddField("currentPassword", current_password.text); 
-        form.AddField("newPassword", new_password.text); 
- 
-        using (UnityWebRequest www = UnityWebRequest.Post("https://puov2.gementar.com/unity_database/ChangePassword.php", form)) 
-        { 
-            yield return www.SendWebRequest(); 
- 
-            if (www.result != UnityWebRequest.Result.Success) 
-            { 
-                Debug.Log(www.error); 
-            } 
-            else 
-            { 
-                if(www.downloadHandler.text.Equals("Password Changed.")) 
-                { 
-                    popUp.OpenPopUp("ERROR!", "Password Changed."); 
-                } 
- 
-                if (www.downloadHandler.text.Equals("Wrong Current Password Entered.")) 
-                { 
-                    popUp.OpenPopUp("ERROR!", "Wrong Current Password Entered."); 
- 
-                } 
- 
-                if (www.downloadHandler.text.Equals("Error! Please if you find the message contact us at admin@gementar.com")) 
-                { 
-                    popUp.OpenPopUp("ERROR!", "Error! Please if you find the message contact us at admin@gementar.com"); 
-                } 
- 
-                Debug.Log(www.downloadHandler.text); 
- 
-            } 
-        } 
-    } 
-} 
- 
-</code> 
- 
-<file | public void ButtonChangePassword() >  
-Client side password checker. 
-</file> 
- 
-<file | IEnumerator Upload() >  
-Upload password into database and check error. 
-</file> 
-====== RankingSystem.cs ====== 
  

QR Code
QR Code wiki:menu_scripts_code (generated for current page)
Hello World!
DokuWiki with monobook... rules!