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. |