Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ IRE Muds - ATCP

IRE Muds - ATCP

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  3  

Posted by Flelm   (15 posts)  Bio
Date Mon 11 Sep 2006 11:18 AM (UTC)
Message
Basically, I was wondering if its possible to get MUSHclient to hook into TELNET sub-option negotiation in order to pull, in my case, information from the various IRE MUDs.

Here is the document on ATCP: http://www.ironrealms.com/rapture/manual/files/FeatATCP-txt.html

I have no problem in doing the coding gruntwork, if someone can point me in the initial direction. I assume I'd need to (at least) put together a dll file.

Thanks in advance.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Mon 11 Sep 2006 12:14 PM (UTC)
Message
Last I checked, which was again just now, Mushclient resists you messing with options negotiation. For example, the following (IRE docs messed up the numerical codes btw):


function OnPluginPacketReceived(packet) 
  if string.find(packet, "\255\251\200") then
     Send("\255\253\200")
  end
end


Results in Mushclient sending 255 255 253 200 + newline, therefore escaping your attempt at an option reply. Then it proceeds to refuse that 200 option. So unless Nick adds a callback to specifically hook into this sequence it seems impossible.

Top

Posted by Flelm   (15 posts)  Bio
Date Reply #2 on Mon 11 Sep 2006 12:19 PM (UTC)
Message
That would answer my question in the short term.

Immediately after posting that I had done a little more research and had figured out if I could only figure out how to send that packet I could filter out the rest of the incoming messages.

Anyone else know of a way to do this? Nick?
Top

Posted by Tsunami   USA  (204 posts)  Bio
Date Reply #3 on Mon 11 Sep 2006 05:44 PM (UTC)
Message
Heh, I've been looking for that information for some time now, thanks for the link.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #4 on Mon 11 Sep 2006 06:14 PM (UTC)
Message
Erm, also worthy of mention is the fact that the last time I successfully negotiated ATCP, which was fairly long ago, there was a catch. Not sure if it still exists, but back then the server sent an authentication code after a couple of minutes, and after my failing to confirm it stopped sending any extra info.

But they might've given up on that since then, I think there was some custom-coded proxy that claimed to successfully use ATCP.
Top

Posted by Flelm   (15 posts)  Bio
Date Reply #5 on Mon 11 Sep 2006 10:26 PM (UTC)
Message
I know of the proxy, and it does successfully use ATCP.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #6 on Mon 11 Sep 2006 11:25 PM (UTC)
Message
At present MUSHclient assumes that when you do world.Send or any of its variants you are trying to send a command to the MUD, and that command will be terminated by a newline. If it didn't make that assumption everyone would have to do things like this:

Send ("north\n")

I suppose it would be reasonably easy to add a "SendPacket" function, which bypasses all the normal tests and plugin callbacks (eg. OnPluginSend and so on) and simply sends the packet.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tsunami   USA  (204 posts)  Bio
Date Reply #7 on Tue 12 Sep 2006 02:55 AM (UTC)
Message
Go Nick :D
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #8 on Tue 12 Sep 2006 03:22 AM (UTC)
Message
OK, added SendPkt to version 3.81.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #9 on Tue 12 Sep 2006 11:31 AM (UTC)
Message
Would that callback work though? I am not an expert on how telnet option negotiation works, but wouldn't Mushclient sending a DON'T after a plugin sends a DO for an option present a problem?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #10 on Tue 12 Sep 2006 09:08 PM (UTC)
Message
Well it actually responds WONT - I just tested with the packet debug.

However all you have to do is amend the incoming packet to get rid of the IAC DO ATCP from the packet, and then using SendPkt you reply IAC WILL ATCP and you should be fine.

So, I think this change is all that is needed to use the ATCP feature.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #11 on Tue 12 Sep 2006 09:20 PM (UTC)
Message
Quote:

Results in Mushclient sending 255 255 253 200 + newline ...


I didn't notice initially your point that the IAC got doubled (as well as a newline added). The new SendPkt function fixes both of those problems, it does not double the IAC character, and does not append newlines.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #12 on Sun 15 Oct 2006 06:46 AM (UTC)

Amended on Sun 15 Oct 2006 06:57 AM (UTC) by Ked

Message
Nevermind - found a way.
Top

Posted by Tsunami   USA  (204 posts)  Bio
Date Reply #13 on Sun 15 Oct 2006 06:43 PM (UTC)
Message
Has anyone got a working version of this they could post?
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #14 on Sun 15 Oct 2006 11:12 PM (UTC)
Message
This is what I have so far, still haven't decided what I want to do with the data though:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="ATCP"
   author="Keldar"
   id="a2a6350d9144c09a8a7c4636"
   language="Lua"
   purpose="Enabling the ATCP protocol"
   date_written="2006-10-15"
   requires="3.81"
   version="1.0"
   >
<description trim="y">
<![CDATA[
sdf
]]>
</description>

</plugin>


<!--  Get our standard constants -->

<include name="constants.lua"/>

<!--  Script  -->


<script>
<![CDATA[
require "tprint"

codes = {
IAC_WILL_ATCP = "\255\251\200",
IAC_WONT_ATCP = "\255\252\200",
IAC_DO_ATCP = "\255\253\200",
IAC_DONT_ATCP = "\255\254\200",
IAC_SB_ATCP = "\255\250\200",
IAC_SE = "\255\240"
}

leftovers = nil

function OnPluginPacketReceived(packet) 
  if string.find(packet, codes.IAC_WILL_ATCP) then
    SendPkt(codes.IAC_DO_ATCP)
    Note("TEST")
    return string.gsub(packet, "(.-)" .. codes.IAC_WILL_ATCP .. "(.-)", "%1%2")
  end
  local atcp = parseATCP(packet)
  --tprint(atcp)
  return packet
end


function parseATCP(packet)
  local packet = packet
  if leftovers then
    packet = leftovers .. packet
  end
  local atcp = {}
  for msg in string.gmatch(packet, codes.IAC_SB_ATCP .. ".-" .. codes.IAC_SE) do
    table.insert(atcp, msg)
  end
  leftovers = string.match(packet, "(\255\250?\200?[^" .. codes.IAC_SE .. "]-)$")
  return atcp
end

]]>
</script>


<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="ATCP:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
function OnHelp ()
  world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script> 

</muclient>
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


85,469 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.