gf3 / Jerk

Stupidly simple IRC bots in Javascript.
http://gf3.github.com/Jerk
The Unlicense
106 stars 17 forks source link

Issues with UnrealIRCd #10

Closed callumacrae closed 13 years ago

callumacrae commented 13 years ago

I think this is a problem with Unreal, not me, but it can't connect:

callum-imac:Jerk callumacrae$ node index.js
[Mon, 25 Apr 2011 20:07:52 GMT] INFO       [RECV]  ERROR :Closing Link: [88.108.23.26] (Ping timeout)
[Mon, 25 Apr 2011 20:07:52 GMT] INFO       [SENT]  NICK nodeXB
[Mon, 25 Apr 2011 20:07:52 GMT] INFO       [SENT]  USER js-irc 0 * :Javascript Bot

events.js:47
        throw new Error("Uncaught, unspecified 'error' event.");
              ^
Error: Uncaught, unspecified 'error' event.
    at EventEmitter.emit (events.js:47:15)
    at IRC.parseMessage (/Users/callumacrae/node_apps/Jerk/node_modules/.npm/irc-js/0.2.17/package/lib/irc.js:138:15)
    at Socket.<anonymous> (native)
    at Socket.emit (events.js:64:17)
    at Socket._onReadable (net.js:665:31)
    at IOWatcher.onReadable [as callback] (net.js:177:10)

I think this is because Unreal requires the user to respond to pings with a value, eg:

PING blablabla
PONG blablabla
gf3 commented 13 years ago

The PING response should echo back the correct data: https://github.com/gf3/IRC-js/blob/master/lib/irc.js#L143-145

When an error event is emitted, it is standard node behaviour to print a stack trace and exit. I'll add some code to Jerk to disconnect and connect again if an error is encountered.