question

dev@megapower.games avatar image
dev@megapower.games asked

Unhealthy Server after Upgrade to Unity 2022.3

Reposting from https://community.playfab.com/questions/142503/playfab-unity-20223-dedicated-server-unhealthy-was.html and adding more.

I too updated to 2022 recently, and didn't attempt a new server build until today...

Same issue.

Once 'Allow Downloads over HTTP' was enabled in Unity settings, it seemed to work again (and I had no changes to my code outside of a Playfab SDK upgrade, but I tested without the upgrade too).

That option above does not exist in Unity 2021, but does in 2022 and when I toggled it - the server builds deployed as normal (still need to do some testing but so far appears correct).

Running the MockAgent doesn't yield any issue for me as the server heartbeat works, activates and terminates without issue.

Looking for some clarity here.

Appendix: Unity option - https://docs.unity3d.com/ScriptReference/PlayerSettings-insecureHttpOption.html

unity3d
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

·
Neils Shi avatar image
Neils Shi answered

As Unity - Manual: Windows Player settings (unity3d.com) mentions that the “Allow downloads over HTTP” option indicates whether to allow downloading content over HTTP, and the default option is Not allowed due to the recommended protocol being HTTPS, which is more secure. It seems that this option was added in the Unity 2022 version for the security reason, and PlayFab server needs this option to be enabled .

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

dev@megapower.games avatar image dev@megapower.games commented ·

Right, but i was hoping to see if there was some sort of reasoning behind it. Seems like the server calls would be at some sort of security risk if this would be left unchecked.

Are there calls from playfab server that need to be plaintext, or are only simply http calls?

0 Likes 0 ·
Neils Shi avatar image Neils Shi dev@megapower.games commented ·

Starting from Unity 2022, the Unity do not support HTTP requests by default, if your game tries to send a request over HTTP, and the "Allow downloads over HTTP" option is disabled, Unity may block the request. In the SendHeartBeatRequest() method of PlayFabMultiplayerAgentAPI.cs, it use the UnityWebRequest to send an HTTP POST request to the “_baseUrl” = string.Format("http://{0}/v1/sessionHosts/{1}/heartbeats", _gsdkconfig.HeartbeatEndpoint, _gsdkconfig.SessionHostId) which is an HTTP URL, and if the "Allow downloads over HTTP" option is disabled, this request will be blocked by Unity, so you need to enable this option.

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image Dimitris-Ilias Gkanatsios dev@megapower.games commented ·

The Unity GSDK library calls our VmAgent process (our game server orchestrator) on the local VM to send game heartbeats and related information. This call is a local call (localhost) so the security risk is minimal.

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.