Accessing/reading a file via a plugin?Solved
is it possible to access the config & plugins directories from within the  compiled plugins as streams?

Say for example I want to read     my current *.cs & config fiels as io.streams?
and have it as platform independant  code:

I.E
var fileName = @"oxide/config/myfile"
var fileName1 = @"oxide/plugins/myfile.cs"
using FileStream fileStream = File.OpenRead(fileName);
using FileStream fileStream1 = File.OpenRead(fileName2);
.....
You can get access to configs through
Config.ReadObject<ConfigData>();
Interface.Oxide.DataFileSystem.ReadObject<>()​

 

Streams are restricted, so you can only use Oxide functions.
Yep I saw that, but I need access to the code file & config file as a stream....
Even if they only added an API for a file named exactly the same as the compiled class.

Also I think your above class only gives access to the  "oxide/data/ " directory...
This wouldn't be doable via a plugin, only an extension. Plugins only have filesystem access for data files, configuration files, and logging.
Yep...  I understand why.... but  I don't see any harm in access limited read only access to only the named class running    cs & config as a stream.

the only way is  an  'exploit'  but your gonna fix it as soon as you saw it.

Specifically it was related to stopping/ making it harder for people to be "stealing" plugins....
Similar to  RSA , you know the formula & you know the public key..... but it gets you nothing...
That 'exploit' is fixed in upcoming builds of uMod as well, but I believe we are considering an option to disable the sandbox for those living in the edge.
Locked automatically