void process_naws( DESCRIPTOR_DATA * d, int width, int height )
{
int oldheight = 0, oldwidth = 0;
if( !d )
{
bug( "process_naws: NULL d" );
return;
}
if( !d->character || !d->character->pcdata )
return;
if( !IS_SET( d->character->pcdata->flags, PCFLAG_VT102 ) )
return;
oldheight = d->character->pcdata->scrlines;
oldwidth = d->character->pcdata->scrcols;
if( height )
{
height = URANGE( 15, height, 99 );
d->character->pcdata->scrlines = height;
}
if( width )
{
width = URANGE( 80, width, 250 );
d->character->pcdata->scrcols = width;
}
if( ( oldwidth != d->character->pcdata->scrcols ) || ( oldheight != d->character->pcdata->scrlines ) )
{
turn_off_vt100( d->character );
// clear_old_vt100( d->character, oldheight, oldwidth );
draw_vt100( d->character );
}
return;
}
void send_naws( DESCRIPTOR_DATA * d )
{
char iac_do_naws[] = { IAC, DO, TELOPT_NAWS, 0 };
write_to_descriptor( d, iac_do_naws, 0 );
}
else if( memcmp( p, iac_sb_naws, strlen( ( const char * )iac_sb_naws ) ) == 0 )
{
short width, height; //should be split into four characters
int i_p = 4;
//width
width = ntohs( p[i_p] );
//height
height = ntohs( p[i_p + 2] );
process_naws( d, width, height );
memmove( p, &p[strlen( ( const char * )iac_sb_naws )],
strlen( ( const char * )( &p[strlen( ( const char * )iac_sb_naws )] ) ) + 1 );
p–;
}
draw_vt100( d->character );
Here's the code from comm.c read_from_buffer:
Here's iac_sb_naws:
I tried to mirror the code in comm.c after my MXP code which works fine. I put an option in the game to echo my input so I could see what it was recieving instead of just seeing 'huh!'. For an example, when I login to the game and type "who" this is what I get echo'ed back to me as my input
Except the u has an upside down v accent above it.
Thanks in advance,
KeB