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!
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:
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?
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?
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.
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.
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