SomeQuestions about the Loadbalancing sample

Options
Xiphias
edited July 2013 in Photon Server
Hi,
I'm a beginner using photon and unity3D, and also a beginner in game programming.
Now I'm trying use Loadbalancing sample and photonbot sample to create a new game.
Here is some questions,
1. What is the NodesReader in Photon.LoadBalancing.Common, and is there any sample of node.txt?
2. I'm confused that some parameterCode use enum in server but some use class in client, is there any reason to do so?
3. Is photon has any API to do something like replication? I mean, when server create some object,then client create it,too, and when some properties changed in server ,then client side will update automatically.
4. How can I synchronous the physical datas and computations between server and client? Does photon has some solutions or I need to construct it myself?

thanks for read the post,and thanks for answers.

Comments

  • Hello!

    1. NodesReader - was only used in our Azure SDK, it's not relevant for the default loadbalancing setup.
    2. Sorry, I don't understand what you mean. Can you give an example?
    3. You can use the RaiseEvent operation on a client to send updates to other clients in the same room; or you could use SendEvent / Broadcast methods on the server to push data / updates / notifications to your clients.
    4. is depending on your client / game - there should be some examples in the tutorials & demos for your client SDK. I suggest that you create a separate topic in the correct client platform subforum to discuss best practices in more detail.

    Thanks!
  • Xiphias
    edited July 2013
    Options
    Hello,
    Thanks for your reply,
    in 2,for example,
    in server(loadbalaning sample) the OperationCode is
    public enum OperationCode : byte
    {
    Authenticate = 230,
    ...
    }

    but in client(photonbots sample) OperationCode is
    public class OperationCode
    {
    public const byte Authenticate = 230;
    ...
    }
    I just want to know,is there any reason to use the different type?


    Thanks a lot.
  • Oh. No, there's no particular reason. They were just created by different developers with different habits.
  • Kaiserludi
    Options
    The server has originally been developed in C#, while the client has originally been developed in objC, then been ported to C++ and from there to C# and the other platforms. While C# has something like byte enum available, both, C++ (although it got support for them with the newest standard) and objC don't support byte enums, but only int ones, which is the reason why we use constants in namespaces there, when the type should not be int. When porting to C#, that reason vanished, but the constants stayed in as a porting relict, because we didn't see a critical need to rewrite that. So its mainly some kind of historical reason because the LoadBalancing layers on client and server have evolved differently.