[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Fully enabled ATCP plugin
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Fully enabled ATCP plugin

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


Pages: 1 2  

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Fri 17 Apr 2009 07:04 AM (UTC)

Amended on Fri 17 Apr 2009 07:05 AM (UTC) by Twisol

Message
I've been working with Trevize's ATCP plugin for a while now, and recently I began modifying it, as you might've deduced from my recent posts here. I've modified it heavily, stripping out bits that weren't needed and updating the functionality a bit. The resulting plugin can now handle any incoming ATCP packet, and it implements a function for sending ATCP messages to the server as well.

The old plugin was restricted to only three messages, and it identified them in BroadcastPlugin() with simple numeric IDs. I changed this so that all message broadcasts had an ID of 1, and the message was packed in with the content in the format "<message>|<content>". I've also added support for enabling of various ATCP command modules, such as 'composer' and 'ping'. Because the plugin needs to know what to enable before connecting, it broadcasts an ID of 0, which client plugins can respond to by calling its EnableModule method. (Thanks to Nick for this technique)

When a module is enabled, various messages included in the module may be sent by the server, which will be broadcast to listening plugins. Modules may also contain client-side messages, such as 'keepalive' which prevents the client from timing out, and 'ping' which speaks for itself. As a basic form of validation, client-side messages can only be sent through the plugin if their associated modules have been enabled. (Basic argument type-checking is also performed on a per-message basis)

To aid in ATCP development, a 'header' file of sorts is included with the plugin, atcp_lua.xml. This file includes definitions such as a variable containing the ATCP plugin's ID, an EnableModuleATCP() function to more easily call the ATCP plugin's EnableModule function, a SendATCP() function that's much the same, and an UnpackATCP() function that splits the broadcast message into two variables (msg and content) and returns them. To use these utilities, add the following line into your plugin file, before the <script> tag:
<include name="atcp_lua.xml" />


Here's an example OnPluginBroadcast definition that shows how easy it is to work with the plugin:


OnPluginBroadcast - function(msg, id, name, text)
  if id == idATCP then
    if msg == 0 then
      EnableModuleATCP("room_brief")
    else
      msg, text = UnpackATCP(text)
      if (msg == "Room.Brief") then
        SetStatus(text)
      end
    end
  end
end


Download page: http://www.jonathan.com/atcp
My documentation of ATCP messages: http://www.jonathan.com/atcp/doc.html

References:
1. Trevize's ATCP plugin: http://www.gammon.com.au/forum/bbshowpost.php?id=8915
2. ATCP documentation: http://www.ironrealms.com/nexus/atcp.html


(If Nick, in his infinite wisdom, sees fit to add this plugin to his plugins page, I will be very, very happy. >_>)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 17 Apr 2009 11:13 AM (UTC)
Message
The four files Twisol refers to can be obtained from here:

http://mushclient.com/plugins/Twisol/

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #2 on Fri 17 Apr 2009 05:00 PM (UTC)
Message
What is ATCP for? That documentation on ironrealms talks about details but not the motivation/purpose of ATCP (or even what the name means).

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #3 on Fri 17 Apr 2009 05:55 PM (UTC)

Amended on Fri 17 Apr 2009 06:36 PM (UTC) by Twisol

Message
It's basically similar to MXP, I suppose, and it was created because at the time, MXP didn't exist. All four (soon to be six, I believe) Iron Realms MUDs are ATCP-enabled.

ATCP stands for Achaean Transport Client Protocol. Another page that's not so clear on the details, but gives a brief overview, can be found here: http://www.ironrealms.com/rapture/manual/files/FeatATCP-txt.html


Nick: Wow, thanks. :D


EDIT: If you happened to see the previous EDIT message I had here, ignore it. My browser had a quirk displaying XML source...

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #4 on Fri 17 Apr 2009 06:38 PM (UTC)
Message
ATCP basically supplies extra information to clients about the game, and works a fair bit differently than MXP. Whereas MXP is negotiated through Telnet once and then mixes its tags (which describe layout, colours and whatnot) in the middle of regular output. With ATCP, any extra information is relayed through telnet data channels (IAC SB ATCP .. IAC SE ATCP if I recall properly) so it will never interfere with the regular output.

It's basically a pure two-way data channel that works with a simple key-like structure.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #5 on Fri 17 Apr 2009 06:42 PM (UTC)

Amended on Fri 17 Apr 2009 06:43 PM (UTC) by Twisol

Message
That's pretty much correct, except that the ATCP is also only "negotiated" once; the start/end byte sequences are in the output text itself, so you have to look for them and remove the ATCP line from the packet before writing the packet data. I thought that was pretty much what MXP did too.

(Also, the end sequence doesn't have an extra ATCP, it's only two bytes)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #6 on Fri 17 Apr 2009 06:54 PM (UTC)
Message
Correct. :) I wrote my own implementation quite some time ago - I bet this is one of those plugins tons of people keep rewriting in their own preferred method. :D

Technically, everything is in the same stream of bits and bytes. The only method to get at said data in MUSHclient is through OnPluginPacketReceived, where you can filter it out also.

On a protocol level however, descriptions of Telnet on RFCs which discuss telnet option negotiation (and suboption negotiation), the data discussed through IAC sequences is considered seperate. To be compliant with the telnet specification, clients -need- to ignore what is inbetween the options if they cannot understand it.

That is basically where ATCP and MXP differ technically, post-negotiation. One messes with input as the client receives it, while the other one continues to do its work below the radar. (On a sidenote - I hate the person who designed MXP, then deviated of it in its own implementation to the point where the 'borked' implementation became the standard... but I digress. :D)
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #7 on Fri 17 Apr 2009 07:07 PM (UTC)

Amended on Fri 17 Apr 2009 07:08 PM (UTC) by Twisol

Message
Interesting, thanks. I'm curious, did your implementation allow for sending as well as recieving? >_>

EDIT: Oh, interesting. I seem to have added a feature that they put in server-side too. It checks outgoing messages to be sure that the appropriate module is enabled, otherwise it doesn't send it - it's mentioned in that Rapture manual page I linked. :D

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #8 on Fri 17 Apr 2009 07:47 PM (UTC)
Message
Mine allows for sending too. It's not too difficult - it's pretty much the same except in the opposite way. SendPkt() is your friend.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #9 on Fri 17 Apr 2009 08:20 PM (UTC)
Message
Yup. Okay, cool, thanks. =)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #10 on Mon 20 Apr 2009 04:10 PM (UTC)
Message
What's the difference more or less between ATCP and ZMP? Probably just that the former was popularized by the Iron Realms games...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #11 on Mon 20 Apr 2009 04:16 PM (UTC)
Message
Er, what's ZMP? <_<

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #12 on Mon 20 Apr 2009 04:20 PM (UTC)
Message
Heh. :-)
http://sourcemud.org/wiki/ZenithMudProtocol

After reading your description of ATCP, it looks like it's basically the same idea: a way to communicate information without using the main communication channel.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #13 on Mon 20 Apr 2009 06:12 PM (UTC)
Message
I think it is the same kind of reason you had VHS and Betamax, with the latter losing even though it predated VHS and was superior. It just gains more popularity because more people use it.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #14 on Mon 20 Apr 2009 07:25 PM (UTC)
Message
Yeah, in fact ZMP looks almost identical to ATCP.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] 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.


18,941 views.

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

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]