how to find out if player hosted game

Sounds like a stupid question, but…
I have no idea how to find out.
Looking for C# to find out if a player has hosted or connected to a game.

I think the simplest way to do this is to use a value which stores the player’s id - obviously only set it when it is empty, so only the first joined player can be stored.