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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  MUD Design Concepts
. . -> [Subject]  (Another) MCCP Thread

(Another) MCCP Thread

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


Posted by Alcornj   (8 posts)  [Biography] bio
Date Sun 29 Aug 2010 12:38 AM (UTC)

Amended on Sun 29 Aug 2010 12:55 AM (UTC) by Alcornj

Message
I'll spare the explanation about how little I know, it'll become self evident soon enough. I'm trying to install MCCP(preferrably support for v1 AND v2) on a ridiculously modified Rom24 mud. I've looked at installing the telopt snippet: "http://www.mudbytes.net/file-2608", but got a little confused because the installation documentation sucks, as well as the "Rom24 patch" from "http://mccp.smaugmuds.org/codebase.html". I ended up installing the "Rom24 patch". Long story short, its not working properly and I don't know -anything- about programming outside of standard Rom C. I've looked at Dawn of Time and Socketmud for inspiration but the implementations are so radically different that I'm getting myself confused. What I'd like is if somebody could point me to a reasonably stock Rom24 with mccp 1&2 support implemented and completely working to study, or anybody who's had problems getting it implemented that might tell me whats wrong with that snippet and how to fix it. I can sign into the mud with Wintin95 (my primary client) and it doens't turn MCCP on, so when I try to turn it on with "compress", the client freezes. Mushclient recognizes the call for MCCP that goes into comm.c, signs me in, allows me to turn compression OFF, but when I try to turn it back on, mushclient boots me off, telling me: "Could note decompress text from MUD: unknown compression method".

When I sign in, do NOT use the compress command, but copyover, it tells me: "Could not decompress text from MUD: invalid literal/length code" No ideas, and any help would be appreciated. It seems like Rom muds are a dying relic, but I imagine enough people currently code for, or used to code for, a Rom mud thats run into this problem before. Thanks again for your time. (Thanks Twisol, for the heads up)
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Sun 29 Aug 2010 12:46 AM (UTC)
Message
Alcornj said:
There's no edit button

Make sure you've logged in using the login form on the upper-right of the page. The login form in the post submission form is just for the one post. If you're logged into the forums directly, you should have an edit button next to the date on your post.

'Soludra' on Achaea

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

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sun 29 Aug 2010 03:51 AM (UTC)
Message
Quote:

Mushclient recognizes the call for MCCP that goes into comm.c, signs me in, allows me to turn compression OFF ...


How did you do that?

- Nick Gammon

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

Posted by Alcornj   (8 posts)  [Biography] bio
Date Reply #3 on Sun 29 Aug 2010 01:22 PM (UTC)
Message
/* mccp: tell the client we support compression
write_to_buffer( dnew, compress_will, 0 );

Immediately before we send the greeting. As far as I know, thats all we needed to do, correct?
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #4 on Sun 29 Aug 2010 02:49 PM (UTC)

Amended on Tue 07 Apr 2015 01:36 AM (UTC) by Nick Gammon

Message
I haven't read the entire thread, but reading your latest post makes me think that your server gets out of sync after hotbooting, basically making it so MUSHclient still believes there is compression going on, but the server does not have a record of such after the reboot, meaning it sends plain data. And MUSHclient can't make sense of plain data because it expects compressed things.

There are several ways you can approach this problem, but the simplest is as follows:

1. Before doing the actual reboot (pre-fork / system call or whatever the exact implementation is), make existing connections terminate their compressed output. If you are using zlib, I believe is has something according to a zlib_end_compress() or whatever, which sends over a few bytes to the client signifying the end of the compression.

2. The next part depends on how you pass over the descriptors of the sockets to the new instance. You will have to find a way to pass information about negotiated protocols along with those handles, since these protocols (MCCP, MXP, etc) belong with the active connection.

3. Now as the copyover or whatever happens in the newly started ('restarted') process, where existing descriptors are attached to characters and such, you will need to keep in mind what the state of the protocols are. In this case of MCCP2, if it has been succesfully negotiated, you will once more want to initialize compression. (Basically, the same thing you do for new connections, minus the entire IAC WILL/DO MCCP2 bit... thus the IAC SB MCCP2 I think it is, followed by a zlib_start_compress() sort of call.)

Doing only step no. 1 will already fix your problem of MUSHclient throwing up because of the compressed data. The disadvantage of not doing steps 2 and 3 is that after the reboot, your game will no longer be compressing the data, and depending on the lifetime of those connections, it may have a smaller or bigger impact than you would expect.

Disclaimer: I am not a psychic, and I don't remember the exact API of zlib although I did implement MCCP2 in my own server once before. But it should be helpful never the less, assuming I'm somewhat on the mark of your problem. :)

Edit: For more information on MCCP, have a look at mudstandards.org/MCCP_Specification

[EDIT] (April 2015) Warning: Domain name mudstandards.org has been abandoned. That site is now an adult products shop.
[Go to top] top

Posted by Alcornj   (8 posts)  [Biography] bio
Date Reply #5 on Sun 29 Aug 2010 05:08 PM (UTC)

Amended on Tue 07 Apr 2015 01:36 AM (UTC) by Nick Gammon

Message
That was simple. Before it goes into the copyover data I have it turn compression off, and sends the string to the client during copyover_recover to essentially re-enable it. But that doesn't fix any of the other problems. I'm having. Thank for the link to mudstandards.org. I'd never even heard of this site and the hours I"ve spent googling never led me to it. When I sign in/copyover recover, it sends the string to let Mushclient know taht mccp is here, and correctly begins compressing data (I assume), because when I use the compress command I get the "Ok, Compression disabled." message. But when I try to re-enable compression, mushclient disconnects me.

[EDIT] (April 2015) Warning: Domain name mudstandards.org has been abandoned. That site is now an adult products shop.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #6 on Sun 29 Aug 2010 05:51 PM (UTC)
Message
Make sure you flush your MCCP buffer once you disable MCCP, or it might still have unsent compressed data next time you enable it. Just a guess, but I know someone who accidentally did that.

'Soludra' on Achaea

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

Posted by Alcornj   (8 posts)  [Biography] bio
Date Reply #7 on Sun 29 Aug 2010 06:21 PM (UTC)
Message
I call compressEnd(d); in the loop where it begins initializing descriptors, and I believe it clears everything in there.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #8 on Sun 29 Aug 2010 07:05 PM (UTC)
Message
Alcornj said:
But when I try to re-enable compression, mushclient disconnects me.


Is there a specific error message you get? Or does it just give you the vanilla "You have disconnected"? If it's an error, it's most likely an issue with the server MCCP. If it's not, it sounds like the server is inadvertently disconnecting the client.

'Soludra' on Achaea

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

Posted by Alcornj   (8 posts)  [Biography] bio
Date Reply #9 on Sun 29 Aug 2010 07:10 PM (UTC)
Message
The three error messages I've seen generated are as follows:

Could not decompress text from MUD: invalid literal/length code

Could not decompress text from MUD: unknown compression method

Could not decompress text from MUD: invalid stored block lengths

I don't remember how I generated the third one, so I can't recreate the circumstances without playing around with the code.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #10 on Sun 29 Aug 2010 07:18 PM (UTC)
Message
I would double-check the implementation of compressEnd(), if you can. That's clearly an MCCP issue, and it looks very much like the zlib buffer wasn't explicitly flushed.

'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 #11 on Sun 29 Aug 2010 08:08 PM (UTC)
Message
I'm with Twisol on this one. Somehow, you aren't flushing your terminated zlib data properly, meaning MUSHclient never got the note about there being no more compression.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #12 on Sun 29 Aug 2010 08:23 PM (UTC)

Amended on Sun 29 Aug 2010 08:24 PM (UTC) by Twisol

Message
Right, that point is important. Flush the buffer immediately after you send the disable-MCCP command to the client, not before.

'Soludra' on Achaea

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

Posted by Alcornj   (8 posts)  [Biography] bio
Date Reply #13 on Sun 29 Aug 2010 09:13 PM (UTC)

Amended on Sun 29 Aug 2010 09:24 PM (UTC) by Alcornj

Message
Okay, I plugged and chugged the way the telopt snippet was handling start and end compression, and with MUSHclient v. 4.43, I'm no longer getting any problems turning compression off and on. (For control purposes, a client thats mccp enabled). My primary client when mudding is Wintin95 (version 1.8) still freezes when I try to turn on compression. Thanks again.
[Go to top] top

Posted by Alcornj   (8 posts)  [Biography] bio
Date Reply #14 on Mon 30 Aug 2010 03:06 PM (UTC)
Message
I believe I got everything sorted out and working, thank you all for your help.
[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.


33,082 views.

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 HostDash]