/// <summary> /// Constructs a LobbyLocatorUiCall object. /// </summary> public LobbyLocatorUiCall(ILobbyLocator locatorObj, LobbyLocatorMethod method, LobbyInfo lobbyArg) : base() { this.locatorObj = locatorObj; this.method = method; this.lobbyArg = lobbyArg; }
/// <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; }
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]; }
/// <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); }
/// <summary> /// Constructs a LobbyLocatorMarshal object. /// </summary> public LobbyLocatorMarshal(ILobbyLocator locatorObj, IUiInvoke ui) { this.locatorObj = locatorObj; this.ui = ui; }
/// <see cref="Network.CreateSearcher_i"/> protected override LobbySearcher CreateSearcher_i(ILobbyLocator listener) { return(new LANLobbySearcher(listener, this.wellKnownBroadcastPorts)); }
/// <summary> /// Internal function to create a lobby searcher object. /// </summary> protected abstract LobbySearcher CreateSearcher_i(ILobbyLocator listener);