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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  MUD Design Concepts
. . -> [Subject]  (Another) MCCP Thread
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: (Another) MCCP Thread
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Alcornj   (8 posts)  [Biography] bio
Date Mon 30 Aug 2010 03:06 PM (UTC)  quote  ]
Message
I believe I got everything sorted out and working, thank you all for your help.
[Go to top] top

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

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 Twisol   USA  (2,230 posts)  [Biography] bio
Date Sun 29 Aug 2010 08:23 PM (UTC)  quote  ]

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 Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sun 29 Aug 2010 08:08 PM (UTC)  quote  ]
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,230 posts)  [Biography] bio
Date Sun 29 Aug 2010 07:18 PM (UTC)  quote  ]
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 Alcornj   (8 posts)  [Biography] bio
Date Sun 29 Aug 2010 07:10 PM (UTC)  quote  ]
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,230 posts)  [Biography] bio
Date Sun 29 Aug 2010 07:05 PM (UTC)  quote  ]
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 Sun 29 Aug 2010 06:21 PM (UTC)  quote  ]
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,230 posts)  [Biography] bio
Date Sun 29 Aug 2010 05:51 PM (UTC)  quote  ]
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 Sun 29 Aug 2010 05:08 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sun 29 Aug 2010 02:49 PM (UTC)  quote  ]

Amended on Sun 29 Aug 2010 02:51 PM (UTC) by Worstje

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 http://mudstandards.org/MCCP_Specification
[Go to top] top

Posted by Alcornj   (8 posts)  [Biography] bio
Date Sun 29 Aug 2010 01:22 PM (UTC)  quote  ]
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 Nick Gammon   Australia  (19,169 posts)  [Biography] bio   Forum Administrator
Date Sun 29 Aug 2010 03:51 AM (UTC)  quote  ]
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 Twisol   USA  (2,230 posts)  [Biography] bio
Date Sun 29 Aug 2010 12:46 AM (UTC)  quote  ]
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 Alcornj   (8 posts)  [Biography] bio
Date Sun 29 Aug 2010 12:38 AM (UTC)  quote  ]

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

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.


5,327 views.

[New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]