Hi,
I've built a game server using Unity+Mirror, tested it locally with container mode as well, using the remove matchmaking service of Playfab. While developing locally, i just used localhost whenever a match was returned to me from the service. Then i uploaded the same zip file, with all the same port configurations to the Multiplayer servers of playfab, and selected this build to be allocated in the MatchMaking queue. As documented, this returns me the allocated server information in the Match object to the client. Then instead of localhost, i use this Ip4 address and the port information to connect to the game server:
Which is straight forward, but it just doesnt connect. Handshake fails and the connection is never successful. Whats more interesting is that the Playfab portal provides RDP connections to servers and game servers, and even these fail with "authentication error". What could i be missing here??
Let me add a comment here, that the same behavior is actually persisting in local container! I cannot connect to the game server thru container by specifying port 56100! It works perfectly when its in process mode and listening on 7777.....
Did you follow these steps before deploying your server to the cloud?
Determining required DLLs for Windows game servers - PlayFab | Microsoft Docs
Locally debugging game servers and integration with PlayFab - PlayFab | Microsoft Docs
@Citrus Yan yes i did, and i actually solved the issue which wasn't playfab related, but something to do with Mirror - which i posted as an answer to this thread.Thanks! One thing that's still missing is the RDP functionality though.. Still giving me authentication errors..
OK, so, regarding the authentication error, may I know your title id for further investigation?
Answer by emreertugrul · Jan 25, 2021 at 09:38 AM
Well, issue resolved!
Here are a few tips if anyone else runs into the same issues.. The first thing that i did was to do a netstat-a on the docker container to see if the 7777 port was open.. and it was, but on UDP! For all this time, i thought KCP Transport - what mirror is using right now (talk about lack of documentation) was on TCP, but no.. it's on UDP. So once i've made the port configuration on the MultiplayerSettings.json to be UDP, the game started connecting to the gameserver on my local container. I then uploaded this gameserver to the playfab, and switch the port there to UDP as well, and viola!
Let me say that i really liked the matchmaking workflow that Playfab is doing, integrating it with the multiplayer servers - the whole session is handled on server-side, which gives you opportunity to make security checks while players are connecting and all, really good flow! I can't say the same for Mirror and Unity though, the lack of good documentation and (no) variety of provided examples really makes it difficult for you to fall into the pit of success!...
Hello,
I had the same issue, and when i saw your post i was sur that it was the cause of my problem. But it stills not work :( .
I tested in local container with this settings :
"PortMappingsList": [ [ { "NodePort": 56100, "GamePort": { "Name": "game_port", "Number": 7777, "Protocol": "UDP" } } ] ],
I have my server project with Kcp Transport on port 7777.
And i have my client project with Kcp Transport on port 56100.
I've the same error, the timeout during the handshake.
Do you have any idea, what i did wrong ?
Hi @pmartinet44, with this setup of mirror+unity there are a million ways things can go wrong.. But in essence, make sure your server (that is derived from class NetworkManager) listens on port 7777 and is started with StartServer() (and is not marked to run on start from unity designer) and use the client like this.. Your port mappings look correct to me...
Answer by Weien Meng · May 14, 2021 at 02:44 AM
{ "RunContainer": false, "OutputFolder": "", "NumHeartBeatsForActivateResponse": 10, "NumHeartBeatsForTerminateResponse": 60, "AgentListeningPort": 56001, "AssetDetails": [ { "MountPath": "C:\\Assets", "LocalFilePath": "E:\\mirror_test\\server1\\server3.zip" } ], "GameCertificateDetails": [], "PortMappingsList": [ [ { "NodePort": 56100, "GamePort": { "Name": "game_port", "Number": 7777, "Protocol": "UDP" } } ] ], "ProcessStartParameters": { "StartGameCommand": ".\\Mirror_test.exe" }, "ContainerStartParameters": { "StartGameCommand": "C:\\Assets\\Mirror_test.exe", "ResourceLimits": { "Cpus": 0, "MemoryGib": 0 }, "ImageDetails": { "Registry": "mcr.microsoft.com", "ImageName": "playfab/multiplayer", "ImageTag": "wsc-10.0.17763.973.1", "Username": "", "Password": "" } }, "SessionConfig": { "SessionId": "ba67d671-512a-4e7d-a38c-2329ce181946", "SessionCookie": null, "InitialPlayers": [ "Player1", "Player2" ] }, "TitleId": "", "BuildId": "00000000-0000-0000-0000-000000000000", "Region": "WestUs" }
Above is my MultiplayerSettings.json
Test locally:
ip set as 127.0.01.
Kcp port set as 7777, connect successfully!
Kcp port set as 56100, handshake Timeout :(
Test on playfab VM:
IP set as returned by RequestMultiplayerServer
Kcp port set as 7777, handshake Timeout :(
Kcp port set as returned by RequestMultiplayerServer, handshake Timeout :(
Please help!
[VERY URGENT] Unity Matchmaking with Mirror cannot connect to server 2 Answers
Where can I find an Android/Unity compatible version of Multiplayer SDK ? 2 Answers
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