Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by CodeHunter · Jan 12 at 06:13 AM · CloudScriptunity3dMatchmakingmultiplayer

[VERY URGENT] Unity Matchmaking with Mirror cannot connect to server

I'm currently developing a title requiring a matchmaking service to connect two players to fight each other in an arena battle. So far I can call the matchmaking service up until the players are presented with the IP address of the server and port to connect to. Once I get to that part, the message is stuck with 'sending Handshake to other end' even after leaving it for hours. I checked the custom server in PlayFab connected to the matchmaking service and I have 4 standby servers and none of them has players connected.

What went wrong???

I've tried deploying the server build from

https://github.com/PlayFab/MpsSamples. Still cannot connect and stuck on that same message. I tried starting a fresh project with the latest version of Mirror from the Unity Asset Store and copied the server code from the same repo and it's still giving me the same result. I tried putting some code to update the player title data when connected but it's not being called at all because the player isn't connected. I tried using both UDP and TCP but I still can't get the client to connect.

I need some answers and fast!

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by CodeHunter · Jan 26 at 03:58 AM

I've managed to get it to work, even if the design itself still needs fixing on my end.


I'm still not sure why the server API doesn't work on the server when I can call it just fine from the editor, but I already found a workaround for this one.

The things I did to get it to work:

  1. Remove the server API call (I used client API calls from the client side after the server 'tells' the client to do so)
  2. Check when you start the server (I used to call StartServer() twice in a single runtime, from the Awake() function and from agent activation)
  3. The player number count and the Application.Quit() actually works, I just didn't call them on the correct places. The function to update the server about the player change was there already, but I didn't call it.
Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Gosen Gao · Jan 12 at 08:41 AM

I have done a test on that sample, and it works fine for me. Since I don't know the details of how you built the server. Could you please deploy your server build locally by following -- Locally debugging game servers and integration with PlayFab to see if you still have this issue? If you still have the issue, please check some debugging tips here MpsSamples/Debugging.md at master PlayFab/MpsSamples (github.com) and try to confirm the cause of the issue. If it works fine locally, could you tell me how you configure the ports when you create your server build in Game Manager?

Comment

People who like this

0 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CodeHunter · Jan 13 at 04:15 AM 0
Share

I tried debugging locally, except the server won't even run in local. I did put a PlayFab server API call in the server as my way of 'debugging' the server and so far it's the reason why my clients can't connect. I took the call out and the client can connect, but I need the server to be able to call server APIs to push data to players after the match is over (will put in a separate question later).

So far the client is connected, but on the server it still shows 0 players connected. Any reason why, or is this behavior actually expected?

avatar image Gosen Gao CodeHunter · Jan 13 at 06:45 AM 0
Share

When the client is connected successfully, you need to communicate with PlayFab to update the current players‘ info. You can check Giving PlayFab information about your game server for more information. As for calling server API issue, we will talk to you in the new thread you post.

avatar image CodeHunter Gosen Gao · Jan 20 at 03:08 AM 0
Share

Sorry for the late response. I've managed to get the API call working now in local, but I haven't tested it out in live server just yet. I'll take a look at the link you gave me because it's quite important now along with putting the active server to either on standby or terminating it after the game ends. Seems like the server is still active even after I called Application.Quit() after the game ends and I don't want to be billed for the servers I'm no longer using.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    9 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Issue communicating with REST server running on Multiplayer Server 1 Answer

    How to pass data from one player to another in matchmaking? 1 Answer

    [Unity3D] How to retrieve SessionId on Multiplayer Server after Matchmaking succeeded? 2 Answers

    PlayFab + Unity + Mirror - Some guidance would be awesome! 1 Answer

    Unity+Mirror Cant connect to allocated gameserver, cant RDP either! 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges