mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 07:24:52 +09:00
Rework RCON statistics gathering
Add a sendRcon method to BaseInstancePlugin and the slave's Instance class. This servers two purposes, one is to reduce the repetition when send RCON commands particularly from plugins, and the other is to instrument the RCON commands sent with metrics about duration and size.
This commit is contained in:
1 parent
4d0720ade8
commit
cdb048741c
8 files changed
+57
-35
No files matched your search
@@ -230,11 +230,11 @@ Communicating with Factorio
|
||||
|
||||
For pushing data into Factorio there's RCON, which lets you send
|
||||
arbitrary Lua commands to invoke whatever code you want in the game.
|
||||
This is done by calling the `sendRcon` method on the instance's server object.
|
||||
This is done by calling the `sendRcon` method on the plugin object.
|
||||
For example:
|
||||
|
||||
async onStart() {
|
||||
let response = await this.instance.server.sendRcon(
|
||||
let response = await this.sendRcon(
|
||||
"/sc rcon.print('data')"
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user