1. Hi all,

    Just wondering if Oxide/Rust has something in place to be able to prompt a client-side function to be run?

    I'm specifically looking at modifying UI-based elements for things such as crafting time, crafting amount, item unlock level, and item unlock costs. Obviously crafting times, amounts and item unlock costs CAN be changed on the server, and it DOES work, but there's no way for the player to see it visually. Ie. the unlock costs will still show their original cost, but when unlocked will only deduct the server-specified amount.

    Changing xp levels of items is the biggest use for this that I have, as even if you successfully lower the level required, the client-side interface still prevents the item being unlocked through the vanilla interface. Sure I could go to all the effort to create my own crafting interface, but thats A LOT more work than potentially being able to trigger the BasePlayer.blueprints.clientInit() or clientUpdate() functions to run for the player.

    My understanding is that the client must already support something that would allow this? So without that, there's no way for Oxide to prompt it. Is it possible through Unity? I have no idea how to use Unity methods such as GetComponent and stuff, I tend to avoid it in my plugins and just go the slightly longer way :p

    Thanks everyone,

    Alex
     
  2. Wulf

    Wulf Community Admin

    There's no way to modify a client element that doesn't communicate with the server. There are many portions of Rust that are client-side only and wouldn't be able to be changed by the server.
     
  3. Yeah, I get that, I just wanted to make sure there was definitely NO way to prompt the client to run a certain function. No in-built sneaky Unity method, for example.
     
  4. Wulf

    Wulf Community Admin

    Unity doesn't handle the networking in Rust. You can send a client command or create custom UI using Rust's CUI, but that's about it.
     
  5. Ah okay, fair enough. Maybe one day Facepunch will add a method for the server to prompt a UI refresh on the client :)
     
  6. Wulf

    Wulf Community Admin

    Why would the UI need to be manually refreshed by the server? The only UI that plugins should control is the CUI stuff, which you can trigger to CUI from your plugin update as needed.
     
  7. This would add a lot of overhead, I guess.
    Also, on executing arbitrary functions, a server shouldn't be allowed to execute arbitrary functions on the client.
    The best example is the bug that occured a few months ago, that allowed any server to delete items from player's steam inventories.