Indiefreaks.Xna.Sessions.Lidgren.LidgrenSessionManager.FindSessions C# (CSharp) Méthode

FindSessions() public méthode

Sends a Find query on the network interface to look for AvailableSession instances asynchrnously
public FindSessions ( SessionType sessionType, int maxLocalPlayers, SessionProperties sessionProperties ) : void
sessionType SessionType The SessionType we're looking for
maxLocalPlayers int The Maximum local players that can be added to the session used to filter sessions that have a limited number of opened public slots
sessionProperties SessionProperties The SessionProperties that will be used to filter query results. Can be null
Résultat void
        public override void FindSessions(SessionType sessionType, int maxLocalPlayers, SessionProperties sessionProperties)
        {

            if (CurrentSession != null)
                throw new CoreException("Session is already running");

            if (sessionType == SessionType.WideAreaNetwork)
                throw new NotImplementedException("Use FindSessionsWan method instead");

            // Create a temporary session to listen for discovery messages
            CurrentSession = new LidgrenSession(sessionType, maxLocalPlayers, 0, sessionProperties);

            _networkSessionLocker = FindingSessions;
            LidgrenSession.BeginFind(sessionType, maxLocalPlayers, sessionProperties, OnLidgrenSessionsFound, _networkSessionLocker);
        }