/// <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());
        }
 public MyCommandManager(BaseMode gameMode) : base(gameMode)
 {
 }
Exemple #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;
        }
Exemple #4
0
 public TestServiceB(BaseMode gameMode)
     : base(gameMode)
 {
 }
Exemple #5
0
 /// <summary>
 ///     Performs post-load actions.
 /// </summary>
 /// <param name="gameMode">The game mode.</param>
 public virtual void PostLoad(BaseMode gameMode)
 {
 }
Exemple #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);
 }
Exemple #7
0
 /// <summary>
 ///     Loads services provided by this extensions.
 /// </summary>
 /// <param name="gameMode">The game mode.</param>
 public virtual void LoadServices(BaseMode gameMode)
 {
 }
Exemple #8
0
 public override void PostLoad(BaseMode gameMode)
 {
     Console.WriteLine("ExtensionB extension was loaded!");
 }
Exemple #9
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="BaseMode" /> class.
 /// </summary>
 protected BaseMode()
 {
     Instance = this;
 }