Search Unity

Unity Networking without using master server - Possible?

Discussion in 'Scripting' started by Jacksendary, Jun 5, 2012.

  1. Jacksendary

    Jacksendary

    Joined:
    Jan 31, 2012
    Posts:
    408
    Hi people, i've been looking very into networking here the last few day and have start wondering if it is possible to make a server without using the master server since i've heard its mainly is used for testing purposes. Im already into how networking in C# works and i've made a IM/Video-conversation app last year. but it seems that all guides i find only uses the master server to make networking games...

    If any of you guys could point me in the right direction where i should look for this i would be glad, thanks

    - Jackie
     
  2. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    There are commercial options out there like Smartfox and Photon if you would rather not use Unity's server. Otherwise, you can certainly roll your own network on top of Mono's TCP/IP socket classes.
     
  3. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    The default master server is indeed not recommended as everyone is using it for testing (being that it's the default). So you could either set up your own hosted master server or use a community hosted one.

    To use a different master server than the default one, simply set MasterServer.ipAddress and port at some point before you start using the MasterServer class.
     
  4. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    But to answer your initial question - yes you don't need to use a master server if you don't want to. It's just a directory service. If you want you could manage a list of IPs somewhere else.
     
  5. Jacksendary

    Jacksendary

    Joined:
    Jan 31, 2012
    Posts:
    408
    Hi both of you thank you very much for the answers :) I do have my own server and can easily set it up there if i just know how it works.

    But if you just can set the master server to anything you like it sounds like a plan, however i still wonder if using the "masterserver" is necessarily for this or i only can use the "network" class to connect?

    Also if some of you have some good sources i would appreciate it alot :) Thanks,

    - Jackie
     
  6. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    As I mentioned the MasterServer is only a directory service. You can just specify IPs directly when connecting.
     
  7. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    Your users have to have some way to connect to each other. You can use a centralized server to let them find random strangers or friends easily. Or you can make them put in their friend's IP and connect directly. Or if they're on a LAN together, you could use UDP to find all other clients on the LAN and connect to each other.
     
  8. Jacksendary

    Jacksendary

    Joined:
    Jan 31, 2012
    Posts:
    408
    @AngryAnt Thanks a lot for the help i've played a bit around with it and i think i get the idea thanks (Mange Tak) :D

    @wccrawford Not sure if i completely understand what you mean but i think AngryAnt have solved it for me. but thanks :)