Possible to send instance of class?

Options
jpb1614
edited November 2012 in Photon Server
Hello,

I've been following the Server2Server tutorial found at CrgGaming. It's a basic cluster server setup. I have a master server that receives all requests and directs them to the appropriate server. I also have a region server in which I want the starting map logic to take place. In there I'm wanting an iteration through all of the connected clients so I can relay player position. Anyway, I've run into a problem. When a client is first launched, it connects to the master server and is added to a dictionary called connectedClients. This dictionary contains the client instance and a Guid to represent an id. What I'm trying to do is when the person actually logs in, I want them to connect to the region server and then disconnect from the master server. I thought that I could maybe just transfer the instance of the client that was created at the start, but I'm running into all sorts of serialization issues as the class has parameters. Any thoughts? Any help is greatly appreciated. Thanks in advance.

-Jarryd

Comments

  • Philip
    Options
    The serialization/deserialization supports basic types (out-of-the-box) and gets into trouble with your custom-type.

    There are these possible ways you can go:

    1) (the way I would do it) is extract the data necessary to re-create your clients instance and send that.

    2) (since you only need it on the servers) serialized to a byte array (using the .net serialization) and send that.

    3) implement custom serialization ... photon supports custom serialization - but its somewhat more involved.
    And I don't have a sample / doc on that at hand.
  • Awesome, thanks for the reply.