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 emreertugrul · Jan 25, 2021 at 01:35 AM · unity3dMatchmakingmultiplayer

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

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??

Comment
Melissa Hanak

People who like this

1 Show 13
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 emreertugrul · Jan 25, 2021 at 07:11 AM 0
Share

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.....

avatar image Citrus Yan emreertugrul · Jan 25, 2021 at 09:19 AM 0
Share

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

avatar image emreertugrul · Jan 25, 2021 at 09:31 AM 0
Share

@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..

avatar image Citrus Yan emreertugrul · Jan 25, 2021 at 09:39 AM 0
Share

OK, so, regarding the authentication error, may I know your title id for further investigation?

avatar image emreertugrul Citrus Yan · Jan 25, 2021 at 10:42 AM 0
Share

Sure, its 7C6FA

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

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

Comment

People who like this

0 Show 2 · 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 pmartinet44 · Jan 30, 2021 at 05:33 PM 0
Share

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 ?

avatar image emreertugrul pmartinet44 · Feb 01, 2021 at 07:01 AM 0
Share

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...

playfab.png (11.9 kB)
avatar image

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!

@emreertugrul

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

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

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    [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

    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