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:
Hornwitser committed 2020-11-20 01:36:07 +01:00
1 parent 4d0720ade8
commit cdb048741c
8 files changed
+57 -35

No files matched your search

+2 -2
View File
@@ -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')"
);