version 1.112 | | version 1.113 |
---|
| | |
/* | | /* |
* static char *rcsid_main_c = | | * static char *rcsid_main_c = |
* "$Id: main.c,v 1.112 2006/02/08 06:53:24 mwedel Exp $"; | | * "$Id: main.c,v 1.113 2006/03/18 15:05:37 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
} | | } |
| | |
/* Really, there is no reason to crypt the passwords any system. But easier | | /** |
| | * Really, there is no reason to crypt the passwords any system. But easier |
* to just leave this enabled for backward compatibility. Put the | | * to just leave this enabled for backward compatibility. Put the |
* simple case at top - no encryption - makes it easier to read. | | * simple case at top - no encryption - makes it easier to read. |
*/ | | */ |
| | |
return !strcmp(crypt_string(typed,crypted),crypted); | | return !strcmp(crypt_string(typed,crypted),crypted); |
} | | } |
| | |
/* This is a basic little function to put the player back to his | | /** |
| | * This is a basic little function to put the player back to his |
* savebed. We do some error checking - its possible that the | | * savebed. We do some error checking - its possible that the |
* savebed map may no longer exist, so we make sure the player | | * savebed map may no longer exist, so we make sure the player |
* goes someplace. | | * goes someplace. |
| | |
free_object(tmp); | | free_object(tmp); |
} | | } |
| | |
/* All this really is is a glorified remove_object that also updates | | /** |
| | * All this really is is a glorified remove_object that also updates |
* the counts on the map if needed. | | * the counts on the map if needed. |
*/ | | */ |
void leave_map(object *op) | | void leave_map(object *op) |
| | |
} | | } |
} | | } |
| | |
/* | | /** |
* enter_map(): Moves the player and pets from current map (if any) to | | * enter_map(): Moves the player and pets from current map (if any) to |
* new map. map, x, y must be set. map is the map we are moving the | | * new map. map, x, y must be set. map is the map we are moving the |
* player to - it could be the map he just came from if the load failed for | | * player to - it could be the map he just came from if the load failed for |
| | |
swap_below_max (newmap->path); | | swap_below_max (newmap->path); |
| | |
if( op->type == PLAYER) | | if( op->type == PLAYER) |
MapNewmapCmd( op->contr); | | map_newmap_cmd(op->contr); |
} | | } |
| | |
void set_map_timeout(mapstruct *oldmap) | | void set_map_timeout(mapstruct *oldmap) |
| | |
} | | } |
| | |
| | |
/* clean_path takes a path and replaces all / with _ | | /** |
| | * clean_path takes a path and replaces all / with _ |
* We do a strcpy so that we do not change the original string. | | * We do a strcpy so that we do not change the original string. |
*/ | | */ |
char *clean_path(const char *file) | | char *clean_path(const char *file) |
| | |
} | | } |
| | |
| | |
/* unclean_path takes a path and replaces all _ with / | | /** |
| | * unclean_path takes a path and replaces all _ with / |
* This basically undoes clean path. | | * This basically undoes clean path. |
* We do a strcpy so that we do not change the original string. | | * We do a strcpy so that we do not change the original string. |
* We are smart enough to start after the last / in case we | | * We are smart enough to start after the last / in case we |
| | |
} | | } |
| | |
| | |
/* The player is trying to enter a randomly generated map. In this case, generate the | | /** |
| | * The player is trying to enter a randomly generated map. In this case, generate the |
* random map as needed. | | * random map as needed. |
*/ | | */ |
| | |
| | |
} | | } |
} | | } |
| | |
/* The player is trying to enter a non-randomly generated template map. In this | | /** |
| | * The player is trying to enter a non-randomly generated template map. In this |
* case, use a map file for a template | | * case, use a map file for a template |
*/ | | */ |
| | |
| | |
} | | } |
| | |
| | |
/* The player is trying to enter a randomly generated template map. In this | | /** |
| | * The player is trying to enter a randomly generated template map. In this |
* case, generate the map as needed. | | * case, generate the map as needed. |
*/ | | */ |
| | |
| | |
} | | } |
| | |
| | |
/* Code to enter/detect a character entering a unique map. | | /** |
| | * Code to enter/detect a character entering a unique map. |
*/ | | */ |
static void enter_unique_map(object *op, object *exit_ob) | | static void enter_unique_map(object *op, object *exit_ob) |
{ | | { |
| | |
} | | } |
| | |
| | |
/* Tries to move 'op' to exit_ob. op is the character or monster that is | | /** |
| | * Tries to move 'op' to exit_ob. op is the character or monster that is |
* using the exit, where exit_ob is the exit object (boat, door, teleporter, | | * using the exit, where exit_ob is the exit object (boat, door, teleporter, |
* etc.) if exit_ob is null, then op->contr->maplevel contains that map to | | * etc.) if exit_ob is null, then op->contr->maplevel contains that map to |
* move the object to. This is used when loading the player. | | * move the object to. This is used when loading the player. |
| | |
} | | } |
} | | } |
| | |
/* | | /** |
* process_active_maps(): Works like process_events(), but it only | | * process_active_maps(): Works like process_events(), but it only |
* processes maps which a player is on. | | * processes maps which a player is on. |
* It will check that it isn't called too often, and abort | | * It will check that it isn't called too often, and abort |
* if time since last call is less than MAX_TIME. | | * if time since last call is less than MAX_TIME. |
* | | |
*/ | | */ |
| | |
void process_active_maps(void) { | | void process_active_maps(void) { |
| | |
} | | } |
} | | } |
| | |
/* process_players1 and process_players2 do all the player related stuff. | | /** |
| | * process_players1 and process_players2 do all the player related stuff. |
* I moved it out of process events and process_map. This was to some | | * I moved it out of process events and process_map. This was to some |
* extent for debugging as well as to get a better idea of the time used | | * extent for debugging as well as to get a better idea of the time used |
* by the various functions. process_players1() does the processing before | | * by the various functions. process_players1() does the processing before |
| | |
write_todclock(); /* lets just write the clock here */ | | write_todclock(); /* lets just write the clock here */ |
} | | } |
| | |
/* clean up everything before exiting */ | | /** clean up everything before exiting */ |
void cleanup(void) | | void cleanup(void) |
{ | | { |
LOG(llevDebug,"Cleanup called. freeing data.\n"); | | LOG(llevDebug,"Cleanup called. freeing data.\n"); |
| | |
#endif | | #endif |
} | | } |
| | |
/* | | /** |
* do_specials() is a collection of functions to call from time to time. | | * do_specials() is a collection of functions to call from time to time. |
* Modified 2000-1-14 MSW to use the global pticks count to determine how | | * Modified 2000-1-14 MSW to use the global pticks count to determine how |
* often to do things. This will allow us to spred them out more often. | | * often to do things. This will allow us to spred them out more often. |