question

Nachiketa Savant avatar image
Nachiketa Savant asked

Playfab + Unity Mirror - OnServerReady is not getting triggered

Hello,

I am developing MP game with Unity + Mirror + Playfab MPS service and Match making. The game follows normal flow, where each game logs into playfab and then land into a lobby. Once each player is ready, game is started and player prefab are instantiated. Game runs perfectly in Standalone and Server only mode (Server and remote clients) with Mirror, but same setup using Playfab MPS service stops at ClientNetworkManager.OnClientSceneChanged. Digging into mirror libraries client network manager is invoking NetworkClient.Ready() function and even sends following message

// Tell server we're ready to have a player object spawned connection.Send(new ReadyMessage());

However it fails to invoke public override void OnServerReady(NetworkConnection conn) which will then initiate process to add players.

The game port is set to 7777 and there is another port that routes to 7777 as per normal playfab support.

sequence of functions is as follows:

Server --> NetworkRoomPlayerExt.CmdStartGame

Server -->startGame

Server -->ServerChangeScene

Client --> OnStopClient (Switch from room to game player)

Client --> NetworkGamePlayerExt.OnStartClient

Client --> OnClientNotReady

Client --> OnClientChangeScene

Server -->OnServerSceneChanged

Server -->OnStartServer

client --> OnClientSceneChanged

This is what not happening with playfab, but works with Mirror only server mode.

Server --> OnServerReady

Server --> SpawnPlayer

game manager
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

·
Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.