Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

MasterServer

Discussion in 'Editor & General Support' started by alaindum, Sep 4, 2011.

  1. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    Hello and thanks in advance for your help.

    There are several post about masterserver here ,
    so I dont know if I have to start a new one , scuse me if I am not in the right place,
    I am new here .

    I have ,I think ,
    a masterserver running on my dedicated OVH server .

    I compiled , from here
    http://unity3d.com/master-server/index.html
    all was needed and ran it as daemon.

    And that runs , I think.


    But I have no idea what to do now to use it .
    I mean :
    Having a client able to connect a "game" from my server's IP witch is 87.98.158.40

    I guess I have first to start hosting a game ,
    but I cant find the way.

    I tried many tutorials from that forum or from others ressources ,
    and I have built several unity files from them ,
    and I understand a bit some *.js files , but I can't figure what must be my next step .


    Thanx in advance

    alain
     
  2. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    from the sources here

    http://unity3d.com/master-server/index.html

    I compiled and ran , for my dedicated Linux server

    the for grpup of files



    - MasterServer
    ....masterserver# ./MasterServer
    07-09-2011 13:44:58 INFO Writing PID to MasterServer.pid
    IP address: 127.0.0.1
    IP address: 94.23.39.112
    IP address: 87.98.158.40
    07-09-2011 13:44:58 LOG Unity master server version 2.0.1f1
    07-09-2011 13:44:58 LOG Master server port set to 23466
    07-09-2011 13:44:58 LOG 1000 connection count limit
    07-09-2011 13:44:58 LOG To quit press Ctrl-C
    ----------------------------------------------------

    Seems ok ...

    I have probs with

    - Facilitator :
    I got first

    IP address: 87.98.158.40
    05-09-2011 16:01:42 LOG Unity Facilitator version 2.0.0
    05-09-2011 16:01:42 LOG Listen port set to 50005
    05-09-2011 16:01:42 LOG 1000 connection count limit
    05-09-2011 16:01:42 LOG To quit press Ctrl-C

    It was OK but after trying to clean something there ,
    now I get "permission denied to recompile that ,
    and the /Facilitator/Facilitator is missing now , so I can't run it


    - ProxyServer :



    ....ProxyServer# ./ProxyServer
    07-09-2011 14:39:17 INFO Writing PID to ProxyServer.pid
    07-09-2011 14:39:17 Proxy Server version 2.0.0b1
    07-09-2011 14:39:17 Listen port set to 10746
    07-09-2011 14:39:17 Server relay ports set to 50110 to 50120
    07-09-2011 14:39:17 Using facilitator at 67.225.180.24:50005
    IP address: 127.0.0.1
    IP address: 94.23.39.112
    IP address: 87.98.158.40
    07-09-2011 14:39:17 To exit the proxy server press Ctrl-C
    ----------------------------------------------------
    07-09-2011 14:39:17 LOG Connecting to 67.225.180.24:50005
    07-09-2011 14:39:17 LOG Sent connect request to facilitator at 67.225.180.24:50005
    07-09-2011 14:39:17 LOG Connected to 67.225.180.24:50005

    ***see below what is that 67.225.180.24 ,
    I have some other file to clean ........


    - ConnTester :

    ...../ConnTester/

    05-09-2011 16:16:17 INFO Writing PID to ConnTester.pid
    05-09-2011 16:16:17 LOG Connection Tester version 2.0.0
    05-09-2011 16:16:17 LOG Listen port set to 10737
    05-09-2011 16:16:17 LOG Max connection count set to 1000
    IP address: 127.0.0.1
    IP address: 94.23.39.112
    IP address: 87.98.158.40
    05-09-2011 16:16:17 ERROR Not enough IP addresses to bind to.
    05-09-2011 16:16:17 ERROR To run the connection tester you need four public IP addresses available.

    *********What is that ??????

    Other question :


    ....it was strange to see my unity files tests trying to connect to 67.225.180.24:10737

    I saw that it is the old unity server ,
    so I changed/edited these files :
    ConnTester\config\unity-conntester
    ProxyServer\config\unity-proxyserver
    Facilitator\config\unity-facilitator
    MasterServer\config\unity-masterserver

    for my rights HOMEDIR= and USERNAME=


    Anyways I understand what is my HOMEDIR , but not sure what is my USERNAME ....


    And not sure if I recompiled all correctly ...


    ****
    Last question :

    are the files here

    http://unity3d.com/master-server/index.html

    really ready now for Linux and for the last version of unity ????????

    I don't want to lost my time if the are just good for the previous version ....


    *****

    Last last question :

    are ConnTester , Facilitator and ProxyServer absolutly necessary or not ?
    If the MasterServer is running , is it sufficient to use it ???? To connect it , I mean.
     
  3. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    I will soon delete all my files on my server and recompile all .

    But as I have read many posts about all that ,
    I got another ConnTester.cpp that the one from unity ....
    from here

    http://anders.tonfeldt.se/?p=679

    I must clean all

    Any help ???? all that is not easy :(
     
  4. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    Hey alaindum,

    it's hard to follow your steps..

    Could u send me your script files? What did you changed and where did you changed something?

    How you compiled it?
     
  5. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    Re hello , Shigeru ,
    Thanks for your patience

    We crossed on simom's thread , but I am sure he will succeed :)

    Now I will stay here to stop to bore him :)


    Well ...


    about me , ...

    I downloaded the for group of files from unity ,

    Master Server
    Facilitator
    Connection Tester
    Proxy Server


    to have a masterserver on my dedicated server .
    Witch is in Linux .
    I compiled with Putty.exe

    but I will soon delete all and will re compile ,
    because I think we have many things to change from the unity files .

    And I followed too what the guy , anders ,
    http://anders.tonfeldt.se/?p=679


    said about another ConnTester.cpp file

    So , my first next step is to have a masterserver running well on my dedicated server .

    Indeed the masterserver seems running ,
    But not the ConnTester , not the Facilitator , not The Proxyserver ,
    and I guess they are needed ( ?????? )

    Then , I need a client and a server unity file to connect ,
    and for that , I tried many tutorials , M2H etc ,
    but that always says " failed to connect 87.98.158.40 " , that is my server ..
     
  6. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    Well.. first you just need the masterserver, the other files are normally not needed.

    You try to connect to an external ip adress.. did you forwared your ports in your router?
    First try to use an internal ip adress (like 127.0.0.1)

    Shigeru
     
  7. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    If I just need the masterserver , it seems running

    IP address: 87.98.158.40
    07-09-2011 13:44:58 LOG Unity master server version 2.0.1f1
    07-09-2011 13:44:58 LOG Master server port set to 23466
    07-09-2011 13:44:58 LOG 1000 connection count limit
    07-09-2011 13:44:58 LOG To quit press Ctrl-C

    what sort of *.unity file I could try to test ??? I have so many , I am lost to know witch one to use
     
  8. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    Just use a simple script with connect.
     
  9. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    LOL give me a good script :) I tried tons , and I guess I complicated too much :)
     
  10. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    Just add an empty gameobject to the scene and add this javascript file

    Where 127.0.0.1 is your ip
    and 25000 is your port

    Check firewall if port is opened
     
  11. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    ????

    But I dont want to connect to my local PC , Shigeru , ( 127.0.0.1)

    I want to connect and having friends able to connect to

    IP address: 87.98.158.40
    07-09-2011 13:44:58 LOG Unity master server version 2.0.1f1
    07-09-2011 13:44:58 LOG Master server port set to 23466

    what's the hell ??
     
  12. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    This was just an example script.

    As I said you have to replace the ip and port with yours..

    I checked your port:
    87.98.158.40 isn't responding on port 23466 ().

    So your firewall is blocking, or router isnt configured well
     
  13. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    OK I beg your pardon ,
    and thanx for your patience

    I know checked how was my master server ,
    on my dedicated server ,
    and got :

    ........mixed3d/masterserver# ./MasterServer
    09-09-2011 21:15:21 INFO Writing PID to MasterServer.pid
    IP address: 127.0.0.1
    IP address: 94.23.39.112
    IP address: 87.98.158.40
    09-09-2011 21:15:21 LOG Unity master server version 2.0.1f1
    09-09-2011 21:15:21 LOG Master server port set to 23466
    09-09-2011 21:15:21 LOG 1000 connection count limit
    09-09-2011 21:15:21 LOG To quit press Ctrl-C
    ----------------------------------------------------



    I added your script on a unityfile ,
    but that needs something to tell me if it is OK or not

    sort of Debug

    I added that one
    function OnServerInitialized() {
    Debug.Log("Server initialized and ready");
    }
    but that says nothing more , my world just open in the editor or in a webplayer.

    Have you a sript for a client to test if we could connect ???

    I am ashame to bore you :(

    Btw I have another question :
    how you could check if the port is open ?
    normaly , on a dedicated server all the ports are open , am I false ?
     
  14. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    Not if the server is using a firewall...

    "OnServerInitialized" is used when you are hosting a server.. but you already have a master server!
    You could try

    If theres no output then the connection was sucessfully.

    Also you can test this script. It will test your connection:


    http://unity3d.com/support/documentation/ScriptReference/Network.TestConnection.html

    Good luck

    Edit: Thers also that one
    http://unity3d.com/support/documentation/ScriptReference/NetworkConnectionError.NoError.html
     
  15. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    with the first sripts I got

    Limited NAT punchthrough capabilities. Cannot
    connect to all types of NAT servers. Running a server
    is ill advised as not everyone can connect.
    When starting a server the NAT
    punchthrough feature should be enabled (useNat parameter)

    .....

    Is the Facilitator not needed to be used ?????

    I will look at your second link

    Thanx for your help , you are very patient :)
     
  16. Shigeru

    Shigeru

    Joined:
    Sep 7, 2011
    Posts:
    32
    No you dont need the facilitator.

    But now I know what the error is...

    You cant connect to the master server as a client!

    You have to connect as a server to the master server.

    The master server will list all servers! And then you connect to the single servers.

    So if you just want one server you dont need a master server, its just for lobbys etc...
    ^^

    Look here:

    MasterServer.RegisterHost = Register a server on master server!9

    You should read this:

    http://unity3d.com/support/documentation/Components/net-MasterServer.html

    There are the single steps:

    - Register a server on master server
    - connect to one of these servers..

    etc..
     
  17. alaindum

    alaindum

    Joined:
    Sep 4, 2011
    Posts:
    15
    sorry for the delay , Shigeru , and thanx for your help .
    I wanted to tell you good news , because simom85 helped me too ,
    and , yes , I forgot the masterserver way ,
    ans will use another way ,
    but I am fighting now to have ports open on my linux server !

    And I dont find the way .

    Scuse for that post not very useful , LOL ,
    but it is polite to tell you merci , and that I will succeed one day :)
     
  18. aastha

    aastha

    Joined:
    Mar 18, 2015
    Posts:
    4
    @Shigeru
    Hi,
    Please help me to connect to my master server. I was able to setup my own master server and got the port as 23466 but on calling "Network.InitializeServer (2, 23466, !Network.HavePublicAddress());" I am receiving the following error:
    "The connection request to 67.225.180.24:50005 failed. Are you sure the server can be connected to?"
    I am not sure why it is showing the error for 67.225.180.24:50005 when I added the MasterServer.ipAddress andMasterServer.port to my own server's address.
    Please help me and Thanks in advance.