Ejemplo n.º 1
0
 void Result(GetUserDataResult obj)
 {
     if (obj.Data.ContainsKey("IsOnline"))
     {
         isOnline = obj.Data["IsOnline"].Value;
         {
             if (isOnline == "false")
             {
                 print("<color=#00bc04>" + "Your account is now online" + "</color>");
                 InfoPlayerCorrect();
             }
             else
             {
                 print("<color=#f51c00>" + "Your account is being used" + "</color>");
                 errorText.text = "Your account is being used.";
             }
         }
     }
     else
     {
         print("<color=#f51c00>" + "You don't have the IsOnline key. Creating the key..." + "</color>");
         PlayFabCloudScripts.SetUserOnlineState(false);
         print("<color=#00bc04>" + "The key has been created correctly, it will reconnect automatically." + "</color>");
         GetOnlineStatus();
     }
 }
Ejemplo n.º 2
0
        // Cuando se conecta a los servicios de Photon
        public override void OnConnectedToMaster()
        {
            PlayFabCloudScripts.SetUserOnlineState(true);

            // Creamos una variable local y esta variable sera iguala la creacion del prefab connections
            // Lo emparentamos
            // Escribimos el texto segun la conexion
            GameObject GO = Instantiate(connections);

            GO.transform.SetParent(parentText);
            GO.GetComponent <TextMeshProUGUI>().text = "<color=#0d9139>" + "Connected to server" + "</color>";


            GameObject nickNameGO = Instantiate(nickName);

            nickNameGO.transform.SetParent(parentText);


            Debug.Log("OnConnectedToMaster() was called by PUN. This client is now connected to Master Server in region [" + PhotonNetwork.CloudRegion +
                      "] and can join a room. Calling: PhotonNetwork.JoinRandomRoom();");
            PhotonNetwork.AutomaticallySyncScene = false;
        }
Ejemplo n.º 3
0
 private void Application_quitting()
 {
     PlayFabCloudScripts.SetUserOnlineState(false);
 }