1. I currently have the following on a parent plugin.
    Code:
    public abstract class ParentPlugin:RustPluginpublic void Post(string url, string body, Action<int,string> response)
         {
           webrequests.EnqueuePost(url, body, response, this);
         }
      
         public void Post(Event e)
         {
           Post(e.Url,e.Body,onEventComplete);
         }     public void callEvent()
         {
           Oxide.Ext.Vanrust.Event e = getNextEvent();
           try
           {
             Post(e);
           }
           catch(Exception ex)
           {
             this.PrintError("NOPE!");
           }
         }
         public abstract void onSetupEvent(Event e);
         public abstract void onEventComplete(int code, string response);
    When the child
    Code:
    MyPlugin:ParentPlugin
    calls the callEvent() function i get the following error.

    <TypeLoadException: Could not load type 'System.Action'2' from assembly 'mscorlib, version=4.0.0.0.0 etc..>
    I believe this has something to do with the web request action not being able to call the childs abstract function. The child's abstract function does exist and all other variables are working.

    I can event replace Post(e) with onEventComplete(1,"Test").
    This means that the onEventComplete is being passed correctly but once given to the EnqueuePost it is unable to run the action.

    Does anything have any ideas?

    EDIT:
    I alsoforgot to mention i am declaring it like public WebRequests webrequests = Interface.Oxide.GetLibrary<WebRequests>("WebRequests");
     
    Last edited by a moderator: Apr 28, 2015
  2. Wulf

    Wulf Community Admin

    What does Oxide.Ext.Vanrust.dll do that can't be done as a plugin?
     
  3. It creates a plugin master class i am working on which all my plugins will be able to extend. It also is my way of trying out extensions.

    The reason why i need a parent class is that all my planned plugins have the same needed base functionality that im working on building off. For this reason i need an extension.

    The issue here is an issue with the webrequest.enqueuepost function. My e.Url and e.Body
     
  4. Wulf

    Wulf Community Admin

    Yeah, that could still be done via a plugin which other plugins can depend on. An extension is overkill for your use. You're also losing hotloading of plugins by having an extension rather than a plugin. Without seeing what your extension is doing, it's hard to really give you a straight answer. Honestly though, I'd get rid of the extension and create it as a plugin instead.