Jump to content

PluginIO v2 - Disables the System.IO and System.XML namespace bans


ZRM

Recommended Posts

For plugin developers only.

I have been informed that the impending 0.21 update for KSP will remove the ban on plugins for using Input and Output. (If this is incorrect, mods, please delete this thread and accept my apologies). To give developers a head start on writing new plugins to take advantage of this, I am now releasing this plugin that circumvents the current bans in KSP 0.20.

Very simple install - just drag, drop and merge into GameData. Make sure to package this with any mods you release that require it. The license used is the MIT license (basically a disclaimer).

You do not need to do anything special with any mods you make. Just make sure that this mod is installed correctly and your plugin will load.

Plugins that rely on this mod must be placed in GameData, not Plugins, in order to be found by this mod.

Download here.

The source is available here.

Happy modding!

V2 changelog - Added diagnostic output for plugin loader.

Edited by ZRM
Link to comment
Share on other sites

Hey, thanks for the plugin.

Issue is I cant seem to get it to work. Do I just use System.IO normally? I don't need to reference your DLL in any way do I?

What I am currently doing:

Merging the folder with GameData. Creating my plugin completely seperate using System.IO and putting it in the normal plugin folders.

Is there anything else I need to do with it? It simply doesnt load my plugin with the same error you normally get with the System.IO ban.

Link to comment
Share on other sites

Hmm... I had tested this on multiple machines.

Are you sure that your plugin is not loading? Ignore the security messages that KSP puts in the log saying that the plugin will not be loaded - PluginIO loads assemblies manually after that process completes. Search the log for "PluginIO" to see the messages my plugin produces. It should say something like

PluginIO: "path/to/plugin.dll" loaded

If it failed to load it it should say

PluginIO: "path/to/plugin.dll" could not be loaded

After loading plugins it should say something like

PluginIO: All x compatible plugins using IO loaded.

Where x is the number of plugins that would normally be banned.

BTW: What platform are you on?

Link to comment
Share on other sites

PluginIO: All 0 compatible libraries using IO loaded.

Windows 8.1 Pro Preview

Is what I get, Full log here:

http://hastebin.com/dejonegaxi.tex

DXDiag (for any other info you may need):

http://hastebin.com/hajeroyofu.tex

Edit:

@ The-Bean Basically for "security reasons" Squad disabled the use of some "system code" inside of addons. So they couldnt create/delete files outside of the directory. Unfortunately the blanket ban they use did more harm than it did good because it disallowed developers from using functions inside their code which makes life tons easier. In .21 they are removing the ban and this basically circumvents the ban so plugin developers can make their plugin in .20 without having to wait for .21 for the ban to be lifted.

Edited by Plornt
Link to comment
Share on other sites

For those of us who have no idea what this means (me), do you mind giving a quick explanation of what this does for modding?

Cheers!

Edit: Argh, ninja'd!

From version 0.15 to version 0.20 of KSP, there is a "security" feature that stops plugins that use IO (file access, network communications, inter-process comms, etc.) from loading so that they cannot do malicious things. In fact this "feature" does not prevent malicious plugins at all, so it is useless in that regard, and it makes many things harder for legitimate plugins, as it also removes several key features that developers rely on. Hence the ban is being removed in version 0.21. My plugin removes the ban now so you can work on plugins that use IO.

Plornt - Your plugin needs to be in GameData to work. I should have mentioned this. It's not meant to be backwards compatible with old mods using "/Plugins", as no such IO mods exist.

Link to comment
Share on other sites

Hmm now its giving me:

PluginIO: "C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\KSPMulti.dll" could not be loaded

Not sure why though. Hmm lemme check something... 1 sec

Ah forgot to move my other DLL over. Now I am having an issue of the debug console being blank http://i.imgur.com/W8xetmS.jpg

Is that normal?

EDIT: Do not worry! My fault. Accidentally started KSP twice.

Awesome, thanks for the great plugin :)

Edited by Plornt
Link to comment
Share on other sites

Hmm now its giving me:

PluginIO: "C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\KSPMulti.dll" could not be loaded

Not sure why though. Hmm lemme check something... 1 sec

Ah forgot to move my other DLL over. Now I am having an issue of the debug console being blank http://i.imgur.com/W8xetmS.jpg

Is that normal?

EDIT: Do not worry! My fault. Accidentally started KSP twice.

Awesome, thanks for the great plugin :)

I have now updated the plugin so that any "could not be loaded" errors now also display the exception that caused the error, so you don't have to guess about why your plugin is not loading.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...