/// <summary> /// Constructor for a network listener. /// </summary> /// <param name="pluginLoadData">The load data for the listener plugin.</param> public NetworkListener(NetworkListenerLoadData pluginLoadData) : base(pluginLoadData) { Address = pluginLoadData.Address; Port = pluginLoadData.Port; #if PRO MetricsManager = pluginLoadData.MetricsManager; MetricsCollector = pluginLoadData.MetricsCollector; #endif }
/// <summary> /// Load the listener given. /// </summary> /// <param name="type">The plugin type to load.</param> /// <param name="name">The name of the plugins instance.</param> /// <param name="address">The address to listen on.</param> /// <param name="port">The port to listen on.</param> /// <param name="settings">The settings for this plugin.</param> internal NetworkListener LoadNetworkListener(Type type, string name, IPAddress address, ushort port, NameValueCollection settings) { NetworkListenerLoadData loadData = new NetworkListenerLoadData( type.Name, address, port, server, settings, logManager.GetLoggerFor(name) #if PRO , metricsManager.GetMetricsCollectorFor(name) #endif ); return(LoadPlugin(name, type, loadData, null, false)); }
/// <summary> /// Loads the plugins found by the plugin factory. /// </summary> /// <param name="settings">The settings to load plugins with.</param> internal void LoadNetworkListeners(ServerSpawnData.ListenersSettings settings) { foreach (ServerSpawnData.ListenersSettings.NetworkListenerSettings s in settings.NetworkListeners) { NetworkListenerLoadData loadData = new NetworkListenerLoadData( s.Name, s.Address, s.Port, server, s.Settings, logManager.GetLoggerFor(s.Name) #if PRO , metricsManager.GetMetricsCollectorFor(s.Name) #endif ); LoadPlugin(s.Name, s.Type, loadData, null, false); } }