Ejemplo n.º 1
0
 /// <summary>
 /// Constructs a LobbyLocatorUiCall object.
 /// </summary>
 public LobbyLocatorUiCall(ILobbyLocator locatorObj, LobbyLocatorMethod method, LobbyInfo lobbyArg)
     : base()
 {
     this.locatorObj = locatorObj;
     this.method     = method;
     this.lobbyArg   = lobbyArg;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a LobbyListener object.
        /// </summary>
        /// <param name="locator">
        /// A listener object that will be notified about the lobbies announced on the network.
        /// </param>
        public LobbySearcher(ILobbyLocator locator)
        {
            if (locator == null)
            {
                throw new ArgumentNullException("locator");
            }

            this.locator        = locator;
            this.collectedInfos = new Dictionary <Guid, LobbyInfo>();
            this.timers         = new Dictionary <Guid, Stopwatch>();
            this.searcherThread = null;
            this.searchFinished = null;
        }
Ejemplo n.º 3
0
        public LANLobbySearcher(ILobbyLocator listener, List <int> wellKnownBroadcastPorts)
            : base(listener)
        {
            if (wellKnownBroadcastPorts == null || wellKnownBroadcastPorts.Count == 0)
            {
                throw new ArgumentNullException("wellKnownBroadcastPorts");
            }

            this.wellKnownBroadcastPorts = new List <int>();
            foreach (int port in wellKnownBroadcastPorts)
            {
                this.wellKnownBroadcastPorts.Add(port);
            }
            this.buffer = new byte[NetworkingSystemConstants.ANNOUNCEMENT_UDP_POCKET_SIZE];
        }
Ejemplo n.º 4
0
        /// <see cref="INetwork.StartLocatingLobbies"/>
        public bool StartLocatingLobbies(ILobbyLocator locator)
        {
            if (this.closed)
            {
                throw new ObjectDisposedException("Network");
            }
            if (locator == null)
            {
                throw new ArgumentNullException("listener");
            }

            if (this.searcher == null)
            {
                this.searcher = CreateSearcher_i(locator);
                bool success = this.searcher.Start();
                if (!success)
                {
                    this.searcher.Stop();
                    this.searcher = null;
                }
                return(success);
            }
            return(false);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs a LobbyLocatorMarshal object.
 /// </summary>
 public LobbyLocatorMarshal(ILobbyLocator locatorObj, IUiInvoke ui)
 {
     this.locatorObj = locatorObj;
     this.ui         = ui;
 }
Ejemplo n.º 6
0
 /// <see cref="Network.CreateSearcher_i"/>
 protected override LobbySearcher CreateSearcher_i(ILobbyLocator listener)
 {
     return(new LANLobbySearcher(listener, this.wellKnownBroadcastPorts));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Internal function to create a lobby searcher object.
 /// </summary>
 protected abstract LobbySearcher CreateSearcher_i(ILobbyLocator listener);