question

Denzie Gray avatar image
Denzie Gray asked

Multiplayer Game Server questions.

I am trying to communicate to a game server using RequestMultiplayerServer in Cloudscript.

When I call the method, I get a response object with the IP address, the Port and FQDN.

I want to use the response object to communicate to the Game Server inside of Cloudscript. I do not want to pass the object to client and have them talk to the game server. I do not need to communicate to the server longer than about 100 MS

If I could accomplish something similar to a 'post' to the server and receive a response I would be done with my migration to PlayFab.

I know some kind of communication is possible since I can send Initial Player and etc to the Request function.

Is there a version for that for arbitrary JSON objects?

How do I talk to the Game server via Cloudscript?

MatchmakingCustom Game Serversmultiplayer
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

·
brendan avatar image
brendan answered

[edited - support for FQDN is part of the Multiplayer Service (MPS), so Web API calls are possible]

I have to back up to correct myself on this, as I wasn't considering that the FQDN is actually available for servers in our Azure hosting. Owing to that, you could indeed make Web API calls to those servers. This would be something we would recommend using Azure Functions Cloud Script (AFCS) for, as legacy Cloud Script cannot be configured to run as a queued function.

So in fact, you have two options: use a UDP/TCP socket connection (using the .Net UdpClient or TcpClient), or a Web API call (using the .Net HttpClient) from the script.

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

Denzie Gray avatar image Denzie Gray commented ·

@Brendan

How would I use Azure Functions Cloud Script to communicate to the GameServer to achieve this?

Separately - Could I call Azure Functions Cloud Script in the legacy version?

EDIT:

What do you mean by 'queued function' ?

Thanks for the response.

0 Likes 0 ·
brendan avatar image brendan ♦♦ Denzie Gray commented ·

In AFCS, you should be able to use the TcpClient class to open a socket connection to the IP/port for the server. I'm not sure what you mean by "call Azure Functions Cloud Script in the legacy version". The legacy Cloud Script and Azure Functions Cloud Script systems are separate. You could call to start an Azure Functions Cloud Script from a legacy Cloud Script, but there would be no point in doing it that way - it would needlessly complicate the flow making debugging difficult, and it would double your execution count and execution time meter costs.

0 Likes 0 ·
Denzie Gray avatar image Denzie Gray brendan ♦♦ commented ·

@Brendan

Ok, so I would send an RPC to the Azure?
Do I still get a similar level of protections as CloudScript?
I was using requestmultiplayer in cloudscript - would I have to call this in Azure?

My plan was to use the http handler in CloudScript to Post/Get a response from the GameServer via the Azure Function URL, you say this is redundant, what should I do instead?

I saw 2 options in the Azure section of the Game Manager but the second one was in another language - what is that option? It was below Http.

Where am I expected to call the Azure Functions?

0 Likes 0 ·
Show more comments
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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]