hallo,
ive started to write a plugin for oxide 2.0 rust
but ive encounterd an error:
View attachment 10337
it says that i am not allowed to use System.Xml.XmlNode (or any of the system.xml namespace for that matter)
Is this somthing oxide holds back?
System.Xml not allowed?
Discussion in 'Rust Development' started by > < { { ° >, Jun 30, 2015.
-
Most likely yes, Wulf mentioned earlier this week the whole System branch is locked out.
You should probably use Newtonsoft's json lib... I assume this is standard on servers because I've seen mods use it, but you might have to upload that assembly manually (if your host allows). -
Wulf Community Admin
Not all, just the ones I mentioned. https://github.com/OxideMod/Oxide/blob/master/Oxide.Game.Rust/RustExtension.cs#L39
@> < { { ° > any particular reason why you need XML? -
I don't understand why oxide decided to blacklist external libs or even basic librarys like system.xml.
i thought oxide was about flexability/expandablity, but limiting it to only a few librarys for rust doesn't really make sense.
I use xml for datastorage. -
Wulf Community Admin
I believe System.Xml was not exposed as it can be used to get access to System.IO, which could be used for malicious means on hosts that are not sandboxed. There's been past discussion about it I believe. If you are wanting to save a datafile, I'd recommend using Oxide's datafile system. -
malicious means? only someone who would upload plugins on this site deliberately with malicouse code could cause any harm to those hosts. though perhaps you should ask the question who's responsibilty it is to prevent this. If this would be oxides problem then code should probably be checked by admins.
limiting developers with this is really painfull. I don't like the default oxide storage system. that's why i decided to use xml.
(hence that all my plugins were already written for legacy, and im just renewing them.)
(there are still ways to damage the system even without all these libs).
anyways, i will either recompile the source to make it work with xml or move on to another framework -
Wulf Community Admin
Not all hosts pull directly from the site here, and many allow manual plugin uploads. We still try to provide security where we can. I see no issue adding XML support, but it would need to be done in a way that doesn't poke holes in the system. If you're using it for personal use, it's fairly simple to remove the assembly/namespace restrictions, but those can't be removed in our builds. -
put a disclaimer on it, only plugins from this site are allowed/supported (as in verified stuff ect) by oxide?
-
Wulf Community Admin
That doesn't really help hosts, and doesn't really solve anything. We can't vouch for every update a developer provides, we can only moderate as able. The assembly/namespace restrictions are for the benefit of hosts and general users.
XML can be supported, but like I said before, it would need to be provided in a manner that doesn't create potential issues. -
i get your point, though you would never achieve 100% safety.
-
Wulf Community Admin
We never guaranteed it.
I'll pass it by the other guys when they're around to see if they have any ideas. -
Awwww, this explains a lot.
I was trying for like an hour yesterday and couldn't figure out why my XmlSerializer wasn't working properly.
I was trying to store the userdata for my RPG plugin in a seperate XML file (like SteamID, level, Skillpoints and stuff). Didn't want to use Oxide's datafile system so users could manually open the file in a text editor and somewhat easily change items.
So is there any way at all to store/load data to/from a seperate file? -
Wulf Community Admin
Currently no, but we're looking into adding support for XML and possibly YML. Most users are familiar with JSON, but it isn't exactly one of the most user-friendly languages for configs.
-
It added xml?
-
No, it isn't yet, and I'm pretty happy that it isn't.
This is an area where flexibility is pointless and introduces unnecessary complexity.
XML is a terrible format to use for configurations and data, it's only relatively useful in regards to markup (where markup is only a small percentage of the content).
It could be argued that YAML is a nicer configuration format, but JSON shines in other regards as configuration format, which is why I believe that introducing unnecessary complexity just so people can use YAML is pointless.
It's good that server owners only have to learn a single format, not three. -
Wulf Community Admin
We had actually looked at a few other options similar to YAML that are a bit more user-friendly. I'm not sure XML will be added, we'd prefer to keep everything as easy and simple as possible for server owners and developers.
