1. Is there a way to get the final path to the oxide data folder/data file? like C:/rustserver/server/myid/oxide/data/test.json
     
  2. Wulf

    Wulf Community Admin

    What are you wanting to do with the path?
     
  3. @Wulf reading the config to send its contents as string to a website (my own) instead of using mysql for connection
     
  4. Wulf

    Wulf Community Admin

  5. @Wulf thanks =)
    [DOUBLEPOST=1447176239][/DOUBLEPOST]@Wulf i cant find the way to just get the entire file as a string. how to do that/is this possible?
     
  6. Wulf

    Wulf Community Admin

    You should be able to just use ToString().
     
  7. Well, its returns the class object.. and i am using data files btw. ;p not config files
    [DOUBLEPOST=1447179610][/DOUBLEPOST]@Wulf can you send a preview?
     
    Last edited by a moderator: Nov 10, 2015
  8. Wulf

    Wulf Community Admin

    You switched between the words a few times, so I wasn't sure. ;)

    I don't have much experience with config objects, so I'm not sure.
     
  9. @Wulf oxide should have acces to read/write files within the server path (virus safe, if you exclude the Managed folder -- with all the dlls).
    then you could add a function like WriteFile(String foldername(<- you can directly check if you want to gain acces to a folder), string filepath);
     
  10. Wulf

    Wulf Community Admin

    It's sandboxed to the oxide directly for security with hosts. System.IO access isn't allowed due to security concerns as well. If access is needed to a certain type of file, we provide wrappers for it, ie. the config/datafile system.
     
  11. @Wulf ist it possible at then for you guys to fix it like you can use
    Code:
    Interface.GetMod().DataFileSystem.ReadDataFile(String name) (returns the content of the file)
    ?????
     
  12. Wulf

    Wulf Community Admin

  13. @Wulf i dont mean get it as a table but as a string just like you could use System.IO.File.ReadAllText(String path);
     
  14. Wulf

    Wulf Community Admin

    I'm not sure that is needed, but you could easily use Newtonsoft.Json to parse the data/config files as strings. There are probably other ways as well.
     
  15. @Wulf well i can use that :) thanks
     
  16. @Wulf this here can save the day:
    Code:
    Puts(Interface.GetMod().DataFileSystem.ReadObject<JObject>("Reconomy").ToString());
     
  17. to write text you can also use ConVar.Server.Log("path", "text");
    but it will have a timestamp in front of the message.
     
  18. @LaserHydra but in general id try to get the config content as string :p