Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

build own server

Discussion in 'Multiplayer' started by casey945, Mar 4, 2009.

  1. casey945

    casey945

    Joined:
    Feb 16, 2009
    Posts:
    46
    Hello,everyone

    I want to build my own server,i have downloaded the MasterServer.exe and ConnTester.exe,and download
    networking sample,How to start? I konw I have to run MasterServer.exe and ConnTester.exe on my server machine.

    But I don't konw which file i have to change?how to setup the networking sample?Shoud i have to make some change for MasterServer or ConnTester?

    I realy need help.Thank you very much.Sorry my English.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The master server and con tester do not allow you to host a dedicated Unity game server if that is your intend.
    They only allow you to host a master server for NAT Punchthrough and listing of currently available games.
     
  3. casey945

    casey945

    Joined:
    Feb 16, 2009
    Posts:
    46
    Thanks for your reply. :)

    i just want to build a MasterServer for Multiplayer Networking,not dedicated Unity game server,how to do?
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Just put the master server on a machine of your choice and run it.
    then when connecting to the masterserver in your script code, put your master server machine IP and port in, not the default one (which goes to Unity techs masterserver)
     
  5. casey945

    casey945

    Joined:
    Feb 16, 2009
    Posts:
    46
    Thank you very much. :D

    should i change this ip and port in ConnectGui.js:
    Code (csharp):
    1. //DontDestroyOnLoad(this);
    2. var remoteIP = "127.0.0.1";
    3. var remotePort = 25001;
    4. var listenPort = 25000;
    and change the port in ConnectGuiMasterServer.js:

    Code (csharp):
    1. DontDestroyOnLoad(this);
    2. var gameName = "You must change this";
    3. var serverPort = 25002;
    4.  
    Anything else I need to change?

    thanks
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if you don't use the direct connect guis you only need to change the later. But you also must change the IP there. It is not changed anywhere (default points to unity techs masterserver), which is why you don't see it mentioned in the source.
    but the script reference on masterserver will show you the possible fields
     
  7. casey945

    casey945

    Joined:
    Feb 16, 2009
    Posts:
    46
    Which file default points to unity techs masterserve?
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No file

    the masterserver class hardcoded default is unity techs own masterserver.
    Please check the MasterServer class documentation in the scripting documentations to see how to point it to a different URL
     
  9. casey945

    casey945

    Joined:
    Feb 16, 2009
    Posts:
    46
    Thanks for your help,dreamora. :)
     
  10. matt77

    matt77

    Joined:
    Apr 14, 2009
    Posts:
    21
    My mates and i want to create a server(preferably using c++) that can comunicate with unity clients and run on linux. Is there a way to build a dedicated Unity game server, apart from the client?
     
  11. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    If you use an alternative networking or directly UDP / TCP sockets, surely
    but not through the unity networking at least without some work on the reverse engineering end to find out the specific consts used in raknet 3.0
     
  12. matt77

    matt77

    Joined:
    Apr 14, 2009
    Posts:
    21
    EDIT: i'm not sure if i understood it correctly. So, if i use another networking or tcp/udp sockets, it's possible. But if i want to use unity network, i have to do some reverse engineering. right?

    dreamora, couldn't i find out about these specific consts reading the unity masterserver code(provided here: http://www.unity3d.com/master-server/index.html)?
     
  13. matt77

    matt77

    Joined:
    Apr 14, 2009
    Posts:
    21
    anyone can answer my question?
     
  14. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The master server beta does not contain any game server related things.
     
  15. matt77

    matt77

    Joined:
    Apr 14, 2009
    Posts:
    21
    thanx!