Skip to content

Instantly share code, notes, and snippets.

@depwl9992
Last active January 19, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save depwl9992/38e3ed9cb98eb747ad0b943d9ef915ce to your computer and use it in GitHub Desktop.
Save depwl9992/38e3ed9cb98eb747ad0b943d9ef915ce to your computer and use it in GitHub Desktop.
MUSHClient Telnet Option Reporter
Incoming packet: 3 (15 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿý.ÿý.ÿû*ÿûFÿûÉ ff fd 18 ff fd 1f ff fb 2a ff fb 46 ff fb c9
Sent packet: 2 (3 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿû. ff fb 18
Sent packet: 3 (3 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿü. ff fc 1f
Sent packet: 4 (3 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿþ* ff fe 2a
Sent packet: 5 (3 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿýF ff fd 46
Sent packet: 6 (3 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿþÉ ff fe c9
Incoming packet: 4 (6 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿú..ÿð ff fa 18 01 ff f0
Sent packet: 7 (16 bytes) at Wednesday, January 16, 2019, 1:10:09 PM
ÿú..mushclientÿð ff fa 18 00 6d 75 73 68 63 6c 69 65 6e 74 ff f0
Incoming packet: 5 (713 bytes) at Wednesday, January 16, 2019, 1:10:10 PM
ÿúF.NAME.The Fai ff fa 46 01 4e 41 4d 45 02 54 68 65 20 46 61 69
ry Garden MUSH.P 72 79 20 47 61 72 64 65 6e 20 4d 55 53 48 01 50
LAYERS.1.UPTIME. 4c 41 59 45 52 53 02 31 01 55 50 54 49 4d 45 02
1547599509.PORT. 31 35 34 37 35 39 39 35 30 39 01 50 4f 52 54 02
3349.PUEBLO.1.CO 33 33 34 39 01 50 55 45 42 4c 4f 02 31 01 43 4f
DEBASE.PennMUSH 44 45 42 41 53 45 02 50 65 6e 6e 4d 55 53 48 20
1.8.7p0.FAMILY.T 31 2e 38 2e 37 70 30 01 46 41 4d 49 4c 59 02 54
inyMUD.WEBSITE.h 69 6e 79 4d 55 44 01 57 45 42 53 49 54 45 02 68
ttps://tfgmush.o 74 74 70 73 3a 2f 2f 74 66 67 6d 75 73 68 2e 6f
rg.CRAWL DELAY.- 72 67 01 43 52 41 57 4c 20 44 45 4c 41 59 02 2d
1.HOSTNAME.tfgmu 31 01 48 4f 53 54 4e 41 4d 45 02 74 66 67 6d 75
sh.org.CONTACT.s 73 68 2e 6f 72 67 01 43 4f 4e 54 41 43 54 02 73
amakhulis@hotmai 61 6d 61 6b 68 75 6c 69 73 40 68 6f 74 6d 61 69
l.com.CREATED.20 6c 2e 63 6f 6d 01 43 52 45 41 54 45 44 02 32 30
09.ICON.https:// 30 39 01 49 43 4f 4e 02 68 74 74 70 73 3a 2f 2f
tfgmush.org/imag 74 66 67 6d 75 73 68 2e 6f 72 67 2f 69 6d 61 67
es/mushroom_icon 65 73 2f 6d 75 73 68 72 6f 6f 6d 5f 69 63 6f 6e
_32x32.png.LANGU 5f 33 32 78 33 32 2e 70 6e 67 01 4c 41 4e 47 55
AGE.English.LOCA 41 47 45 02 45 6e 67 6c 69 73 68 01 4c 4f 43 41
TION.United Stat 54 49 4f 4e 02 55 6e 69 74 65 64 20 53 74 61 74
es of America.MI 65 73 20 6f 66 20 41 6d 65 72 69 63 61 01 4d 49
NIMUM AGE.13.GEN 4e 49 4d 55 4d 20 41 47 45 02 31 33 01 47 45 4e
RE.Fantasy.GAMEP 52 45 02 46 61 6e 74 61 73 79 01 47 41 4d 45 50
LAY.Roleplaying. 4c 41 59 02 52 6f 6c 65 70 6c 61 79 69 6e 67 01
STATUS.Live.GAME 53 54 41 54 55 53 02 4c 69 76 65 01 47 41 4d 45
SYSTEM.None.INTE 53 59 53 54 45 4d 02 4e 6f 6e 65 01 49 4e 54 45
RMUD..SUBGENRE.F 52 4d 55 44 02 01 53 55 42 47 45 4e 52 45 02 46
airy.AREAS.39.HE 61 69 72 79 01 41 52 45 41 53 02 33 39 01 48 45
LPFILES.0.MOBILE 4c 50 46 49 4c 45 53 02 30 01 4d 4f 42 49 4c 45
S.0.OBJECTS.695. 53 02 30 01 4f 42 4a 45 43 54 53 02 36 39 35 01
ROOMS.2288.CLASS 52 4f 4f 4d 53 02 32 32 38 38 01 43 4c 41 53 53
ES.4.LEVELS.0.RA 45 53 02 34 01 4c 45 56 45 4c 53 02 30 01 52 41
CES.12.SKILLS.26 43 45 53 02 31 32 01 53 4b 49 4c 4c 53 02 32 36
.ANSI.1.GMCP.1.M 01 41 4e 53 49 02 31 01 47 4d 43 50 02 31 01 4d
CCP.0.MCP.0.MSDP 43 43 50 02 30 01 4d 43 50 02 30 01 4d 53 44 50
.0.MSP.0.MXP.0.U 02 30 01 4d 53 50 02 30 01 4d 58 50 02 30 01 55
TF-8.0.VT100.0.X 54 46 2d 38 02 30 01 56 54 31 30 30 02 30 01 58
TERM 256 COLORS. 54 45 52 4d 20 32 35 36 20 43 4f 4c 4f 52 53 02
1.PAY TO PLAY.0. 31 01 50 41 59 20 54 4f 20 50 4c 41 59 02 30 01
PAY FOR PERKS.0. 50 41 59 20 46 4f 52 20 50 45 52 4b 53 02 30 01
HIRING BUILDERS. 48 49 52 49 4e 47 20 42 55 49 4c 44 45 52 53 02
0.HIRING CODERS. 30 01 48 49 52 49 4e 47 20 43 4f 44 45 52 53 02
0.X-CLACKS-OVERH 30 01 58 2d 43 4c 41 43 4b 53 2d 4f 56 45 52 48
EAD.GNU Terry Pr 45 41 44 02 47 4e 55 20 54 65 72 72 79 20 50 72
atchettÿð 61 74 63 68 65 74 74 ff f0
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="OOB_Tester"
author="Daniel Powell"
id="9fb6f35ca9de5dd7490565c6"
language="Lua"
purpose="Test OnPluginBroadcast for Telnet Options"
date_written="2019-01-16 11:23:00"
requires="4.90"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
-- Ripped off from Nick Gammon's GMCP Handler
-- https://www.gammon.com.au/gmcp
-- https://raw.githubusercontent.com/nickgammon/plugins/master/GMCP_handler_NJG.xml
require "tprint"
require "json"
-- Standard Telnet Options
-- (https://www.iana.org/assignments/telnet-options/telnet-options.xhtml,
-- https://www.gammon.com.au/scripts/doc.php?general=plugin_callbacks,
-- http://pcmicro.com/netfoss/telnet.html)
local BIN = 0x00
local Echo = 0x01
local SGA = 0x03
local STA = 0x05
local TMK = 0x06
local RMT = 0x07
local LINEWIDTH = 0x08
local PAGESIZE = 0x09
local CRDISP = 0x0A
local HTABS = 0x0B
local HTABDISP = 0x0C
local FFDISP = 0x0D
local VTABS = 0x0E
local VTABDISP = 0x0F
local LFDISP = 0x10
local XASCII = 0x11
local LOGOUT = 0x12
local BYTEMACRO = 0x13
local DETERM = 0x14
local SUPDUP = 0x15
local SUPDUPOUT = 0x16
local SENDLOC = 0x17
local TTYPE = 0x18 -- https://tintin.sourceforge.io/protocols/mtts/
local EOR = 0x19
local TACACSID = 0x1A
local OUTMARK = 0x1B
local TERMLOC = 0x1C
local TEL3270 = 0x1D
local X3PAD = 0x1E
local NAWS = 0x1F
local BAUD = 0x20
local FLOWCTRL = 0x21
local LINEMODE = 0x22
local XDISPLOC = 0x23
local ENVOPT = 0x24
local AUTHOPT = 0x25
local ENCOPT = 0x26
local NEWENVOPT = 0x27
local TN3270E = 0x28
local XAUTH = 0x29
local CHARSET = 0x2A
local TELRSP = 0x2B
local COMCTRL = 0x2C
local TELSLE = 0x2D
local STARTTLS = 0x2E
local KERMIT = 0x2F
local SENDURL = 0x30
local FORWARDX = 0x31
-- Custom Telnet Options 50-137, 141-254 (0x32-0x89, 0x8D-0xFE)
local MSDP = 0x45 -- https://tintin.sourceforge.io/protocols/msdp/
local MSSP = 0x46 -- https://tintin.sourceforge.io/protocols/mssp/
local MCCPv1 = 0x55
local MCCPv2 = 0x56 -- https://tintin.sourceforge.io/protocols/mccp/
local MSP = 0x5A -- https://www.zuggsoft.com/zmud/msp.htm
local MXP = 0x5B -- http://www.zuggsoft.com/zmud/mxp.htm
local Aardwolf = 0x66
local ATCP = 0xC8 -- https://www.ironrealms.com/rapture/manual/files/FeatATCP-txt.html
local GMCP = 0xC9 -- https://www.gammon.com.au/gmcp
-- Telnet Commands
local SE = 0xF0
local SB = 0xFA
local WILL = 0xFB
local WONT = 0xFC
local DO = 0xFD
local DONT = 0xFE
local IAC = 0xFF
---------------------------------------------------------------------------------------------------
-- Mushclient callback function when telnet SB data received.
---------------------------------------------------------------------------------------------------
function OnPluginTelnetRequest (msg_type, data)
Note("OnPluginTelnetRequest(): Type " .. msg_type .. ", Data: " .. data)
if msg_type == MSSP then
-- Indicate that we can read MSSP
return true
else
return false -- return this for now.
end -- if
end -- function OnPluginTelnetRequest
function OnPluginTelnetSubnegotiation (msg_type, data)
Note("OnPluginTelnetSubnegotiation(): Type " .. msg_type .. ", Data: " .. data)
end -- function OnPluginTelnetSubnegotiation
---------------------------------------------------------------------------------------------------
-- Helper function to send GMCP data.
---------------------------------------------------------------------------------------------------
function Send_GMCP_Packet (what)
assert (what, "Send_GMCP_Packet passed a nil message.")
SendPkt (string.char (IAC, SB, GMCP) ..
(string.gsub (what, "\255", "\255\255")) .. -- IAC becomes IAC IAC
string.char (IAC, SE))
end -- Send_GMCP_Packet
]]>
</script>
</muclient>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment