I am trying to implement what I thought was the simplest, default way of joining multiplayer games:
1. client connects, if there are no multiplayer sessions running it creates one
2. if one already exists it joins that
- no consideration to stats, teams, skills or any kind of advanced matchmaking are required.
- the official playfab sample doesn't do this, as every time it runs it attempts to create a new server:
https://github.com/PlayFab/gsdkSamples/tree/master/WindowsRunnerCSharp
So after searching the forums I found this thread:
https://community.playfab.com/questions/39583/mutliplayer-how-to-get-servers-to-join-to.html
- here, someone recommended that I make the following 3 consecutive calls:
1. Call ListBuildSummaries
2. Call ListMultiplayerServers
3. Call RequestMultiplayerServer
- I tried this, but ListMultiplayerServers cannot be called from the client. One of the PlayFab techs in another thread:
https://community.playfab.com/questions/39941/how-to-use-listmultiplayerservers-in-a-game-client.html
- suggested that I use Cloudscript for this. So I am off to the Cloudscript tutorial. On the page "Writing custom cloudscript":
https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript/writing-custom-cloudscript
- it says that the 'server' object "Has access to all server-side API calls listed in the PlayFab API reference documentation."
Great! I head over to that page to look for ways how to call ListMultiplayerServers, but there is no documentation for Javascript, only for REST web requests. I tried to guess the correct function name and the object hierarchy to call:
I tried calling server.ListMultiplayerServers(). This returned an error informing me that 'server.ListBuildSummaries is not a function'.
Please help. And please write documentation for your software, as I am literally spending my time guessing how to call remote javascript functions...