Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mostly Mudlog #42

Merged
merged 14 commits into from
Feb 15, 2018
1 change: 1 addition & 0 deletions src/act.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ ACMD(do_gen_tog);
#define SCMD_WIMPY 30
#define SCMD_PAGELENGTH 31
#define SCMD_SCREENWIDTH 32
#define SCMD_ZONERESETS 33

/* do_quit */
ACMD(do_quit);
Expand Down
15 changes: 12 additions & 3 deletions src/act.informative.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ ACMD(do_help)

if ((mid = search_help(argument, GET_LEVEL(ch))) == NOWHERE) {
send_to_char(ch, "There is no help on that word.\r\n");
mudlog(NRM, MAX(LVL_IMPL, GET_INVIS_LEV(ch)), TRUE,
mudlog(NRM, MIN(LVL_IMPL, GET_INVIS_LEV(ch)), TRUE,
"%s tried to get help on %s", GET_NAME(ch), argument);
for (i = 0; i < top_of_helpt; i++) {
if (help_table[i].min_level > GET_LEVEL(ch))
Expand Down Expand Up @@ -1924,6 +1924,9 @@ ACMD(do_toggle)
{"wimpy", 0, 0, "\n", "\n"},
{"pagelength", 0, 0, "\n", "\n"},
{"screenwidth", 0, 0, "\n", "\n"},
{"zoneresets", PRF_ZONERESETS, LVL_IMPL,
"You will no longer see zone resets.\r\n",
"You will now see zone resets.\r\n"},
{"\n", 0, -1, "\n", "\n"} /* must be last */
};

Expand Down Expand Up @@ -1957,15 +1960,21 @@ ACMD(do_toggle)
" NoHassle: %-3s "
" Holylight: %-3s "
" ShowVnums: %-3s\r\n"
" Syslog: %-3s\r\n",
" Syslog: %-3s%s ",

ONOFF(PRF_FLAGGED(ch, PRF_BUILDWALK)),
ONOFF(PRF_FLAGGED(ch, PRF_NOWIZ)),
ONOFF(PRF_FLAGGED(ch, PRF_CLS)),
ONOFF(PRF_FLAGGED(ch, PRF_NOHASSLE)),
ONOFF(PRF_FLAGGED(ch, PRF_HOLYLIGHT)),
ONOFF(PRF_FLAGGED(ch, PRF_SHOWVNUMS)),
types[(PRF_FLAGGED(ch, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(ch, PRF_LOG2) ? 2 : 0)]);
types[(PRF_FLAGGED(ch, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(ch, PRF_LOG2) ? 2 : 0)],
GET_LEVEL(ch) == LVL_IMPL ? "" : "\r\n");
}
if (GET_LEVEL(ch) >= LVL_IMPL) {
send_to_char(ch,
" ZoneResets: %-3s\r\n",
ONOFF(PRF_FLAGGED(ch, PRF_ZONERESETS)));
}

send_to_char(ch,
Expand Down
2 changes: 1 addition & 1 deletion src/act.movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ ACMD(do_gen_door)
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum)) )
{
send_to_char(ch, "It is locked, but you have the key.\r\n");
send_to_char(ch, "*Click*\r\n");
do_doorcmd(ch, obj, door, SCMD_UNLOCK);
do_doorcmd(ch, obj, door, subcmd);
}
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum)) )
Expand Down
9 changes: 7 additions & 2 deletions src/act.other.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,9 @@ ACMD(do_gen_tog)
{"Autokey disabled.\r\n",
"Autokey enabled.\r\n"},
{"Autodoor disabled.\r\n",
"Autodoor enabled.\r\n"}
"Autodoor enabled.\r\n"},
{"ZoneResets disabled.\r\n",
"ZoneResets enabled.\r\n"}
};

if (IS_NPC(ch))
Expand Down Expand Up @@ -783,7 +785,7 @@ ACMD(do_gen_tog)
break;
case SCMD_CLS:
result = PRF_TOG_CHK(ch, PRF_CLS);
break;
break;
case SCMD_BUILDWALK:
if (GET_LEVEL(ch) < LVL_BUILDER) {
send_to_char(ch, "Builders only, sorry.\r\n");
Expand Down Expand Up @@ -840,6 +842,9 @@ ACMD(do_gen_tog)
case SCMD_AUTODOOR:
result = PRF_TOG_CHK(ch, PRF_AUTODOOR);
break;
case SCMD_ZONERESETS:
result = PRF_TOG_CHK(ch, PRF_ZONERESETS);
break;
default:
log("SYSERR: Unknown subcmd %d in do_gen_toggle.", subcmd);
return;
Expand Down
25 changes: 13 additions & 12 deletions src/act.wizard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,6 @@ static void stop_snooping(struct char_data *ch)
else {
send_to_char(ch, "You stop snooping.\r\n");

if (GET_LEVEL(ch) < LVL_IMPL)
mudlog(BRF, GET_LEVEL(ch), TRUE, "(GC) %s stops snooping", GET_NAME(ch));

ch->desc->snooping->snoop_by = NULL;
Expand Down Expand Up @@ -1193,7 +1192,6 @@ ACMD(do_snoop)
}
send_to_char(ch, "%s", CONFIG_OK);

if (GET_LEVEL(ch) < LVL_IMPL)
mudlog(BRF, GET_LEVEL(ch), TRUE, "(GC) %s snoops %s", GET_NAME(ch), GET_NAME(victim));

if (ch->desc->snooping)
Expand Down Expand Up @@ -1445,13 +1443,14 @@ ACMD(do_purge)
if (*buf) {
t = buf;
number = get_number(&t);
if ((vict = get_char_vis(ch, buf, &number, FIND_CHAR_ROOM)) != NULL) { if (!IS_NPC(vict) && (GET_LEVEL(ch) <= GET_LEVEL(vict))) {
send_to_char(ch, "You can't purge %s!\r\n", HMHR(vict));
if ((vict = get_char_vis(ch, buf, &number, FIND_CHAR_ROOM)) != NULL) {
if (!IS_NPC(vict) && (GET_LEVEL(ch) <= GET_LEVEL(vict))) {
send_to_char(ch, "You can't purge %s!\r\n", GET_NAME(vict));
return;
}
act("$n disintegrates $N.", FALSE, ch, 0, vict, TO_NOTVICT);

if (!IS_NPC(vict) && GET_LEVEL(ch) < LVL_GOD) {
if (!IS_NPC(vict)) {
mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has purged %s.", GET_NAME(ch), GET_NAME(vict));
if (vict->desc) {
STATE(vict->desc) = CON_CLOSE;
Expand Down Expand Up @@ -1602,6 +1601,8 @@ ACMD(do_restore)
else if (!IS_NPC(vict) && ch != vict && GET_LEVEL(vict) >= GET_LEVEL(ch))
act("$E doesn't need your help.", FALSE, ch, 0, vict, TO_CHAR);
else {
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s restored %s",GET_NAME(ch), GET_NAME(vict));

GET_HIT(vict) = GET_MAX_HIT(vict);
GET_MANA(vict) = GET_MAX_MANA(vict);
GET_MOVE(vict) = GET_MAX_MOVE(vict);
Expand All @@ -1616,7 +1617,7 @@ ACMD(do_restore)
vict->real_abils.intel = 25;
vict->real_abils.wis = 25;
vict->real_abils.dex = 25;
vict->real_abils.str = 18;
vict->real_abils.str = 25;
vict->real_abils.con = 25;
vict->real_abils.cha = 25;
}
Expand Down Expand Up @@ -2279,7 +2280,7 @@ ACMD(do_zreset)
for (i = 0; i <= top_of_zone_table; i++)
reset_zone(i);
send_to_char(ch, "Reset world.\r\n");
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset entire world.", GET_NAME(ch));
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset entire world.", GET_NAME(ch));
return; }
} else if (*arg == '.' || !*arg)
i = world[IN_ROOM(ch)].zone;
Expand All @@ -2292,7 +2293,7 @@ ACMD(do_zreset)
if (i <= top_of_zone_table && (can_edit_zone(ch, i) || GET_LEVEL(ch) > LVL_IMMORT)) {
reset_zone(i);
send_to_char(ch, "Reset zone #%d: %s.\r\n", zone_table[i].number, zone_table[i].name);
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset zone %d (%s)", GET_NAME(ch), zone_table[i].number, zone_table[i].name);
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset zone %d (%s)", GET_NAME(ch), zone_table[i].number, zone_table[i].name);
} else
send_to_char(ch, "You do not have permission to reset this zone. Try %d.\r\n", GET_OLC_ZONE(ch));
}
Expand Down Expand Up @@ -4748,7 +4749,7 @@ ACMD(do_zlock)
return;
}
send_to_char(ch, "%d zones have now been locked.\r\n", counter);
mudlog(BRF, LVL_GOD, TRUE, "(GC) %s has locked ALL zones!", GET_NAME(ch));
mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has locked ALL zones!", GET_NAME(ch));
return;
}
if (is_abbrev(arg, "list")) {
Expand Down Expand Up @@ -4791,7 +4792,7 @@ ACMD(do_zlock)
}
SET_BIT_AR(ZONE_FLAGS(zn), ZONE_NOBUILD);
if (save_zone(zn)) {
mudlog(NRM, LVL_GRGOD, TRUE, "(GC) %s has locked zone %d", GET_NAME(ch), znvnum);
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has locked zone %d", GET_NAME(ch), znvnum);
}
else
{
Expand Down Expand Up @@ -4842,7 +4843,7 @@ ACMD(do_zunlock)
return;
}
send_to_char(ch, "%d zones have now been unlocked.\r\n", counter);
mudlog(BRF, LVL_GOD, TRUE, "(GC) %s has unlocked ALL zones!", GET_NAME(ch));
mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has unlocked ALL zones!", GET_NAME(ch));
return;
}
if (is_abbrev(arg, "list")) {
Expand Down Expand Up @@ -4885,7 +4886,7 @@ ACMD(do_zunlock)
}
REMOVE_BIT_AR(ZONE_FLAGS(zn), ZONE_NOBUILD);
if (save_zone(zn)) {
mudlog(NRM, LVL_GRGOD, TRUE, "(GC) %s has unlocked zone %d", GET_NAME(ch), znvnum);
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has unlocked zone %d", GET_NAME(ch), znvnum);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/aedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ACMD(do_oasis_aedit)
STATE(d) = CON_AEDIT;
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing actions.", GET_NAME(ch));
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing actions.", GET_NAME(ch));
}

static void aedit_setup_new(struct descriptor_data *d) {
Expand Down Expand Up @@ -330,7 +330,7 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
switch (*arg) {
case 'y': case 'Y':
aedit_save_internally(d);
mudlog (CMP, LVL_IMPL, TRUE, "OLC: %s edits action %s",
mudlog (CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s",
GET_NAME(d->character), OLC_ACTION(d)->command);

/* do not free the strings.. just the structure */
Expand Down
2 changes: 1 addition & 1 deletion src/cedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ACMD(do_oasis_cedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);

mudlog(BRF, LVL_IMMORT, TRUE,
mudlog(BRF, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s starts editing the game configuration.", GET_NAME(ch));
return;
} else if (str_cmp("save", buf1) != 0) {
Expand Down
1 change: 1 addition & 0 deletions src/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ const char *preference_bits[] = {
"AUTOMAP",
"AUTOKEY",
"AUTODOOR",
"ZONERESETS",
"\n"
};

Expand Down
9 changes: 8 additions & 1 deletion src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "ibt.h"
#include "mud_event.h"
#include "msgedit.h"
#include "screen.h"
#include <sys/stat.h>

/* declarations of most of the 'global' variables */
Expand Down Expand Up @@ -2506,8 +2507,14 @@ void zone_update(void)
if (zone_table[update_u->zone_to_reset].reset_mode == 2 ||
is_empty(update_u->zone_to_reset)) {
reset_zone(update_u->zone_to_reset);
mudlog(CMP, LVL_IMPL, FALSE, "Auto zone reset: %s (Zone %d)",
mudlog(CMP, LVL_IMPL+1, FALSE, "Auto zone reset: %s (Zone %d)",
zone_table[update_u->zone_to_reset].name, zone_table[update_u->zone_to_reset].number);
struct descriptor_data *pt;
for (pt = descriptor_list; pt; pt = pt->next)
if (IS_PLAYING(pt) && pt->character && PRF_FLAGGED(pt->character, PRF_ZONERESETS))
send_to_char(pt->character, "%s[Auto zone reset: %s (Zone %d)]%s",
CCGRN(pt->character, C_NRM), zone_table[update_u->zone_to_reset].name,
zone_table[update_u->zone_to_reset].number, CCNRM(pt->character, C_NRM));
/* dequeue */
if (update_u == reset_q.head)
reset_q.head = reset_q.head->next;
Expand Down
2 changes: 1 addition & 1 deletion src/dg_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void script_damage(struct char_data *vict, int dam)

if (GET_POS(vict) == POS_DEAD) {
if (!IS_NPC(vict))
mudlog( BRF, 0, TRUE, "%s killed by script at %s",
mudlog( BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(vict)), TRUE, "%s killed by script at %s",
GET_NAME(vict), vict->in_room == NOWHERE ? "NOWHERE" : world[vict->in_room].name);
die(vict, NULL);
}
Expand Down
4 changes: 2 additions & 2 deletions src/dg_olc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ACMD(do_oasis_trigedit)
d = ch->desc;
/* Give descriptor an OLC structure. */
if (d->olc) {
mudlog(BRF, LVL_IMMORT, TRUE,
mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: do_oasis_trigedit: Player already had olc structure.");
free(d->olc);
}
Expand Down Expand Up @@ -104,7 +104,7 @@ ACMD(do_oasis_trigedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);

mudlog(CMP, LVL_IMMORT, TRUE,"OLC: %s starts editing zone %d [trigger](allowed zone %d)",
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,"OLC: %s starts editing zone %d [trigger](allowed zone %d)",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
}

Expand Down
7 changes: 7 additions & 0 deletions src/dg_variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.cha += addition;
if (c->real_abils.cha > max) c->real_abils.cha = max;
if (c->real_abils.cha < 3) c->real_abils.cha = 3;
affect_total(c);
}
snprintf(str, slen, "%d", GET_CHA(c));
}
Expand All @@ -657,6 +658,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.con += addition;
if (c->real_abils.con > max) c->real_abils.con = max;
if (c->real_abils.con < 3) c->real_abils.con = 3;
affect_total(c);
}
snprintf(str, slen, "%d", GET_CON(c));
}
Expand All @@ -675,6 +677,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.dex += addition;
if (c->real_abils.dex > max) c->real_abils.dex = max;
if (c->real_abils.dex < 3) c->real_abils.dex = 3;
affect_total(c);
}
snprintf(str, slen, "%d", GET_DEX(c));
}
Expand Down Expand Up @@ -799,6 +802,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.intel += addition;
if (c->real_abils.intel > max) c->real_abils.intel = max;
if (c->real_abils.intel < 3) c->real_abils.intel = 3;
affect_total(c);
}
snprintf(str, slen, "%d", GET_INT(c));
}
Expand Down Expand Up @@ -1059,6 +1063,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.str += addition;
if (c->real_abils.str > max) c->real_abils.str = max;
if (c->real_abils.str < 3) c->real_abils.str = 3;
affect_total(c);
}
snprintf(str, slen, "%d", GET_STR(c));
}
Expand All @@ -1069,6 +1074,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.str_add += addition;
if (c->real_abils.str_add > 100) c->real_abils.str_add = 100;
if (c->real_abils.str_add < 0) c->real_abils.str_add = 0;
affect_total(c);
}
snprintf(str, slen, "%d", GET_ADD(c));
}
Expand Down Expand Up @@ -1131,6 +1137,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
c->real_abils.wis += addition;
if (c->real_abils.wis > max) c->real_abils.wis = max;
if (c->real_abils.wis < 3) c->real_abils.wis = 3;
affect_total(c);
}
snprintf(str, slen, "%d", GET_WIS(c));
}
Expand Down
6 changes: 4 additions & 2 deletions src/fight.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void check_killer(struct char_data *ch, struct char_data *vict)

SET_BIT_AR(PLR_FLAGS(ch), PLR_KILLER);
send_to_char(ch, "If you want to be a PLAYER KILLER, so be it...\r\n");
mudlog(BRF, LVL_IMMORT, TRUE, "PC Killer bit set on %s for initiating attack on %s at %s.",
mudlog(BRF, MAX(LVL_IMMORT, MAX(GET_INVIS_LEV(ch), GET_INVIS_LEV(vict))),
TRUE, "PC Killer bit set on %s for initiating attack on %s at %s.",
GET_NAME(ch), GET_NAME(vict), world[IN_ROOM(vict)].name);
}

Expand Down Expand Up @@ -743,7 +744,8 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
}

if (!IS_NPC(victim)) {
mudlog(BRF, LVL_IMMORT, TRUE, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch), world[IN_ROOM(victim)].name);
mudlog(BRF, MAX(LVL_IMMORT, MAX(GET_INVIS_LEV(ch), GET_INVIS_LEV(victim))),
TRUE, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch), world[IN_ROOM(victim)].name);
if (MOB_FLAGGED(ch, MOB_MEMORY))
forget(ch, victim);
}
Expand Down
3 changes: 2 additions & 1 deletion src/hedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ ACMD(do_oasis_hedit)
STATE(d) = CON_HEDIT;
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)),
TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
}

static void hedit_setup_new(struct descriptor_data *d)
Expand Down
5 changes: 3 additions & 2 deletions src/ibt.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ ACMD(do_ibt)
case SCMD_TYPO: LINK( ibtData, first_typo, last_typo, next, prev );
break;
}
mudlog(NRM,LVL_IMMORT, FALSE, "%s has posted %s %s!", GET_NAME(ch), TANA(CMD_NAME), CMD_NAME);
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)),
FALSE, "%s has posted %s %s!", GET_NAME(ch), TANA(CMD_NAME), CMD_NAME);
return;
}
else if (is_abbrev(arg,"resolve"))
Expand Down Expand Up @@ -839,7 +840,7 @@ ACMD(do_oasis_ibtedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);

mudlog(CMP, LVL_IMMORT, TRUE,"OLC: %s starts editing %s %d",
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,"OLC: %s starts editing %s %d",
GET_NAME(ch), IBT_TYPE, OLC_NUM(d));
}

Expand Down