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

Match Up - Drop in matchmaking system

Discussion in 'Assets and Asset Store' started by thegreatzebadiah, Nov 7, 2017.

  1. VasyaCullin

    VasyaCullin

    Joined:
    Feb 17, 2014
    Posts:
    8
  2. Zebadiah

    Zebadiah

    Joined:
    Apr 6, 2014
    Posts:
    67
    @VasyaCullin why are you hosting on port 80? It seems like you're getting web requests which are throwing the server off which is about what I would expect. You should use a different port or maybe some iptables filters to filter out web requests or something.
     
  3. wade51

    wade51

    Joined:
    Jul 31, 2019
    Posts:
    4
    Hi
    I read in your description it says Match Up provides easy-to-use, hassle free matchmaking support for any networking system. So I purchased the package so that i can use it on PUN2 but I can't an option to connect to Photon network in the match maker script....Help
     
  4. Zebadiah

    Zebadiah

    Joined:
    Apr 6, 2014
    Posts:
    67
    @wade51 Match Up isn't in charge of doing the actual networking. All it does is let hosts store some data in a central location so that clients can get that data and do whatever they want with it. In the UNet and Mirror examples that means storing the host's IP and Port so that clients can use it to connect. How you handle the actual connection / networking is entirely independent of Match Up. So for PUN2, you just need hosts to store whatever identifier PUN2 uses to connect, and then use that on clients to connect however you normally would with PUN2. I'm not super familiar with it myself so I don't know the exact details of how that is done.
     
  5. ByoungGeun

    ByoungGeun

    Joined:
    Jun 27, 2017
    Posts:
    1
    Nice to meet you!
    I bought match-up and soomth-sync!
    I want to use these two to find my room through match-up with each character and bring it to a natural game play through Soomth-sync!
    If you have a video or article that you can refer to by linking these two sets, please recommend it!
     
  6. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    587
    @ByoungGeun
    You wouldn't use them any differently just because you are using them together.
    Smooth Sync is for syncing Transforms across the network.
    Match Up is for finding games that your players (or you) host.

    Smooth Sync tutorial video:


    Match Up tutorial video:
     
  7. cparki3

    cparki3

    Joined:
    Jan 13, 2014
    Posts:
    41
    Just want to clarify something. If I need to access match data from a different scene... I'm assuming I just use "DontDestroyOnLoad" on the Matchmaker GameObject?
     
  8. AlphaLulz

    AlphaLulz

    Joined:
    Sep 2, 2019
    Posts:
    51
    Can this be used to host private lobbies and have a text box where you type in a code to join?
     
  9. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
  10. AlphaLulz

    AlphaLulz

    Joined:
    Sep 2, 2019
    Posts:
    51
    Cool, thanks! Also, is there a way to make a match but not display it on the list?
     
  11. ninjadragon777

    ninjadragon777

    Joined:
    Jul 30, 2017
    Posts:
    2
    How can I get the variable matches in other functions:

    public void List() {

    match[] = matches;

    var data = match[1].matchData; GameObject joinmatch = Instantiate(join_ui); joinmatch.transform.SetParent(ParentPanel, true);


    }

    it says Identifier expected
     
  12. w0lfi

    w0lfi

    Joined:
    Oct 17, 2017
    Posts:
    3
    Hi

    I stood now in front of the problem of hosting my own matchmaking server. I couldn’t test my game because the development matchmaking server was/is down for a few days. Sooner or later, I would have had to host it anyways myself.
    Since I couldn’t find any step-by-step instructions, I had to google it together. :D
    So, for everyone else who doesn’t know how to do it I will write the necessary steps together. I hosted my matchmaking server on Linux.

    1. First you need to get a server from a provider. I opted for the cheapest one I could find from my website hoster. It’s a virtual Linux server for 1€ a month. Linux V3

    2. After you have your server, you can choose which OS they should install on it. I went with CentOS 8 64bit.

    3. You then have to access your server through an SSH client. I used “PuTTY” for that. There is pretty good instructions (in German) from my provider on how to use it with the Linux Server.

    4. When you are logged on your server you need to get that matchmaking executable on it. Therefore write
    wget -yourDownloadURL-
    into the console to download it. For more information on the command, look here.
    Noble whale offers a download link to a server file but it is pretty outdated. Best is if you take that server file from the Assets/MatchUp/Server directory in your Unity project and throw it in Dropbox. Create a link for it and replace in the beginning https://www.dropbox.com” with https://dl.dropboxusercontent.com” and in the end remove the “?dl=0”. This will change it so that the download starts as soon as you access the link. It should look like this: https://dl.dropboxusercontent.com/s/w0kavru1j33edtd/MatchUpServer
    This is my link, feel free to use it, but no guarantee it still works or is up to date.

    5. Great, now we have the Matchmaking program on our server. We now have to make it executable first by entering
    chmod +x ./MatchUpServer
    To run it we just write
    ./MatchUpServer
    See here. You will now see some information like the IP-Address and the used port number.

    6. Okay, it is running now. But it won’t work because the port that it uses is not open. Close the matchmaking process with Ctrl + C. You can find a pretty good instruction on how to open (and close a port) in CentOS 8 here.
    Here are the ones you need. Enter these commands one after the other:
    firewall-cmd --zone=public --permanent --add-port 20205/tcp
    firewall-cmd –reload
    firewall-cmd --list-all

    That’s it, the port 20205 used by the matchmaking process is open now.

    7. You can now restart your server with
    ./MatchUpServer -v

    The additional “-v” will give you some more log outputs.
    And test your MM Server by entering the following in the unity inspector for the Matchmaker:
    Matchmaker URL: hxxxxxxx.stratoserver.net (your own servers address)
    Matchmaker Port: xxxxx (as shown by the process in the terminal, here 20205)

    8. Great, its working now, but as soon as we disconnect our SSH client (PuTTY) it will stop.
    If you still have your process running, end it by pressing Ctrl + C.
    Then start it again as a background process with an ‘&’ after the command. See here for more details.
    ./MatchUpServer &
    It now executes same as before. But if you press Enter now you can write other commands.

    9. Okay, it runs as a background process now, but it will still be stopped when we close the SSH client. To prevent that we first make sure that only one background job is running. Type
    jobs
    This will give us a list of all background jobs running. To detach these from the shell’s job control and make them truly run on their own, type
    disown


    10. If you now check with
    jobs
    again you will see that it is gone. That’s good, because it runs now truly detached in the background. If you want to see some stats about it you can type
    ps aux


    11. In case you want to stop your matchmaking server or simply restart it you can kill it with the command
    kill xyz

    Note that xyz represents the process ID (PID) which we can find in the second column when we use the
    ps aux
    command.

    If your server needs to restart because of some security updates or other maintenance you probably want your matchmaking executable to start automatically after reboot to reduce any unnecessary downtime.
    I solved that by using a cron. You can read more about it here.

    First you need to open the crontab editor. Write
    crontab -e

    For me this opened automatically in the vim-editor. You can read more about its commands here.
    If you use the same you need to press “i” to enter the insert mode.
    Then enter the following lines
    # m h  dom mon dow   command
    @reboot ./MatchUpServer

    Or whatever your matchup server executable is named. It’s the same name that’s used in step 5, 7 & 8.
    Then press the esc-key to exit the insert mode and write “:x” and press return to save the file and exit the editor. You can check the content of it afterwards by writing
    crontab -l


    That’s it! The next time your server reboots the MatchUpServer executable gets started automatically.
     
    Last edited: Jul 7, 2021
    13E12K, meta44, mark_carolan and 2 others like this.
  13. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Thank you so much for that guide. You just made my life so much easier. I used a free amazon instance running ubuntu.
     
    w0lfi likes this.
  14. Cecrit

    Cecrit

    Joined:
    May 18, 2015
    Posts:
    18
    Thank you very much! I just set everything up now and my own matchUp server is running :)
     
    w0lfi likes this.
  15. jconst

    jconst

    Joined:
    Sep 5, 2014
    Posts:
    3
    Hi, is the testing server down currently? I'm just getting MatchUp set up, but I'm finding that, on startup, both my app and, more importantly, the example scene fail to auto-connect to the matchmaker, printing out this warning every 5 seconds:

    Match Up: Failed attempting to connect to the matchmaking server. Is it running?
    System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it.
    UnityEngine.Debug:LogWarning (object)
    MatchUp.Matchmaker/<ConnectToMatchmaker>d__27:MoveNext () (at Assets/Match Up/Matchmaker.cs:221)
    UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)​

    I assume the "target machine" in this case is the matchmaking server, but if it's talking about my computer, then perhaps I need to fiddle with some router settings.

    I'm using all the default settings - matchmaker url: noblewhale.com, port: 20205, external ip source: ipv4.noblewhale.com

    In the meantime I'll assume the test server is down and work on getting my own server running. Thank you.
     
  16. w0lfi

    w0lfi

    Joined:
    Oct 17, 2017
    Posts:
    3
    Yes, its down. I get the same message when trying to connect to it. But to my own one it works just fine.
    So no problem on your computer/ router.
    You can put your time into getting your own server running.
     
  17. jconst

    jconst

    Joined:
    Sep 5, 2014
    Posts:
    3
    Thanks. I got my own server running pretty quickly and that's working well.

    Unfortunately there seems to be an issue with lingering matches. @thegreatzebadiah I see you mentioned that you hopefully fixed this issue in the 3.02 release but I'm seeing this behavior in my app currently: Host creates a match, a client joins the match, both are connected. Then I stop both apps in the Unity Editor, restart one and fetch the match list - the same match I was just in will be visible, even though no one is hosting it. Then if I host a new match I'll see two identical entries in the list. The abandoned match seems to stick around indefinitely, though I'm not certain of that yet.

    The key seems to be that I kill the host app after the match has been joined. If I stop it manually (calling DestroyMatch), or kill the app before the match has been joined, then the match gets destroyed properly.

    I'm using the version of MatchUp (readme says 3.08) that came with the copy of NobleConnect I bought a week or two ago. This seems to be the latest version on the app store, assuming the readme is accurate.

    I'll try poking around in the MatchUp server code for a bit and see if I can find anything suspicious.
     
  18. jconst

    jconst

    Joined:
    Sep 5, 2014
    Posts:
    3
    Nevermind, figured it out. After an embarrassing amount of time spent debugging this, I realized that I had an unwanted LeaveMatch() call being run by the host (no idea why, but I must have put this in when I was first figuring things out.)

    Basically, the host was leaving the match on shutdown instead of destroying the match (or doing nothing). Either of the latter would have worked, but by leaving the match, the Client record for the host was destroyed, which left the Match record lingering. The fix was simply to remove that call.
     
  19. CJ_123

    CJ_123

    Joined:
    Apr 7, 2020
    Posts:
    3
    Hello, I'm new to this so I have some questions, is a private server the same as sever build, but just private ?, and another question, do I need my internet for the server to run, or not?
     
  20. Zebadiah

    Zebadiah

    Joined:
    Apr 6, 2014
    Posts:
    67
    @CJ_123 I guess I haven't checked here in a bit but hopefully I can answer your question. If you're asking about the matchmaking server, that is not the same as a server build within unity. The matchmaker is a separate executable, written in c++, that runs on a linux server to act as the centralized storage for the list of matches. We keep one up and running at noblewhale.com for you to test with, but you'll want to host your own before release. This generally means renting a server at AWS or Digitial Ocean or wherever. The server executable is included with the plugin, you just need to move it over to your server and run it. You could, in theory, run the matchmaking server software on any computer you want, including one sitting in your own room, as long as it's running a recent version of linux, and as long as you make sure to unblock / port-forward the required port on your router.
     
  21. lafain

    lafain

    Joined:
    Aug 12, 2012
    Posts:
    6
    This windows server link is down.
     
  22. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    587
    @lafain
    Sorry but we actually stopped support for the Windows server-side part of Match Up about a year ago.
    When we rewrote server-side Match Up to be much faster, the features we were using were unable to be translated to Windows. Supporting multiple versions seemed like more trouble than it was worth. You can still use Match Up from other OSes on the client side.
    It looks like we have some outdated docs to update and we can probably make the Match Up Store page more clear also.

    Thank you for bringing this to our attention.

    If you bought Match Up thinking you could run it on a Windows server and you want a refund, I completely understand. If this is the case, please send us your invoice number in a non-public manner and we can put it through. Invoice numbers typically start with "IN".
    Otherwise, you'll have to use the Linux server version.
     
  23. Jicefrost

    Jicefrost

    Joined:
    May 13, 2019
    Posts:
    40
    @Fuestrine

    Hi! I want to buy match up asset. Before I done I have question is it fit to me -
    I got dedicated server (windows) got unity MLAPI multiplayer game. I need for clients was possible to implement a random matchmaking with MLAPI. I mean - client launch game -> press "search" button and as soon as someone else is doing the same -> they all started scene - game.
    is "match up" can do this?
     
  24. Zebadiah

    Zebadiah

    Joined:
    Apr 6, 2014
    Posts:
    67
    @Jice128 Match Up isn't really designed for what you describe. The general flow for Match Up is that a player decides to host a game, the match is created, and then some time later a client requests a list of matches, picks one, and joins the host. You can easily implement something like automatically creating a match if none exists, but I think what you're talking about is a bit different so I'm not sure if it would be possible or not. Match Up generally was not designed with dedicated servers in mind, and it won't do anything to manage your servers or start new instances as players are grouped into matches or anything like that.
     
  25. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Does Match Up have any kind of "heartbeat" functionality (hosts having to confirm they are "still there" periodically) so in case a player hosted server shuts down without calling DestroyMatch the match doesn't linger forever?
     
  26. phdhamster

    phdhamster

    Joined:
    Jun 16, 2020
    Posts:
    12
    Is the MatchUp testing server down at the moment?

    edit: up now
     
    Last edited: Nov 28, 2022
  27. meta44

    meta44

    Joined:
    Sep 11, 2018
    Posts:
    23
    I just started encountering an error that I wasn't getting 3 days ago:
    "Transaction: Timed out waiting for response from matchmaking server."

    Are the matchmaking servers down? If so, is this for scheduled maintenance, or is it due to an unforseen issue with the servers? I had scheduled a playtesting session for my multiplayer game for today, and this issue caused the game to be completely unplayable. If this issue is due to the servers being down for maintenance, is there somewhere I can view the schedule?

    Also, is there a better place to get support besides this thread? Like, is there a Noble Whale discord server? Your product has been great so far, minus the occasional server downtime.

    Paging @Fuestrine , @Zebadiah , @thegreatzebadiah
     
  28. meta44

    meta44

    Joined:
    Sep 11, 2018
    Posts:
    23
    I'm looking into hosting my own matchup server, and I'm looking at my options. When you say you used a free amazon instance, what specific service are you referencing? Is that Amazon Lightsail?
     
  29. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    587
    @meta44
    Try to connect to our Match Up servers again. It should be back up now.

    Note that the servers we provide have no guaranteed uptime. We state this on our Asset Store page but I'm always happy to take suggestions if I can word anything better.
    You'll want to host your own Match Up server. Our Discord is here: https://discord.gg/PpaAtcu
     
    meta44 likes this.
  30. meta44

    meta44

    Joined:
    Sep 11, 2018
    Posts:
    23
    I got my own matchmaking server up and running following the tutorial above. I think I was too slow on that invite and the like has expired. Can you send it again? It doesn't appear to be a public server, couldn't find it in the search.
     
  31. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    587
    That link should be a never ending invite we've been using for awhile. The same link is on each of our product Store Pages. It appears to work for me but I don't use Discord much so maybe I'm doing something wrong.

    Try to click it from one of our Store Pages maybe: https://assetstore.unity.com/packages/tools/network/match-up-104411
     
  32. meta44

    meta44

    Joined:
    Sep 11, 2018
    Posts:
    23
    I get the same error clicking that link, says the link is invalid or has expired.
     
  33. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    587
    @meta44
    I'm not seeing any issues with the link and we get new people into our Discord each day. I'm not sure what's going wrong unfortunately.
    Here's a separate link that is used for invites: https://discord.gg/6VpgNQg
     
  34. meta44

    meta44

    Joined:
    Sep 11, 2018
    Posts:
    23
    I'm developing an android app that uses Match Up, and I can't seem to retrieve match lists on my android phone. I am using the Google Play Developers Console, with an internal testing track, and I previously had everything working on my phone when the target API was 31.

    I just updated my unity version to 2022.3.9f1 in order to meet new play store requirements of having the target API of 33. Now, when I test the game on my computer running multiple instances, everything works fine, but when I try to connect with my phone, when I call the function:
    matchUp.GetMatchList(OnMatchListReceived, 0, 10, filters, true)

    Then when the callback OnMatchListReceived(bool success, Match[] matchList) is called, success is returned false.

    Any ideas on how I can troubleshoot this issue?

    Also, I'd still like to get into the discord server, but for some reason none of the links are working. Could someone please invite me to the server? My discord username is meta4trev

    Edit: I think the issue might have something to do with Android Permissions. I had previously set a custom launcher manifest in the Publishing Settings, and added the android internet permission to the LauncherManifest.xml file, and that used to work. Now, when the app is installed on my phone and I look at app info, it says "No Permissions Requested". I tried checking "Custom main Manifest" in the publishing settings, and adding the internet permission line the generated AndroidManifest.xml file, but when I rebuilt the game nothing seems to have changed. I also don't know what the difference between Main and Launcher manifests are, and which one I should be using to request permission.
     
    Last edited: Sep 14, 2023
  35. meta44

    meta44

    Joined:
    Sep 11, 2018
    Posts:
    23
    Just had a breakthrough: I had it set up to have both a custom Launcher Manifest AND a custom main Android Manifest, both of which asked for permissions. I tried disabling the Launcher Manifest, and it worked when I tested it on my Android 12 device. I'll test it on an Android 13 device tomorrow, but it's looking promising.

    So, basically, for anyone who wants to use Match Up in an android app, you have to go into Project Settings > Player > Publishing Settings, and under "Build" check "Custom Main Manifest".

    Then, go to the location of the generated AndroidManifest.xml file, and open that in an editor. Then, inside the <manifest> tag (I put it just above the </manifest> at the end), add the line:
    <uses-permission android:name="android.permission.INTERNET"/>

    Save the file and you should be good to go.
     
  36. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    587
    @meta44
    Glad you got it figured out! And thanks for explaining how you solved it! :)
    I'm not sure why the discord links aren't working for you. New people join the discord each day. Unfortunately I don't use discord myself besides for this business so I'm not too comfortable inviting a specific person to the channel in case it sets permissions differently than the links we've been using for years. Maybe try a new account?
     
  37. phdhamster

    phdhamster

    Joined:
    Jun 16, 2020
    Posts:
    12
    Looks like your Discord server has been hacked dude. All the chat channels are locked down and there is a pinned announcement advertising what appears to be obvious malware: https://i.imgur.com/WPu3Jwq.png

    I'd really try to resolve that if you can.
     
  38. Zebadiah

    Zebadiah

    Joined:
    Apr 6, 2014
    Posts:
    67
    Yeah we are aware and working on addressing it. Thanks for the heads up. Sorry about the spam messages. We've been trying to warn people, hopefully this messages saves someone from our fate.
     
  39. Zebadiah

    Zebadiah

    Joined:
    Apr 6, 2014
    Posts:
    67
    New discord is up: https://discord.gg/58ENetmr

    Fresh and clean

    I also have a new account: (whale__whale__whale_38382)

    Anyone still in the old server should leave it and block my old account.

    Sorry for the downtime!
     
  40. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    132
    To start the server via docker, create a Dockerfile and write this content in it:

    Code (CSharp):
    1. # syntax=docker/dockerfile:1
    2. FROM ubuntu:22.04
    3.  
    4. # Set the working directory
    5. WORKDIR /app
    6.  
    7. # install app
    8. COPY MatchUpServer /app/MatchUpServer
    9.  
    10. EXPOSE 20205
    11.  
    12. RUN chmod +x /app/MatchUpServer
    13.  
    14. CMD ["/app/MatchUpServer"]
    15.  
    Run this command to create the image:

    docker build -t matchup:latest .

    Run this command to create the container and start it:

    docker run --name matchup -p 127.0.0.1:20205:20205 -d matchup:latest


    the server is listening locally on port 20205.