Can't Set Property in Offline Mode

Options
Hi,
I am developing multiplayer game using Photon Unity Networking.
I also want to implement single player for my game. I have used following statement to implement single player.
PhotonNetwork.offlineMode = true;
            PhotonNetwork.CreateRoom("Roulette");
This is great feature provided by Photon and many thanks for this because it reduces lot of developer work.

1) I want to ask two questions regarding this offline mode. I am using same code for single player that I used for multiplayer. In that I am setting custom property of player as per following way
ExitGames.Client.Photon.Hashtable playerHashTable = new ExitGames.Client.Photon.Hashtable();
        GameManager.Instance.ChipsColor = ChooseUniqueChipsColor();
        playerHashTable.Add(Constants.PROP_CHIPS_COLOR, GameManager.Instance.ChipsColor);
        playerHashTable.Add(Constants.PROP_CONFIRM_BET, false);
        PhotonNetwork.player.SetCustomProperties(playerHashTable);

But using above code I am getting following error that represented in image:

I want to know about this error. Is it limitation of offline mode that it can't set player custom property? Is there anything else that we can't do in offline mode then it mention information about those.

2) On start of my offline mode scene, I got callback executed of following method
void OnPhotonPlayerPropertiesChanged(object[] playerAndUpdatedProps)
    {
        Debug.Log("::::::::: Photon Player Property Changed : " + playerAndUpdatedProps.Length);
    }

Though I have not set any property, I got 2 as length. I want to know reason about calling of this method because at start as per consideration I didn't changed any property.
Also setting custom property already refusing me.

I think, I wrote more content if you want any more detail then ask me. Please help me in understanding concept.

Comments

  • vadim
    Options
    1) Error in offline mode while setting room or actor properties is a bug. Thanks for report. To be fixed soon.
    You can safely skip this message until fix fill be available. Properties are set locally as expected despite the error.
    2) It would be much easier to find out reason If you print not only properties length but content also.
  • Which type of content you want?
    I have already given console details.
  • vadim
    Options
    Content of playerAndUpdatedProps in OnPhotonPlayerPropertiesChanged
  • I think your team resolved this bug in the latest version of Photon Unity Network.
    Because after update I don'e receiving this type of message.
    Although I am pasting my code for further reference.
    void OnPhotonPlayerPropertiesChanged(object[] playerAndUpdatedProps)
        {
            Debug.Log("::::::::: Photon Player Property Changed : " + playerAndUpdatedProps.Length);
            if (IsRotationCompleteFromOthers())
            {
                GameObject.FindGameObjectWithTag(Constants.TAG_GAME_CONTROLLER).GetComponent<NetworkPlayer>().MoveToNumberTable();
                SetRotationCompletesProperty(false);
                transform.rotation = transform.parent.rotation;
            }
        }
    
        private void SetRotationCompletesProperty(bool flag)
        {
            ExitGames.Client.Photon.Hashtable rotationCompleteHashTable = new ExitGames.Client.Photon.Hashtable();
            rotationCompleteHashTable.Add(Constants.PROP_BALL_ROTATION_COMPLETE, flag);
            PhotonNetwork.player.SetCustomProperties(rotationCompleteHashTable);
        }
    
        private bool IsRotationCompleteFromOthers()
        {
            PhotonPlayer[] connectedPlayer = PhotonNetwork.playerList;
            foreach (PhotonPlayer player in connectedPlayer)
            {
                var obj = player.customProperties[Constants.PROP_BALL_ROTATION_COMPLETE];
                if (obj != null)
                {
                    bool isRotationComplete = (bool)obj;
                    Debug.Log("Name : " + player.name + " isRotationComplete : " + isRotationComplete);
                    if (!isRotationComplete)
                        return false;
                }
            }
            return true;
        }
    

    Why don't photon team provide active support to customers?
    For your reply I have waited for two days and now you are available for help.
    Anyway thanks for you help and support.
  • Tobias
    Options
    We are sorry to make you wait for support but this is actually free support and based on whatever time we can muster for that.
    You posted on a Friday. Depending on time zone differences, we might be off for the weekend.

    PUN 1.26 actually has some fixed for offline games and props, so this is not a random thing that went away.
    Good to read it helped.