From 79e7ab10ea1e91254f03ee1e706e20aa70e8fe74 Mon Sep 17 00:00:00 2001 From: Nauzhror Date: Thu, 15 Feb 2018 10:55:18 -0500 Subject: [PATCH] Mostly Mudlog (#42) * Added %log%, and made %send%, %echo%, etc. not force capitalization. * Fixed Previous Commit * Really fixed this time. * Fixed look 2.mail Also reverted CMMAND_TERMS, was increased in previous commit when it didn't need to be due to the removed of marena. * Fixed add_to_lookup_table Fixed as per Welcor https://www.tbamud.com/forum/2-general/4307-crash-bug-need-assistance-with-gdb?start=20#7390 * Fixed two crash bugs Fixed tw crash bugs Welcor found here https://www.tbamud.com/forum/4-development/4300-simple-list-forced-to-reset-itself * wizhelp changes Cleared buf in columns_list that was getting garbage data in it. Removed wizhelp subcommand from do_commands, and removed buf and sprintf line that were never sent to anyone and replaced it with a send_to_char. Removed arg capability from do_commands as it's no longer useful without the wizhelp subcommand. Replaced wizhelp subcommand with separate do_wizhelp command that sorts commands by their level and shows all imms all imm commands regardless of their level. * Fix Fixed previous commit * Trigedit Mostly Changed attributes to persist across logout when changed in trigedit. Made strength now loer for GRGOD and above when wearing equipment. Added npcflag field to trigedit. Fixed %actor.vnum()% * Log Files Fixed Farbled Data in Logfiles. Fix from Prool on forums. * Mudlog, Trigedit, New Pref Toggle Skimmed every call of mudlog for missing GET_INVIS_LEV and other obvious inconsistencies. Added affect_total() cals to dg_variables so stats adjust properly. Added zoneresets toggle to prefedit because syslog complete is super spammy as a result of zone resets so tey're now separate from other syslog options. --- src/act.h | 1 + src/act.informative.c | 15 ++++++++++++--- src/act.movement.c | 2 +- src/act.other.c | 9 +++++++-- src/act.wizard.c | 25 +++++++++++++------------ src/aedit.c | 4 ++-- src/cedit.c | 2 +- src/constants.c | 1 + src/db.c | 9 ++++++++- src/dg_misc.c | 2 +- src/dg_olc.c | 4 ++-- src/dg_variables.c | 7 +++++++ src/fight.c | 6 ++++-- src/hedit.c | 3 ++- src/ibt.c | 5 +++-- src/interpreter.c | 6 ++++-- src/limits.c | 2 +- src/medit.c | 2 +- src/msgedit.c | 2 +- src/oasis.c | 13 +++++++++---- src/objsave.c | 2 +- src/oedit.c | 2 +- src/prefedit.c | 19 ++++++++++++++++++- src/qedit.c | 2 +- src/redit.c | 2 +- src/sedit.c | 2 +- src/spells.c | 3 ++- src/structs.h | 3 ++- src/tedit.c | 2 +- src/utils.c | 6 ++++-- src/zedit.c | 2 +- 31 files changed, 114 insertions(+), 51 deletions(-) diff --git a/src/act.h b/src/act.h index 37b8de9..41b7688 100644 --- a/src/act.h +++ b/src/act.h @@ -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); diff --git a/src/act.informative.c b/src/act.informative.c index df4e3a9..72f87d7 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -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)) @@ -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 */ }; @@ -1957,7 +1960,7 @@ 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)), @@ -1965,7 +1968,13 @@ ACMD(do_toggle) 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, diff --git a/src/act.movement.c b/src/act.movement.c index ee68acb..956f6bd 100644 --- a/src/act.movement.c +++ b/src/act.movement.c @@ -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)) ) diff --git a/src/act.other.c b/src/act.other.c index 3ab0f9e..d5bb798 100644 --- a/src/act.other.c +++ b/src/act.other.c @@ -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)) @@ -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"); @@ -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; diff --git a/src/act.wizard.c b/src/act.wizard.c index 0c72be1..29fe013 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -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; @@ -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) @@ -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; @@ -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); @@ -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; } @@ -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; @@ -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)); } @@ -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")) { @@ -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 { @@ -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")) { @@ -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 { diff --git a/src/aedit.c b/src/aedit.c index 2b7843b..763658d 100644 --- a/src/aedit.c +++ b/src/aedit.c @@ -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) { @@ -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 */ diff --git a/src/cedit.c b/src/cedit.c index f7dc9fb..82b1016 100644 --- a/src/cedit.c +++ b/src/cedit.c @@ -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) { diff --git a/src/constants.c b/src/constants.c index 86323a7..a1b2874 100644 --- a/src/constants.c +++ b/src/constants.c @@ -252,6 +252,7 @@ const char *preference_bits[] = { "AUTOMAP", "AUTOKEY", "AUTODOOR", + "ZONERESETS", "\n" }; diff --git a/src/db.c b/src/db.c index d921d9d..726eb3d 100644 --- a/src/db.c +++ b/src/db.c @@ -37,6 +37,7 @@ #include "ibt.h" #include "mud_event.h" #include "msgedit.h" +#include "screen.h" #include /* declarations of most of the 'global' variables */ @@ -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; diff --git a/src/dg_misc.c b/src/dg_misc.c index 05d3c75..be4d62a 100644 --- a/src/dg_misc.c +++ b/src/dg_misc.c @@ -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); } diff --git a/src/dg_olc.c b/src/dg_olc.c index 94de0b0..48f1432 100644 --- a/src/dg_olc.c +++ b/src/dg_olc.c @@ -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); } @@ -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)); } diff --git a/src/dg_variables.c b/src/dg_variables.c index d3b8e66..b8a495a 100644 --- a/src/dg_variables.c +++ b/src/dg_variables.c @@ -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)); } @@ -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)); } @@ -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)); } @@ -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)); } @@ -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)); } @@ -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)); } @@ -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)); } diff --git a/src/fight.c b/src/fight.c index cfa53e8..e4b74b5 100644 --- a/src/fight.c +++ b/src/fight.c @@ -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); } @@ -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); } diff --git a/src/hedit.c b/src/hedit.c index 694d69f..7aec3df 100644 --- a/src/hedit.c +++ b/src/hedit.c @@ -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) diff --git a/src/ibt.c b/src/ibt.c index 04aa4ba..e0e779f 100755 --- a/src/ibt.c +++ b/src/ibt.c @@ -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")) @@ -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)); } diff --git a/src/interpreter.c b/src/interpreter.c index 872aab1..5d27cc4 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -355,6 +355,7 @@ cpp_extern const struct command_info cmd_info[] = { { "wizlock" , "wizlock" , POS_DEAD , do_wizlock , LVL_IMPL, 0 }, { "write" , "write" , POS_STANDING, do_write , 1, 0 }, + { "zoneresets", "zoner" , POS_DEAD , do_gen_tog , LVL_IMPL, SCMD_ZONERESETS }, { "zreset" , "zreset" , POS_DEAD , do_zreset , LVL_BUILDER, 0 }, { "zedit" , "zedit" , POS_DEAD , do_oasis_zedit, LVL_BUILDER, 0 }, { "zlist" , "zlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_ZLIST }, @@ -1148,7 +1149,7 @@ static int perform_dupe_check(struct descriptor_data *d) case RECON: write_to_output(d, "Reconnecting.\r\n"); act("$n has reconnected.", TRUE, d->character, 0, 0, TO_ROOM); - mudlog(NRM, MAX(0, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character), d->host); + mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character), d->host); if (has_mail(GET_IDNUM(d->character))) write_to_output(d, "You have mail waiting.\r\n"); break; @@ -1775,7 +1776,8 @@ void nanny(struct descriptor_data *d, char *arg) delete_variables(GET_NAME(d->character)); write_to_output(d, "Character '%s' deleted! Goodbye.\r\n", GET_NAME(d->character)); - mudlog(NRM, LVL_GOD, TRUE, "%s (lev %d) has self-deleted.", GET_NAME(d->character), GET_LEVEL(d->character)); + mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "%s (lev %d) has self-deleted.", + GET_NAME(d->character), GET_LEVEL(d->character)); STATE(d) = CON_CLOSE; return; } else { diff --git a/src/limits.c b/src/limits.c index a79f8cb..daa8ff3 100644 --- a/src/limits.c +++ b/src/limits.c @@ -367,7 +367,7 @@ static void check_idling(struct char_data *ch) Crash_rentsave(ch, 0); else Crash_idlesave(ch); - mudlog(CMP, LVL_GOD, TRUE, "%s force-rented and extracted (idle).", GET_NAME(ch)); + mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s force-rented and extracted (idle).", GET_NAME(ch)); add_llog_entry(ch, LAST_IDLEOUT); extract_char(ch); } diff --git a/src/medit.c b/src/medit.c index 9cba8f2..b0f3e2a 100644 --- a/src/medit.c +++ b/src/medit.c @@ -167,7 +167,7 @@ ACMD(do_oasis_medit) 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 allowed zone %d", + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,"OLC: %s starts editing zone %d allowed zone %d", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); } diff --git a/src/msgedit.c b/src/msgedit.c index 2ce9856..84c440e 100644 --- a/src/msgedit.c +++ b/src/msgedit.c @@ -328,7 +328,7 @@ ACMD(do_msgedit) 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 message %d", + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing message %d", GET_NAME(ch), OLC_NUM(d)); } diff --git a/src/oasis.c b/src/oasis.c index d9b7299..9edc2ac 100644 --- a/src/oasis.c +++ b/src/oasis.c @@ -197,13 +197,18 @@ void cleanup_olc(struct descriptor_data *d, byte cleanup_type) act("$n stops using OLC.", TRUE, d->character, NULL, NULL, TO_ROOM); if (cleanup_type == CLEANUP_CONFIG) - mudlog(BRF, LVL_IMMORT, TRUE, "OLC: %s stops editing the game configuration", GET_NAME(d->character)); + mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), + TRUE, "OLC: %s stops editing the game configuration", GET_NAME(d->character)); else if (STATE(d) == CON_TEDIT) - mudlog(BRF, LVL_IMMORT, TRUE, "OLC: %s stops editing text files.", GET_NAME(d->character)); + mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), + TRUE, "OLC: %s stops editing text files.", GET_NAME(d->character)); else if (STATE(d) == CON_HEDIT) - mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s stops editing help files.", GET_NAME(d->character)); + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), + TRUE, "OLC: %s stops editing help files.", GET_NAME(d->character)); else - mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s stops editing zone %d allowed zone %d", GET_NAME(d->character), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(d->character)); + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), + TRUE, "OLC: %s stops editing zone %d allowed zone %d", + GET_NAME(d->character), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(d->character)); STATE(d) = CON_PLAYING; } diff --git a/src/objsave.c b/src/objsave.c index e456453..b6ce0f2 100644 --- a/src/objsave.c +++ b/src/objsave.c @@ -248,7 +248,7 @@ static void auto_equip(struct char_data *ch, struct obj_data *obj, int location) else equip_char(ch, obj, j); } else { /* Oops, saved a player with double equipment? */ - mudlog(BRF, LVL_IMMORT, TRUE, + mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "SYSERR: autoeq: '%s' already equipped in position %d.", GET_NAME(ch), location); location = LOC_INVENTORY; } diff --git a/src/oedit.c b/src/oedit.c index 1fd922f..48dfe3e 100644 --- a/src/oedit.c +++ b/src/oedit.c @@ -178,7 +178,7 @@ ACMD(do_oasis_oedit) SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); /* Log the OLC message. */ - mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d", + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing zone %d allowed zone %d", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); } diff --git a/src/prefedit.c b/src/prefedit.c index 6a086cf..6e40a1d 100755 --- a/src/prefedit.c +++ b/src/prefedit.c @@ -161,6 +161,10 @@ static void prefedit_disp_main_menu(struct descriptor_data *d) ONOFF(PREFEDIT_FLAGGED(PRF_NOHASSLE)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_HOLYLIGHT)), CCCYN(d->character, C_NRM) ); + if (GET_LEVEL(PREFEDIT_GET_CHAR) == LVL_IMPL) + send_to_char(d->character, "%s7%s) Zone Resets %s[%s%3s%s]\r\n", + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_ZONERESETS)), CCCYN(d->character, C_NRM)); } /* Finishing Off */ @@ -360,7 +364,8 @@ void prefedit_parse(struct descriptor_data * d, char *arg) case 'y': case 'Y': prefedit_save_to_char(d); - mudlog(CMP, LVL_BUILDER, TRUE, "OLC: %s edits toggles for %s", GET_NAME(d->character), GET_NAME(OLC_PREFS(d)->ch)); + mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits toggles for %s", + GET_NAME(d->character), GET_NAME(OLC_PREFS(d)->ch)); /*. No strings to save - cleanup all .*/ cleanup_olc(d, CLEANUP_ALL); break; @@ -500,6 +505,18 @@ void prefedit_parse(struct descriptor_data * d, char *arg) } break; + case '7': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMPL) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_ZONERESETS); + } + break; + default: send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); prefedit_disp_main_menu(d); diff --git a/src/qedit.c b/src/qedit.c index 3bc394c..d17df59 100644 --- a/src/qedit.c +++ b/src/qedit.c @@ -188,7 +188,7 @@ ACMD(do_oasis_qedit) 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_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing zone %d allowed zone %d", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); } diff --git a/src/redit.c b/src/redit.c index 90df0b4..b62be91 100644 --- a/src/redit.c +++ b/src/redit.c @@ -149,7 +149,7 @@ ACMD(do_oasis_redit) 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 allowed zone %d", + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing zone %d allowed zone %d", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); } diff --git a/src/sedit.c b/src/sedit.c index c042fec..f6eab3a 100644 --- a/src/sedit.c +++ b/src/sedit.c @@ -168,7 +168,7 @@ ACMD(do_oasis_sedit) 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 allowed zone %d", + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing zone %d allowed zone %d", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); } diff --git a/src/spells.c b/src/spells.c index 5bf1818..ffa50cd 100644 --- a/src/spells.c +++ b/src/spells.c @@ -136,7 +136,8 @@ ASPELL(spell_summon) GET_NAME(ch), world[IN_ROOM(ch)].name); send_to_char(ch, "You failed because %s has summon protection on.\r\n", GET_NAME(victim)); - mudlog(BRF, LVL_IMMORT, TRUE, "%s failed summoning %s to %s.", GET_NAME(ch), GET_NAME(victim), world[IN_ROOM(ch)].name); + mudlog(BRF, MAX(LVL_IMMORT, MAX(GET_INVIS_LEV(ch), GET_INVIS_LEV(victim))), TRUE, + "%s failed summoning %s to %s.", GET_NAME(ch), GET_NAME(victim), world[IN_ROOM(ch)].name); return; } } diff --git a/src/structs.h b/src/structs.h index f328b33..94bb896 100644 --- a/src/structs.h +++ b/src/structs.h @@ -262,8 +262,9 @@ #define PRF_AUTOMAP 31 /**< Show map at the side of room descs */ #define PRF_AUTOKEY 32 /**< Automatically unlock locked doors when opening */ #define PRF_AUTODOOR 33 /**< Use the next available door */ +#define PRF_ZONERESETS 34 /** Total number of available PRF flags */ -#define NUM_PRF_FLAGS 34 +#define NUM_PRF_FLAGS 35 /* Affect bits: used in char_data.char_specials.saved.affected_by */ /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */ diff --git a/src/tedit.c b/src/tedit.c index e3fdc01..4cd5679 100644 --- a/src/tedit.c +++ b/src/tedit.c @@ -38,7 +38,7 @@ void tedit_string_cleanup(struct descriptor_data *d, int terminator) fputs(*d->str, fl); } fclose(fl); - mudlog(CMP, LVL_GOD, TRUE, "OLC: %s saves '%s'.", GET_NAME(d->character), storage); + mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s saves '%s'.", GET_NAME(d->character), storage); write_to_output(d, "Saved.\r\n"); if (!strcmp(storage, NEWS_FILE)) newsmod = time(0); diff --git a/src/utils.c b/src/utils.c index c3cf3c1..c138435 100644 --- a/src/utils.c +++ b/src/utils.c @@ -191,8 +191,9 @@ int strn_cmp(const char *arg1, const char *arg2, int n) void basic_mud_vlog(const char *format, va_list args) { time_t ct = time(0); - char timestr[20]; - + char timestr[21]; + int i; + if (logfile == NULL) { puts("SYSERR: Using log() before stream was initialized!"); return; @@ -201,6 +202,7 @@ void basic_mud_vlog(const char *format, va_list args) if (format == NULL) format = "SYSERR: log() received a NULL format."; + for (i=0;i<21;i++) timestr[i]=0; strftime(timestr, sizeof(timestr), "%b %d %H:%M:%S %Y", localtime(&ct)); fprintf(logfile, "%-20.20s :: ", timestr); diff --git a/src/zedit.c b/src/zedit.c index f5bdea5..7b028c9 100644 --- a/src/zedit.c +++ b/src/zedit.c @@ -183,7 +183,7 @@ ACMD(do_oasis_zedit) 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 allowed zone %d", + mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing zone %d allowed zone %d", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); }