Closing a cached world in MmoWorldCache

Options
ktweedy1
ktweedy1 ✭✭
edited August 2010 in Photon Server
Hope I am not driving you guys crazy with questions.

I don't see anything that ever removes a MmoWorld instace from the MmoWorldCache.

My worlds are class lessons so once everyone leaves the world we will never reuse that instance of that world again. Is there something in place to remove a world from the cache or do I need to implement something that looks at how many players are in the world and close it on the last one?

Also, how do i know if the world is empty? Look to see if any avatar type items are in MmoItemCache/itemCache in the GridWorld instance?

Students click end class so I can use that as a single to initial a close world instance on the server but I see times where something goes wrong and the client crashes so it does't get called for the last student.

I see there is an ExitWorld operation but that looks like just a notification. Looks like the IGameListener doesn't even see it, just the RemoveItem event.

Thanks for the help, any thoughts are appreciated.

Comments

  • Boris
    Options
    There's nothing in place for this.
    You could add a counter and increment/decrement it with the interlocked class, at 0 remove the world.
  • Boris
    Options
    ktweedy1 wrote:
    I see there is an ExitWorld operation but that looks like just a notification. Looks like the IGameListener doesn't even see it, just the RemoveItem event.
    Clients receive the itemdestroyed event, that removes the cached item from the client.
    Works for subscribed items only though.