Initial world setup and item state

ktweedy1 ✭✭
edited August 2010 in Photon Server
What I need to start working on is when someone enters the virtual world there may have been things already happending, things moved around, etc. So I need to get the inital state.

I believe the item catch will tell me all objects that exist but how I cache their state? Is this what SetPropety and GetProperty is for?

Looking aruond at the code, but would save me some time. Also is there a property change event? or if I set proporties I need to then send an event to tell people properties have changed?



  • Boris
    The properties are for the state, correct.
    the setproperties operation has two important parameters: PropertiesSet and PropertiesUnset.
    The first will be merged into the existing properties, the second will remove properties. At the same time the PropertiesRevision is incremented.
    Subscribed clients receive the ItemPropertiesSet event with the changes and the new PropertiesRevision.
    If clients lose and gain sight again they receive the current item PropertiesRevision. If this number differs to what's cached the client needs to call GetProperties in order to receive the latest state.
  • ktweedy1
    Nice, can't wait to play with that.