Help with lobby/room

Greetings, I’m venturing into multiplayer/networked game development using mirror and starting with a simple room/lobby implementation with a custom UI to learn the basics.

I am using the 2020.1.0b10.3837 version of Unity and grabbed the latest mirror code. I was able to build and run their room and chat examples.

I copied their NetworkRoomManagerExt and NetworkRoomPlayerExt classes into my project and was able to get it working but with the built-in development UI.

I am now trying to retrofit it to use my own custom UI.

I’ve wired the Host Game and Join buttons up to the NetworkRoomManager’s StartHost() and StartClient() methods and that all works great.

The problem arose when I tried to follow the pattern from the Mirror chat example to set the player name.
I added a Player Name property to the NetworkRoomManagerExt class and wired the OnValueChanged event of my player name input field to it.

Then, I added the following overrides:

    public override void OnRoomStartServer()
    {
        base.OnRoomStartServer();
        NetworkServer.RegisterHandler<CreatePlayerMessage>(OnCreatePlayer);
    }

    public override void OnClientConnect(NetworkConnection conn)
    {
        base.OnRoomClientConnect(conn);
        Debug.Log($"OnClientConnect {conn?.connectionId ?? -1}, {conn?.identity?.hasAuthority}, {conn?.identity?.name ?? "null"}");

        // tell the server to create a player with this name
        conn.Send(new CreatePlayerMessage { name = PlayerName });
    }

Note: I originally tried using OnRoomCoientConnect but that gave me this error:

So I tried using OnClientConnect() instead.

This is the result I’m getting:
6098352--662934--upload_2020-7-16_15-25-7.png

I’m struggling to see how to use my custom UI with the room/lobby code I copied from the sample. The sample hides all the UI/Network interaction and I don’t see any good examples of how to replace the built-in developer UI with mine.

Here’s how I’ve layed out my UI:
6098352--662937--upload_2020-7-16_15-26-31.png

The Host Button disables the Panel_Login and IPAddress input sections and calls StartHost().

I’ve actually got past that error but I am still very confused. I realized the Chat example was instantiating the actual game player in OnClientConnect() which is not what I want. Since this is a lobby I want to instantiate the NetworkRoomPlayer.
I know the room player is automatically getting instantiated somehow because I see this on the roommanager GUI:
6098571--662997--upload_2020-7-16_16-48-38.png

In the NetworkRoomManager I see these settings:
6098571--663006--upload_2020-7-16_16-50-50.png

I want to turn off the default GUI and display my own but I need to know how to intercept the creation of the room players so I can set the player names?

Can anyone provide an example of this?

Thanks.

Did you get or found a way to do this?
Thanks

Yeah but it involved me ditching the Mirror sample project and building my own room/lobby system on top of Mirror.

I learned a lot from this guys videos:
https://www.patreon.com/firstgeargames/posts
https://www.youtube.com/channel/UCGIF1XekJqHYIafvE7l0c2A