示例#1
0
        /// <summary>
        /// Should only be called by GP.Session
        /// Starts the client or server sessions depending on run location
        /// </summary>
        /// <param name="runningOn"></param>
        public static void Initialize(RunLocation runningOn)
        {
            Log.Trace("Starting Concealment Sessions", "Initialize");

            RunningOn = runningOn;

            switch (RunningOn) {
                case RunLocation.Client:
                    Client = new ClientConcealSession();
                    Client.Initialize();
                    break;
                case RunLocation.Server:
                    Server = new ServerConcealSession();
                    Server.Initialize();
                    break;
                case RunLocation.Singleplayer:
                    Server = new ServerConcealSession();
                    Server.Initialize();
                    Client = new ClientConcealSession();
                    Client.Initialize();
                    break;
            }

            Log.Trace("Finished Starting Concealment Sessions", "Initialize");
        }
        public override void Initialize()
        {
            Log.Trace("Initializing Server Conceal Session", "Initialize");

            Log.Trace("Loading settings", "Initialize");
            Settings.Load();

            Log.Trace("Registering message handler", "Initialize");
            Messenger = new ServerMessageHandler();

            Log.Trace("Registering concealment manager", "Initialize");
            Manager = new ConcealmentManager();
            Manager.Initialize();
            if (!Manager.Loaded)
            {
                Log.Error("Error loading sector, conceal disabled.", "Initialize");
                Messenger.Disabled = true;
            }


            base.Initialize();
            Instance = this;
            Log.Trace("Finished Initializing Server Conceal Session", "Initialize");
        }
        public override void Initialize()
        {
            Log.Trace("Initializing Server Conceal Session", "Initialize");

            Log.Trace("Loading settings", "Initialize");
            Settings.Load();

            Log.Trace("Registering message handler", "Initialize");
            Messenger = new ServerMessageHandler();

            Log.Trace("Registering concealment manager", "Initialize");
            Manager = new ConcealmentManager();
            Manager.Initialize();
            if (!Manager.Loaded) {
                Log.Error("Error loading sector, conceal disabled.", "Initialize");
                Messenger.Disabled = true;
            }

            base.Initialize();
            Instance = this;
            Log.Trace("Finished Initializing Server Conceal Session", "Initialize");
        }
示例#4
0
        /// <summary>
        /// Should only be called by GP.Session
        /// Stops the client or server sessions depending on run location
        /// </summary>
        public static void Terminate()
        {
            Log.Trace("Terminating Concealment Sessions", "Initialize");

            switch (RunningOn) {
                case RunLocation.Client:
                    Client.Terminate();
                    Client = null;
                    break;
                case RunLocation.Server:
                    Server.Terminate();
                    Server = null;
                    break;
                case RunLocation.Singleplayer:
                    Server.Terminate();
                    Server = null;
                    Client.Terminate();
                    Client = null;
                    break;
            }

            Log.Trace("Finished Terminating Concealment Sessions", "Initialize");
        }