OnPluginTelnetRequest always called with SENT_DO

Posted by Twisol on Mon 25 Oct 2010 06:42 AM — 5 posts, 20,194 views.

USA #0
I'm having a strange issue where OnPluginTelnetRequest is called with "SENT_DO" even if no plugin anywhere has responded true to a "WILL". Furthermore, it falls into an infinite subnegotiation sequence with the server, as I get an infinite sequence of WILL calls followed by SENT_DO calls. Here's the code I'm using:

function OnPluginTelnetRequest (opt, data)
  if opt ~= codes.GMCP then
    return
  end
  
  if data == "WILL" then
    return true
  elseif data == "SENT_DO" then
    Note("GMCP enabled.\n")
    
    SendGMCP("Core.Hello ", CLIENT_ID)
    SendGMCP("Core.Supports.Set ", GMCP_options)
  end
end


The SENT_DO branch is still called even if I remove the WILL branch. No other plugins are installed. I'm using v4.65, updated from v4.50. (A wide gap, I know.) My previous version didn't have this problem; I figure it's probably from the plugin callback changes.
Amended on Mon 25 Oct 2010 07:08 AM by Twisol
Australia Forum Administrator #1
For which option code? Some are responded to automatically, you don't necessarily have to have plugins installed to have them acknowledged.
USA #2
GMCP, which is 201. This wasn't a problem previously.
USA #3
*sigh* Well, aren't I an imbecile? SendGMCP() was wrapping the message with IAC DO(253) GMCP, rather than IAC SB(250) GMCP. Sorry about that...

local SB_GMCP = "\255\253\201%s\255\240"
function SendGMCP(--[[...]])
  -- ...
  SendPkt(SB_GMCP:format(message))
  -- ...
end
Amended on Mon 25 Oct 2010 07:45 AM by Twisol
Netherlands #4
That's a bright booboo to make. I smiled. :)

Glad you figured it out.