Make sending data to the server easier & send new stats to the server (and load, not fully yet tho)
This commit is contained in:
@@ -27,13 +27,13 @@ public class AccountLogin : MonoBehaviour
|
||||
|
||||
async void SubmitLogin()
|
||||
{
|
||||
WWWForm dataForm = new();
|
||||
dataForm.AddField("username", SensitiveInfo.Encrypt(loginUsernameInput.text, SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
dataForm.AddField("password", SensitiveInfo.Encrypt(loginPasswordInput.text, SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
dataForm.AddField("currentHighScore", SensitiveInfo.Encrypt(PlayerPrefs.GetString("HighScoreV2", "0"), SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
dataForm.AddField("loginType", SensitiveInfo.Encrypt("0", SensitiveInfo.SERVER_SEND_TRANSFER_KEY)); //Yes.
|
||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "loginAccount.php", dataForm);
|
||||
request.SetRequestHeader("User-Agent", "BerryDashClient");
|
||||
EncryptedWWWForm dataForm = new();
|
||||
dataForm.AddField("username", loginUsernameInput.text);
|
||||
dataForm.AddField("password", loginPasswordInput.text);
|
||||
dataForm.AddField("currentHighScore", PlayerPrefs.GetString("HighScoreV2", "0"));
|
||||
dataForm.AddField("loginType", "0");
|
||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "loginAccount.php", dataForm.GetWWWForm());
|
||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||
request.SetRequestHeader("ClientVersion", Application.version);
|
||||
request.SetRequestHeader("ClientPlatform", Application.platform.ToString());
|
||||
await request.SendWebRequest();
|
||||
|
||||
Reference in New Issue
Block a user