question

Robyn To avatar image
Robyn To asked

RequestMultiplayerServer API is returning same VM Port/IP for different Session IDs

My team is getting new behavior from existing code where RequestMultiplayerServer API is returning the same VM and Port/IP for two different session IDs. We are getting players joined to the same server when there are expected to be two different servers.

I am not sure if this is a new bug or if there is some expected behavior here.

Request from Player 1:

 [2024.01.05-22.08.35:655][759]LogBleOnline: RequestMultiplayerServer PlayFabRequest: {"BuildId":"350b2087-b530-4fca-b5bd-d0a65ce39978","InitialPlayers":["A95B495792C3C222"],"PreferredRegions":["WestUs"],"SessionId":"19EA35B74FEA1E2459BD7882397C09B4"}
 [2024.01.05-22.08.35:788][764]LogBleOnline: RequestMediumServer Success PlayFabResponse: {"BuildId":"350b2087-b530-4fca-b5bd-d0a65ce39978","FQDN":"dns5301d-68a62f15-8cf1-4c8a-abaf-6855eeae5fa7.westus.cloudapp.azure.com","IPV4Address":"23.99.94.26","Ports":[{"Name":"gameport","Num":30000,"Protocol":"UDP"}],"PublicIPV4Addresses":[{"FQDN":"dns5301d-68a62f15-8cf1-4c8a-abaf-6855eeae5fa7.westus.cloudapp.azure.com","IpAddress":"23.99.94.26","RoutingType":"Microsoft"}],"Region":"WestUs","ServerId":"4949f08e1813b5b72aad07d50c87ce067da73baa384ff709e8e2bf80c88c788c","SessionId":"19ea35b7-4fea-1e24-59bd-7882397c09b4","State":"Active","VmId":"vmss:WestUs:5301D_68a62f15-8cf1-4c8a-abaf-6855eeae5fa7:a5472ac4-f2aa-4c48-8796-7cd2f5f0c5e7"}

Request from Player 2:

 [2024.01.05-22.07.28:004][731]LogBleOnline: RequestMultiplayerServer PlayFabRequest: {"BuildId":"350b2087-b530-4fca-b5bd-d0a65ce39978","InitialPlayers":["8D9395328910C5D"],"PreferredRegions":["WestUs"],"SessionId":"6A4D59CA494690D605889A960FF006A1"}
 [2024.01.05-22.07.28:237][739]LogBleOnline: RequestMediumServer Success PlayFabResponse: {"BuildId":"350b2087-b530-4fca-b5bd-d0a65ce39978","FQDN":"dns5301d-68a62f15-8cf1-4c8a-abaf-6855eeae5fa7.westus.cloudapp.azure.com","IPV4Address":"23.99.94.26","LastStateTransitionTime":"2024-01-05T22:04:24.007Z","Ports":[{"Name":"gameport","Num":30000,"Protocol":"UDP"}],"PublicIPV4Addresses":[{"FQDN":"dns5301d-68a62f15-8cf1-4c8a-abaf-6855eeae5fa7.westus.cloudapp.azure.com","IpAddress":"23.99.94.26","RoutingType":"Microsoft"}],"Region":"WestUs","ServerId":"552ccc32d92aed9d99bfe515ca59a3349923c2f13c5a8254d3fbfc3625f61d38","SessionId":"6a4d59ca-4946-90d6-0588-9a960ff006a1","State":"Active","VmId":"vmss:WestUs:5301D_68a62f15-8cf1-4c8a-abaf-6855eeae5fa7:a5472ac4-f2aa-4c48-8796-7cd2f5f0c5e7"}
apisCustom Game Servers
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Xiao Zha avatar image
Xiao Zha answered

The IP is the public IPv4 address of the virtual machine that is hosting the server instances, so the IP could be the same when your server instances request from the same virtual machine. However, the Port should be the server instance uses, If the two server instances requested by player1 and player2 are active at the same time, the ports of the two server instances should not be the same. Once a server instance is terminated, the port it occupied will be released and may be used by a new server instance. In this case, the new server instance could have the same IP and Port as the terminated server instance. You may check the status of the server instances in GameManager to see if there are two server instances active at the same time with the same port.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Robyn To avatar image Robyn To commented ·

Is it possible for the RequestMultiplayerServices API to return a 200 for both requests if the first request hasn't reserved the Port/IP?

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha Robyn To commented ·

If the “return a 200 for both requests” means return 2 server instances, the first request hasn't reserved the Port/IP won’t affect the request of new server instance. The RequestMultiplayerServer API will return a new server instance before the number of active server instance reach the Maximum.

0 Likes 0 ·
Robyn To avatar image
Robyn To answered

hi @Xiao Zha my team ran into this again. This time I had two groups of players 3 minutes apart requesting a server and were sent to same IP/Port.

Is there a suggested workaround?

 [2024.01.16-21.14.49:747][ 48]LogBleOnline: RequestMultiplayerServer PlayFabRequest: {"BuildAliasParams":{"AliasId":"5dbb4644-b4a4-44da-9438-041971cd12e8"},"InitialPlayers":["40290FF3C4A48F66 (DSU)","19092E36F451B7B4 (COYOTE)","2E6C3E1D5668618E (EVAN)","39A6074AED09ED6C (Waltsabi)"],"PreferredRegions":["WestUs"],"SessionId":"0601C92E4B3DC2B8A2390684B0023E7A"}
    
 [2024.01.16-21.14.49:946][ 55]LogBleOnline: RequestMediumServer Success PlayFabResponse: {"BuildId":"4900d38b-ed6c-4ab5-97cf-5b2cd53126a6","FQDN":"dns5301d-d939981d-c7df-442c-9b72-4d05795676d0.westus.cloudapp.azure.com","IPV4Address":"20.253.175.37","Ports":[{"Name":"gameport","Num":30005,"Protocol":"UDP"}],"PublicIPV4Addresses":[{"FQDN":"dns5301d-d939981d-c7df-442c-9b72-4d05795676d0.westus.cloudapp.azure.com","IpAddress":"20.253.175.37","RoutingType":"Microsoft"}],"Region":"WestUs","ServerId":"c1296e5c366f425eebdbc957654c3baed95873948c2c93362449858a978641cf","SessionId":"0601c92e-4b3d-c2b8-a239-0684b0023e7a","State":"Active","VmId":"vmss:WestUs:5301D_d939981d-c7df-442c-9b72-4d05795676d0:6e9fae8f-15b3-4aa4-9710-b78e8ec4ae9b"}
    
 ------------------------------------------------------------------------------
    
    
 [2024.01.16-21.11.08:123][104]LogBleOnline: RequestMultiplayerServer PlayFabRequest: {"BuildId":"4900d38b-ed6c-4ab5-97cf-5b2cd53126a6","InitialPlayers":["BCE7193BFCC1E4D1 (caryn)","4D6C2B73C2AEB383 (serena3)","26828D3004358480 (jettin to palmetto)","F67D5FF56E91113C (KentAgain)"],"PreferredRegions":["WestUs"],"SessionId":"8DA00F124B7FEB4A4DAD4AA6F1EA9A0A"}
    
    
 [2024.01.16-21.11.08:327][111]LogBleOnline: RequestMediumServer Success PlayFabResponse: {"BuildId":"4900d38b-ed6c-4ab5-97cf-5b2cd53126a6","FQDN":"dns5301d-d939981d-c7df-442c-9b72-4d05795676d0.westus.cloudapp.azure.com","IPV4Address":"20.253.175.37","Ports":[{"Name":"gameport","Num":30005,"Protocol":"UDP"}],"PublicIPV4Addresses":[{"FQDN":"dns5301d-d939981d-c7df-442c-9b72-4d05795676d0.westus.cloudapp.azure.com","IpAddress":"20.253.175.37","RoutingType":"Microsoft"}],"Region":"WestUs","ServerId":"9f15d22ec01844986cf987cf9c3856aa07113770fc524d70510afd94884fa9d8","SessionId":"8da00f12-4b7f-eb4a-4dad-4aa6f1ea9a0a","State":"Active","VmId":"vmss:WestUs:5301D_d939981d-c7df-442c-9b72-4d05795676d0:6e9fae8f-15b3-4aa4-9710-b78e8ec4ae9b"}
12 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Robyn To avatar image Robyn To commented ·

The expected outcome is for two servers to spin up, these players were all playing around the same time but with the requests 3 min apart

0 Likes 0 ·
Dimitris Gkanatsios avatar image Dimitris Gkanatsios Robyn To commented ·

In the response we can see that the server ID is different, any chance the first server crashed, the system brought one in StandingBy and the second RequestMultiplayerServer converted it to Active?

1 Like 1 ·
Robyn To avatar image Robyn To Dimitris Gkanatsios commented ·

I can check for that next time it happens, the logs expired out of the archive

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.