예제 #1
0
        /// <summary>
        ///     Registers the services this controller provides.
        /// </summary>
        /// <param name="gameMode">The game mode.</param>
        /// <param name="serviceContainer">The service container.</param>
        public override void RegisterServices(BaseMode gameMode, GameModeServiceContainer serviceContainer)
        {
            CommandsManager = new CommandsManager(gameMode);
            serviceContainer.AddService(CommandsManager);

            // Register commands in game mode.
            CommandsManager.RegisterCommands(gameMode.GetType());
        }
예제 #2
0
 public MyCommandManager(BaseMode gameMode) : base(gameMode)
 {
 }
예제 #3
0
        protected BaseMode(bool redirectConsole)
        {
            if (redirectConsole)
                Console.SetOut(new ServerLogWriter());

            if (FrameworkConfiguration.MessageLevel == FrameworkMessageLevel.Debug)
            {
                var type = Type.GetType("Mono.Runtime");
                var displayName = type?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);

                if (displayName != null)
                    FrameworkLog.WriteLine(FrameworkMessageLevel.Debug, "Detected mono version: {0}",
                        displayName.Invoke(null, null));
            }

            Instance = this;
        }
예제 #4
0
 public TestServiceB(BaseMode gameMode)
     : base(gameMode)
 {
 }
예제 #5
0
 /// <summary>
 ///     Performs post-load actions.
 /// </summary>
 /// <param name="gameMode">The game mode.</param>
 public virtual void PostLoad(BaseMode gameMode)
 {
 }
예제 #6
0
 /// <summary>
 ///     Loads controllers provided by this extensions.
 /// </summary>
 /// <param name="gameMode">The game mode.</param>
 /// <param name="controllerCollection">The controller collection.</param>
 public virtual void LoadControllers(BaseMode gameMode, ControllerCollection controllerCollection)
 {
     gameMode.AutoloadControllersForAssembly(GetType().GetTypeInfo().Assembly);
 }
예제 #7
0
 /// <summary>
 ///     Loads services provided by this extensions.
 /// </summary>
 /// <param name="gameMode">The game mode.</param>
 public virtual void LoadServices(BaseMode gameMode)
 {
 }
예제 #8
0
 public override void PostLoad(BaseMode gameMode)
 {
     Console.WriteLine("ExtensionB extension was loaded!");
 }
예제 #9
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="BaseMode" /> class.
 /// </summary>
 protected BaseMode()
 {
     Instance = this;
 }