Player Custom Properties not being updated

Hi,
I am making a game in which I am updating some values to player's custom properties using the
ExitGames.Client.Photon.Hashtable setValues = new ExitGames.Client.Photon.Hashtable ();
for (int index = 0; index < 4; index++) {
	setValues.Add ("currentData" + index.ToString (), GameManager.Instance.playerObjects [playerIndex].data[index].GetComponent<Controller> ().CurrentData);
if (photonIndex > -1 && photonIndex < PhotonNetwork.playerList.Length) {
	PhotonNetwork.playerList[photonIndex].SetCustomProperties (setValues, null, false);
}
}

This code works fine when the player whose custom properties are being set is online/active and also when that players game is killed i.e not running. But, in the case when the game is running in background or the internet is lost the custom properties of that player are not updated. There is no error in this case the above code runs fine. I don't know what is the problem here as the same code runs perfectly when the game is kill/not running but misbehaves in case when the game is in background or internet connection is lost.

Thanks in advance :)

Answers

  • Hi @UzairF,

    [...] but misbehaves in case when the game is in background or internet connection is lost.


    Please check, if Run In Background is enabled in the Player Settings and rebuild the application if necessary.

    If you don't have an internet connection, the Custom Player Properties are only updated locally, but not on the remote clients.
  • UzairF
    UzairF
    edited July 2018

    Hi @UzairF,

    [...] but misbehaves in case when the game is in background or internet connection is lost.


    Please check, if Run In Background is enabled in the Player Settings and rebuild the application if necessary.

    If you don't have an internet connection, the Custom Player Properties are only updated locally, but not on the remote clients.
    I am changing the custom property of another player from another player which has proper internet connection and is currently playing the game. So, basically I am saying that I am updating custom properties of another player from a second player in the game which has all the required information of the player and has proper internet connection. This works correctly if the player whose custom properties are being updated (by other player) has killed his game but misbehaves when his game is in the background or has lost internet connection.