So just this week the admins over at Geas MUD (geas.de) implemented an upgrade that will provide players with ATCP2 data that can enable some really sweet mapping to happen.
It's exciting stuff and I'm keen to try my hand at adapting the MUSHclient mapping capability for Geas.
There's just one issue; I'm struggling to get the handler plugin to function correctly (or to understand whether it is working correctly) and, while I'm comfortable with basic lua scripts now, I feel a bit out of my depth with this one. I've had a crack at it before coming to the forums here but haven't gotten very far.
Firstly, Geas describes this in terms of ATCP2 rather than GMCP. To be honest, I don't understand the implications of that difference except that I've been told they're basically the same thing.
Assuming that they are the same (and I'm very unsure of that assumption), I've been trying to understand how a GMCP handler plugin would work on the MUD.
Here are the steps I've taken so far:
I'm currently watching Trace and Debug Packets while I connect to the MUD and move to a new room.
And I'm using two of Nick's plugins listed on this GMCP thread https://www.gammon.com.au/gmcp
1. GMCP_handler_NJG
2. GMCP_message_receiver_test
How I'm interpretting things is that there's some initial TelnetSubnegotiation going on at connection time but then it ceases when the client doesn't return a sufficient response to the server. Here's the connection sequence I've monitored...
On connecting to the MUD:
Quote:
TRACE: Executing Plugin GMCP_handler_NJG script "OnPluginTelnetRequest"
TRACE: Executing Plugin GMCP_handler_NJG script "OnPluginTelnetRequest"
Enabling GMCP.
Client then sends from GMCP_handler_NJC:
Send_GMCP_Packet (string.format ('Core.Hello { "client": "MUSHclient", "version": "%s" }', Version()))
Send_GMCP_Packet ('Core.Supports.Set [ "Char 1", "Comm 1", "Room 1" ]')
Server then sends (Debug Packets):
Quote:
APS ["AP","LI","CV"]
Client receives and handler broadcasts to all plugins:
Quote:
TRACE: Executing Plugin GMCP_handler_NJG script "OnPluginTelnetSubnegotiation"
APS ["AP","LI","CV"]
GMCP_message_receiver_test plugin receives broadcast:
Quote:
TRACE: Executing Plugin GMCP_message_receiver_test script "OnPluginBroadcast"
Debugging from GMCP_message_receiver_test plugin echoes the message in the world window:
Quote:
GMCP: APS
But there's no handler table set up for that message in the test plugin:
Quote:
Warning: No handler for: APS
Now, by comparison, here is what guidance Geas provides in their ATCP2 helpfile:
Quote:
Telnet Protocol Codes:
Name Code
IAC 255
DO 253 DONT 254
WILL 251 WONT 252
SB 250 SE 240
ATCP2 201
ATCP2 packages:
CORE 065 080 # 'AP'
LOCATION 076 073 # 'LI' info about the characters surrounding
VITALS 067 086 # 'CV' info about the characters vitals
Server-tags:
SUPPORTS 083 032 # 'S ' Server send a list of supported features
DATA 068 032 # 'D ' Server sends data
Client-tags:
BEGIN 066 # 'B' Server should send data then changes detected
END 069 # 'E' Server should stop send data
REQUEST 082 # 'R' Server should send actual data
LOCATION-package DATA
"exits" -> mapping of exits with exit type
"hash" -> hash-id of the room (if avaibale)
"links" -> hash-id of linked rooms (if avaibale)
"inside" -> send by inside rooms
"short" -> short desc of the room (if not normal)
"temperature" -> temperature in the room
"type" -> type of the room
exit-types:
undefined -1
room-type 1-13
road 100
door 101 (closed -101)
TRACE: Matched trigger "\b(manhole|door|gate)\b"
hall 102
yard 103
path 104
room types:
water 1
under water 2
air 3
desert 4
arctic 5
mountain 6
meadow 7
forest 8
beach 9
swamp 10
town 11
jungle 12
cave 13
temperature-level
very cold -2
cold -1
hot 1
very hot 2
VITALS-package DATA:
"fatigue" -> 1-20 fatigue level see 'help fatigue'
"health" -> 1-11 health level, see ' help hitpoints'
"intox" -> 1-10 intoxicated level
"mana" -> 1-11 mana level, see 'help mana'
"soaked" -> 1-6 soaked level
"stamina" -> 1-9 stamina level, seel help 'stamina'
"stuffed" -> 1-10 stuffed level
EXAMPLE
Server IAC WILL ATCP
Client IAC DO ATCP2
Server IAC SB ATCP2 CORE SUPPORTS [CORE,LOCATION,VITALS] IAC SE
Client IAC SB ATCP2 LOCATION REQUEST IAC SE
Server IAC SB ATCP2 LOCATION DATA"{"exits":{"north":8,
"northeast":8,"northwest":100,"south":100,"west":8},
"hash":"1A8549F81F6C","links":{"north":"F48B49A87E40",
"northeast":"6AEF4FA8EBE3","northwest":"838C44A84ED6",
"south":"060949403E41","west":"710E44F00ED7"},
"short":"The entrance to a light forest","temperature":-1,
"type":8} IAC SE
If I'm reading this right, the message currently being received:
APS ["AP","LI","CV"]
is actually this:
Server IAC SB ATCP2 CORE SUPPORTS [CORE,LOCATION,VITALS] IAC SE
However, it's not decoded.
So, where is it all going wrong? Are there some changes need to GMCP_handler_NJG to be compatible with the ATCP2 info set out by Geas?
Very appreciative of any insight. |