ok that was interesting... it seem that i managed to fix some bugs on my side and i managed to root up the bug that cause massive lag to the server by my mere plugin.
anyway, here is a workable code using GMCP(or ATCP 2) that you can play with in your plugin.. again, here dirty and a updated code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="ATCP2"
author="Richard M"
id="29a4c0721bef6ae11c3e9a82"
language="Lua"
purpose="Richard's dirty GMCP plugin"
date_written="2010-03-09 10:04:32"
requires="4.50"
version="1.0"
>
<description trim="y">
<![CDATA[
]]>
</description>
</plugin>
<!-- Script -->
<script>
<![CDATA[
local CLIENT_ID = "MUSHclient " .. Version ()
local IAC, SB, SE, DO = 0xFF, 0xFA, 0xF0, 0xFD
local ATCP2 = 201
local ATTEMPTED = false
function OnPluginTelnetRequest (type, data)
Note("TYPE: " .. tostring(type) .. "\nDATA:" .. tostring(data))
if type== ATCP2 and data == "WILL" and ATTEMPTED == false then
SendPkt(string.char(IAC, DO, ATCP2))
return
end
if type == ATCP2 and data == "SENT_DO" and ATTEMPTED == false then
ColourNote("blue", "black", "attempting to enable ATCP2\n")
ColourNote("white", "black", "\n")
SendPkt(string.char(IAC, SB, ATCP2) ..
[[ Core.Hello { "client" : "Mushclient", "version": "4.51"} ]] ..
string.char(IAC, SE))
SendPkt(string.char(IAC, SB, ATCP2) ..
' Core.Supports.Set [ "Char 1", "Char.Skills 1", "Char.Items 1" ] ' ..
string.char(IAC, SE))
ATTEMPTED = true
end
end
function OnPluginTelnetSubnegotiation (type, option)
Note("Telnet Subnegotiation [ TYPE: " .. tostring(type) .. "\n" ..
"OPTION" .. tostring(option) .. "]")
end
function OnPluginTelnetOption (data)
Note ("Received option string ", tostring(data))
end -- function OnPluginTelnetOption
]]>
</script>
</muclient>
|