UPDATED: dealing corectly with 'pong' command
UPDATED: removed erroneous reference to LogPrintf function