Solved Cache image

Discussion in 'Rust Development' started by Reynostrum, Jul 22, 2016.

  1. I was wondering what can i do for storing a image on cache, and then when it's downloaded show it CuiRawImageComponent.

    Storing it is the problem, i really have no clue.
     
  2. You can try to use FileStorage class
     
  3. Wulf

    Wulf Community Admin

    Keep in mind that this only stores it on the server, it doesn't cache it on the client. All this would do is transition the load from the client to the server.
     
  4. Also, to add to this, providing people with an interface to indirectly store images on your server yields a lot of dangers like inappropriate images, blocking the downstream via image downloads, filling up the HDD with large images, ...
     
  5. What about in-game signs? Players can draw "inappropriate images".
     
  6. If the OP is actually intending on allowing users to store their own images to file storage there are still limitation options you can put in place such as image size, type, etc although it doesn't seem to me that is what he is doing.
    @Reynostrum There are plenty of plugins that do what you are looking for and it is not overly complicated to replicate, you should take a look at them. SignArtist, ServerRewards, LustyMap (I think?) to name a few
     
  7. I'm talking about illegal images, essentially.
     
  8. What is that mean? "illegal"? :D
    He just want to cache image in GUI so it wouldn't be downloaded every time player open GUI, i think.
    [DOUBLEPOST=1469267317][/DOUBLEPOST]Here is come limitations of Rust CUI. You can make an issue about this on github but i don't think that they are really interested in modding community.
     
  9. Child pornography for instance.
    I'm just warning him. Generally, whenever you allow something to upload images to your server, you'll have an effort moderating these images.
    If you're just linking images and not actually storing them on your server then it's a different story.
    The best approach if you don't want to moderate images is generally limiting image linking to hosts that you know are well moderated and never store images on your server.
     
  10. I appreciate your answers.
    Solved.
     
  11. How exactly would I go about downloading a png and saving it to the data folder?
     
  12. You can't via a plugin but you can load it from the internet into Rusts file storage with the sign images