char output_db[256]; /**< Name of the output database file */
char flagdb[256]; /**<Name of flag database file */
char crash_db[256]; /**< Name of the panic database file */
+#ifdef USE_MAILER
char mail_db[256]; /**< Name of the mail database file */
+#endif
dbref player_start; /**< The room in which new players are created */
dbref guest_start; /**<The room in which new guests are created */
dbref master_room; /**< The master room for global commands/exits */
#endif
struct descriptor_data *next; /**< Next descriptor in linked list */
struct descriptor_data *prev; /**< Previous descriptor in linked list */
+#ifdef USE_MAILER
struct mail *mailp; /**< Pointer to start of player's mail chain */
+#endif
int conn_flags; /**< Flags of connection (telnet status, etc.) */
unsigned long input_chars; /**< Characters received */
unsigned long output_chars; /**< Characters sent */
tbuf1[strlen(tbuf1)+1] = '\0';
(void) atr_add(d->player, "LASTACTIVITY", tbuf1, GOD, NOTHING);
announce_disconnect(d->player);
+#ifdef USE_MAILER
do_mail_purge(d->player);
+#endif
if (MAX_LOGINS) {
login_number--;
if (!under_limit && (login_number < MAX_LOGINS)) {
d->cmds = 0;
d->hide = 0;
d->doing[0] = '\0';
+#ifdef USE_MAILER
d->mailp = NULL;
+#endif
d->pinfo.object = NOTHING;
d->pinfo.atr = NULL;
d->pinfo.lock = 0;
tbuf1[strlen(tbuf1)+1] = '\0';
(void) atr_add(d->player, "LASTACTIVITY", tbuf1, GOD, NOTHING);
announce_disconnect(d->player);
+#ifdef USE_MAILER
do_mail_purge(d->player);
+#endif
}
if (MAX_LOGINS) {
login_number--;
d->cmds = 0;
d->hide = 0;
d->doing[0] = '\0';
+#ifdef USE_MAILER
d->mailp = NULL;
+#endif
strncpy(d->addr, "localhost", 100);
d->addr[99] = '\0';
strncpy(d->ip, "127.0.0.1", 100);
d->cmds = 0;
d->hide = 0;
d->doing[0] = '\0';
+#ifdef USE_MAILER
d->mailp = NULL;
+#endif
strncpy(d->addr, addr, 100);
d->addr[99] = '\0';
strncpy(d->ip, ip, 100);
return 0;
}
}
+#ifdef USE_MAILER
d->mailp = find_exact_starting_point(player);
+#endif
/* check to see if this is a reconnect and also set DARK status */
is_hidden = Can_Hide(player) && Dark(player);
check_last(player, d->addr, d->ip); /* set Last, Lastsite, give paycheck */
/* Check folder 0, not silently (i.e. Report lack of mail, too) */
queue_eol(d);
+#ifdef USE_MAILER
if (command_check_byname(player, "@MAIL"))
check_mail(player, 0, 0);
set_player_folder(player, 0);
+#endif
do_look_around(player);
if (Haven(player))
notify(player, T("Your HAVEN flag is set. You cannot receive pages."));
}
+#ifdef USE_MAILER
+
/** Return the mailp of the player closest in db# to player,
* or NULL if there's nobody on-line.
* In the current mail system, mail is stored in a linked list, sorted
}
}
+#endif /* USE_MAILER */
d->raw_input = NULL;
d->raw_input_at = NULL;
d->quota = options.starting_quota;
+#ifdef USE_MAILER
d->mailp = NULL;
+#endif
#ifndef COMPILE_CONSOLE
#ifdef HAS_OPENSSL
d->ssl = NULL;
strcpy(poll_msg, getstring_noalloc(f));
globals.first_start_time = getref(f);
globals.reboot_count = getref(f) + 1;
+#ifdef USE_MAILER
DESC_ITER_CONN(d) {
d->mailp = find_exact_starting_point(d->player);
}
+#endif
#ifndef COMPILE_CONSOLE
#ifdef HAS_OPENSSL
if (SSLPORT) {
add_to_exit_path(match, player);
announce_disconnect(player);
match->player = target;
+#ifdef USE_MAILER
match->mailp = find_exact_starting_point(target);
+#endif
is_hidden = Can_Hide(target) && Dark(target);
DESC_ITER_CONN(d)
if(d->player == player) {
announce_connect(target, 0, num);
check_last(target, match->addr, match->ip); /* set last, lastsite, give paycheck */
queue_eol(match);
+#ifdef USE_MAILER
if(command_check_byname(target, "@MAIL"))
check_mail(target, 0, 0);
set_player_folder(target, 0);
+#endif
do_look_around(target);
if(Haven(target))
notify(player, T("Your HAVEN flag is set. You cannot receive pages."));
/* Clear path_entry spot */
d->su_exit_path = path_entry->next;
mush_free(path_entry, "SU_PATH_ENTRY");
+#ifdef USE_MAILER
d->mailp = find_exact_starting_point(d->player);
+#endif
is_hidden = Can_Hide(d->player) && Dark(d->player);
DESC_ITER_CONN(c)
if(c->player == d->player) {
announce_connect(d->player, 0, num);
check_last(d->player, d->addr, d->ip); /* set last, lastsite, give paycheck */
queue_eol(d);
+#ifdef USE_MAILER
if(command_check_byname(d->player, "@MAIL"))
check_mail(d->player, 0, 0);
set_player_folder(d->player, 0);
+#endif
do_look_around(d->player);
if(Haven(d->player))
notify(d->player, T("Your HAVEN flag is set. You cannot receive pages."));
do_lset(player, arg_left, arg_right);
}
+#ifdef USE_MAILER
COMMAND (cmd_mail) {
int urgent = SW_ISSET(sw, SWITCH_URGENT);
int silent = SW_ISSET(sw, SWITCH_SILENT);
else
do_malias(player, arg_left, arg_right);
}
+#endif
COMMAND (cmd_map) {
unsigned int flags = DOL_MAP;
CMD_T_ANY | CMD_T_NOGAGGED | CMD_T_GOD, "POWER^SITE"},
{"@LSET", NULL, cmd_lset,
CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, NULL},
+#ifdef USE_MAILER
{"@MAIL",
"NOEVAL NOSIG STATS DSTATS FSTATS DEBUG NUKE FOLDERS UNFOLDER LIST READ CLEAR UNCLEAR PURGE FILE TAG UNTAG FWD FORWARD SEND SILENT URGENT",
cmd_mail, CMD_T_ANY | CMD_T_EQSPLIT, NULL},
{"@MALIAS",
"SET CREATE DESTROY DESCRIBE RENAME STATS CHOWN NUKE ADD REMOVE LIST ALL WHO MEMBERS USEFLAG SEEFLAG",
cmd_malias, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, NULL},
+#endif
{"@MAP", "DELIMIT", cmd_map, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_NOPARSE,
NULL},
{"@MOTD", "CONNECT LIST DOWN FULL", cmd_motd,
{"crash_database", cf_str, options.crash_db, sizeof options.crash_db, 0,
"files"}
,
+#ifdef USE_MAILER
{"mail_database", cf_str, options.mail_db, sizeof options.mail_db, 0, "files"}
,
+#endif
{"chat_database", cf_str, options.chatdb, sizeof options.chatdb, 0, "files"}
,
{"compress_suffix", cf_str, options.compresssuff, sizeof options.compresssuff,
options.chan_cost = 1000;
options.max_player_chans = 3;
options.max_channels = 200;
+#ifdef USE_MAILER
strcpy(options.mail_db, "data/maildb");
+#endif
options.player_start = 0;
options.guest_start = options.player_start;
options.master_room = 2;
char alias[BUFFER_LEN + 1];
/* Clear out mail. */
+#ifdef USE_MAILER
do_mail_clear(thing, NULL);
do_mail_purge(thing);
malias_cleanup(thing);
+#endif
#ifdef CHAT_SYSTEM
/* Chown any chat channels they own to God */
{"FLIP", fun_flip, 1, -1, FN_REG},
{"FLOORDIV", fun_floordiv, 2, 2, FN_REG},
{"FOLD", fun_fold, 2, 4, FN_REG},
+#ifdef USE_MAILER
{"FOLDERSTATS", fun_folderstats, 0, 2, FN_REG},
+#endif
{"FOLLOWERS", fun_followers, 1, 1, FN_REG},
{"FOLLOWING", fun_following, 1, 1, FN_REG},
{"FOREACH", fun_foreach, 2, 4, FN_REG},
{"LVTHINGS", fun_dbwalker, 1, 1, FN_REG},
{"LWHO", fun_lwho, 0, 1, FN_REG},
{"LWHOID", fun_lwho, 0, 1, FN_REG},
+#ifdef USE_MAILER
{"MAIL", fun_mail, 0, 2, FN_REG},
{"MAILFROM", fun_mailfrom, 1, 2, FN_REG},
{"MAILSTATS", fun_mailstats, 1, 1, FN_REG},
{"MAILSTATUS", fun_mailstatus, 1, 2, FN_REG},
{"MAILSUBJECT", fun_mailsubject, 1, 2, FN_REG},
{"MAILTIME", fun_mailtime, 1, 2, FN_REG},
+#endif
{"MAP", fun_map, 2, 4, FN_REG},
{"MAPSQL", fun_mapsql, 2, 4, FN_REG},
{"MATCH", fun_match, 2, 3, FN_REG},
perror(realtmpfl);
longjmp(db_err, 1);
}
+#ifdef USE_MAILER
sprintf(realdumpfile, "%s%s", options.mail_db, options.compresssuff);
strcpy(tmpfl, make_new_epoch_file(options.mail_db, epoch));
sprintf(realtmpfl, "%s%s", tmpfl, options.compresssuff);
longjmp(db_err, 1);
}
}
+#endif
#ifdef CHAT_SYSTEM
sprintf(realdumpfile, "%s%s", options.chatdb, options.compresssuff);
strcpy(tmpfl, make_new_epoch_file(options.chatdb, epoch));
} else {
do_rawlog(LT_ERR, T("DUMPING: %s"), panicfile);
db_write(f, DBF_PANIC);
+#ifdef USE_MAILER
dump_mail(f);
+#endif
#ifdef CHAT_SYSTEM
save_chatdb(f);
#endif /* CHAT_SYSTEM */
FILE *f;
int c;
const char *infile, *outfile;
+#ifdef USE_MAILER
const char *mailfile;
+#endif
const char *flag_file;
int panicdb;
infile = restarting ? options.output_db : options.input_db;
outfile = options.output_db;
flag_file = options.flagdb;
+#ifdef USE_MAILER
mailfile = options.mail_db;
+#endif
strcpy(globals.dumpfile, outfile);
/* read small text files into cache */
if (!GoodObject(GOD) || (!IsPlayer(GOD)))
do_rawlog(LT_ERR, T("WARNING: God (#%d) is NOT a player."), GOD);
+#ifdef USE_MAILER
/* read mail database */
mail_init();
db_close(f);
}
}
+#endif /* USE_MAILER */
#ifdef CHAT_SYSTEM
init_chatdb();
add_to_exit_path(d, d->player);
announce_disconnect(d->player);
d->player = d->pinfo.object;
+#ifdef USE_MAILER
d->mailp = (MAIL *) find_exact_starting_point(d->pinfo.object);
+#endif
/* We're good @su him */
is_hidden = Can_Hide(d->pinfo.object) && Dark(d->pinfo.object);
DESC_ITER_CONN(match)
#ifdef USE_MAILER
if (command_check_byname(d->pinfo.object, "@MAIL"))
check_mail(d->pinfo.object, 0, 0);
-#endif
set_player_folder(d->pinfo.object, 0);
+#endif
do_look_around(d->pinfo.object);
if (Haven(d->pinfo.object))
notify(d->player,
for (lptr = Locks(end_obj); lptr; lptr = L_NEXT(lptr))
if (L_KEY(lptr) != NULL_CHUNK_REFERENCE)
actual++;
+#ifdef USE_MAILER
if (IsPlayer(end_obj)) {
for (mp = find_exact_starting_point(end_obj); mp; mp = mp->next)
if (mp->msgid != NULL_CHUNK_REFERENCE)
actual++;
}
+#endif
end_obj = (end_obj + 1) % db_top;
} while (actual < amount && end_obj != start_obj);
refs[actual] = &(lptr->key);
actual++;
}
+#ifdef USE_MAILER
if (IsPlayer(start_obj)) {
for (mp = find_exact_starting_point(start_obj); mp; mp = mp->next)
if (mp->msgid != NULL_CHUNK_REFERENCE) {
actual++;
}
}
+#endif
start_obj = (start_obj + 1) % db_top;
} while (start_obj != end_obj);
switch (Typeof(thing)) {
case TYPE_PLAYER:
+#ifdef USE_MAILER
mp = desc_mail(thing);
notify_format(player, T("First mail sender: %d"), mp ? mp->from : NOTHING);
+#endif
case TYPE_THING:
notify_format(player, "Location: %d", Location(thing));
notify_format(player, "Home: %d", Home(thing));