I am trying to figure out what the workflow is to connect a client to a server which is running locally as a Linux container. My Game Development program is Unity and I would like to use Netcode for Entities for the Transport protocol. I am having a little difficulty because all of the examples I have found which talk about using Playfab servers locally to test your build are using Mirror for their transport stuff.
Currently I have my bootstrap file:
switch (ClientServerBootstrap.RequestedPlayType)
{
case PlayType.Server:
server = ClientServerBootstrap.CreateServerWorld("ServerWorld");
drvQuery = server.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>());
drvQuery.GetSingletonRW<NetworkStreamDriver>().ValueRW.Listen(ClientServerBootstrap.DefaultListenAddress.WithPort(Port));
drvQuery.Dispose();
World.DefaultGameObjectInjectionWorld ??= server;
break;
case PlayType.Client:
client = ClientServerBootstrap.CreateClientWorld("ClientWorld");
drvQuery = client.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>());
drvQuery.GetSingletonRW<NetworkStreamDriver>().ValueRW.Connect(client.EntityManager, ClientServerBootstrap.DefaultConnectAddress.WithPort(Port));
World.DefaultGameObjectInjectionWorld ??= client;
break;
}
Which I believe works as intended. I then Try to connect my client to the server. I know the server is running correctly because the Docker logs show that the local Playfab server is in the active state. The steps I take to try to connect the client are:
1) authenticate client using LoginWithCustomIDRequest()
2) call RequestMultiplayerServer() using hard-coded values for the BuildID and SessionID which I obtain from the Docker debug logs
3) RequestMultiplayerServer() returns an error stating that the multiplayer server cannot be found.
Is this the correct workflow? Or do I need to connect the client to the server first after the login API call by creating a new Unity Entity and adding the NetworkStreamRequestConnect component to it. I believe this is the Unity Netcode for Entities equivalent to NetworkClient.Connect(networkAddress) in Mirror.
Any help would be greatly appreciated, especially if you have links/ references to using Unity Netcode for Entities in combination with Playfab servers. Thank you!