Go to the documentation of this file.
20 #define WANT_UNARMED_SKILLS
54 "Maps matching search: '%s'", search);
58 "[fixed]Path Reset In (HH:MM:SS) Pl IM TO");
61 "[fixed]Path Reset In (HH:MM)");
65 char *to_be_freed = NULL;
66 char *search_array[64];
67 int search_array_count = 0;
69 to_be_freed = strdup(search);
71 search_array[0] = to_be_freed;
72 search_array_count = 1;
74 search_array_count =
split_string(to_be_freed,search_array,64,
',');
80 if ( search_array_count ) {
82 for (
int i=0; i<search_array_count; ++i) {
83 if ( strstr(
m->path,search_array[i]) ) {
89 if ( !
match )
continue;
93 if (strlen(
m->path) <= 26) {
94 strcpy(map_path,
m->path);
96 safe_strncpy(map_path,
m->path + strlen(
m->path) - 26,
sizeof(map_path));
102 ttr = (
m->unique ? 0 :
m->reset_timeout) + 300;
104 else if (
m->timeout) {
105 ttr = (
m->unique ? 0 :
m->reset_timeout) +
m->timeout;
107 const uint32_t hh = ttr/3600, mm = (ttr%3600)/60, ss = ttr%60;
111 "[fixed]%-26.26s %2d:%02d:%02d %2d %2d %4d",
112 map_path, hh, mm, ss,
m->players,
m->in_memory,
m->timeout);
116 "[fixed]%-26.26s %2d:%02d%s", map_path, hh, mm,
117 m->players ?
" (in use)" :
"");
120 if ( to_be_freed ) free( to_be_freed );
139 "Your current language is set to: English.");
141 "Available languages:");
149 if (language == -1) {
151 "Unknown language.");
155 op->contr->language = language;
158 "Your current language is set to English.");
182 "The first column is the name of the body location.");
185 "The second column is how many of those locations your body has.");
188 "The third column is how many slots in that location are available.");
194 if (
op->body_info[i] ||
op->body_used[i]) {
196 "[fixed]%-30s %5d %5d",
202 "You are not allowed to wear armor.");
205 "You are not allowed to use weapons.");
255 int nrm = 0, mapmem = 0, anr,
anims, sum_alloc = 0, sum_used = 0, i, alnr;
270 for (
m =
first_map, nrofmaps = 0;
m != NULL;
m =
m->next, nrofmaps++)
277 "Sizeof: object=%d player=%d map=%d",
284 "[fixed]%6d used", ob_used);
288 "[fixed] (used list mismatch: %d)",
293 "[fixed]%6d free (%.2f%% of %d allocated)",
298 "[fixed] (free list mismatch: %d)",
303 "[fixed]%6d on active list",
306 i = (ob_used*
sizeof(
object));
311 "[fixed] object total: %11d", i);
313 i = (ob_free*
sizeof(
object));
317 "[fixed]%4d players: %8d",
324 "[fixed]%4d maps allocated: %8d",
325 nrofmaps, i = (nrofmaps*
sizeof(
mapstruct)));
331 "[fixed]%4d maps in memory: %8d",
338 "[fixed]%4d archetypes: %8d",
345 "[fixed]%4d animations: %8d",
352 "[fixed]%4d treasurelists %8d",
359 "[fixed]%4ld treasures %8d",
366 "[fixed]%4ld artifacts %8d",
373 "[fixed]%4ld artifacts strngs %8d",
380 "[fixed]%4d artifactlists %8d",
387 "[fixed]Total space allocated:%8d",
391 "[fixed]Total space used: %8d",
418 "You are in %s.\n%s",
440 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %d reset_group: %s",
441 m->players,
m->difficulty,
450 #ifdef DEBUG_MALLOC_LEVEL
459 void command_malloc_verify(
object *
op,
char *
parms) {
460 extern int malloc_verify(
void);
462 if (!malloc_verify())
464 "Heap is corrupted.");
467 "Heap checks out OK.");
503 if (reg->
parent != NULL) {
507 LOG(
llevError,
"command_whereabouts() Region %s with no longname has no parent\n", reg->
name);
511 "In the world currently there are:");
554 int num_players = 0, num_wiz = 0, num_afk = 0, num_bot = 0;
570 if (party &&
pl->
party != party)
578 "who failed - out of memory!");
581 sprintf(chars[num_players-1].namebuf,
"%s",
pl->
ob->
name);
596 if (reg == NULL && party == NULL)
598 "Total Players (%d) -- WIZ(%d) AFK(%d) BOT(%d)",
599 num_players, num_wiz, num_afk, num_bot);
600 else if (party == NULL)
602 "Total Players in %s (%d) -- WIZ(%d) AFK(%d) BOT(%d)",
606 "Total Players in party %s (%d) -- WIZ(%d) AFK(%d) BOT(%d)",
607 party->
partyname, num_players, num_wiz, num_afk, num_bot);
609 qsort(chars, num_players,
sizeof(
chars_names), (
int (*)(
const void *,
const void *))
name_cmp);
610 for (i = 0; i < num_players; i++)
645 strcpy(outbuf,
"[fixed]");
648 LOG(
llevError,
"display_who_entry(): I was passed a null player\n");
651 for (i = 0; i <= strlen(format); i++) {
652 if (format[i] ==
'%') {
655 strcat(outbuf, tmpbuf);
656 }
else if (format[i] ==
'_') {
659 snprintf(tmpbuf,
sizeof(tmpbuf),
"%c", format[i]);
660 strcat(outbuf, tmpbuf);
707 snprintf(return_val, size,
"%u",
pl->
ob->
count);
711 snprintf(return_val, size,
"\n");
719 snprintf(return_val, size,
"%d",
pl->
ob->
level);
755 snprintf(return_val, size,
"%%");
759 snprintf(return_val, size,
"_");
777 "You are no longer AFK");
895 "Global debug level is %d.",
901 "Debug level set to %d.",
927 "You will now walk through walls.");
931 "You will now be stopped by walls.");
957 "You can now cast spells anywhere.");
961 "You now cannot cast spells in no-magic areas.");
1092 "Set listen to what (presently %d)?",
1093 op->contr->listening);
1098 "Verbose level should be positive.");
1101 op->contr->listening = (char)i;
1103 "Your verbose level is now %d.",
1120 uint32_t hours, minutes;
1138 "[fixed]\nStat Nat/Real/Max");
1141 "[fixed]Str %2d/ %3d/%3d",
1144 "[fixed]Dex %2d/ %3d/%3d",
1147 "[fixed]Con %2d/ %3d/%3d",
1150 "[fixed]Int %2d/ %3d/%3d",
1153 "[fixed]Wis %2d/ %3d/%3d",
1156 "[fixed]Pow %2d/ %3d/%3d",
1159 "[fixed]Cha %2d/ %3d/%3d",
1162 "\nAttack Mode: %s",
1167 float weap_speed =
pl->weapon_speed;
1168 if (weap_speed < 0.0f)
1170 if (weap_speed > 1.0f)
1174 float dps = (1000000.0f /
tick_duration) * weap_speed *
pl->stats.dam;
1178 "\n\nDam/Sec: %4d", (
int)(dps + 0.5f));
1189 minutes = (uint32_t)
seconds / 60;
1190 hours = minutes / 60;
1191 minutes = minutes % 60;
1194 "You have played this character for %u ticks, which amounts "
1195 "to %d hours and %d minutes.",
1237 if (!((
entry->d_name[0] ==
'.' &&
entry->d_name[1] ==
'\0')
1238 || (
entry->d_name[0] ==
'.' &&
entry->d_name[1] ==
'.' &&
entry->d_name[2] ==
'\0'))) {
1241 strcpy(
t,
entry->d_name);
1242 if (stat(
buf, &st) == 0) {
1246 if (S_ISDIR(st.st_mode)) {
1247 struct tm *tm = localtime(&st.st_mtime);
1250 "[fixed]%s\t%04d %02d %02d %02d %02d %02d",
1276 static const char *
const types[] = {
1284 "applymode is set to %s",
1289 if (!strcmp(
params,
"nochoice"))
1291 else if (!strcmp(
params,
"never"))
1293 else if (!strcmp(
params,
"always"))
1297 "applymode: Unknown options %s, valid options are nochoice, never, always",
1302 "applymode%s set to %s",
1303 (unapply ==
op->contr->unapply ?
"" :
" now"),
1317 static const char *
const types[] = {
1335 "bowmode is set to %s",
1343 op->contr->bowtype = i;
1364 "bowmode%s set to %s",
1365 (oldtype ==
op->contr->bowtype ?
"" :
" now"),
1384 "unarmed skill is set to %s",
1385 op->contr->unarmed_skill ?
op->contr->unarmed_skill:
"nothing");
1397 "You do not know any such skill called %s",
1401 for (i = 0; i <
sizeof(unarmed_skills); i++)
1402 if (skill->
subtype == unarmed_skills[i])
1404 if (i ==
sizeof(unarmed_skills)) {
1406 "%s is not an unarmed skill!",
1412 if (
op->contr->unarmed_skill)
1421 "unarmed skill is now set to %s",
1422 op->contr->unarmed_skill);
1436 static const char *
const types[] = {
1445 "petmode is set to %s",
1450 if (!strcmp(
params,
"normal"))
1452 else if (!strcmp(
params,
"sad"))
1454 else if (!strcmp(
params,
"defend"))
1456 else if (!strcmp(
params,
"arena"))
1460 "petmode: Unknown options %s, valid options are normal, sad (seek and destroy), defend, arena",
1465 "petmode%s set to %s",
1466 (oldtype ==
op->contr->petmode ?
"" :
" now"),
1480 int counter = 0, target = 0;
1481 int have_shown_pet = 0;
1487 for (obl =
list; obl != NULL; obl = obl->
next) {
1488 object *
ob = obl->
ob;
1496 ++counter,
ob->name,
ob->level);
1497 }
else if (!have_shown_pet && ++counter == target) {
1499 "[fixed]level %d %s",
1500 ob->level,
ob->name);
1502 "[fixed]%d/%d HP, %d/%d SP",
1503 ob->stats.hp,
ob->stats.maxhp,
ob->stats.sp,
ob->stats.maxsp);
1528 "[fixed]wc %d damage %d ac %d",
1529 ob->stats.wc,
ob->stats.dam,
ob->stats.ac);
1539 "You have no pets.");
1540 else if (target != 0 && have_shown_pet == 0)
1555 static const char *
const types[] = {
1563 "usekeys is set to %s",
1568 if (!strcmp(
params,
"inventory"))
1570 else if (!strcmp(
params,
"keyrings"))
1572 else if (!strcmp(
params,
"containers"))
1576 "usekeys: Unknown option %s, valid options are inventory, keyrings, containers",
1581 "usekeys%s set to %s",
1582 (oldtype ==
op->contr->usekeys ?
"" :
" now"),
1605 "[fixed]%-20s %+5d",
1617 "\nNatural skin resistances:");
1619 for (attack = 0; attack <
NROFATTACKS; attack++) {
1646 const char *language;
1678 && *de->d_name ==
'.'
1679 && (namelen == 1 || de->d_name[1] ==
'.'))
1681 if (strstr(de->d_name,
suffix)) {
1682 strcat(
line, strtok(de->d_name,
"."));
1704 if (stat(
path, &st) == 0 && S_ISREG(st.st_mode)) {
1771 const char *language;
1785 if (!strcmp(
params,
"topics")) {
1796 if (!strcmp(
params,
"commands")) {
1806 "Illegal characters in '%s'",
1815 "No help available on '%s'",
1839 if (sscanf(
line,
"%d", &i))
1874 "To leave the game, sleep in (apply) a bed to reality. To "
1875 "permenantly delete your character, use the 'delete' command.");
1894 i18n(
op,
"Quitting will delete your character.\nAre you sure you want to delete your character (y/n):"));
1910 op->contr->socket.sound =
op->contr->socket.sound|
SND_MUTE;
1912 "Sounds are turned off.");
1914 op->contr->socket.sound =
op->contr->socket.sound&~
SND_MUTE;
1916 "The sounds are enabled.");
1940 op->contr->name_changed = 1;
1953 unsigned int pwd_len = strlen(password);
1955 if (pwd_len == 0 || pwd_len > 16) {
1960 "Password changed cancelled.");
1971 LOG(
llevInfo,
"Banned player tried to add: [%s@%s]\n",
op->name,
op->contr->socket.host);
1973 "You are not allowed to play.");
1981 "The passwords did not match.");
1985 LOG(
llevInfo,
"LOGIN: New player named %s from ip %s\n",
op->name,
op->contr->socket.host);
1988 "\nWelcome, Brave New Warrior!\n");
1997 "You entered the wrong current password.");
2008 sizeof(
op->contr->new_password));
2010 i18n(
op,
"Please confirm your new password, or blank to cancel:"));
2018 "The new passwords don't match!");
2021 "Password changed.");
2022 strncpy(
op->contr->password,
op->contr->new_password, 13);
2029 sizeof(
op->contr->password));
2049 "You cannot change your title.");
2056 "Dragons cannot change titles.");
2064 snprintf(
buf,
sizeof(
buf),
"Your title is '%s'.",
tmp);
2068 if (strcmp(
params,
"clear") == 0 || strcmp(
params,
"default") == 0) {
2071 "Your title is the default title.");
2074 "Title set to default.");
2099 "You can not save on unholy ground.");
2100 }
else if (!
op->stats.exp) {
2102 "You don't deserve to save yet.");
2106 "You have been saved.");
2123 if ((
op->contr->peaceful = !
op->contr->peaceful))
2125 "You will not attack other players.");
2128 "You will attack other players.");
2144 "Your current wimpy level is %d.",
2149 if (i < 0 || i > 100) {
2151 "Wimpy level should be between 1 and 100.",
2157 "Your new wimpy level is %d.",
2172 op->contr->braced = !
op->contr->braced;
2176 if (
op->contr->braced)
2198 "Your pets have been killed.");
2201 int counter = 0, removecount = 0;
2202 int target = atoi(
params);
2204 for (obl =
list; obl != NULL; obl = obl->
next) {
2205 object *
ob = obl->
ob;
2219 if (removecount != 0)
2225 "Couldn't find any suitable pets to kill.");
2248 "passwd is maintained for older clients that do not support the account system. Please use the 'Password' button in your character selection screen to change your password.");
2263 int count = 0, proba;
2264 int level, exp, check_exhaust = 0;
2267 object *
item, *
inv, *harvested;
2268 sstring trace, ttool, tspeed, race, tool, slevel, sexp;
2286 if (!
pl->chosen_skill ||
pl->chosen_skill->skill != skill->
skill)
2292 if (!trace || strcmp(trace,
"") == 0 || !ttool || strcmp(ttool,
"") == 0 || !tspeed || strcmp(tspeed,
"") == 0) {
2294 LOG(
llevError,
"do_harvest: tool %s without harvest_[race|tool|speed]\n",
pl->chosen_skill->name);
2307 if (race && (!slevel || !sexp)) {
2308 LOG(
llevError,
"do_harvest: item %s without harvest_[level|exp]\n",
inv->name);
2311 if (race == trace && (!tool || tool == ttool))
2328 level = atoi(slevel);
2331 speed = atof(tspeed);
2333 speed = -speed*
pl->speed;
2334 pl->speed_left -= speed;
2364 if (
inv->nrof == 0) {
2368 if (
count == 1 &&
inv->nrof == 1) {
2371 if (
inv->nrof == 1 ) {
2399 if (check_exhaust) {
2402 if (replacement[0] !=
'-') {
#define GET_MAP_OB(M, X, Y)
uint32_t get_weight_limit(int stat)
void command_version(object *op, const char *params)
EXTERN long nrofallowedstr
const char * get_name_of_region_for_map(const mapstruct *m)
static void get_who_escape_code_value(char *return_val, int size, const char letter, player *pl)
#define ST_CHANGE_PASSWORD_OLD
void object_free(object *ob, int flags)
sstring add_string(const char *str)
void object_remove(object *op)
void remove_friendly_object(object *op)
StringBuffer * stringbuffer_new(void)
void pets_terminate_all(object *owner)
signed long object_sum_weight(object *op)
size_t assets_number_of_animations()
#define NUM_BODY_LOCATIONS
void time_info(object *op)
void command_list(object *pl, bool is_dm)
void hiscore_display(object *op, int max, const char *match)
void command_motd(object *op, const char *params)
void command_afk(object *op, const char *params)
void command_bowmode(object *op, const char *params)
void send_news(const object *op)
region * get_region_by_name(const char *region_name)
void command_help(object *op, const char *params)
object * object_find_by_type_and_arch_name(const object *who, int type, const char *name)
void dump_friendly_objects(void)
#define QUERY_FLAG(xyz, p)
char const * newhash(char const *password)
BufferReader * bufferreader_init_from_file(BufferReader *br, const char *filepath, const char *failureMessage, LogLevel failureLevel)
static int find_help_file(const char *name, const char *language, int wiz, char *path, int length)
objectlink * get_friends_of(const object *owner)
object * object_new(void)
int i18n_find_language_by_code(const char *code)
int region_is_child_of_region(const region *child, const region *r)
int player_has_own_title(const struct pl *pl)
static int name_cmp(const chars_names *c1, const chars_names *c2)
void command_whereami(object *op, const char *params)
void command_petmode(object *op, const char *params)
void receive_player_password(object *op, const char *password)
void command_save(object *op, const char *params)
void command_dumpfriendlyobjects(object *op, const char *params)
void command_resistances(object *op, const char *params)
void get_password(object *op)
void command_unarmed_skill(object *op, const char *params)
#define CS_QUERY_SINGLECHAR
EXTERN artifactlist * first_artifactlist
char * bufferreader_next_line(BufferReader *br)
void command_kill_pets(object *op, const char *params)
size_t assets_number_of_archetypes()
static void current_region_info(object *op)
void player_set_own_title(struct pl *pl, const char *title)
void command_dumpallmaps(object *op, const char *params)
#define MSG_TYPE_COMMAND_ERROR
EXTERN mapstruct * first_map
void command_printlos(object *op, const char *params)
const char * get_region_longname(const region *r)
void command_dumpallobjects(object *op, const char *params)
short freearr_x[SIZEOFFREE]
short freearr_y[SIZEOFFREE]
void command_brace(object *op, const char *params)
const char * object_get_value(const object *op, const char *const key)
#define MSG_TYPE_ADMIN_DM
void free_string(sstring str)
void command_applymode(object *op, const char *params)
static event_registration m
DIR * opendir(const char *)
void object_dump_all(void)
void command_debug(object *op, const char *params)
void object_copy_with_inv(const object *src_ob, object *dest_ob)
void command_dumpmap(object *op, const char *params)
void send_rules(const object *op)
void command_wizcast(object *op, const char *params)
void print_los(object *op)
#define ST_CHANGE_PASSWORD_CONFIRM
void command_fix_me(object *op, const char *params)
void check_login(object *op, const char *password)
#define MSG_TYPE_COMMAND_INFO
const char * get_region_msg(const region *r)
void display_motd(const object *op)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
void command_whereabouts(object *op, const char *params)
#define MAP_WHEN_RESET(m)
struct dirent * readdir(DIR *)
#define MSG_TYPE_COMMAND_MALLOC
sstring i18n_get_language_code(int language)
void ss_dump_statistics(char *buf, size_t size)
#define MSG_TYPE_COMMAND_STATISTICS
void command_players(object *op, const char *params)
char * ss_dump_table(int what, char *buf, size_t size)
#define FREE_AND_COPY(sv, nv)
struct artifactliststruct * next
EXTERN player * first_player
void fix_object(object *op)
object * object_create_arch(archetype *at)
char * stringbuffer_finish(StringBuffer *sb)
#define ST_CHANGE_PASSWORD_NEW
static void current_map_info(object *op)
#define INS_BELOW_ORIGINATOR
int object_set_value(object *op, const char *key, const char *value, int add_key)
const typedef char * sstring
int rndm(int min, int max)
void command_hiscore(object *op, const char *params)
void command_rules(object *op, const char *params)
int is_dragon_pl(const object *op)
void command_mapinfo(object *op, const char *params)
void command_language(object *op, const char *params)
void command_body(object *op, const char *params)
object * find_skill_by_name(object *who, const char *name)
void command_passwd(object *pl, const char *params)
size_t strlcpy(char *dst, const char *src, size_t size)
void command_wimpy(object *op, const char *params)
size_t split_string(char *str, char *array[], size_t array_size, char sep)
int checkbanned(const char *login, const char *host)
int64_t level_exp(int level, double expmul)
void command_sound(object *op, const char *params)
static bool IS_PLAYER(object *op)
int random_roll(int min, int max, const object *op, int goodbad)
int object_count_used(void)
int object_count_active(void)
static void help_topics(object *op, int what)
void do_harvest(object *pl, int dir, object *skill)
void command_ssdumptable(object *op, const char *params)
const EXTERN char *const change_resist_msg[NROFATTACKS]
int object_count_free(void)
struct regiondef * parent
#define MSG_TYPE_SKILL_FAILURE
char who_wiz_format[MAX_BUF]
static void malloc_info(object *op)
void i18n_list_languages(object *who)
#define ST_CONFIRM_PASSWORD
void LOG(LogLevel logLevel, const char *format,...)
#define MSG_TYPE_COMMAND_BODY
void command_title(object *op, const char *params)
void roll_again(object *op)
int object_find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
size_t assets_number_of_treasurelists()
void receive_player_name(object *op, const char *name)
bool object_value_set(const object *op, const char *const key)
void command_showpets(object *op, const char *params)
void bufferreader_destroy(BufferReader *br)
void command_listen(object *op, const char *params)
const EXTERN char *const attacktype_desc[NROFATTACKS]
void command_quit(object *op, const char *params)
#define CLEAR_FLAG(xyz, p)
region * get_region_from_string(const char *name)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
object * object_insert_in_ob(object *op, object *where)
void command_news(object *op, const char *params)
void dump_map(const mapstruct *m)
#define MSG_TYPE_COMMAND_CONFIG
void command_time(object *op, const char *params)
void list_players(object *op, region *reg, partylist *party)
uint32_t map_size(mapstruct *m)
#define MSG_TYPE_COMMAND_MAPS
int strcasecmp(const char *s1, const char *s2)
region * get_region_by_map(mapstruct *m)
int save_player(object *op, int flag)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
#define ST_GET_PARTY_PASSWORD
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
void command_delete(object *op, const char *params)
void object_free_drop_inventory(object *ob)
void command_strings(object *op, const char *params)
const char * i18n(const object *who, const char *code)
void player_set_state(player *pl, uint8_t state)
archetype * try_find_archetype(const char *name)
void command_peaceful(object *op, const char *params)
void command_dumpallarchetypes(object *op, const char *params)
bool check_password(const char *typed, const char *crypted)
EXTERN long nrofartifacts
#define FREE_OBJ_FREE_INVENTORY
void command_usekeys(object *op, const char *params)
void command_malloc(object *op, const char *params)
#define MSG_TYPE_ADMIN_VERSION
int atnr_is_dragon_enabled(int attacknr)
static void display_help_file(object *op, const char *filename)
static void map_info(object *op, const char *search)
void command_who(object *op, const char *params)
void command_statistics(object *pl, const char *params)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
void player_get_title(const struct pl *pl, char *buf, size_t bufsize)
int check_name(player *me, const char *name)
void command_wizpass(object *op, const char *params)
#define MSG_TYPE_COMMAND_WHO
EXTERN region * first_region
static void display_who_entry(object *op, player *pl, const char *format)
body_locations_struct body_locations[NUM_BODY_LOCATIONS]
void set_map_reset_time(mapstruct *map)
void command_maps(object *op, const char *params)
void send_query(socket_struct *ns, uint8_t flags, const char *text)
object * object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
#define FOR_INV_PREPARE(op_, it_)
static int find_help_file_in(const char *dir, const char *name, const char *language, char *path, int length)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
void free_objectlink(objectlink *ol)
void dump_all_archetypes(void)
size_t assets_number_of_treasures()
void get_name(object *op)
object * object_get_owner(object *op)
#define CS_QUERY_HIDEINPUT
static int onoff_value(const char *line)
player * find_player(const char *plname)