I currently have the following on a parent plugin.
When the childCode: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);calls the callEvent() function i get the following error.Code:MyPlugin:ParentPlugin
<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");
Not an Issue WebRequest ParentPlugin can't call abstract function
Discussion in 'Rust Discussion' started by Dr Jones, Apr 28, 2015.
-
Wulf Community Admin
What does Oxide.Ext.Vanrust.dll do that can't be done as a plugin?
-
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 -
Wulf Community Admin