Search Unity

How do the Master Server work

Discussion in 'Multiplayer' started by reset, Jul 6, 2009.

  1. reset

    reset

    Joined:
    May 22, 2009
    Posts:
    393
    Sorry for my ignorance ...

    but if I wanted to put a game online at my own dot com how would I utilize the MS?

    Do I upload it and get it running on my web host behind the game?

    Does the MS actually receive all data from the server and clients and then send it to the respective receiver or does it just facilitate connection between a server and the clients and then steps out of the game?

    Just not sure how to approach a web hosting company to explain what type of web hosting package I would need?
     
  2. cyb3rmaniak

    cyb3rmaniak

    Joined:
    Dec 10, 2007
    Posts:
    162
    The part that handles the NAT punchthrough and the connections between clients is actually the facilitator (which is part of the master server)
    The Master Server is very usefull especially if you're planning on letting your clients start servers of their own.
    You run it on a machine on your webhosting (or any other machine that has a public IP address that is accessible by all - not firewalled). You actually have an executable that you run (probably wise to somehow make it a deamon or a service on your server).

    In the simplest form it will just be used by the users to query for servers running the game they want and receive the IP address of the server, if any is found.

    The more advanced part of the Master Server will use the facilitator to help the users start a game server of their own even if they are behind a firewall (Or help them connect to your game server - if it's firewalled). The new game server (behind a firewall) connects to the facilitator (since the facilitator is on a public IP). It will remain connected to the facilitator, thus keeping the communication chanel open. When a client will attempt to connect to the game server - it will first connect to the facilitator.
    Now, I'm not 100% sure about the next part, but from what I undestand - since they are now both connected simultaniosly, the facilitator and the master server can use the connections they have with both systems (client and firedwall server) to make them connect to each other. Basically a command is sent to the client and the game server to try to connect to each other simultaniously - each to the public IP of the other. If it works - the game server will actually open a channel through it's firewall to the other client directly. Once the channel is opened from that end- it probably can be used in the other direction too. Since the server was the one that opened the channel- it's firewall will not mess with that channel since it's trusted.
    From there on the facilitator has done it's job and is out of the picture regarding this specific connection.
     
  3. reset

    reset

    Joined:
    May 22, 2009
    Posts:
    393
    thanks for your reply.

    So once the server and client/s are connected does all the game play (game object positions, rotations etc) get set to/from the server and client/s via the Master Server?

    Or does it just get sent to/from the server and client/s directly and NOT via the Master Server?

    thanks
     
  4. DrHotbunz

    DrHotbunz

    Joined:
    Feb 14, 2009
    Posts:
    315
    Not via. The master server only tells the clients how to connect.