LuaRCON objects should be allowed to print() after calling itCurrently, if you send this to RCON...
Code: Select all
/c local remote = rcon script.on_event( defines.events.on_console_chat, function ( event ) remote.print( "this does not work." ) end) rcon.print( "this works" )
It should, this allows third party developers such as modders and server hosting companies to make advanced rcon utilities for factorio
without having to be connected to the stdout stream of the factorio executable process
or using workarounds like clusterio
Suggestion:instead of disabling the LuaRCON object after call, set `rcon` -> `nil`
as mentioned here: viewtopic.php?f=23&t=93545&p=528996#p528996
EDIT 1: (more info for the suggestion)In regards to the ( Valve/Source ) RCON protocol:
...boskid wrote: ↑Sat Dec 26, 2020 8:19 amDo you have any protocol description references for that claim? responses should arrive in the same order as the commands they requested them, so sending responses in order ID=1 (for request 1), ID=2 (for request 2) then ID=1 (unsolicited) would violate the order preserving property.smartguy1196 wrote: ↑Sat Dec 26, 2020 8:14 amFYI, you can send the same ID more than one, as long as it is a Response and it is sent back to the originating (request) socket, so in this example "socket information" would also contain the response id to the originating request that defined the LuaRCON instance.
From the original Source RCON protocol spec (https://developer.valvesoftware.com/wik ... #Packet_ID):
The packet id field is a 32-bit little endian integer chosen by the client for each request. It may be set to any positive integer. When the server responds to the request, the response packet will have the same packet id as the original request (unless it is a failed SERVERDATA_AUTH_RESPONSE packet - see below.)
It need not be unique, but if a unique packet id is assigned, it can be used to match incoming responses to their corresponding requests.