paste this in the login scripts
using System;
using Photon.Pun;
using PlayFab;
using PlayFab.ClientModels;
using UnityEngine;
using UnityEngine.SceneManagement;
// Token: 0x020000D1 RID: 209
public class login : MonoBehaviourPunCallbacks
{
// Token: 0x060003C2 RID: 962 RVA: 0x00018F32 File Offset: 0x00017132
private void Start()
{
this.Login();
}
// Token: 0x060003C3 RID: 963 RVA: 0x00018F3A File Offset: 0x0001713A
private void Login()
{
PlayFabClientAPI.LoginWithCustomID(new LoginWithCustomIDRequest
{
CustomId = PlayFabSettings.DeviceUniqueIdentifier,
CreateAccount = new bool?(true)
}, new Action<LoginResult>(this.OnSuccess), new Action<PlayFabError>(this.OnError), null, null);
}
// Token: 0x060003C4 RID: 964 RVA: 0x00018F78 File Offset: 0x00017178
private void OnSuccess(LoginResult result)
{
Debug.Log("Successful login/account create!");
this.PlayFabPlayerLoggedIn();
this.PlayFabID = result.PlayFabId;
string @string = PlayerPrefs.GetString("username");
UpdateUserTitleDisplayNameRequest updateUserTitleDisplayNameRequest = new UpdateUserTitleDisplayNameRequest();
updateUserTitleDisplayNameRequest.DisplayName = @string;
PlayFabClientAPI.UpdateUserTitleDisplayName(updateUserTitleDisplayNameRequest, delegate (UpdateUserTitleDisplayNameResult result2)
{
Debug.Log("Display Name Changed!");
}, delegate (PlayFabError error)
{
Debug.Log(error.ErrorDetails);
}, null, null);
}
// Token: 0x060003C5 RID: 965 RVA: 0x00018FFD File Offset: 0x000171FD
private void OnError(PlayFabError error)
{
Debug.Log("Error while logging in/creating account!");
if (error.Error == PlayFabErrorCode.AccountBanned)
{
SceneManager.LoadScene(1);
}
Debug.Log(error.GenerateErrorReport());
}
// Token: 0x060003C6 RID: 966 RVA: 0x00019027 File Offset: 0x00017227
public override void OnConnectedToMaster()
{
base.OnConnectedToMaster();
}
// Token: 0x060003C7 RID: 967 RVA: 0x0001902F File Offset: 0x0001722F
public virtual void PlayFabPlayerLoggedIn()
{
}
// Token: 0x04000494 RID: 1172
public string PlayFabID;
}
and make a script called banned
using System;
using PlayFab;
using UnityEngine;
using UnityEngine.SceneManagement;
// Token: 0x020000AD RID: 173
public class banned : MonoBehaviour
{
// Token: 0x06000345 RID: 837 RVA: 0x000174E5 File Offset: 0x000156E5
private void Start()
{
base.InvokeRepeating("checkifPlayerBanned", 0.1f, 60f);
}
// Token: 0x06000346 RID: 838 RVA: 0x0001751D File Offset: 0x0001571D
private void checkifPlayerBanned()
{
PlayFabClientAPI.GetUserData(null, null, delegate (PlayFabError error)
{
if (error.Error == PlayFabErrorCode.AccountBanned)
{
Application.Quit();
}
}, null, null);
}
}