question

Krzysztof Krawczyk avatar image
Krzysztof Krawczyk asked

How to connect to a DarkRift server hosted on PlayFab?

Hi,
I'm making a Real-Time-Strategy game in Unity, using DarkRift as an authoritative server, hosted on PlayFab. Unity is only used as a client for rendering and input.
For now I am able to connect and play using PlayFab's Matchmaking only, as it returns an IP address and ports to connect to. However I don't want to use Matchmaking, as I'd like to create a lobby with rooms that the client can join. On starting the game, player will see a list with all rooms created by other players and can either join an existing one or create a new one - popular solution.
For that I imagine I can write a DarkRift plugin that would keep track of all rooms and players in them and when the players click "Play" it would RequestMultiplayerServer() from PlayFab and send new IP and ports to the players to connect there.
In the given scenario, how would I connect to my DarkRift server to see the lobby, before a MultiplayerServer is requested? I need an IP and a port for that.

Is my way of thinking even correct? Can I have the same PlayFab's VM run the lobby, as well as multiple game instances?

Basically I need a way to connect to my server .exe after logging in (for instance with LoginWithCustomID) and before the players are matched

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

·
Rick Chen avatar image
Rick Chen answered

>> In the given scenario, how would I connect to my DarkRift server to see the lobby, before a MultiplayerServer is requested? I need an IP and a port for that.

DarkRift is not a service of PlayFab, I am not an expert in DarkRift. Please reach out to the DarkRift Team for feedback.

>> Can I have the same PlayFab's VM run the lobby, as well as multiple game instances?

No, Lobby-like feature is not supported by Multiplayer Server 2.0 and it could be high resource consuming for the PlayFab Multiplayer Server acting as a lobby system, because the lobby could be hanging. You could refer to this document Building Lobbies with Azure PlayFab and check the example implementation for creating, browsing, and searching lobbies, along with joining an existing lobby.

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.

Krzysztof Krawczyk avatar image Krzysztof Krawczyk commented ·

I know how to connect with DarkRift, but I need an IP and a port to pass in. How can I grab those without using Matchmaking?

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Krzysztof Krawczyk commented ·

Sorry for the late reply. If you need the PlayFab multiplayer server IP and ports for players to play the game, you could use the RequestMultiplayerServer API to skip the matchmaking and request a PlayFab server directly and get the IP and ports after all players in the lobby agree to play, as you mentioned in your origin post. I am not sure what you were asking. As I understand, you are using the DarkRift server as the lobby system, if you want to show the players a list of lobbies, they should be the DarkRift server’s IPs and ports that you want to retrieve, and we don’t have suggestions on how to retrieve the DarkRift server’s IPs and ports.

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ Krzysztof Krawczyk commented ·

Basically, the custom lobby system should not be hosted in PlayFab. In the sample Rick mentioned, the lobby system is implemented with Azure Function and Cosmos DB, see https://github.com/southworks/playfab-samples/tree/master/multiplayer-tic-tac-toe#support-match-lobby.

PlayFab will support Lobby feature later this year, see PlayFab Roadmap - PlayFab | Microsoft Docs. If you do not want to create a custom lobby system, please keep an eye on PlayFab Blog and Roadmap.

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.