# How to know if the player is signed in?

I was wondering if there's any way to know if the "player" is signed in or not?

Something like this:

if (GamePad.GetState(PlayerIndex.Two).IsConnected && !Gamer.PlayerTwo.IsSignedIn)


So that the controller is connected and it can be used, but the player is not signed in to an account. Something like a guess.

In XNA there is a SignedInGamer class with a SignedInGamer.PlayerIndex member that should tell you just that if you can get a hold of the SignedInGamer object.

To do that, there is the Gamer.SignedInGamers static property which contains a collection of SignedInGamer objects based on the current state of the system. This is from the Microsoft.Xna.Framework.GamerServices namespace.

With this information you could do something like the following:

//If player 2 is connected