- Home /
 
Photon Network Get all the connected players.
I am trying to show a list of all the connected players to photon network. I have a table of users. in mySQL DB, I made a "status" column that I set to 1 when I log in and 0 when I logout. but if the game has crashed, or he closed it not using my function Quit() then he'd be still recorded as online. so I guess that there is a way I get this done by using the Photon. because it keeps updating.. thanks in advance . .
login PHP
 $sql2 = mysqli_query($conn , "UPDATE users SET status = 1 WHERE (userName = '".$email."' OR email = '".$email."')");
 
               logOut PHP
 $sql2 = mysqli_query($conn , "UPDATE users SET status = 0 WHERE userName = '".$userName."'");
 
               Quit C#
 WWW wwLogOut;
     private IEnumerator LogOut(WWWForm f)
     {
         wwLogOut = new WWW(logoutURL, f);
         yield return wwLogOut;
         LoadingHide();
 #if UNITY_EDITOR
         UnityEditor.EditorApplication.isPlaying = false; //Set the editor.isplaying to false to simulate the quit. 
 #else
         Application.Quit(); //Quit the app
 #endif
     }
     public void Quit() //called when you wanna log out and shut down the app
     {
         LoadingShow("Logging out...");
         WWWForm logOutForm = new WWWForm();
         Debug.Log(PlayerManager.Instance.playerName);
         logOutForm.AddField("userName", PlayerManager.Instance.playerName);
         StartCoroutine(LogOut(logOutForm));
     }
 
              Your answer
 
             Follow this Question
Related Questions
How to change colors in unity using photon? 0 Answers
How to connect to our own dedicated server using photon networking in unity?(Self-hosted) 0 Answers
how to display photon private rooms on rooms list? 0 Answers
Photon Combat script does not work 0 Answers
Photon network won't join random room with a custom property 0 Answers