Indiefreaks.Xna.Sessions.Live.LiveSessionManager.CreateLanSession C# (CSharp) Method

CreateLanSession() public method

Creates a local area network session
it doesn't yet support multiple local players
public CreateLanSession ( int maxPlayers, SessionProperties sessionProperties ) : void
maxPlayers int The total maximum players for this session
sessionProperties SessionProperties The SessionProperties that will be used to find this session on the network. Can be null
return void
        public override void CreateLanSession(int maxPlayers, SessionProperties sessionProperties)
        {
            if (LocalPlayers.Count > 1)
                throw new NotImplementedException();
            if (CurrentSession != null)
                throw new CoreException("A session already exists. Close the previous session first");

            _networkSessionLocker = CreatingSession;

            NetworkSession.BeginCreate(NetworkSessionType.SystemLink, 1, maxPlayers, 0,
                                       LiveSessionProperties.ConvertToLiveSessionProperties(sessionProperties),
                                       OnLiveSessionCreated, _networkSessionLocker);
        }