mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Remove getLua and getCommand from clusterTools
Remove the unused and badly behaved getCommand and getLua functions from clusterTools. The main issue with these is that encourage the use of large commands that have negative impact on the performance of the servers, as such large commands have to be transmitted to all players that are connected. These functions also have poor handling of lua comments and will fail on strings containing for example "--".
This commit is contained in:
1 parent
1595555154
commit
5d9d3981ff
5 files changed
+4
-75
No files matched your search
@@ -1,20 +1,11 @@
|
||||
/**
|
||||
|
||||
Functions frequently needed from different places in the cluster. Ex:
|
||||
* Loading Lua scripts
|
||||
* Getting an instance's displayname from their ID
|
||||
|
||||
*/
|
||||
|
||||
module.exports = ({config} = {}) => ({
|
||||
/**
|
||||
async function to get Lua from a file, remove comments, minify and return.
|
||||
|
||||
arg1 is the file path
|
||||
arg2 is whether or not to compress the Lua. Makes debugging harder, but reduces bandwidth when many players are online. Recommended for polling commands. Defaults to true.
|
||||
Promise resolves with a string of Lua.
|
||||
*/
|
||||
getLua: require("./getLua.js"),
|
||||
/**
|
||||
async function to get an instances displayname from their instanceID
|
||||
|
||||
@@ -22,12 +13,4 @@ module.exports = ({config} = {}) => ({
|
||||
Promise resolves with a string, either the displayName or instanceID if not found.
|
||||
*/
|
||||
getInstanceName: require("./getInstanceName.js")(config),
|
||||
/**
|
||||
async function same as getLua, but using an in memory cache to lower FS operations.
|
||||
|
||||
arg1 is the file path
|
||||
arg2 is whether or not to compress, default true
|
||||
Promise resolves with a string of Lua.
|
||||
*/
|
||||
getCommand: require("./getCommand.js"),
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user