/// <summary> /// Constructs a new lobby announcer object. /// </summary> /// <param name="lobby">The lobby that this object will announce.</param> /// <param name="customDataProvider">The object that provides additional informations to the announcement.</param> public LobbyAnnouncer(LobbyServer lobby, ILobbyCustomDataProvider customDataProvider) { if (lobby == null) { throw new NetworkingSystemException("lobby"); } this.announcedLobby = lobby; this.customDataProvider = customDataProvider; this.announcerThread = null; this.announcementFinished = null; }
/// <see cref="ILobbyServer.StartAnnouncing"/> public void StartAnnouncing(ILobbyCustomDataProvider customDataProvider) { if (this.announcer == null) { this.announcer = CreateAnnouncer_i(customDataProvider); bool success = this.announcer.Start(); if (!success) { this.announcer.Stop(); this.announcer = null; } } }
public LANLobbyAnnouncer(LobbyServer lobby, ILobbyCustomDataProvider customDataProvider, List <int> wellKnownBroadcastPorts) : base(lobby, customDataProvider) { if (wellKnownBroadcastPorts == null || wellKnownBroadcastPorts.Count == 0) { throw new ArgumentNullException("wellKnownBroadcastPorts"); } this.wellKnownBroadcastPorts = new List <int>(); foreach (int port in wellKnownBroadcastPorts) { this.wellKnownBroadcastPorts.Add(port); } }
/// <summary> /// Internal function to create a lobby announcer object. /// </summary> protected abstract LobbyAnnouncer CreateAnnouncer_i(ILobbyCustomDataProvider customDataProvider);
/// <see cref="LobbyServer.CreateAnnouncer_i"/> protected override LobbyAnnouncer CreateAnnouncer_i(ILobbyCustomDataProvider customDataProvider) { LobbyAnnouncer ann = new LANLobbyAnnouncer(this, customDataProvider, this.wellKnownBroadcastPorts); return(ann); }
/// <summary> /// Starts announcing the DSS-lobby on the network created by the local operator. /// </summary> /// <param name="customDataProvider"> /// The object that will generate the custom data package into the announcement. If this parameter is null /// then no custom data will be placed into the announcement. /// </param> /// <remarks>If there is no DSS-lobby created by the local operator then this function has no effect.</remarks> public static void StartAnnouncingDSS(ILobbyCustomDataProvider customDataProvider) { }