Why ActorNr not designed to be globally unique?

lpp168lpp168
edited August 2012 in Photon Server
Why ActorNr not designed to be globally unique?
Until today, I found the original of each room ActorNr start counting from 1.
When the players joined the room after the broadcast event ActorNr.
So if I want to find players in another room, I look for what the primary key?
public class MyApplication : LiteApplication
    {
        public static Actor GetActorByGlobal(int actorNr)
        {
            var roomNames = Lite.Caching.LiteGameCache.Instance.GetRoomNames();
            foreach (var roomId in roomNames)
            {
                Room room;
                Lite.Caching.LiteGameCache.Instance.TryGetRoomWithoutReference(roomId, out room);
                return room.Actors.FirstOrDefault(a => a.ActorNr.Equals(actorNr));
            }
            return null;
        }

        public static Room GetRoomByGlobal(int actorNr)
        {
        ...
        }
}

Really want to do not understand the design of the Lite
Was it merely to limit the players into a room, not allowed to see the outside of the sky?

I think the importance of the Photon should not just be in that Network SDK
Can handle Stocket packet engine like hairs as much as
Processing agreement protobuf-net is not worse than the Photon.

If you do not fancy the above two points Lite demo design such limitations, so also do something using Photon?

Comments

  • > Why ActorNr not designed to be globally unique?
    Cause that's much more complex and wouldn't allow us to use just an int as ID.

    > So if I want to find players in another room, I look for what the primary key?
    You will have to identify the users somehow and create a list of them. This is complex and takes away performance, so Photon isn't doing this by default.
    Rooms are separated and don't access each other, so they can run concurrently in separate threads, which is needed to scale up.

    > Really want to do not understand the design of the Lite
    In worst case, you could cook your own "Lite" and start with a blank Application. Lite is just one way to do things. It if doesn't fit your needs, Photon is open as app framework with operations, responses and events.

    > Processing agreement protobuf-net is not worse than the Photon.
    Most likely it's not, true.


    > If you do not fancy the above two points Lite demo design such limitations, so also do something using Photon?
    What?
Sign In or Register to comment.