1. Hi,

    Trying to update a plugin.
    Getting this message in the console.
    Remember seeing some plugins that had "Updates" to address this, but cannot find any.

    Looking for either
    1. examples of before and after plugins to see that I need to do. (learn by example)
    2. if 1 is not available, sample structure to recreate the Mod.

    Code:
    namespace Oxide.Plugins
    {
        [Info()] //info removed
        [Description()] //description removed    class MyClass : GameModePlugin<MyClassConfig, MyClassState>
        {
            //chat commands
            //void OnPlayerInit etc.
        }    namespace MyClass
        {
        public class MyClassState : IGameState
            {
            public MyClassState()
                {
                }
            }        public class MyClassConfig : IGameConfig
            {
                public MyClassConfig()
               {
               }
            }        public Assassin Assassin { get; private set;}
        }
    }    namespace MyClass2
        {
            public class GameModePlugin<TConfig, TState> : RustPlugin
            {
                protected TConfig GameConfig { get; private set; }
                protected TState State { get; private set; }
            }      public interface IGameConfig
          {
           }
           public interface IGameState
          {
          }
        }

    Perhaps someone would be kind enough to assist me with how this all ties together, so I can mode the old (if it is old) classes and interfaces (do I need interfaces?)
    Code:
    namespace Oxide.Plugins
        class MyClass : GameModePlugin<MyClassConfig, MyClassState>
            namespace MyClass        
                public class MyClassState : IGameState
                public Assassin Assassin { get; private set;}
                public class MyClassConfig : IGameConfig
            namespace MyClass2
                public class GameModePlugin<TConfig, TState> : RustPlugin
                    protected TConfig GameConfig { get; private set; }
                    protected TState State { get; private set; }
                public interface IGameConfig
                public interface IGameState
    
    (this may make it easier to see what i'm working with)

    Any feedback appreciate, links, 2 page explanations, anything.
    Hook.

    p.s. If I can just static something or whatever even better as the code works and runs.
     
  2. Wulf

    Wulf Community Admin

    The message is basically stating that you're nesting classes under a namespace other than what the plugin should be using. If you really need to have additional namespaces or classes outside of the main, then you should be using your plugin's name as the namespace. The warning is basically stating that using generic names would pollute/bleed over to other plugins and potentially cause issues. In most cases, everything can be under the main class and namespace.
     
  3. Ok, thanks for the reply. Ill look at moving everything from MyClass2 into MyClass.

    Or do you mean I need to create a namespace above the initial
    class MyClass : GameModePlugin<MyClassConfig, MyClassState>
    and put everything in it?

    Nevermind, I am confident you meant move it into the base class (MyClass)

    I have double checked a couple of other Mods.
    namespace Oxide.Plugins
    {
    [Info("RustNotifications", "seanbyrne88", "0.9.1")]
    [Description("Configurable Notifications for Rust Events")]
    class RustNotifications : RustPlugin
    {
    }
    }
    Has private classes at the bottom as does Discord.cs etc.
     
    Last edited by a moderator: Apr 25, 2017