I'm looking for a snippet for my swr mud. where might i find some for slicing?.. ad help would be thanked.
SWR slicing snippet
Posted by Jason on Sat 22 Nov 2003 05:14 AM — 14 posts, 43,342 views.
Hmm, the SWFotE codebase had slicing in it. Perhaps you could rip it from there, and add it to your mud. As for the snippet, I've never seen one.
What is it in 'sliciing' that your looking for? There's lots of things that a slicer would do, its practically a class, so you might wanna specify what your looking for.
well i was looking for the whole class... but i am taking from the SWFOTE code... but i have encountered a problem if any one can i'd be most please.... it has to do with the showbeacon command here is where my debugger is saying this is the problem in interp.c
char *one_argument( char *argument, char *arg_first )
{
char cEnd;
sh_int count;
count = 0;
while ( isspace(*argument) )
argument++;
cEnd = ' ';
if ( *argument == '\'' || *argument == '"' )
cEnd = *argument++;
while ( *argument != '\0' || ++count >= 255 )
{
if ( *argument == cEnd )
{
argument++;
break;
}
*arg_first = LOWER(*argument);
arg_first++;
argument++;
}
*arg_first = '\0';
while ( isspace(*argument) )
argument++;
return argument;
}
HERE IS THE CODE FOR The skill (show beacons crashes the mud as soon as used)
void do_showbeacons( CHAR_DATA *ch, char *argument )
{
SHIP_DATA *ship;
SHIP_DATA *ship2;
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char buf3[MAX_STRING_LENGTH];
int count = 0;
if(IS_NPC(ch)) return;
if (number_percent() > ch->pcdata->learned[gsn_showbeacons])
{
send_to_char("You can't figure out what to do.\n\r", ch);
learn_from_failure(ch,gsn_showbeacons);
return;
}
send_to_char("\n\r",ch);
send_to_char("&zRequesting response from active locator beacons...\n\r", ch);
send_to_char("&w__________________________________________________\n\r\n\r",ch);
for ( ship = first_ship; ship; ship = ship->next )
{
if(is_name(ch->name, ship->pbeacon))
{
if(!ship->in_room && ship->shipstate != SHIP_HYPERSPACE)
sprintf(buf3, "&w%.0f&z, &w%.0f&z, &w%.0f", ship->vx, ship->vy, ship->vz);
if(ship->shipstate == SHIP_HYPERSPACE)
sprintf(buf3, "In Hyperspace");
for(ship2 = first_ship; ship2; ship2 = ship2->next)
{
if(ship->in_room)
{
if(ship->in_room->vnum == ship2->hanger1)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger2)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger3)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger4)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
}
}
ch_printf(ch,"^g&xACTIVE^x&z: &w%-15.15s&z Location:&w %s &z(&w%s&z)&w\n\r", ship->name,
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->area->planet->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf :
(!ship->in_room && ship->starsystem) ? ship->starsystem->name :
ship->shipstate == SHIP_HYPERSPACE ? "Unknown" : "Unknown",
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf2 :
ship->shipstate == SHIP_HYPERSPACE ? "In Hyperspace" :
(!ship->in_room) ? buf3 : "Unknown");
count++;
}
}
if(count == 0)
send_to_char(" &zNo active beacons found.\n\r", ch);
learn_from_success(ch,gsn_showbeacons);
}
char *one_argument( char *argument, char *arg_first )
{
char cEnd;
sh_int count;
count = 0;
while ( isspace(*argument) )
argument++;
cEnd = ' ';
if ( *argument == '\'' || *argument == '"' )
cEnd = *argument++;
while ( *argument != '\0' || ++count >= 255 )
{
if ( *argument == cEnd )
{
argument++;
break;
}
*arg_first = LOWER(*argument);
arg_first++;
argument++;
}
*arg_first = '\0';
while ( isspace(*argument) )
argument++;
return argument;
}
HERE IS THE CODE FOR The skill (show beacons crashes the mud as soon as used)
void do_showbeacons( CHAR_DATA *ch, char *argument )
{
SHIP_DATA *ship;
SHIP_DATA *ship2;
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char buf3[MAX_STRING_LENGTH];
int count = 0;
if(IS_NPC(ch)) return;
if (number_percent() > ch->pcdata->learned[gsn_showbeacons])
{
send_to_char("You can't figure out what to do.\n\r", ch);
learn_from_failure(ch,gsn_showbeacons);
return;
}
send_to_char("\n\r",ch);
send_to_char("&zRequesting response from active locator beacons...\n\r", ch);
send_to_char("&w__________________________________________________\n\r\n\r",ch);
for ( ship = first_ship; ship; ship = ship->next )
{
if(is_name(ch->name, ship->pbeacon))
{
if(!ship->in_room && ship->shipstate != SHIP_HYPERSPACE)
sprintf(buf3, "&w%.0f&z, &w%.0f&z, &w%.0f", ship->vx, ship->vy, ship->vz);
if(ship->shipstate == SHIP_HYPERSPACE)
sprintf(buf3, "In Hyperspace");
for(ship2 = first_ship; ship2; ship2 = ship2->next)
{
if(ship->in_room)
{
if(ship->in_room->vnum == ship2->hanger1)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger2)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger3)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger4)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
}
}
ch_printf(ch,"^g&xACTIVE^x&z: &w%-15.15s&z Location:&w %s &z(&w%s&z)&w\n\r", ship->name,
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->area->planet->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf :
(!ship->in_room && ship->starsystem) ? ship->starsystem->name :
ship->shipstate == SHIP_HYPERSPACE ? "Unknown" : "Unknown",
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf2 :
ship->shipstate == SHIP_HYPERSPACE ? "In Hyperspace" :
(!ship->in_room) ? buf3 : "Unknown");
count++;
}
}
if(count == 0)
send_to_char(" &zNo active beacons found.\n\r", ch);
learn_from_success(ch,gsn_showbeacons);
}
this is the only skill i am having problems with so far... everything else i have gotten to work.
oh the debugger is saying that the problem is with this line of that code:
while ( isspace(*argument) )
argument++;
The first one.
while ( isspace(*argument) )
argument++;
The first one.
The first thing you need to figure out, if you think that the beacon command is causing the problem, is why you ever entered one_argument even though it's never called in the function.
In your debugger you should do a backtrace and see what functions were called when from where... at the moment you don't have enough information to do much of anything. I'm sure that (unless you modified it) the one_argument function works just fine, as long as you call it with valid arguments.
In your debugger you should do a backtrace and see what functions were called when from where... at the moment you don't have enough information to do much of anything. I'm sure that (unless you modified it) the one_argument function works just fine, as long as you call it with valid arguments.
ok i did a back trace and here is what i got:
char *one_argument( char *argument, char *arg_first )
{
char cEnd;
sh_int count;
count = 0;
HERE--->while ( isspace(*argument) )
argument++;
cEnd = ' ';
if ( *argument == '\'' || *argument == '"' )
cEnd = *argument++;
Then it went to handler.c and this is what it has:
bool is_name( const char *str, char *namelist )
{
HERE--->char name[MAX_INPUT_LENGTH];
for ( ; ; )
{
namelist = one_argument( namelist, name );
if ( name[0] == '\0' )
return FALSE;
if ( !str_cmp( str, name ) )
return TRUE;
}
}
Then it went to do showbeacons
void do_showbeacons( CHAR_DATA *ch, char *argument )
{
SHIP_DATA *ship;
SHIP_DATA *ship2;
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char buf3[MAX_STRING_LENGTH];
int count = 0;
if(IS_NPC(ch)) return;
if (number_percent() > ch->pcdata->learned[gsn_showbeacons])
{
send_to_char("You can't figure out what to do.\n\r", ch);
learn_from_failure(ch,gsn_showbeacons);
return;
}
send_to_char("\n\r",ch);
send_to_char("&zRequesting response from active locator beacons...\n\r", ch);
send_to_char("&w__________________________________________________\n\r\n\r",ch);
for ( ship = first_ship; ship; ship = ship->next )
{
HERE--->if(is_name(ch->name, ship->pbeacon))
{
if(!ship->in_room && ship->shipstate != SHIP_HYPERSPACE)
sprintf(buf3, "&w%.0f&z, &w%.0f&z, &w%.0f", ship->vx, ship->vy, ship->vz);
if(ship->shipstate == SHIP_HYPERSPACE)
sprintf(buf3, "In Hyperspace");
for(ship2 = first_ship; ship2; ship2 = ship2->next)
{
if(ship->in_room)
{
if(ship->in_room->vnum == ship2->hanger1)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger2)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger3)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger4)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
}
}
ch_printf(ch,"^g&xACTIVE^x&z: &w%-15.15s&z Location:&w %s &z(&w%s&z)&w\n\r", ship->name,
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->area->planet->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf :
(!ship->in_room && ship->starsystem) ? ship->starsystem->name :
ship->shipstate == SHIP_HYPERSPACE ? "Unknown" : "Unknown",
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf2 :
ship->shipstate == SHIP_HYPERSPACE ? "In Hyperspace" :
(!ship->in_room) ? buf3 : "Unknown");
count++;
}
}
if(count == 0)
send_to_char(" &zNo active beacons found.\n\r", ch);
learn_from_success(ch,gsn_showbeacons);
}
THEN IT WENT TO intrep.c and it is:
/*
* Look for command in skill and socials table.
*/
if ( !found )
{
HERE--->( !check_skill( ch, command, argument )
&& !check_social( ch, command, argument ) )
{
EXIT_DATA *pexit;
/* check for an auto-matic exit command */
if ( (pexit = find_door( ch, command, TRUE )) != NULL
&& IS_SET( pexit->exit_info, EX_xAUTO ))
{
if ( IS_SET(pexit->exit_info, EX_CLOSED)
&& (!IS_AFFECTED(ch, AFF_PASS_DOOR)
|| IS_SET(pexit->exit_info, EX_NOPASSDOOR)) )
{
if ( !IS_SET( pexit->exit_info, EX_SECRET ) )
act( AT_PLAIN, "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
else
send_to_char( "You cannot do that here.\n\r", ch );
return;
}
move_char( ch, pexit, 0 );
return;
}
send_to_char( "Huh?\n\r", ch );
}
return;
}
then it went to comm.c and i got:
char *one_argument( char *argument, char *arg_first )
{
char cEnd;
sh_int count;
count = 0;
HERE--->while ( isspace(*argument) )
argument++;
cEnd = ' ';
if ( *argument == '\'' || *argument == '"' )
cEnd = *argument++;
Then it went to handler.c and this is what it has:
bool is_name( const char *str, char *namelist )
{
HERE--->char name[MAX_INPUT_LENGTH];
for ( ; ; )
{
namelist = one_argument( namelist, name );
if ( name[0] == '\0' )
return FALSE;
if ( !str_cmp( str, name ) )
return TRUE;
}
}
Then it went to do showbeacons
void do_showbeacons( CHAR_DATA *ch, char *argument )
{
SHIP_DATA *ship;
SHIP_DATA *ship2;
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char buf3[MAX_STRING_LENGTH];
int count = 0;
if(IS_NPC(ch)) return;
if (number_percent() > ch->pcdata->learned[gsn_showbeacons])
{
send_to_char("You can't figure out what to do.\n\r", ch);
learn_from_failure(ch,gsn_showbeacons);
return;
}
send_to_char("\n\r",ch);
send_to_char("&zRequesting response from active locator beacons...\n\r", ch);
send_to_char("&w__________________________________________________\n\r\n\r",ch);
for ( ship = first_ship; ship; ship = ship->next )
{
HERE--->if(is_name(ch->name, ship->pbeacon))
{
if(!ship->in_room && ship->shipstate != SHIP_HYPERSPACE)
sprintf(buf3, "&w%.0f&z, &w%.0f&z, &w%.0f", ship->vx, ship->vy, ship->vz);
if(ship->shipstate == SHIP_HYPERSPACE)
sprintf(buf3, "In Hyperspace");
for(ship2 = first_ship; ship2; ship2 = ship2->next)
{
if(ship->in_room)
{
if(ship->in_room->vnum == ship2->hanger1)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger2)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger3)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
if(ship->in_room->vnum == ship2->hanger4)
{
sprintf(buf, "%s", ship2->name);
sprintf(buf2, "%s", ship->in_room->name);
break;
}
}
}
ch_printf(ch,"^g&xACTIVE^x&z: &w%-15.15s&z Location:&w %s &z(&w%s&z)&w\n\r", ship->name,
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->area->planet->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf :
(!ship->in_room && ship->starsystem) ? ship->starsystem->name :
ship->shipstate == SHIP_HYPERSPACE ? "Unknown" : "Unknown",
(ship->in_room && ship->in_room->area->planet) ?
ship->in_room->name :
(ship->in_room && !ship->in_room->area->planet) ?
buf2 :
ship->shipstate == SHIP_HYPERSPACE ? "In Hyperspace" :
(!ship->in_room) ? buf3 : "Unknown");
count++;
}
}
if(count == 0)
send_to_char(" &zNo active beacons found.\n\r", ch);
learn_from_success(ch,gsn_showbeacons);
}
THEN IT WENT TO intrep.c and it is:
/*
* Look for command in skill and socials table.
*/
if ( !found )
{
HERE--->( !check_skill( ch, command, argument )
&& !check_social( ch, command, argument ) )
{
EXIT_DATA *pexit;
/* check for an auto-matic exit command */
if ( (pexit = find_door( ch, command, TRUE )) != NULL
&& IS_SET( pexit->exit_info, EX_xAUTO ))
{
if ( IS_SET(pexit->exit_info, EX_CLOSED)
&& (!IS_AFFECTED(ch, AFF_PASS_DOOR)
|| IS_SET(pexit->exit_info, EX_NOPASSDOOR)) )
{
if ( !IS_SET( pexit->exit_info, EX_SECRET ) )
act( AT_PLAIN, "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
else
send_to_char( "You cannot do that here.\n\r", ch );
return;
}
move_char( ch, pexit, 0 );
return;
}
send_to_char( "Huh?\n\r", ch );
}
return;
}
then it went to comm.c and i got:
void game_loop( )
{
struct timeval last_time;
char cmdline[MAX_INPUT_LENGTH];
DESCRIPTOR_DATA *d;
/* time_t last_check = 0; */
signal( SIGPIPE, SIG_IGN );
signal( SIGALRM, caught_alarm );
/* signal( SIGSEGV, SegVio ); */
gettimeofday( &last_time, NULL );
current_time = (time_t) last_time.tv_sec;
/* Main loop */
while ( !mud_down )
{
accept_new( control );
accept_new( control2 );
accept_new( conclient);
accept_new( conjava );
/*
* Kick out descriptors with raised exceptions
* or have been idle, then check for input.
*/
for ( d = first_descriptor; d; d = d_next )
{
if ( d == d->next )
{
bug( "descriptor_loop: loop found & fixed" );
d->next = NULL;
}
d_next = d->next;
d->idle++; /* make it so a descriptor can idle out */
if ( FD_ISSET( d->descriptor, &exc_set ) )
{
FD_CLR( d->descriptor, &in_set );
FD_CLR( d->descriptor, &out_set );
if ( d->character
&& ( d->connected == CON_PLAYING
|| d->connected == CON_EDITING ) )
save_char_obj( d->character );
d->outtop = 0;
close_socket( d, TRUE );
continue;
}
else
if ( (!d->character && d->idle > 360) /* 2 mins */
|| ( d->connected != CON_PLAYING && d->idle > 1200) /* 5 mins */
|| d->idle > 28800 ) /* 2 hrs */
{
write_to_descriptor( d->descriptor,
"Idle timeout... disconnecting.\n\r", 0 );
d->outtop = 0;
close_socket( d, TRUE );
continue;
}
else if (d->idle > 3600 && (d->character) && !IS_SET(d->character->act, PLR_AFK))
{
send_to_char("Idle for 15minutes, AFK has been automatically set on you.\n\r", d->character);
do_afk(d->character, "");
continue;
}
else
{
d->fcommand = FALSE;
if ( FD_ISSET( d->descriptor, &in_set ) )
{
d->idle = 0;
if ( d->character )
d->character->timer = 0;
if ( !read_from_descriptor( d ) )
{
FD_CLR( d->descriptor, &out_set );
if ( d->character
&& ( d->connected == CON_PLAYING
|| d->connected == CON_EDITING ) )
save_char_obj( d->character );
d->outtop = 0;
close_socket( d, FALSE );
continue;
}
}
/* IDENT authentication */
if ( ( d->auth_fd == -1 ) && ( d->atimes < 20 )
&& !str_cmp( d->user, "unknown" ) )
start_auth( d );
if ( d->auth_fd != -1)
{
if ( FD_ISSET( d->auth_fd, &in_set ) )
{
read_auth( d );
/* if ( !d->auth_state )
check_ban( d );*/
}
else
if ( FD_ISSET( d->auth_fd, &out_set )
&& IS_SET( d->auth_state, FLAG_WRAUTH) )
{
send_auth( d );
/* if ( !d->auth_state )
check_ban( d );*/
}
}
if ( d->character && d->character->wait > 0 )
{
--d->character->wait;
continue;
}
read_from_buffer( d );
if ( d->incomm[0] != '\0' )
{
d->fcommand = TRUE;
stop_idling( d->character );
strcpy( cmdline, d->incomm );
d->incomm[0] = '\0';
if ( d->character )
set_cur_char( d->character );
if ( d->pagepoint )
set_pager_input(d, cmdline);
else
switch( d->connected )
{
default:
nanny( d, cmdline );
break;
case CON_PLAYING:
HERE---> interpret( d->character, cmdline );
break;
case CON_EDITING:
edit_buffer( d->character, cmdline );
break;
}
}
}
if ( d == last_descriptor )
break;
}
then it went to comm.c again and i got
game_loop( );
/*
* That's all, folks.
*/
log_string( "Normal termination of game." );
exit( 0 );
return 0;
}
Hope fully you can help with this
{
struct timeval last_time;
char cmdline[MAX_INPUT_LENGTH];
DESCRIPTOR_DATA *d;
/* time_t last_check = 0; */
signal( SIGPIPE, SIG_IGN );
signal( SIGALRM, caught_alarm );
/* signal( SIGSEGV, SegVio ); */
gettimeofday( &last_time, NULL );
current_time = (time_t) last_time.tv_sec;
/* Main loop */
while ( !mud_down )
{
accept_new( control );
accept_new( control2 );
accept_new( conclient);
accept_new( conjava );
/*
* Kick out descriptors with raised exceptions
* or have been idle, then check for input.
*/
for ( d = first_descriptor; d; d = d_next )
{
if ( d == d->next )
{
bug( "descriptor_loop: loop found & fixed" );
d->next = NULL;
}
d_next = d->next;
d->idle++; /* make it so a descriptor can idle out */
if ( FD_ISSET( d->descriptor, &exc_set ) )
{
FD_CLR( d->descriptor, &in_set );
FD_CLR( d->descriptor, &out_set );
if ( d->character
&& ( d->connected == CON_PLAYING
|| d->connected == CON_EDITING ) )
save_char_obj( d->character );
d->outtop = 0;
close_socket( d, TRUE );
continue;
}
else
if ( (!d->character && d->idle > 360) /* 2 mins */
|| ( d->connected != CON_PLAYING && d->idle > 1200) /* 5 mins */
|| d->idle > 28800 ) /* 2 hrs */
{
write_to_descriptor( d->descriptor,
"Idle timeout... disconnecting.\n\r", 0 );
d->outtop = 0;
close_socket( d, TRUE );
continue;
}
else if (d->idle > 3600 && (d->character) && !IS_SET(d->character->act, PLR_AFK))
{
send_to_char("Idle for 15minutes, AFK has been automatically set on you.\n\r", d->character);
do_afk(d->character, "");
continue;
}
else
{
d->fcommand = FALSE;
if ( FD_ISSET( d->descriptor, &in_set ) )
{
d->idle = 0;
if ( d->character )
d->character->timer = 0;
if ( !read_from_descriptor( d ) )
{
FD_CLR( d->descriptor, &out_set );
if ( d->character
&& ( d->connected == CON_PLAYING
|| d->connected == CON_EDITING ) )
save_char_obj( d->character );
d->outtop = 0;
close_socket( d, FALSE );
continue;
}
}
/* IDENT authentication */
if ( ( d->auth_fd == -1 ) && ( d->atimes < 20 )
&& !str_cmp( d->user, "unknown" ) )
start_auth( d );
if ( d->auth_fd != -1)
{
if ( FD_ISSET( d->auth_fd, &in_set ) )
{
read_auth( d );
/* if ( !d->auth_state )
check_ban( d );*/
}
else
if ( FD_ISSET( d->auth_fd, &out_set )
&& IS_SET( d->auth_state, FLAG_WRAUTH) )
{
send_auth( d );
/* if ( !d->auth_state )
check_ban( d );*/
}
}
if ( d->character && d->character->wait > 0 )
{
--d->character->wait;
continue;
}
read_from_buffer( d );
if ( d->incomm[0] != '\0' )
{
d->fcommand = TRUE;
stop_idling( d->character );
strcpy( cmdline, d->incomm );
d->incomm[0] = '\0';
if ( d->character )
set_cur_char( d->character );
if ( d->pagepoint )
set_pager_input(d, cmdline);
else
switch( d->connected )
{
default:
nanny( d, cmdline );
break;
case CON_PLAYING:
HERE---> interpret( d->character, cmdline );
break;
case CON_EDITING:
edit_buffer( d->character, cmdline );
break;
}
}
}
if ( d == last_descriptor )
break;
}
then it went to comm.c again and i got
game_loop( );
/*
* That's all, folks.
*/
log_string( "Normal termination of game." );
exit( 0 );
return 0;
}
Hope fully you can help with this
ALL LINES THAT HAD ERROR IS MARKED WITH HERE---->
Format that properly and make it readable using the [code] [/code] tags and I'll go through it... :)
And you also posted a whole bunch of completely irrelevant code... if you know that the bad code is from do_showbeacons onwards, then why are you posting the network and main loop code?
Maybe you should do a search on Google for how to use the debugger program, or how to debug code efficiently...
Maybe you should do a search on Google for how to use the debugger program, or how to debug code efficiently...
Quote:
while ( isspace(*argument) )
argument++;
while ( isspace(*argument) )
argument++;
About the only way these lines could go wrong is if "argument" is invalid, eg. null (zero) or not pointing to a valid portion of memory.
In the debugger, see what "argument" is.
[quote]if(is_name(ch->name, ship->pbeacon))[/quote]
I know for a fact that line calls one_argument.
I'd suggest making sure that ship->pbeacon is not null. And it defanatly would not hurt to throw in a line one_argument (and one_argument2, and probably all the is_name and such) such as:
[code]if (argument == NULL) return NULL;[/code]
~ Gavin
I know for a fact that line calls one_argument.
I'd suggest making sure that ship->pbeacon is not null. And it defanatly would not hurt to throw in a line one_argument (and one_argument2, and probably all the is_name and such) such as:
[code]if (argument == NULL) return NULL;[/code]
~ Gavin