Barotrauma

Barotrauma

Not enough ratings
RuyiLuaComponent
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
199.674 KB
24 Apr @ 7:05am
25 Apr @ 3:17am
2 Change Notes ( view )

Subscribe to download
RuyiLuaComponent

Description
​Introduction​
The mod has numerous code snippets from MicroLua by Matheus
The mod allows you to scripting in Lua for new circuit component, which offering ​32 I/O ports, enough to replace many complex vanilla circuits.
The lua component is ​lightweight, has high-performance, supports ​hot-reloading, event-driven, and detailed error logging.
The script runs on both the server and all clients, like vanilla logic components.
You can check out Code Examples and User Manual in the discussion section for more details.

Advanced techniques

​Dependencies​
Both the server and clients must have the following mods installed:

​Technical Foundation​
The mod is built upon ​Lua for Barotrauma​​ and follow to ​MoonSharp-compatible Lua 5.2[www.lua.org]​ standards.
You can check the official Moonsharp website for related documentation:

Cybersecurity Statement
In Multiplayer
For clients, each RuyiLua component creates a separate sandboxed script that removes the following APIs to restrict script access to the system:
  • Methods in the "os" package except those listed for OS_Time
  • Methods in the "io" and "file" packages
  • Load-related methods: "load", "loadsafe", "loadfile", "loadfilesafe", "dofile", and "require"
Furthermore, MoonSharp Lua interpreter prohibits Cross-Script Access to private resources, including dangerous APIs such as "​File", "​Hook", "​dofile", and "​loadfile​" provided by LuaForBarotrauma's primary script. This nearly eliminates potential malicious act by users.
However, these restrictions do not affect access to common game objects such as ​Character, ​Item, ​Entity, ​Outpost, ​InputType, etc. APIs for these game objects are provided in the mod installed folder:
...\RuyiLuaComponent\Sandboxing\libs\
And, it cannot be ruled out that a malicious host might execute infinite loop code and bugs to crash your game program, or counterfeit this mod.
​For server hosts, Each RuyiLua component runs on LuaForBarotrauma's primary script, which offers more possibilities but also introduces security risks. I strongly recommend keeping the RuyiLua component’s AllowInGameEditing setting ​false​ (the default value). This prevents clients from editing the component’s code and uploading it to the server for execution.
In Singleplayer
I can't guarantee anything, just please only use mods you trust!

Project Repository

Popular Discussions View All (2)
0
24 Apr @ 7:09am
Code Example
whosyourdaddy
0
24 Apr @ 7:08am
User Manual
whosyourdaddy