question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

How do I get the IP/Port of a server from ListMultiplayerServers?

How do I get the IP/Port of a server from ListMultiplayerServers?

I'm trying to implement a 'reconnect' feature where a player can reconnect to their old session in the event that they were disconnected (or their computer crashed).

Currently I'm trying to use ListMultiplayerServers and compare that with the player's saved ServerId to figure out which server he should connect to.

More context: this is a continuation of this thread:

https://community.playfab.com/questions/32283/how-can-you-check-if-a-match-is-finished-given-a-m.html?childToView=32320#answer-32320

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

1 Answer

·
Seth Du avatar image
Seth Du answered

I will reply your previous questions in this thread:

The reason why “Only entities of the following types may call this API: title” occurs is that ListMultiplayerServers API needs a higher permission which is not exposed to players and only administrator is able to make this call. To get a entity token, If you are using RESTful testing tools like Postman, you may simply call GetEntityToken to get. Be aware that you may enter the secret key as value of “X-SecretKey” field in the header and leave out(uncheck) the property “X-Authorization”.

Ps. I will close the previous thread and if you have any other questions, feel free to reply in this thread.

-----

>>get the IP/Port of a server from ListMultiplayerServers

It seems not feasible to do it by the players. The IPV4Address, Ports and Regions are contained in the
ServerDetails
, which is a property of callback result of GetMatch API. When you first call the GetMatch API, I’d suggest you store the details locally.

1 comment
10 |1200

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

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Thanks for the context. I figured out a workaround where I just store the IP/Port as part of a player's Player Data. I'll consider the GetMatch approach (assuming I'd need to store the MatchId and QueueName in the player's Player Data) if this workaround doesn't work.

0 Likes 0 ·

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.