A bit confused

Options
ddks
edited March 2012 in Photon Server
Hi,

I just recently started looking at Photon and various samples / tutorials out there. I am getting a little stuck due to my lack of understanding how this works under the hood and hopefully some folks on this thread have some insights they can share.

This what I have done so far, I have a master server and 2 sub servers, furthermore I have also created a client peer class. Right now the sub servers can connect to the master and the client can connect to the master. I am getting a little stuck in the passing of operations (and in general how operations / parameters work).

As a simple example: I have a client do a Login operation. Right now the client calls the master, the master will do a switch based on the operation code and then call the appropriate sub server with:
as LoginServer.SendOperationRequest(operationRequest, sendParameters);

My sub servers are based on ApplicationBase and have a private instance ServerPeerBase that points to the Master.

What do I need to implement to handle the SendOperationRequest call coming from the Master. Given that my Login Server is based on ApplicationBase I assume I need to add another ServerPeerBase class to my loginServer to receive the requests from the Master?

Any help would be very much appreciated.

Dan

Comments

  • Yes, you need a ServerPeerBase subclass on both sides. Simply implement the OnOperationRequest, OnOperationResponse, and OnEvent methods in order to handle those events from the peer. You'll do that on both sides of the connection. In other words, your master server would have a LoginServerPeer and the login server would have a MasterServerPeer. Both inherit ServerPeerBase.
  • Philip
    Options
    Is there any specific reason for the architecture you are choosing? Just asking because this it's not an easy task you're engaging in - you'll have to invest a lot of work to have a really stable solution.

    It also increases your hosting costs and I wouldn't recommend it if you have a "fast" game - you'll also have a bigger round trip time.

    If you are just trying to understand the concepts and assuming you did have a look at Helloworld
    you could have a look at http://doc.exitgames.com/v3/photonserver/anapp%20from%20scratch.

    To see how the server2server api works you can have a look at the loadbalancing project in the sdk.
  • ddks
    Options
    Hi,

    I am not totally sold on this, I understand the bigger effort but what are the alternatives for a scalable MMO design? e.g. 10 players in a room is not going to cut it, and not using multilple sub servers would reduce the scalability (e.g. assume we cut a game into multilple world where players can jump between worlds). Then for scalability have interest areas to controll data events.

    Am i missing some obvious design options? Appreciate any suggestions from more experience folks out there?

    Dan