I ran across a snippet today that allows for a mud to do some telnet negotioation with the client to determine it's id string. I was wondering if you might know of a way to get smaug to work with this since I notice that Mushclient will respond to the request string. I've been trying to get this working in mine, but the code isn't doing much beyond disrupting the login process.
In the packet debug, this is what is sent at the beginning of the greeting display:
After the rest of the greeting packet is spewed, this gets sent back:
Now, the problem of course is, the client ID string isn't being sent with a /n/r combination since that shows up as 0a 0d. It seems to instead be terminated by the ff f0 combination. Now, what's happening is this. I boot the mud, then try to log in. The login sequence asks my name. I input it. The login prompt then tells me no such player exists, at which point I can input it again, get the password prompt, and go from there. Only once I'm in, the MCCP/MXP/MSP options have failed to negotiate, and the logs don't show that it ever detected a terminal.
The same thing is happening with Zmud too. Simply fails to detect and then disrupts the entire login process. Of course I can't get a nice neat packet debug off of that. And interestingly enough, it seems that Linux telnet doesn't even respond to the query since it logged in fine.
The code I am using to do this is as follows: (it's commented out right now since it doesn't work)
The original snippet I was modifying for use on my mud was here: http://www.auricmud.com/snippets/client-code.html
--
Modified by Nick to add forum codes for readability.
In the packet debug, this is what is sent at the beginning of the greeting display:
0a 0d ff fa 18 01 ff f0 ff fb 56 ff fb 5b ff fb 5a
After the rest of the greeting packet is spewed, this gets sent back:
Sent packet: 1 (16 bytes)
....mushclient.. ff fa 18 00 6d 75 73 68 63 6c 69 65 6e 74 ff f0
Sent packet: 2 (3 bytes)
..V ff fd 56
Sent packet: 3 (3 bytes)
..[ ff fd 5b
Sent packet: 4 (3 bytes)
..Z ff fe 5a
Now, the problem of course is, the client ID string isn't being sent with a /n/r combination since that shows up as 0a 0d. It seems to instead be terminated by the ff f0 combination. Now, what's happening is this. I boot the mud, then try to log in. The login sequence asks my name. I input it. The login prompt then tells me no such player exists, at which point I can input it again, get the password prompt, and go from there. Only once I'm in, the MCCP/MXP/MSP options have failed to negotiate, and the logs don't show that it ever detected a terminal.
The same thing is happening with Zmud too. Simply fails to detect and then disrupts the entire login process. Of course I can't get a nice neat packet debug off of that. And interestingly enough, it seems that Linux telnet doesn't even respond to the query since it logged in fine.
The code I am using to do this is as follows: (it's commented out right now since it doesn't work)
if ( d->inbuf[i] == (signed char)IAC )
iac = 1;
else if ( iac == 1 && ( d->inbuf[i] == (signed char)DO || d->inbuf[i] == (signed char)DONT
|| d->inbuf[i] == (signed char)TERMINAL_TYPE ) )
iac = 2;
else if( iac == 2 )
{
iac = 0;
/*
if( d->inbuf[i] == (signed char)IS && d->inbuf[i-1] == (signed char)TERMINAL_TYPE )
{
char tmp[100];
int x, y = i+1;
for( x = 0; x < 100; x++, y++ )
tmp[x] = d->inbuf[y];
tmp[100] = '\0';
log_printf( "%s client detected for %s.", tmp, d->host );
}
*/
if ( d->inbuf[i] == (signed char)TELOPT_COMPRESS2 )
{
if ( d->inbuf[i-1] == (signed char)DO )
{
log_printf( "MCCP support detected for %s.", d->host );
compressStart( d );
}
else if ( d->inbuf[i-1] == (signed char)DONT )
compressEnd( d );
}
else if ( d->inbuf[i] == (signed char)TELOPT_MXP )
{
if ( d->inbuf[i-1] == (signed char)DO )
{
log_printf( "MXP support detected for %s.", d->host );
send_mxp_stylesheet( d );
}
}
else if ( d->inbuf[i] == (signed char)TELOPT_MSP )
{
if ( d->inbuf[i-1] == (signed char)DO )
{
log_printf( "MSP support detected for %s.", d->host );
send_msp_startup( d );
}
}
}
The original snippet I was modifying for use on my mud was here: http://www.auricmud.com/snippets/client-code.html
--
Modified by Nick to add forum codes for readability.