Esempio n. 1
0
        public override void StartServer(SocketConfig socketConfig)
        {
            if (IsMasterRunning)
            {
                return;
            }
            base.StartServer(socketConfig);

            IsMasterRunning = true;
            MasterStarted?.Invoke(this);
        }
        public override void StartServer(int port)
        {
            if (IsRunning)
            {
                return;
            }

            Logger.Debug("Starting on port: " + port + "...");

            base.StartServer(port);

            Logger.Info("Started on port: " + port);

            // Notify about uninitialized modules
            var uninitializedModules = GetUninitializedModules();

            if (uninitializedModules.Count > 0)
            {
                Logger.Warn("Some of the Master Server modules failed to initialize: \n" +
                            string.Join(" \n", uninitializedModules.Select(m => m.GetType().ToString()).ToArray()));
            }

            // Notify about initialized modules
            if (Logger.IsLogging(LogLevel.Debug))
            {
                Logger.Warn("Successfully initialized modules: \n" +
                            string.Join(" \n", GetInitializedModules().Select(m => m.GetType().ToString()).ToArray()));
            }

            OnStarted();

            IsMasterRunning = IsRunning;

            // Invoke the event
            if (MasterStarted != null)
            {
                MasterStarted.Invoke(this);
            }
        }