GMCP Help

Posted by Kevnuke on Sat 25 Aug 2018 03:40 AM — 13 posts, 37,915 views.

USA #0
Can anyone confirm that IRE.Rift.Request on Achaea is not getting a response from the server, or am I just not doing it right?

http://nexus.ironrealms.com/GMCP under IRE.Rift

I'm using the following:


<alias
    match="^rift$"
    enabled="y"
    regexp="y"
    ignore_case="y"
    send_to="12"
    script="IRERiftRequest"
/>

local SB_GMCP = "\255\250\201" .. "%s" .. "\255\240"

function IRERiftRequest ()
	SendPkt(SB_GMCP:format("IRE.Rift.Request"))
end


I also tried this with the same alias:


function SendGMCP(message, content)
	if type(message) ~= "string" then
		return nil, "Message name must be a string."
	end
  
	if content ~= nil then
		content = json.encode({content})
		if content == nil then
			return nil, "Invalid input."
		end
		message = ("%s %s"):format(message, content:sub(2, #content-1))
	end
  
	SendPkt(SB_GMCP:format(message))
	return true
end

function IRERiftRequest ()
	SendGMCP("IRE.Rift.Request", "")
end


I also tried putting a space after IRE.Rift.Request, but that made no difference.
Australia Forum Administrator #1
Is this in a context where everything else works in GMCP (eg. room info, etc.)?

If so, maybe they didn't implement that message.
#2
Make sure you have IRE.Rift in you core.supports.
http://www.ironrealms.com/gmcp-doc
USA #3
Sondayga said:

Make sure you have IRE.Rift in you core.supports.
http://www.ironrealms.com/gmcp-doc


That was the first thing I did.

Nick Gammon said:

Is this in a context where everything else works in GMCP (eg. room info, etc.)?

If so, maybe they didn't implement that message.


It's the same context as the others, and it's implemented. I know someone on Mudlet that tested it and got a response but I guess they used IRE.Rift, instead of IRE.Rift.Request. I tried it both ways and still nothing. They got an object back like the example they give on the GMCP site.

I mainly just wanted to see if anyone on MUSHclient had done it successfully before saying anything to IRE about it.

I was thinking maybe it has something to do with how the function I'm using doesn't like content = nil, for the messages that don't have any content following them.

maybe this would work?


function SendGMCP(message, content)
	if type(message) ~= "string" then
		return nil, "Message name must be a string."
	end
  
	if content ~= nil then
		content = json.encode({content})
		message = ("%s %s"):format(message, content:sub(2, #content-1))
	end
  
	SendPkt(SB_GMCP:format(message))
	return true
end
Australia Forum Administrator #4
Your first alias looked OK to me, however this would be less confusing:


SendPkt("\255\250\201" .. "IRE.Rift.Request" .. "\255\240")


Or even:


SendPkt("\255\250\201IRE.Rift.Request\255\240")


That string.format stuff is unnecessary when it is all constant data. Also the JSON encoding doesn't really apply here.
Australia Forum Administrator #5
Did you do what Sondayga suggested in reply #2?
#6
Not sure if it helps, but this is what I have.


function gmcp_sendpkt(data)
	SendPkt(string.char(IAC, SB, GMCP)..string.gsub(data, "\255", "\255\255")..string.char(IAC, SE))
end



function get_rift()
	gmcp_sendpkt('IRE.Rift.Request')
end
USA #7
Nick Gammon said:

Did you do what Sondayga suggested in reply #2?


Yes, I replied in Reply #3.

This is my supported modules table. The only thing I can think of is maybe the version number is wrong for IRE.Rift?


local GMCP_options = {
  "Char 1",
  "Char.Afflictions 1",
  "Char.Defences 1",
  "Char.Items 1",
  "Char.Skills 1",
  "Comm.Channel 1",
  "Room 1",
  "IRE.Rift 1",
  "IRE.Target 1",
  "IRE.Time 1"
}


I've tried sending IRE.Time.Request and Comm.Channel.Players as well just to see if any of them worked and Comm.Channel.Players worked if I put Send("") after the SendPkt. For some reason certain messages don't send a response without some extra input from the client.

The only thing I can think of is that either MUSHclient is intercepting the messages before the client can ColourNote them to the screen or IRE has something against MUSHclient lol

I'm not sending the wrong message because when I have before I get this response from the server:

WARNING: Your client sent an erroneous GMCP message - ire.rift. If you are using one of the IRE clients, please file a BUG in-game, otherwise please check your client settings.
#8
Did you get any head way on this? I'm able to get a response while on Achaea.


[05:30:23|100%h|91%m|100%en|100%will|Level]  ex- 
[debug]: Received GMCP message: IRE.Time.Update.
[debug]: Data: { "daynight": "48" }

[debug]: Received GMCP message: Char.Vitals.
[debug]: Data: { "hp": "3095", "maxhp": "3095", "mp": "2899", "maxmp": "3190", "ep": "14375", "maxep": "14375", "wp": "13400", "maxwp": "13400", "nl": "1", "bal": "1", "eq": "1", "string": "H:3095/3095 M:2899/3190 E:14375/14375 W:13400/13400 NL:1/100 ", "charstats": [ "Bleed: 0", "Rage: 0", "Spirits: 0" ] }
[debug]: gmcp.Char.Vitals updated.
[05:31:24|100%h|91%m|100%en|100%will|Level]  ex- 
[debug]: Received GMCP message: IRE.Rift.List.
[debug]: Data: [ { "name": "bayberry", "amount": "46", "desc": "bayberry bark" }, { "name": "mending", "amount": "625", "desc": "a salve of mending" }, { "name": "pear", "amount": "100", "desc": "prickly pear" }, { "name": "echinacea", "amount": "50", "desc": "echinacea" }, { "name": "elm", "amount": "148", "desc": "slippery elm" }, { "name": "ginger", "amount": "50", "desc": "ginger root" }, { "name": "myrrh", "amount": "48", "desc": "myrrh gum" }, { "name": "bellwort", "amount": "150", "desc": "bellwort flower" }, { "name": "cohosh", "amount": "150", "desc": "black cohosh" }, { "name": "kola", "amount": "100", "desc": "kola nut" }, { "name": "valerian", "amount": "98", "desc": "valerian" }, { "name": "skullcap", "amount": "196", "desc": "skullcap" }, { "name": "ginseng", "amount": "99", "desc": "ginseng root" }, { "name": "epidermal", "amount": "389", "desc": "an epidermal salve" }, { "name": "mana", "amount": "2000", "desc": "an elixir of mana" }, { "name": "caloric", "amount": "199", "desc": "a caloric salve" }, { "name": "health", "amount": "592", "desc": "an elixir of health" }, { "name": "bloodroot", "amount": "73", "desc": "bloodroot leaf" }, { "name": "rope", "amount": "22", "desc": "rope" }, { "name": "cloth", "amount": "2", "desc": "cloth" }, { "name": "immunity", "amount": "400", "desc": "an elixir of immunity" }, { "name": "restoration", "amount": "660", "desc": "a salve of restoration" }, { "name": "goldenseal", "amount": "50", "desc": "goldenseal root" }, { "name": "hawthorn", "amount": "50", "desc": "hawthorn berry" }, { "name": "kelp", "amount": "49", "desc": "kelp" }, { "name": "ash", "amount": "50", "desc": "prickly ash bark" }, { "name": "sileris", "amount": "130", "desc": "sileris" }, { "name": "frost", "amount": "400", "desc": "an elixir of frost" }, { "name": "lobelia", "amount": "60", "desc": "lobelia seed" }, { "name": "wood", "amount": "20", "desc": "wood" }, { "name": "steel", "amount": "10", "desc": "steel" }, { "name": "speed", "amount": "60", "desc": "an elixir of speed" } ]
[debug]: Received GMCP message: IRE.Time.Update.
[debug]: Data: { "daynight": "51" }
[debug]: Received GMCP message: Comm.Channel.Text.
[debug]: Data: { "channel": "ct", "talker": "Auld", "text": "\u001b[0;32m(Eleusis): Auld says, \"Bye!\"\u001b[0;37m" }
[debug]: Received GMCP message: Comm.Channel.Start.
[debug]: Data: ["ct"]

(Eleusis): Auld says, "Bye!"
[debug]: Received GMCP message: Comm.Channel.End.
[debug]: Data: ["ct"]


Are you getting rift change messages when you outr or inr?
Amended on Mon 27 Aug 2018 08:36 PM by Sondayga
Australia Forum Administrator #9

What’s the problem exactly? You are getting IRE.Rift.List messages.

#10
I am getting the messages yes. Kevnuke was not able to get them and I was checking if they had got it fixed. Thanks!
Australia Forum Administrator #11
Sorry, I got the two of you confused. :)
USA #12
Not sure how I got unsubscribed from this thread, but anyway I got a reply from IRE staff earlier.


Message #12         Sent by Anytus
2018/9/03/13:32 Greetings! Regarding issue #83520: Our head coder and user of Mushclient has tested the rift request GMCP function and it appears to be working fine. If you are continuing to have problems with this, please file a BUG or another ISSUE and we will look into it further.


I know it's working, I just wasn't doing something right.
So I took the alias and function I was using to send IRE.Rift.Request and stuck it in your GMCP_handler_NJG plugin.
BAM started getting IRE.Rift.List. Something in my plugin is interfering, probably in the OnPluginTelnetSubnegotiation. I'm not sure how or why since I'm doing the ColourNote before I change the "data" in anyway. but here's the entire plugin.

https://pastebin.com/SAGz0uPr