Closed1

Unity/PlayFab/MultiPlay

yagi_engyagi_eng

Reference

Overview

https://www.codeproject.com/Articles/5321996/Multiplayer-Is-Easy-with-Unity-on-Azure-PlayFab-Pa
https://www.codeproject.com/Articles/5322002/Multiplayer-is-Easy-with-Unity-on-Azure-PlayFab-2
https://www.codeproject.com/Articles/5322004/Multiplayer-Is-Easy-with-Unity-on-Azure-PlayFab-3
https://www.codeproject.com/Articles/5325095/Unity-on-Azure-PlayFab-Part-3-Setting-Up-a-Multipl
https://www.codeproject.com/Articles/5325096/Unity-on-Azure-PlayFab-Part-4-Setting-Up-a-Multipl

Details

https://docs.unity3d.com/Packages/com.unity.transport@0.3/manual/workflow-client-server.html#server-update-loop
https://docs.unity3d.com/Packages/com.unity.transport@1.0/api/Unity.Networking.Transport.DataStreamWriter.html
https://github.com/PlayFab/MpsSamples/blob/main/UnityMirror/UnityServer/Assets/Server/Scripts/AgentListener.cs

As the com.unity.transport package uses the Unity C# Job System internally, the m_Driver has a ScheduleUpdate method call. Inside our Update loop you need to make sure to call the Complete method on the JobHandle that is returned, in order to know when you are ready to process any updates.

codes after networkDriver.ScheduleUpdate().Complete() isn't executed until network init is completed.

Worklog

Error

"Could not save compressapidata because PlayFabSettings could not be found." endless warning spam, Editor extension unusable

A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

https://www.codeproject.com/Articles/5322004/Multiplayer-Is-Easy-with-Unity-on-Azure-PlayFab-3q

To import the GSDK into the game, drag and drop the MultiplayerAgent folder into your Unity project’s Assets/PlayFabSDK folder.

it caused following error on Unity.
it disappeared on Part4 for some reasons.

Building the Project into a Server Executable

We do this by opening File > Build Settings, enabling the Server Build checkbox, and clicking Build. This action creates a non-graphical, server-only project version that we can upload to run on PlayFab’s virtual machines.

cannot find the Server Build checkbox on my mac, so use Dedicated Server instead.

NullReferenceException: Object reference not set to an instance of an object

TIPS

Allow client to start games

Before we dive into the Client script code, we need to enable an API setting for testing purposes. We click the gear icon on the Dashboard, go to Title settings and navigate to the API Features tab. Then we select the Allow client to start games checkbox and click Save. This flag is just for testing purposes and shouldn’t be enabled for publicly launched games.

このスクラップは2023/01/05にクローズされました