Hotboot/MCCP conflict

Posted by Zeno on Sun 26 Dec 2004 05:01 PM — 5 posts, 18,526 views.

USA #0
Even though Samson's hotboot snippet should support MCCP, it basically doesn't. Or at least not v2. I have no warnings or errors while compiling without MCCP. But with MCCP, and hotboot...

hotboot.c: In function `do_hotboot':
hotboot.c:651: error: structure has no member named `can_compress'
hotboot.c: In function `hotboot_recover':
hotboot.c:796: error: structure has no member named `can_compress'
hotboot.c:797: error: structure has no member named `can_compress'
hotboot.c:798: error: too few arguments to function `compressStart'


I saw nothing like can_compress with MCCP v2, so I'm not sure where to go. The link to the MCCP v2 installation is here:
http://www.dotd.com/source/smaug14a-mccp2.patch

I had to manually install the patch due to my codebase has changed too much. I already emailed Samson, but I suppose it would be easier to start a topic here rather than do it through email.
Canada #1
I've implemented MCCP into lots of different code bases that had copyover, and none went smoothly. can_compress, I beleiver(at work, can't confirm), is a string constant that is used to send to connecting clients to detect if they support MCCP. If you can't find it, there are several other places that you can get it, including AFKmud, since you're obviously no stranger to his site :). Unless you have more errors as well, it looks like the calls to can_compress in comm.c are fine, so you likely just need to define an extern to it inside hotboot.c. The too few arguements should be a fairly simple fix. I beleive that there might be a few other posts about this problem, but none come to mind immediately.
Amended on Sun 26 Dec 2004 06:34 PM by Greven
USA #2
I think can_compress is a interger from what I saw. I have these fields added for MCCP:
    unsigned char       compressing;
    z_stream *          out_compress;
    unsigned char *     out_compress_buf;


I think that one of them can be used instead of can_compress.
Canada #3
Doing a search on these forums for can_compess found this
#ifdef MCCP
d->can_compress,
#else
Thinking about this, its a bool for saving during the hotboot. Just written to the hotboot file and read in about a specific descriptor.
USA #4
can_compress is just as Greven said, merely a bool for storing the state of the compressin over a hotboot. While the hotboot code is setup to support MCCP for the most part, not everything will have been accounted for. It was a bool I added on my own to make things a bit easier on myself. It should be added to the descriptor_data structure.

If you look in AFKMud as mentioned, you'll find that variable is referenced in a couple of places to make sure the MCCP can get started properly again.