Example #1
0
        public Server(ILogger <ServerContext> logger, IServerContext context, IServerConstants configConstants, Microsoft.Extensions.Options.IOptions <LoruleOptions> loruleOptions, IObjectManager objectManager)
        {
            _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
            _objectManager = objectManager;

            if (loruleOptions.Value.Location == null)
            {
                return;
            }

            context.InitFromConfig(loruleOptions.Value.Location, loruleOptions.Value.ServerIP);
            _logger.LogInformation($"{configConstants.SERVER_TITLE}: Server Version: {LoruleVersion}.");
            context.Start(configConstants, logger);
        }
Example #2
0
        public Server(ILogger <Server> logger, IServerContext context, IServerConstants configConstants,
                      IOptions <LoruleOptions> loruleOptions)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            if (loruleOptions.Value.Location == null)
            {
                return;
            }

            context.InitFromConfig(loruleOptions.Value.Location);
            _logger.LogInformation($"{configConstants.SERVER_TITLE}: Server Version: {LoruleVersion}.");
            context.Start(configConstants, Log, Error);
        }