FS#5643 - Addition of 3 packets

Attached to Project: OpenTTD
Opened by Xaroth Brook (Xaroth) - Wednesday, 10 July 2013, 10:09 GMT
Last edited by Ingo von Borstel (planetmaker) - Thursday, 11 July 2013, 20:35 GMT
Type Patch
Category Network → Admin
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


As discussed with planetmaker on IRC.

The added patch adds functionality for the following:

1) It modifies Receive_ADMIN_RCON to send a ADMIN_PACKET_SERVER_RCON_END packet at the end of the command execution; this way clients who send such commands have a clear indicator that that the command has executed, regardless of the amount of lines of output generated. The packet sends the original command as sent so it can be matched by the client.

2) It adds a PING/PONG system, this way clients have a 'clean' method of determining the connection status (and the responsiveness of the server), and act accordingly (i.e. notify the admins if the server becomes unresponsive for too long)

ADMIN_PACKET_ADMIN_PING is sent by the client; taking an uint32 payload. this payload is then returned by the server in the ADMIN_PACKET_SERVER_PONG response.

As discussed these changes should be backwards compatible (granted old clients ignore unknown packets), and don't require a bump of the protocol version.

Please note that I have not yet got the time to test the validity of the attached patch; I will update this after some tests have been made.
This task depends upon

Closed by  Ingo von Borstel (planetmaker)
Thursday, 11 July 2013, 20:35 GMT
Reason for closing:  Implemented
Additional comments about closing:  In r25587 and r25588. Thanks for the patches.
Comment by Xaroth Brook (Xaroth) - Wednesday, 10 July 2013, 18:01 GMT
Added separate patches for the two points mentioned, as they are really different problems.

Note, both are based separately off of a clean trunk checkout.
Comment by xOR (xOR) - Saturday, 03 August 2013, 01:13 GMT
Thanks dude, great addition, xShunter makes use of both now and it's working like a charm. In the past I had an ugly solution for the ping where I would send the payload to the console using "echo" and parsing it when it returns. Now there finally is a clean solution. Same story for RCON.