Remove a GameProperty

I'm storing some information about kills/deaths, etc. in the room properties using - OpSetPropertiesOfGame

From my understanding using this:

PhotonNetwork.networkingPeer.OpSetPropertiesOfGame(new Hashtable() { { property, Value } }, true, (byte)0);

- If the key doesn't exist... it adds it
- If the key exists, it updates it (is this true or does it make multiple copies?)

How do I tell it to remove one of those properties? Do I just pass it null for value or does that still have the property just with the value null?

I wrote these functions myself, but I really wish they were built into PUN

SetRoomProperty(key, value)
GetRoomProperty(key)

Thanks!

Comments

  • The server does not yet delete properties. At least in terms of actor-listing, PUN currently simply relies on having some.
    You can set them to null but all the custom props you ever used in a room will stick (as key).

    PUN 1.9 exposes the property features.
    We also added a string[] for you to define which properties must be available in the lobby / room listing. This helps save a lot of traffic if you use props a lot.
  • Thanks Tobias as always for the speedy responses. Could you include some sample code about this new property and how to use it? I'm totally in love with Exit Game Photon Network, but the lack of documentation is kind of frustrating. If you look at Unity's docs. Even for a simple self explanatory function or member variable, they have at least a 3 line of code example (and in JS and C#)

    Thanks!

    -Carmine
  • Currently, we can't write as many examples as we would like to. It's taking quite some time to write something useful and link it with related concepts, etc.
    We try to make the documentation of the code as helpful as possible.

    I'm glad you like Photon and hope this will not keep you from using it. Bug us with your questions until it becomes easier for us to write examples than to answer here ;)
Sign In or Register to comment.