Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
 /// <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;
         }
     }
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Internal function to create a lobby announcer object.
 /// </summary>
 protected abstract LobbyAnnouncer CreateAnnouncer_i(ILobbyCustomDataProvider customDataProvider);
Esempio n. 5
0
        /// <see cref="LobbyServer.CreateAnnouncer_i"/>
        protected override LobbyAnnouncer CreateAnnouncer_i(ILobbyCustomDataProvider customDataProvider)
        {
            LobbyAnnouncer ann = new LANLobbyAnnouncer(this, customDataProvider, this.wellKnownBroadcastPorts);

            return(ann);
        }
Esempio n. 6
0
 /// <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)
 {
 }