pushrax/node-rcon — pull request #3 by fastrde (2013-07-25 09:10:07+00:00)
Title: fix an Issue when more then one RCON-pakets are in data-buffer

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
```javascript
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