How to Obtain List of Peers/Actors in Room

Options
White Rabbit
edited February 2013 in Photon Server
I need to be able to obtain a list of Actors(name/properties) and/or the list of Peers in a room along with all the rooms on the server. I can get the rooms from the GameCache, but Actors is a protected property and I have yet to find a way to access them without modifying the photon base class code which I have inherited from - which I am trying to avoid.

I also would like to get a complete list of Peer connections to the server - something else I can't find access to.

What is the best way to accomplish these?

Comments

  • Hi,

    for the complete list of Peers on a server - that's currently not implemented, but this thread describes how you can get a list of peers per application: viewtopic.php?f=5&t=2271&p=10588&hilit=+createpeer#p10588

    For the list of actors / peers in a room: you either need to modify code of the base classes, or add a new property in your derived class that gives access to the protected properties of the base class. We've released the source code of the applications because we want you to modify it until it fits your needs. Just do it. :)
  • I viewed the referenced post, which offered:

    1) Right. You need to extend the server-side code yourself. I would probably create a class that holds a list of all connected peers, and add / remove the peers in your code that overrides ApplicationBase.CreatePeer() and PeerBase.Disconnect().

    Unfortunately, there is no override for PeerBase.Disconnect() that I can find. One can override LitePeer.Disconnect() I suppose.
  • Errr. It should be PeerBase.OnDisconnect(). I'll edit the original post. :)