question

sharkraceclub avatar image
sharkraceclub asked

request server works from client but list of active servers don't?

So I called RequestMultiplayerServer and it worked one time, when Stand-By server moved to Active. Then It started to tell me that limit is reached (I set 1 server only), okay.

So I thought that I need first to check servers list or since I have only one I can try GetMultiplayerServerDetails to get active and connect to it (by SessionID, how can I know session ID? Is it same parameter I set to RequestMultiplayerServer?) But I can not do that, it saying that only "title" entity could do that request. And it looks like I need to execute cloud script and get result of this action?

Two questions: first - is it correct? second - WHY? Why I can't just get IP of servers on client and connect?

multiplayer
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

·
Xiao Zha avatar image
Xiao Zha answered

>> So I called RequestMultiplayerServer and it worked one time, when Stand-By server moved to Active. Then It started to tell me that limit is reached (I set 1 server only), okay.

Since you set Max server to 1, so when there is already an active server, calling ReqeustMultiplayerServer to request another server will fail.

>> So I thought that I need first to check servers list or since I have only one I can try GetMultiplayerServerDetails to get active and connect to it (by SessionID, how can I know session ID? Is it same parameter I set to RequestMultiplayerServer?) But I can not do that, it saying that only "title" entity could do that request. And it looks like I need to execute cloud script and get result of this action? Why I can't just get IP of servers on client and connect?

You can get the Ip and Port on client with API ReqeustMultiplayerServer, it will return the server detail info in its response. If you want to get the server info somewhere else, then you are correct, you need to call GetMultiplayerServerDetails with Cloud Script. And the parameter session id is same as when you created the server.

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

sharkraceclub avatar image sharkraceclub commented ·

I don't think you get my point - I can get IP + port with RequestMultiplayerServer only once when server is set from Stand By to Active, if servers already is Active I will receive an error - not enough servers etc. But I can do that from CLIENT!

What I can not do - is do get same server IP from client for ACTIVE server with GetMultiplayerServerDetails. For that I need to run cloud script, why functions with same logic needs so different approaches????

0 Likes 0 ·
itsjustnils avatar image itsjustnils sharkraceclub commented ·

If you'd keep the build id and session id somewhere and use it to RequestMultiplayerServer, you'll get the same server back, even when it's active.

0 Likes 0 ·
sharkraceclub avatar image sharkraceclub commented ·

Also Matchmaking works from client, it returns IP of server at the end too. Without any cloud script. It will be so good if I can only be possible to connect to server without any cloud scripts, just API calls.

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao sharkraceclub commented ·

You can connect to the server without calling any Cloud Script, after calling RequestMultiplayerServer, you can connect to the server directly with the IP and port info. Then you can store this info in case you want to use it somewhere else. Just like how you store the SessionId.

In common, if you want to use RequestMultiplayerServer to start the server, then other players need to get the server information through the server applicant. Because they don't know anything about this server, including IP, port and sessionid.

For example, If client A has started the server with RequestMultiplayerServer, and client B want to join the game, then client A should tell client B the Port and IP for connection. There should be no need to call GetMultiplayerServerDetails within a Cloud Script for any client, since if they can know the sessionid to call this API, they should also have the ability to know the IP and port.

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.