1. @Wulf , Can you add methods(nested type) to handle hook
    Code:
    // CSPlugin.cs line: 64// Find all hooks in the plugin and any base classes derived from CSPlugin
    var types = new List<Type>();
    var type = GetType();
    types.Add(type);//REPLACE
        while (type != typeof(CSPlugin)) types.Add(type = type.BaseType);
    //TO
        while (type != typeof(CSPlugin)) {
            types.AddRange(type.GetNestedTypes(BindingFlags.NonPublic | BindingFlags.Public));
            types.Add(type = type.BaseType);
        }
    // END// Add hooks implemented in base classes before user implemented methods
    for (var i = types.Count - 1; i >= 0; i--)
    {
        foreach (var method in types[i].GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance))
        {
            var attr = method.GetCustomAttributes(typeof(HookMethodAttribute), true);
            if (attr.Length < 1) continue;
            var hookmethod = attr[0] as HookMethodAttribute;
            AddHookMethod(hookmethod?.Name, method);
        }
    [DOUBLEPOST=1490279093][/DOUBLEPOST]Example
    Code:
    namespace Oxide.Plugins
    {
        [Info("EpicStuff", "Unknown", 0.1)]
        [Description("Makes epic stuff happen")]    class EpicStuff : RustPlugin
        {
            class Foo
            {
                [HookMethod("OnServerInitialized")]
                void OnServerInitialized()
                {
                    Puts("It's work!");
                }
            }
        }
    }
     
  2. Wulf

    Wulf Community Admin

    Why would this be needed? It looks like it'd just be unnecessary overhead in most cases.
     
  3. Patterns)
    [DOUBLEPOST=1490280406][/DOUBLEPOST]Facade, Decorator, ...
    [DOUBLEPOST=1490280598][/DOUBLEPOST]Will you add it on the next update?