Making an attempt to get the gmcp mapper working with the Family LAN MUD is proving to me just how lacking in LUA knowledge I currently am.
decided to finally break down and ask here if someone can point me in the right direction to figuring this out, or even just point and laugh at
the obivous thing I'm missing.. but still point me in the direction of fixing it. :)
Anyways, fresh install of:
Muschlient 5.05 , GMCP_handler_NJG 1.0 , GMCP_Mapper 1.70, muschclient mapper ver 2.6
I get the error:
Run-time error
Plugin: GMCP_Mapper (called from world: CoffeeTest)
Function/Sub: OnPluginBroadcast called by Plugin GMCP_Mapper
Reason: Executing plugin GMCP_Mapper sub OnPluginBroadcast
[string "Plugin: GMCP_Mapper"]:1273: bad argument #1 to 'concat' (table expected, got string)
stack traceback:
[C]: in function 'concat'
[string "Plugin: GMCP_Mapper"]:1273: in function 'f'
[string "Plugin: GMCP_Mapper"]:1366: in function <[string "Plugin: GMCP_Mapper"]:1313>
After this, I made some quick additions to GMCP_Mapper's OnPluginBroadcat . (Please don't laugh too hard.)
function OnPluginBroadcast (msg, id, name, text)
if id == "85f72d0e263d75df7bde6f00" then
local f = handlers [msg]
if f then
f (text)
end -- have handler
end -- if ATCP message
if id == "74f8c420df7d59ad5aa66246" then -- GMCP_handler_NJG
-- pull out GMCP message, plus the data belonging to it
-- hacky debug time
print ("Pre GMCP pull:" ,message, params)
message, params = string.match (text, "([%a.]+)%s+(.*)")
-- hacky debug time
print ("Post GMCP pull:" ,message, params)
-- no match? oops!
if not message then
return
end -- if
-- hacky debug time
print ("After Match Check:", params)
-- ensure we have an array or object
if not string.match (params, "^[%[{]") then
params = "[" .. params .. "]" -- JSON hack, make msg first element of an array.
-- hacky debug time
print ("After check:", params)
end -- if
-- decode it
result = assert (json.decode (params))
-- hacky debug time
print ("After decode:", result)
-- find a handler for this message type
local f = GMCP_handlers [message:lower ()]
-- hacky debug time
print ("After find handler:", f)
-- warn if not found
if f then
-- call the handler, pass in whatever we got
-- hacky debug time
print ("After find handler Inside:", f, result)
f (result)
-- hacky debug time
print ("After result call:", f, result)
end -- no handler
end -- if GMCP message
-- hacky debug time
print ("After result Outside:", f, result)
end
Which then resulted in this:
MUSHclient mapper installed, version 2.6
Added plugin C:\Users\macki\Documents\MUSHclient\worlds\plugins\GMCP_Mapper.xml
comm.tick { }
Pre GMCP pull: nil nil
Post GMCP pull: comm.tick { }
After Match Check: { }
After decode: table: 02FE4020
After find handler: nil
After result Outside: nil table: 02FE4020
n
room.info {"num":1079696970,"id":"Archon Abode#5","name":"Kitchen","zone":"Archon Abode","desc":"","terrain":"stone","details":"","exits":{"S":-1079696975,"NE":-1079696968,"SW":-1079696969},"coord":{"id":0,"x":-1,"y":-1,"cont":0}}
Pre GMCP pull: comm.tick { }
Post GMCP pull: room.info {"num":1079696970,"id":"Archon Abode#5","name":"Kitchen","zone":"Archon Abode","desc":"","terrain":"stone","details":"","exits":{"S":-1079696975,"NE":-1079696968,"SW":-1079696969},"coord":{"id":0,"x":-1,"y":-1,"cont":0}}
After Match Check: {"num":1079696970,"id":"Archon Abode#5","name":"Kitchen","zone":"Archon Abode","desc":"","terrain":"stone","details":"","exits":{"S":-1079696975,"NE":-1079696968,"SW":-1079696969},"coord":{"id":0,"x":-1,"y":-1,"cont":0}}
After decode: table: 02FE7790
After find handler: function: 02FC4EA0
After find handler Inside: function: 02FC4EA0 table: 02FE7790
Added room 1079696970 to database. Name: Kitchen
Run-time error
Plugin: GMCP_Mapper (called from world: CoffeeTest)
Function/Sub: OnPluginBroadcast called by Plugin GMCP_Mapper
Reason: Executing plugin GMCP_Mapper sub OnPluginBroadcast
[string "Plugin: GMCP_Mapper"]:1273: bad argument #1 to 'concat' (table expected, got string)
stack traceback:
[C]: in function 'concat'
[string "Plugin: GMCP_Mapper"]:1273: in function 'f'
[string "Plugin: GMCP_Mapper"]:1366: in function <[string "Plugin: GMCP_Mapper"]:1313>
My lack of LUA knowledge puts me in the postion of not knowing if this is an issue of the GMCP data being sent incorrectly from the MUD,
(CoffeeMud, which I can access and change the code as I am more familiar with java coding then just inform the codebase developer of the issue)
or some obvious and simple change in the mapper that I am missing thats causing the parsing to get bungled. Anyways, any help, either directly or
pointing me in the right direction to work it out myself would be greatly appreciated.
oh, and in case I missed some info that pertains to the issue, here a link to a vid capture of me gathering the debug info:
https://www.youtube.com/watch?v=cWuTcJSnXos |