Пример #1
0
 /// <summary>
 ///     Creates a new ServerRegistryConnectorManager.
 /// </summary>
 /// <param name="server">The server that owns this manager.</param>
 /// <param name="pluginFactory">The server's plugin factory.</param>
 /// <param name="logManager">The server's log manager.</param>
 /// <param name="metricsManager">The server's metrics manager.</param>
 internal ServerRegistryConnectorManager(DarkRiftServer server, PluginFactory pluginFactory, LogManager logManager, MetricsManager metricsManager)
 {
     this.server         = server;
     this.pluginFactory  = pluginFactory;
     this.logManager     = logManager;
     this.metricsManager = metricsManager;
 }
 /// <summary>
 ///     Creates a new ExtendedPluginManagerBase.
 /// </summary>
 /// <param name="server">The server that owns this plugin manager.</param>
 /// <param name="dataManager">The server's datamanager.</param>
 /// <param name="pluginFactory">The server's plugin factory.</param>
 /// <param name="logger">The logger for this manager.</param>
 internal ExtendedPluginManagerBase(DarkRiftServer server, DataManager dataManager, PluginFactory pluginFactory, Logger logger)
     : base(server, dataManager, pluginFactory)
 {
     this.server      = server;
     this.dataManager = dataManager;
     this.logger      = logger;
 }
Пример #3
0
        /// <summary>
        ///     Creates a new log manager.
        /// </summary>
        /// <param name="server">The server we belong to.</param>
        /// <param name="settings">The settings to load writers from.</param>
        internal LogManager(DarkRiftServer server, ServerSpawnData.LoggingSettings settings)
        {
            this.server = server;

            //Load default writer
            LogWriter writer = new DefaultWriter(new LogWriterLoadData("Initial", server, new NameValueCollection(), GetLoggerFor(nameof(DefaultWriter))));

            //Set this writer to be used for everything but trace
            logWriters = new LogWriter[] { writer };
            if (settings.StartupLogLevels != null)
            {
                writerMatrix = new LogWriter[][]
                {
                    settings.StartupLogLevels.Contains(LogType.Trace) ? logWriters : new LogWriter[0],
                    settings.StartupLogLevels.Contains(LogType.Info) ? logWriters : new LogWriter[0],
                    settings.StartupLogLevels.Contains(LogType.Warning) ? logWriters : new LogWriter[0],
                    settings.StartupLogLevels.Contains(LogType.Error) ? logWriters : new LogWriter[0],
                    settings.StartupLogLevels.Contains(LogType.Fatal) ? logWriters : new LogWriter[0]
                };
            }
            else
            {
                writerMatrix = new LogWriter[][]
                {
                    new LogWriter[0],
                    logWriters,
                    logWriters,
                    logWriters,
                    logWriters
                };
            }
        }
        /// <summary>
        ///     Creates a new NetworkListenerManager.
        /// </summary>
        /// <param name="server">The server that owns this plugin manager.</param>
        /// <param name="logManager">The server's log manager.</param>
        /// <param name="dataManager">The server's datamanager.</param>
        /// <param name="pluginFactory">The server's plugin factory.</param>
        internal NetworkListenerManager(DarkRiftServer server, LogManager logManager, DataManager dataManager, PluginFactory pluginFactory)
#endif
            : base(server, dataManager, pluginFactory)
        {
            this.logManager = logManager;
#if PRO
            this.metricsManager = metricsManager;
#endif
            this.server = server;
        }
Пример #5
0
        internal PluginBaseLoadData(string name, DarkRiftServer server, NameValueCollection settings, Logger logger)
            : this(name, settings, server.ServerInfo, server.ThreadHelper)
        {
#pragma warning disable CS0618 // Type or member is obsolete
            DatabaseManager = server.DatabaseManager;
#pragma warning restore CS0618 // Type or member is obsolete
            Dispatcher = server.Dispatcher;
            LogManager = server.LogManager;
            Logger     = logger;
            Server     = server;
        }
Пример #6
0
        /// <summary>
        ///     Creates a new PluginManager.
        /// </summary>
        /// <param name="server">The server that owns this plugin manager.</param>
        /// <param name="dataManager">The server's datamanager.</param>
        /// <param name="logManager">The server's log manager.</param>
        /// <param name="pluginFactory">The server's plugin factory.</param>
        /// <param name="logger">The logger for this manager.</param>
        internal PluginManager(DarkRiftServer server, DataManager dataManager, LogManager logManager, PluginFactory pluginFactory, Logger logger)
#endif
            : base(server, dataManager, pluginFactory, logger)
        {
            this.server      = server;
            this.dataManager = dataManager;
            this.logManager  = logManager;
#if PRO
            this.metricsManager = metricsManager;
#endif
            this.pluginFactory = pluginFactory;
        }
Пример #7
0
        /// <summary>
        ///     Creates a new plugin base using the given plugin load data.
        /// </summary>
        /// <param name="pluginLoadData"></param>
        public PluginBase(PluginBaseLoadData pluginLoadData)
        {
            this.Name = pluginLoadData.Name;
#pragma warning disable CS0618 // Type or member is obsolete
            this.DatabaseManager = pluginLoadData.DatabaseManager;
#pragma warning restore CS0618 // Type or member is obsolete
            this.Dispatcher   = pluginLoadData.Dispatcher;
            this.ServerInfo   = pluginLoadData.ServerInfo;
            this.ThreadHelper = pluginLoadData.ThreadHelper;
            this.LogManager   = pluginLoadData.LogManager;
            this.Logger       = pluginLoadData.Logger;
            this.Server       = pluginLoadData.Server;
        }
Пример #8
0
        internal ExtendedPluginBaseLoadData(string name, DarkRiftServer server, NameValueCollection settings, Logger logger
#if PRO
                                            , MetricsCollector metricsCollector
#endif
                                            )
            : base(name, server, settings, logger)
        {
#pragma warning disable CS0618 // Implementing obsolete functionality
            if (logger != null)
            {
                WriteEventHandler = logger.Log;
            }
#pragma warning restore CS0618

#if PRO
            this.MetricsManager = server.MetricsManager;
            MetricsCollector    = metricsCollector;
#endif
        }
Пример #9
0
        internal PluginLoadData(string name, DarkRiftServer server, NameValueCollection settings, Logger logger,
#if PRO
                                MetricsCollector metricsCollector,
#endif
                                string resourceDirectory)
            : base(name, server, settings, logger
#if PRO
                   , metricsCollector
#endif
                   )
        {
            this.ClientManager          = server.ClientManager;
            this.PluginManager          = server.PluginManager;
            this.NetworkListenerManager = server.NetworkListenerManager;
#if PRO
            this.ServerRegistryConnectorManager = server.ServerRegistryConnectorManager;
            this.RemoteServerManager            = server.RemoteServerManager;
#endif
            this.ResourceDirectory = resourceDirectory;
        }
        internal NetworkListenerLoadData(string name, IPAddress address, ushort port, DarkRiftServer server, NameValueCollection settings, Logger logger
#if PRO
                                         , MetricsCollector metricsCollector
#endif
                                         )
            : base(name, server, settings, logger
#if PRO
                   , metricsCollector
#endif
                   )
        {
            this.Address = address;
            this.Port    = port;
            this.NetworkListenerManager = server.NetworkListenerManager;
        }
 internal LogWriterLoadData(string name, DarkRiftServer server, NameValueCollection settings, Logger logger)
     : base(name, server, settings, logger)
 {
 }
Пример #12
0
 /// <summary>
 ///     Creates a new server registry connector.
 /// </summary>
 /// <param name="serverRegistryConnectorLoadData">The data to load the connector with.</param>
 public ServerRegistryConnector(ServerRegistryConnectorLoadData serverRegistryConnectorLoadData) : base(serverRegistryConnectorLoadData)
 {
     server = serverRegistryConnectorLoadData.Server;
     ServerRegistryConnectorManager = serverRegistryConnectorLoadData.ServerRegistryConnectorManager;
     RemoteServerManager            = serverRegistryConnectorLoadData.RemoteServerManager;
 }
 /// <summary>
 ///     Creates a new NetworkListenerManager.
 /// </summary>
 /// <param name="server">The server that owns this plugin manager.</param>
 /// <param name="logManager">The server's log manager.</param>
 /// <param name="dataManager">The server's datamanager.</param>
 /// <param name="pluginFactory">The server's plugin factory.</param>
 /// <param name="metricsManager">The server's metrics manager.</param>
 internal NetworkListenerManager(DarkRiftServer server, LogManager logManager, MetricsManager metricsManager, DataManager dataManager, PluginFactory pluginFactory)
Пример #14
0
 /// <summary>
 ///     Creates a new PluginManagerBase.
 /// </summary>
 /// <param name="server">The server we are part of.</param>
 /// <param name="dataManager">The server's data manager.</param>
 /// <param name="pluginFactory">The server's plugin factory.</param>
 internal PluginManagerBase(DarkRiftServer server, DataManager dataManager, PluginFactory pluginFactory)
 {
     this.server        = server;
     this.dataManager   = dataManager;
     this.pluginFactory = pluginFactory;
 }
Пример #15
0
 internal ServerRegistryConnectorLoadData(string name, DarkRiftServer server, NameValueCollection settings, Logger logger, MetricsCollector metricsCollector)
     : base(name, server, settings, logger, metricsCollector)
 {
     this.ServerRegistryConnectorManager = server.ServerRegistryConnectorManager;
     this.RemoteServerManager            = server.RemoteServerManager;
 }
Пример #16
0
 /// <summary>
 ///     Creates a new PluginManager.
 /// </summary>
 /// <param name="server">The server that owns this plugin manager.</param>
 /// <param name="dataManager">The server's datamanager.</param>
 /// <param name="logManager">The server's log manager.</param>
 /// <param name="pluginFactory">The server's plugin factory.</param>
 /// <param name="logger">The logger for this manager.</param>
 /// <param name="metricsManager">The server's metrics manager.</param>
 internal PluginManager(DarkRiftServer server, DataManager dataManager, LogManager logManager, MetricsManager metricsManager, PluginFactory pluginFactory, Logger logger)