Search Unity

Third Party Photon CAS code example.

Discussion in 'Multiplayer' started by ThySpektre, May 13, 2019.

  1. ThySpektre

    ThySpektre

    Joined:
    Mar 15, 2016
    Posts:
    362
    Does anyone have a code example for changing a RoomProperty in Photon using CAS, that includes the error handling?

    I have a float[] as a custom property. The various players can change elements of the float array. However, because of concurrency, while I try to change one element, another player may try to change a different element.

    Ultimately what I am looking for (psuedocode)

    ChangeRoomProperties()
    {
    ReadRoomProperties() //casting them to an array[]
    alter the desired element
    recreate Hashtable
    room.SetCustomProperties(prop, oldvalueProp);
    if error == incorrect oldValueProp
    {
    ChangeRoomProperties()
    }
    }
     
    Last edited: May 13, 2019