Skip to content

Conversation

fastrde
Copy link
Contributor

@fastrde fastrde commented Jul 25, 2013

hi pushrax,

thanks for your work. You helped me so I want to help you ;-)

in socketOnData you handle each buffer as only one RCON-packet.
When you have for example logging enabled you can have multiple packets in the buffer, so the line

var str = data.toString('utf8', 12);

cuts the header of the first RCON-Packet but dont touch the headers of the other packets in buffer and emit the packets as one big packet.

This fix read the structure of the RCON-Packets descriped on https://developer.valvesoftware.com/wiki/Source_RCON_Protocol
and splits the buffer in single packets.

lg

fastrde

pushrax added a commit that referenced this pull request Jul 30, 2013
Properly parse multiple packets in the buffer
@pushrax pushrax merged commit 5e982fc into pushrax:master Jul 30, 2013
@pushrax
Copy link
Owner

pushrax commented Jul 30, 2013

Thanks for your contribution 🍉

SweetieRick added a commit to SweetieRick/node-rcon that referenced this pull request Apr 20, 2022
Issue pushrax#1 and Issue pushrax#3 have been addressed and improved upon accordingly, waiting for `_sendSocket` issue to resolve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants