|
1. MCCP2 help
|
|
Sat Feb 12, 2005 [8:08 PM]
|
ROMMAN
Email not supplied
member since: Oct 24, 2004
|
Reply
|
|
Im trying to get some MCCP2 support going. unfortunately i havent been able to find a patch snippet or source for rom. Ive got a code base that supports it and ive tried ripping it out of there , and transplanting it , and it works i think except for one little thing that bothers me. after enabling compression , or let me rephrase that after trying to enable compression ( in other words weather or not your client supports it, does this to all characters) the first command or input you type returns a Huh? statement , its like after trying to enable compression it tacks on some invisible characters or something to your descriptor, so that your next command is who for example.
so my question is , anyone know what this might from? or a patch for MCCP2 for rom?
Thanks ROMMAN
|
|
|
|
|
2. RE: MCCP2 help
|
|
Sat Feb 12, 2005 [8:11 PM]
|
Samson
Email not supplied
member since: Jul 24, 1999
|
In Reply To
Reply
|
http://mccp.afkmud.comThere is a patch against stock Rom 2.4 code available here. As indicated, it hasn't been extensively tested, but it should work.
|
|
|
|
|
3. RE: MCCP2 help
|
|
Sat Feb 12, 2005 [8:43 PM]
|
ROMMAN
Email not supplied
member since: Oct 24, 2004
|
In Reply To
Reply
|
|
Ive seen that, but that is only MCCP1 support if i am not mistaken. i figured if im going to do this i might as well support it all.
|
|
|
|
|
4. RE: MCCP2 help
|
|
Sat Feb 12, 2005 [10:33 PM]
|
Samson
Email not supplied
member since: Jul 24, 1999
|
In Reply To
Reply
|
|
I'm not aware of anything out there with version 2 support for Rom. The material on the mccp site I'm archiving is rather old, but if someone does have a patch, I'd gladly host it there.
|
|
|
|
|
5. RE: MCCP2 help
|
|
Sun Feb 13, 2005 [12:14 PM]
|
Robbert
Email not supplied
member since: Jul 12, 1999
|
In Reply To
Reply
|
|
I'm not familiar with MCCP2, but I'm assuming it works similarly to the telnet negotiation sequences. If so, then the problem is that you are not flushing your input buffer from the client socket after interpreting the stream sent to you.
Reset the input buffer (to '\0' in ROM, I think) after handling the negotiation, and it should work fine. What is happening is your game is receiving the next command from the client, with the previous data there as well (since it was in the buffer, but not cleared), so is seeing something like 31who (where 31 is a single-digit int, really '31''w''h' and 'o')
--Bert
|
|
|
license.theinquisition.net
--Duty is the most sublime word in the English language. One can never do more than one's duty, and should never wish to do less.
|
|
6. RE: MCCP2 help
|
|
Mon Feb 14, 2005 [10:03 AM]
|
ROMMAN
Email not supplied
member since: Oct 24, 2004
|
In Reply To
Reply
|
|
This makes sense and i think your probably right, im just not sure what pointer im supposed to clear. Im assuming that this should be done after enabling compression.
|
|
|
|
|
7. RE: MCCP2 help
|
|
Mon Feb 14, 2005 [5:57 PM]
|
Robbert
Email not supplied
member since: Jul 12, 1999
|
In Reply To
Reply
|
I took the time to read up on this, and it's exactly that. I wrote this into the project I'm working on (custom, using bare socket information from KaVir's Gladiator Pits II). What you need to do is whereever your server gets the information that the client will decompress (iac_do_compress2) have the code return from there: (copied from the mccp v1 patch for ROM)
+ if (!memcmp(&d->inbuf[i], compress_do, strlen(compress_do))) {
+ i += strlen(compress_do) - 1;
+ compressStart(d);
+++ d->incomm[0] = '\0'; //reset the buffer
+++ return;
+ }
+ else if (!memcmp(&d->inbuf[i], compress_dont, strlen(compress_dont))) {
+ i += strlen(compress_dont) - 1;
+ compressEnd(d);
+++ d->incomm[0] = '\0'; //reset the incoming buffer
+++ return;
+ }
+ }
It has been a few years since I touched ROM code, but I think this may be what you need, and where you need it. Essentially, you are doing 'read_from_buffer' and getting the telnet-negotiation stuff (IAC, DO, COMPRESS2), and doing what is necessary to turn on (or off) that compression. Clients are set up to send negotiation streams as a line to themselves (in sane environments), so it should be safe to assume that no further traffic is necessary on that line. You can continue to process it, or do a simple check to see if there's anything further, but I doubt it is necessary. I do have a question now. From what I have seen, the only difference between MCCP1 and MCCP2 is that the MCCP2 protocol uses 86 instead of 86 for COMPRESS, and that it uses proper IAC SB OPT IAC SE encapsulation. Is there another difference beyond this that I am missing? --Bert
|
|
|
license.theinquisition.net
--Duty is the most sublime word in the English language. One can never do more than one's duty, and should never wish to do less.
|
|
8. RE: MCCP2 help
|
|
Tue Feb 15, 2005 [5:13 PM]
|
ROMMAN
Email not supplied
member since: Oct 24, 2004
|
In Reply To
Reply
|
|
Bert thanks for your help i appreciate the amount of time you spent working on my problem, i decided to restore froma backup and use the MCCp1 patch , and muddle through adding all the .rej , after adding in some of the missing things, i got it to work correctly. i noticed. there was no mention of d->incomm[0] = '\0'; //reset the buffer so i went ahead and added as double protection :) Again thanks for the input.
|
|
|
|
|
9. RE: MCCP2 help
|
|
Tue Feb 15, 2005 [7:38 PM]
|
Robbert
Email not supplied
member since: Jul 12, 1999
|
In Reply To
Reply
|
|
That d->incomm[0] = '\0'; //reset the buffer was a hack to make it work if it wasn't resetting on its own for whatever reason. It -should- work without it. Try commenting out those lines (the two with +++ on them, those were my additions) and see if it works now. If you had .rej files that were not applied during your initial post, it is quite likely that your problem(s) arose from that.
--Robbert
|
|
|
license.theinquisition.net
--Duty is the most sublime word in the English language. One can never do more than one's duty, and should never wish to do less.
|
|
10. RE: MCCP2 help
|
|
Wed Feb 16, 2005 [8:55 AM]
|
ROMMAN
Email not supplied
member since: Oct 24, 2004
|
In Reply To
Reply
|
|
My original post stated that i was stripping out the mccp code form a difrent code base, and tried to implement it. i then decided to restore from a backup and use a rom2.4 patfch and filled in the gaps. I have everything working ok now thanks.
|
|
|
|
|