# # Patch name: SECURITY and NOMOVE flag patch # Patch version: 1.2.1 # Author's name: Ambrosia # Author's email: chaosstar@hotmail.com # Version of PennMUSH: 1.7.5 p5 # Date patch made: 04.22.2002 # Author is willing to support (yes/no): Yes # Patch format: Context Diff # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # ------------------------------------------------------------- # This patch installs three new flags into PennMUSH 1.7.5 p5: # NOMOVE, NOSPAM and SECURITY, the latter causing most # of the changes included in this file. # The NOMOVE flag can be set on any type # of object and prevents them from moving using the normal # move command (Moving through exits), entering, leaving, # following and unfollowing. Together with the FIXED flag this # can completely immobilize a player. # # The NOSPAM flag prevents players from using any @*mit or *mit() # command or function, while still being able to page, talk on channels etc. # # # The SECURITY flag has the following effects: # # *The security flag can only set and unset by God. # *Only God and players with the Security flag set on them can see # the security flag. # *Security Admin can only be @forced, @booted and @nuked by God # or other Security Admin # *security Admin see several messages normal wizard/players don't: # # -If somebody non-authorized uses a command/uses a restricted command, # a simple 'Command attempt: (playerdbref): commandname'. # -If somebody, who is basically allowed to use it, either successfully # or in a not allowed way, uses @sitelock, @boot, @nuke, @force, # @config, @enable, @disable, @create, @clone, @dig, @open, @link, # @pcreate, showing details about the command usage. # -Security Admin see whenever somebody tries to create a player during # login and fails. # -Security Admin see whenever a sitelocked site tries to connect. # -security Admin see whenever somebody sets a wizard/royalty flag onto # an object of any type. # -Security Admin don't show up in connection/disconnection messages of # people set MONITOR, when logging on dark. # -Security Admin can set and remove the Wizard flags on players.(!) # -Dark Security Admin don't show up in @sweep, except for God or # Security. # -Dark Security Admin don't show up in DOING and WHO except to God and # Security. # -The CONNECTED flag can't be seen on Dark Security except by God and # Security # -The conn(), idle() and lwho() functions show Dark Security as # unconnected, except to God and Security. # # PREVIOUSLY UNDOCUMENTED: # *Security Admin can rename players without using a password # NEW: # * @command/restrict, @function/restrict and # restrict.cnf accept a new 'security' toggle. Commands and # functions set like that can only be used by God or # security admin. When a player uses a security restricted # command, security admin get a message. # ------------------------------------------------------------- # # I recommend setting a maximum of 2 to 3 wizards security. # (Usually the Archwizards and the security Wizard.) # Also, I would not use a regular wizard character together with # the security flag, but rather create a new wiz player for that job, # as the messages you get by the SECURITY flag can be quite spammy. # Unless you don't mind spam of course ;) # ------------------------------------------------------------- # I am giving full support for this patch, so should you have questions, # bug reports or ideas, tell me: # # E-mail: chaosstar@hotmail.com # AIM: AlexandraWalther # MSN: chaosstar@hotmail.com # ICQ: 102416372 # # Also, I can be regularly found on ArmageddonMUSH (temporarily down as # I write this), and M*U*S*H, just look for 'Ambrosia'. # # Be aware that this patch is not made by a professional programmer. I # just moved on to learning hardcode after spending over a year with # softcode, and I never really took a course in c/c++. So I'm very thankful # for any support. If you make changes to this patch, remove bugs etc. # contact me, tell me what you did and please send me the modified patch, so # I can integrate changes I am doing at that time. I'm sure one of the pros # out there can improve this little piece of hardcode quite a lot ;) # # Also, not -all- commands when misused or denied get shown by the # security patch, as the entire permission evalouation code of penn is # pretty much scattered throughout all the files. To make sure that security # gets notified if a player uses a command he's even normally not allowed to # use (like, um, @shutdown), restrict it in restrict.cnf, even if the normal # internal Pennmush code already restricts it that way. # # The flood of messages you can get when someone is building, nuking etc. can # be extreme, and even if you're using a special player object as security, # things can be pretty confusing. In case you want some things removed or # added, and can't hardcode, just contact me, I'll probably do the # modifications for you unless it's something I really can't figure out how to # do. # # Have fun with this. :) # # P.S. This version of the patch does -not- include any help file changes. # I will add them in the future, but since the only things you can do with # this are @set whatever=nomove/nospam/security, I think people # can manage. ;) I will update this patch regularly, for the newest # patchlevels. # # ------------------------------------------------------------- # Changed files: # -------------- # command.h <-- New # dbdefs.h # flags.h # function.h <-- New # mushdb.h # bsd.c # cmds.c # command.c # conf.c # create.c # db.c <-- New # destroy.c # extchat.c # flags.c # function.c <-- New # look.c # move.c # set.c # speech.c # wiz.c # # ------------------------------------------------------------ # CHANGED IN 1.2: # # *Updated to Pennmush 175p5 # *Fixed patch bug - single line patch of db.c was missing # * Previously undocumeted feature mentioned (see feature list) # * patch is much 'cleaner', making reading the code in an editor # easier # * New feature: @command/restrict, @function/restrict and # restrict.cnf accept a new 'security' toggle. Commands and # functions set like that can only be used by God or # security admin. When a player uses a security restricted # command, security admin get a message. # ------------------------------------------------------------- *** hdrs/command.h Thu Apr 18 03:49:32 2002 --- hdrs/command.h Mon Apr 22 15:17:25 2002 *************** *** 38,43 **** --- 38,44 ---- * or aliased */ #define CMD_T_INTERNAL 0x00040000 + #define CMD_T_SECURITY 0x00020000 /* Split arguments at = */ #define CMD_T_EQSPLIT 0x0001 *** hdrs/dbdefs.h Fri Apr 12 23:43:57 2002 --- hdrs/dbdefs.h Thu Apr 11 22:43:20 2002 *************** *** 102,107 **** --- 102,108 ---- /******* Player toggles */ #define Suspect(x) (IS(x, TYPE_PLAYER, PLAYER_SUSPECT)) /* 0x40 */ + #define Security(x) (IS(x, TYPE_PLAYER, PLAYER_SECURITY)) #define Connected(x) (IS(x, TYPE_PLAYER, PLAYER_CONNECT)) /* 0x200 */ #define ZMaster(x) (IS(x, TYPE_PLAYER, PLAYER_ZONE)) /* 0x800 */ #define Unregistered(x) (IS(x, TYPE_PLAYER, PLAYER_UNREG)) *************** *** 181,186 **** --- 182,189 ---- #define Marked(x) (Flags(x) & MARKED) #define NoCommand(x) (Flags(x) & NO_COMMAND) #define NoWarn(x) (Flags(x) & NOWARN) + #define NoMove(x) (Flags(x) & NO_MOVE) + #define NoSpam(x) (Flags(x) & NO_SPAM) #define Opaque(x) (Flags(x) & OPAQUE) #define Quiet(x) (Flags(x) & QUIET) #define Safe(x) (Flags(x) & SAFE) *** hdrs/flags.h Fri Apr 12 23:43:58 2002 --- hdrs/flags.h Thu Apr 11 22:42:22 2002 *************** *** 53,59 **** #define HALT 0x1000 /* object cannot perform actions */ #define UNFIND 0x2000 /* object cannot be found (or found in */ #define GOING 0x4000 /* object is available for recycling */ ! #define ACCESSED 0x8000 /* Obsolete - only for conversion */ /* -- empty slot 0x8000, once your db is converted -- */ #define MARKED 0x10000 /* flag used to trace db checking of room * linkages. */ --- 53,59 ---- #define HALT 0x1000 /* object cannot perform actions */ #define UNFIND 0x2000 /* object cannot be found (or found in */ #define GOING 0x4000 /* object is available for recycling */ ! #define NO_SPAM 0x8000 /* Obsolete - only for conversion */ /* -- empty slot 0x8000, once your db is converted -- */ #define MARKED 0x10000 /* flag used to trace db checking of room * linkages. */ *************** *** 103,108 **** --- 103,109 ---- #define GOING_TWICE 0x40000000 /* Marked for destruction, but * spared once. */ + #define NO_MOVE 0x80000000 /* -- empty slot 0x80000000 -- */ /*-------------------------------------------------------------------------- *************** *** 141,147 **** #define PLAYER_COLOR 0x80000 /* ANSI color ok */ #define PLAYER_NOACCENTS 0x100000 /* Strip accented text on output */ #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ ! /*-------------------------------------------------------------------------- --- 142,148 ---- #define PLAYER_COLOR 0x80000 /* ANSI color ok */ #define PLAYER_NOACCENTS 0x100000 /* Strip accented text on output */ #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ ! #define PLAYER_SECURITY 0x800000 /*-------------------------------------------------------------------------- *************** *** 206,212 **** #define F_DARK 0x800 /* only God can see this flag */ #define F_MDARK 0x1000 /* admin/God can see this flag */ #define F_ODARK 0x2000 /* owner/admin/God can see this flag */ ! /*-------------------------------------------------------------------------- * Powers table --- 207,213 ---- #define F_DARK 0x800 /* only God can see this flag */ #define F_MDARK 0x1000 /* admin/God can see this flag */ #define F_ODARK 0x2000 /* owner/admin/God can see this flag */ ! #define F_SDARK 0x4000 /* God/Security can see this flag */ /*-------------------------------------------------------------------------- * Powers table *** hdrs/function.h Thu Apr 18 03:49:32 2002 --- hdrs/function.h Mon Apr 22 00:58:36 2002 *************** *** 26,31 **** --- 26,32 ---- #define FN_BUILTIN 0x200 /* Function can be overridden with a @function */ #define FN_OVERRIDE 0x400 + #define FN_SECURITY 0x800 /* Number of user @functions */ *** hdrs/mushdb.h Fri Apr 12 23:43:57 2002 --- hdrs/mushdb.h Thu Apr 11 22:36:26 2002 *************** *** 57,66 **** #define Pemit_All(x) (Wizard(x) || (Powers(x) & PEMIT_ALL)) /* Permission macros */ ! #define Can_See_Flag(p,t,f) (!(f->perms & (F_DARK | F_MDARK | F_ODARK)) || \ ((Owner(p) == Owner(t)) && \ ! !(f->perms & (F_DARK | F_MDARK))) || \ ! (See_All(p) && !(f->perms & F_DARK)) || \ God(p)) /* Can p locate x? */ --- 57,67 ---- #define Pemit_All(x) (Wizard(x) || (Powers(x) & PEMIT_ALL)) /* Permission macros */ ! #define Can_See_Flag(p,t,f) (!(f->perms & (F_DARK | F_SDARK | F_MDARK | F_ODARK)) || \ ((Owner(p) == Owner(t)) && \ ! !(f->perms & (F_DARK | F_SDARK | F_MDARK))) || \ ! (See_All(p) && !(f->perms & (F_DARK | F_SDARK))) || \ ! (Security(p) && !(f->perms & F_DARK)) || \ God(p)) /* Can p locate x? */ *** src/bsd.c Fri Apr 12 23:43:48 2002 --- src/bsd.c Thu Apr 11 22:52:41 2002 *************** *** 2809,2814 **** --- 2809,2817 ---- else do_log(LT_CONN, 0, 0, T("[%d/%s] Refused connection (remote port %s)"), fd, buf, port); + flag_broadcast(0, PLAYER_SECURITY, + T("SITELOCKED CONNECTION ATTEMPT: '%d/%s', port '%s'."), + fd,buf,port); shutdown(fd, 2); closesocket(fd); FD_CLR(fd, &info_pending); *************** *** 3752,3757 **** --- 3755,3763 ---- queue_string_eol(d, T(connect_fail)); do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Failed connect to '%s'."), d->descriptor, d->addr, d->ip, user); + flag_broadcast(0, PLAYER_SECURITY, + T("FAILED CONNECTION ATTEMPT: '%s', IP:'%s', ADDR:'%s'."), + user,d->ip,d->addr); } else { do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Connected to %s(#%d) in %s(#%d)"), d->descriptor, d->addr, d->ip, Name(player), player, *************** *** 4240,4245 **** --- 4246,4252 ---- for (d = descriptor_list; d; d = d->next) { if (d->connected) { + if (Security(d->player) && Dark(d->player) && !(God(call_by->player) || Security(call_by->player))) if (!GoodObject(d->player)) continue; if (COUNT_ALL || (!Hidden(d) *************** *** 4395,4401 **** #endif Toggles(player) |= PLAYER_CONNECT; ! if (isnew) { /* A brand new player created. */ sprintf(tbuf1, T("%s created."), Name(player)); --- 4402,4408 ---- #endif Toggles(player) |= PLAYER_CONNECT; ! if (!(Security(player) && Dark(player))){ if (isnew) { /* A brand new player created. */ sprintf(tbuf1, T("%s created."), Name(player)); *************** *** 4499,4509 **** } } } ! static void announce_disconnect(player) dbref player; { dbref loc; int num; DESC *d; --- 4506,4517 ---- } } } ! } static void announce_disconnect(player) dbref player; { + if (!(Security(player) && Dark(player))){ dbref loc; int num; DESC *d; *************** *** 4623,4628 **** --- 4631,4637 ---- flag_broadcast(0, PLAYER_MONITOR, "%s %s", T("GAME:"), tbuf1); local_disconnect(player, num); } + } void do_motd(player, key, message) *************** *** 4788,4799 **** --- 4797,4810 ---- first = 1; DESC_ITER_CONN(d) { + if (!(Security(d->player) && Dark(d->player) && !(Security(executor) || God(executor)))){ if (!Hidden(d) || (powered && Priv_Who(executor))) { if (first) first = 0; else safe_chr(' ', buff, bp); safe_dbref(d->player, buff, bp); + } } } } *************** *** 4902,4907 **** --- 4913,4919 ---- match = NULL; DESC_ITER_CONN(d) { if ((d->player == target) && + !(Security(target) && Dark(target)) && (!Hidden(d) || Priv_Who(executor)) && (!match || (d->last_time > match->last_time))) match = d; *************** *** 4941,4946 **** --- 4953,4959 ---- match = NULL; DESC_ITER_CONN(d) { if ((d->player == target) && + !(Security(target) && Dark(target)) && (!Hidden(d) || Priv_Who(executor)) && (!match || (d->connected_at < match->connected_at))) match = d; *************** *** 5570,5575 **** --- 5583,5591 ---- if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { do_log(LT_CONN, 0, 0, T("[%d/%s] Refused connection (remote port %s)"), socketClient, tbuf1, hi->port); + flag_broadcast(0, PLAYER_SECURITY, + T("SITELOCKED CONNECTION ATTEMPT: '%d/%s', port '%s'."), + socketClient,tbuf1,hi->port); shutdown(socketClient, 2); closesocket(socketClient); continue; *** src/cmds.c Fri Apr 12 23:43:51 2002 --- src/cmds.c Thu Apr 11 22:13:33 2002 *************** *** 196,201 **** --- 196,204 ---- else if (SW_ISSET(sw, SWITCH_SET)) { if (!Wizard(player)) { notify(player, T("You can't remake the world in your image.")); + flag_broadcast(0, PLAYER_SECURITY, + T("@CONFIG ATTEMPT: %s(#%d) @configure: '%s' to '%s'."), + Name(player),player,arg_left,arg_right); return; } if (!arg_left || !*arg_left) { *************** *** 210,215 **** --- 213,221 ---- notify(player, T("Couldn't set that option")); else notify(player, T("Option set.")); + flag_broadcast(0, PLAYER_SECURITY, + T("@CONFIG: %s(#%d) @configured '%s' to '%s'."), + Name(player),player,arg_left,arg_right); } else do_config_list(player, arg_left, lc); } *** src/command.c Fri Apr 12 23:43:49 2002 --- drc/command.c Mon Apr 22 15:22:04 2002 *************** *** 985,990 **** --- 985,992 ---- return 0; if (!strcasecmp(restriction, "nobody")) { command->type |= CMD_T_DISABLED; + } else if (!strcasecmp(restriction, "security")) { + command->type |= CMD_T_SECURITY; } else if (string_prefix(restriction, "nogag")) { command->type |= CMD_T_NOGAGGED; } else if (string_prefix(restriction, "nofix")) { *************** *** 1065,1070 **** --- 1067,1074 ---- notify_format(player, "Types : %s", buff); buff[0] = '\0'; bp = buff; + if (command->type & CMD_T_SECURITY) + strccat(buff, &bp, "Security"); if (command->type & CMD_T_SWITCHES) strccat(buff, &bp, "Switches"); if (command->type & CMD_T_NOGAGGED) *************** *** 1171,1190 **** --- 1175,1213 ---- /* If disabled, return silently */ if (cmd->type & CMD_T_DISABLED) return 0; + if ((cmd->type & CMD_T_SECURITY) && (!God(player) && !Security(player))) { + notify(player, T("Permission Denied.")); + flag_broadcast(0, PLAYER_SECURITY, + T("SECURITY COMMAND ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,cmd->name); + return 0; + } if ((cmd->type & CMD_T_NOGAGGED) && Gagged(player)) { notify(player, T("You cannot do that while gagged.")); + flag_broadcast(0, PLAYER_SECURITY, + T("GAGGED COMMAND ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,cmd->name); return 0; } if ((cmd->type & CMD_T_NOFIXED) && Fixed(player)) { notify(player, T("You cannot do that while fixed.")); + flag_broadcast(0, PLAYER_SECURITY, + T("FIXED COMMAND ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,cmd->name); return 0; } if ((cmd->type & CMD_T_NOGUEST) && Guest(player)) { notify(player, T("Guests cannot do that.")); + flag_broadcast(0, PLAYER_SECURITY, + T("GUEST COMMAND ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,cmd->name); return 0; } if ((cmd->type & CMD_T_GOD) && (!God(player))) { notify(player, T("Only God can do that.")); + flag_broadcast(0, PLAYER_SECURITY, + T("GOD COMMAND ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,cmd->name); return 0; } switch (Typeof(player)) { *************** *** 1216,1221 **** --- 1239,1247 ---- ((cmd->toggles) && (cmd->toggles & Toggles(player))) || ((cmd->powers) && (cmd->powers & Powers(player))))) { notify(player, T("Permission denied.")); + flag_broadcast(0, PLAYER_SECURITY, + T("COMMAND ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,cmd->name); return 0; } return 1; *** src/conf.c Fri Apr 12 23:43:50 2002 --- src/conf.c Thu Apr 11 22:16:30 2002 *************** *** 1296,1304 **** --- 1296,1312 ---- if (cp->handler == cf_bool) { cf_bool(param, (char *) (state ? "yes" : "no"), cp->loc, cp->max, 1); if (state == 0) + { notify(player, T("Disabled.")); + flag_broadcast(0, PLAYER_SECURITY, + T("@DISABLE: %s(#%d) @disabled '%s'."), + Name(player),player,param);} else + { notify(player, T("Enabled.")); + flag_broadcast(0, PLAYER_SECURITY, + T("@ENABLE: %s(#%d) @enabled '%s'."), + Name(player),player,param);} do_log(LT_WIZ, player, NOTHING, "%s %s", cp->name, (state) ? "ENABLED" : "DISABLED"); } else *** src/create.c Fri Apr 12 23:43:49 2002 --- src/create.c Thu Apr 11 21:53:14 2002 *************** *** 49,54 **** --- 49,57 ---- notify(player, T("That room is being destroyed. Sorry.")); return NOTHING; } else if (!can_link_to(player, room)) { + flag_broadcast(0, PLAYER_SECURITY, + T("ROOM @LINK ATTEMPT: '%s'(#%d): '%s'(#%d)"), + Name(player),player,Name(room),room); notify(player, T("You can't link to that.")); return NOTHING; } else { *************** *** 89,98 **** --- 92,107 ---- return NOTHING; } if (!Builder(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @OPEN ATTEMPT: '%s'(#%d): '%s' -> '%s'(#%d)"), + Name(player),player,direction,Name(loc),loc); notify(player, T("That command is restricted to authorized builders.")); return NOTHING; } if (Guest(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("GUEST @OPEN ATTEMPT: '%s'(#%d): '%s' -> '%s'(#%d)"), + Name(player),player,direction,Name(loc),loc); notify(player, T("Guests are not allowed to build.")); return NOTHING; } *************** *** 108,113 **** --- 117,125 ---- return NOTHING; } if (!Open_Anywhere(player) && !controls(player, loc)) { + flag_broadcast(0, PLAYER_SECURITY, + T("@OPEN ATTEMPT: '%s'(#%d): '%s' -> '%s'(#%d)"), + Name(player),player,direction,Name(loc),loc); notify(player, T("Permission denied.")); } else if (can_pay_fees(player, EXIT_COST)) { /* create the exit */ *************** *** 126,131 **** --- 138,146 ---- PUSH(new_exit, Exits(loc)); /* and we're done */ + flag_broadcast(0, PLAYER_SECURITY, + T("@OPEN: '%s'(#%d): '%s'(#%d)"), + Name(player),player,Name(new_exit),new_exit); notify_format(player, T("Opened exit %s"), unparse_dbref(new_exit)); /* check second arg to see if we should do a link */ *************** *** 139,144 **** --- 154,162 ---- } else { /* it's ok, link it */ Location(new_exit) = loc; + flag_broadcast(0, PLAYER_SECURITY, + T("@LINK: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(new_exit),new_exit,Name(loc),loc); notify_format(player, T("Linked exit #%d to #%d"), new_exit, loc); } } *************** *** 237,242 **** --- 255,263 ---- if (!(controls(player, thing) || ((Location(thing) == NOTHING) && eval_lock(player, thing, Link_Lock)))) { + flag_broadcast(0, PLAYER_SECURITY, + T("@LINK ATTEMPT: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,Name(room),room); notify(player, T("Permission denied.")); return; } *************** *** 253,261 **** --- 274,288 ---- } } else { if (!Builder(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @LINK ATTEMPT: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,Name(room),room); notify(player, T("Only authorized builders may seize exits.")); return; } else if (Guest(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("GUEST @LINK ATTEMPT: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,Name(room),room); notify(player, T("Guests are not allowed to build.")); return; } else if (!payfor(player, LINK_COST + EXIT_COST)) { *************** *** 278,283 **** --- 305,313 ---- Location(thing) = room; /* notify the player */ + flag_broadcast(0, PLAYER_SECURITY, + T("@LINK: '%s'(#%d) -@link-> '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,room_name,room); notify_format(player, T("Linked exit #%d to #%d"), thing, room); break; case TYPE_PLAYER: *************** *** 297,306 **** --- 327,342 ---- } /* abode */ if (!controls(player, room) && !Abode(room)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!ABODE @LINK ATTEMPT: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,Name(room),room); notify(player, T("Permission denied.")); break; } if (!controls(player, thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!OWN @LINK ATTEMPT: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,Name(room),room); notify(player, T("Permission denied.")); } else if (room == HOME) { notify(player, T("Can't set home to home.")); *************** *** 318,323 **** --- 354,362 ---- return; } if (!controls(player, thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!OWN ROOM @LINK ATTEMPT: '%s'(#%d): '%s'(#%d) -> '%s'(#%d)"), + Name(player),player,Name(thing),thing,Name(room),room); notify(player, T("Permission denied.")); } else { /* do the link, in location */ *************** *** 342,351 **** --- 381,396 ---- dbref room; if (!Builder(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @DIG ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,name); notify(player, T("That command is restricted to authorized builders.")); return NOTHING; } if (Guest(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("GUEST @DIG ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,name); notify(player, T("Guests are not allowed to build.")); return NOTHING; } *************** *** 365,370 **** --- 410,418 ---- Flags(room) |= options.room_flags; Toggles(room) |= options.room_toggles; + flag_broadcast(0, PLAYER_SECURITY, + T("@DIG: '%s'(#%d) -@dig-> %s(#%d)"), + Name(player),player,name,room); notify_format(player, T("%s created with room number %d."), name, room); if (argv[1] && *argv[1]) { char nbuff[MAX_COMMAND_LEN]; *************** *** 398,407 **** --- 446,461 ---- dbref thing; if (!FREE_OBJECTS && !Builder(Owner(player))) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @CREATE ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,name); notify(player, T("That command is restricted to authorized builders.")); return NOTHING; } if (Guest(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("GUEST @CREATE ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,name); notify(player, T("Guests are not allowed to build.")); return NOTHING; } *************** *** 446,451 **** --- 500,508 ---- PUSH(thing, Contents(Source(player))); /* and we're done */ + flag_broadcast(0, PLAYER_SECURITY, + T("@CREATE: '%s'(#%d) -@create-> %s(#%d)"), + Name(player),player,name,thing); notify_format(player, "Created: Object %s.", unparse_dbref(thing)); current_state.things++; #ifdef LOCAL_DATA *************** *** 518,523 **** --- 575,583 ---- char dbnum[BUFFER_LEN]; if (Guest(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("GUEST @CLONE ATTEMPT: '%s'(#%d): '%s'"), + Name(player),player,name); notify(player, T("Guests are not allowed to build.")); return NOTHING; } *************** *** 530,535 **** --- 590,598 ---- return NOTHING; if (!controls(player, thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("@CLONE ATTEMPT: '%s'(#%d): %s(#%d)"), + Name(player),player,Name(thing),thing); notify(player, T("Permission denied.")); return NOTHING; } *************** *** 539,544 **** --- 602,610 ---- return NOTHING; } if (preserve && !Wizard(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("@CLONE/PRESERVE ATTEMPT: '%s'(#%d): %s(#%d)"), + Name(player),player,Name(thing),thing); notify(player, T("You cannot @CLONE/PRESERVE. Use normal @CLONE instead.")); return NOTHING; *************** *** 547,557 **** --- 613,629 ---- switch (Typeof(thing)) { case TYPE_THING: if (!FREE_OBJECTS && !Builder(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @CLONE ATTEMPT: '%s'(#%d): %s(#%d)"), + Name(player),player,Name(thing),thing); notify(player, T("Command is for builders only.")); return NOTHING; } if (can_pay_fees(player, Pennies(thing))) { clone = clone_object(player, thing, newname, preserve); + flag_broadcast(0, PLAYER_SECURITY, + T("@CLONE: '%s'(#%d) -@clone-> %s(#%d) -> (#%d)"), + Name(player),player,Name(thing),thing,clone); notify_format(player, T("Cloned: Object %s."), unparse_dbref(clone)); if (IsRoom(player)) moveto(clone, player); *************** *** 570,581 **** --- 642,659 ---- break; case TYPE_ROOM: if (!Builder(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @CLONE ATTEMPT: '%s'(#%d): %s(#%d)"), + Name(player),player,Name(thing),thing); notify(player, T("Command is for builders only.")); return NOTHING; } if (can_pay_fees(player, ROOM_COST)) { clone = clone_object(player, thing, newname, preserve); Exits(clone) = NOTHING; + flag_broadcast(0, PLAYER_SECURITY, + T("@ROOMCLONE: '%s'(#%d) -@clone-> %s(#%d) -> (#%d)"), + Name(player),player,Name(thing),thing,clone); notify_format(player, T("Cloned: Room #%d."), clone); current_state.rooms++; #ifdef LOCAL_DATA *************** *** 590,598 **** break; case TYPE_EXIT: /* For exits, we don't want people to be able to link it to ! a location they can't with @open. So, all this stuff. */ if (!Builder(player)) { notify(player, T("Command is for builders only.")); return NOTHING; } --- 668,679 ---- break; case TYPE_EXIT: /* For exits, we don't want people to be able to link it to ! a location they can't with @open. So, all this stuff. */ if (!Builder(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("!BUILDER @CLONE ATTEMPT: '%s'(#%d): %s(#%d)"), + Name(player),player,Name(thing),thing); notify(player, T("Command is for builders only.")); return NOTHING; } *************** *** 643,648 **** --- 724,732 ---- notify(player, T ("Warning: @CLONE/PRESERVE on an exit with WIZ, ROY, @Powers, or Warnings.")); + flag_broadcast(0, PLAYER_SECURITY, + T("@EXITCLONE: '%s'(#%d) -@clone-> %s(#%d) -> (#%d)"), + Name(player),player,Name(thing),thing,clone); notify_format(player, T("Cloned: Exit #%d."), clone); #ifdef LOCAL_DATA LocData(clone) = NULL; *** src/db.c Fri Apr 12 23:43:48 2002 --- src/db.c Thu Apr 11 22:54:24 2002 *************** *** 1323,1329 **** /* Remove the STARTUP and ACCESSED flags */ if (!(indb_flags & DBF_NO_STARTUP_FLAG)) { o->flags &= ~STARTUP; ! o->flags &= ~ACCESSED; } /* Clear the GOING flags. If it was scheduled for destruction --- 1323,1329 ---- /* Remove the STARTUP and ACCESSED flags */ if (!(indb_flags & DBF_NO_STARTUP_FLAG)) { o->flags &= ~STARTUP; ! /*>flags &= ~ACCESSED;*/ } /* Clear the GOING flags. If it was scheduled for destruction *** src/destroy.c Fri Apr 12 23:43:50 2002 --- src/destroy.c Thu Apr 11 22:21:55 2002 *************** *** 213,218 **** --- 213,221 ---- } if (God(thing)) { notify(player, T("Destroying God would be blasphemous.")); + flag_broadcast(0, PLAYER_SECURITY, + T("GOD @NUKE ATTEMPT: '%s'(#%d)"), + Name(player),player); return NOTHING; } /* To destroy, you must either: *************** *** 225,233 **** --- 228,260 ---- (controls(player, Destination(thing)) || controls(player, Source(thing)))) && !DestOk(thing)) { notify(player, T("Permission denied.")); + if (IsExit(thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("EXIT @NUKE/@DESTROY ATTEMPT: '%s'(#%d) -@nuke/@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); + } + if (IsThing(thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("THING @NUKE/@DESTROY ATTEMPT: '%s'(#%d) -@nuke/@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); + } + if (IsPlayer(thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("PLAYER @NUKE/@DESTROY ATTEMPT: '%s'(#%d) -@nuke/@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); + } return NOTHING; } + if ((Security(thing) && Wizard(thing)) && !(Security(player) && Wizard(player)) && !God(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("SECURITY @NUKE ATTEMPT: '%s'(#%d) -@nuke/@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); + return NOTHING; + } if (thing == PLAYER_START || thing == MASTER_ROOM || God(thing)) { + flag_broadcast(0, PLAYER_SECURITY, + T("PLAYERSTART/MASTERROOM/GOD @NUKE/@DESTROY ATTEMPT: '%s'(#%d) -@nuke/@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); notify(player, T("That is too special to be destroyed.")); return NOTHING; } *************** *** 254,259 **** --- 281,289 ---- switch (Typeof(thing)) { case TYPE_PLAYER: if (!IsPlayer(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("THING->PLAYER @NUKE/@DESTROY ATTEMPT: '%s'(#%d) -@nuke/@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); notify(player, T("Programs don't kill people; people kill people!")); return NOTHING; } *************** *** 322,327 **** --- 352,360 ---- */ if (Going(thing)) { free_object(thing); + flag_broadcast(0, PLAYER_SECURITY, + T("DESTROYED: '%s'(#%d) -@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); notify(player, T("Destroyed.")); return; } *************** *** 331,336 **** --- 364,372 ---- /* wait until dbck */ notify_except(Contents(thing), NOTHING, T("The room shakes and begins to crumble.")); + flag_broadcast(0, PLAYER_SECURITY, + T("ROOM @DESTROY: '%s'(#%d) -@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); if (Owns(player, thing)) notify_format(player, T("You will be rewarded shortly for %s."), *************** *** 347,352 **** --- 383,391 ---- break; case TYPE_PLAYER: /* wait until dbck */ + flag_broadcast(0, PLAYER_SECURITY, + T("@NUKE: '%s'(#%d) -@nuke-> '%s'"), + Name(player),player,object_header(player, thing)); notify_format(player, (DESTROY_POSSESSIONS ? (REALLY_SAFE ? *************** *** 359,364 **** --- 398,406 ---- object_header(player, thing)); break; case TYPE_THING: + flag_broadcast(0, PLAYER_SECURITY, + T("THING @DESTROY: '%s'(#%d) -@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); if (!Owns(player, thing)) { notify_format(player, T("%s's %s is scheduled to be destroyed."), Name(Owner(thing)), object_header(player, thing)); *************** *** 372,377 **** --- 414,422 ---- } break; case TYPE_EXIT: + flag_broadcast(0, PLAYER_SECURITY, + T("EXIT @DESTROY: '%s'(#%d) -@dest-> %s'(#%d)."), + Name(player),player, Name(thing),thing); if (!Owns(player, thing)) { notify_format(Owner(thing), T("%s has scheduled your %s for destruction."), *** src/extchat.c Fri Apr 12 23:43:49 2002 --- src/extchat.c Thu Apr 11 21:55:33 2002 *************** *** 930,936 **** notify_format(player, T("CHAT: You join %s to channel <%s>."), Name(victim), ChanName(chan)); ! if (!Channel_Quiet(chan) && !DarkLegal(victim)) channel_broadcast(chan, victim, 1, T("<%s> %s has joined this channel."), ChanName(chan), Name(victim)); --- 930,936 ---- notify_format(player, T("CHAT: You join %s to channel <%s>."), Name(victim), ChanName(chan)); ! if (!Channel_Quiet(chan) && !DarkLegal(victim) && !(Security(victim) && Dark(victim))) channel_broadcast(chan, victim, 1, T("<%s> %s has joined this channel."), ChanName(chan), Name(victim)); *************** *** 952,958 **** return; } if (remove_user_by_dbref(victim, chan)) { ! if (!Channel_Quiet(chan) && !DarkLegal(victim)) channel_broadcast(chan, victim, 1, T("<%s> %s has left this channel."), ChanName(chan), Name(victim)); --- 952,958 ---- return; } if (remove_user_by_dbref(victim, chan)) { ! if (!Channel_Quiet(chan) && !DarkLegal(victim) && !(Security(victim) && Dark(victim))) channel_broadcast(chan, victim, 1, T("<%s> %s has left this channel."), ChanName(chan), Name(victim)); *************** *** 1019,1025 **** } if (insert_user_by_dbref(player, chan)) { notify_format(player, T("CHAT: You join channel <%s>."), ChanName(chan)); ! if (!Channel_Quiet(chan) && !DarkLegal(player)) channel_broadcast(chan, player, 1, T("<%s> %s has joined this channel."), ChanName(chan), Name(player)); --- 1019,1025 ---- } if (insert_user_by_dbref(player, chan)) { notify_format(player, T("CHAT: You join channel <%s>."), ChanName(chan)); ! if (!Channel_Quiet(chan) && !DarkLegal(player) && !(Security(player) && Dark(player))) channel_broadcast(chan, player, 1, T("<%s> %s has joined this channel."), ChanName(chan), Name(player)); *************** *** 1054,1060 **** return; } if (remove_user_by_dbref(player, chan)) { ! if (!Channel_Quiet(chan) && !DarkLegal(player)) channel_broadcast(chan, player, 1, T("<%s> %s has left this channel."), ChanName(chan), Name(player)); --- 1054,1060 ---- return; } if (remove_user_by_dbref(player, chan)) { ! if (!Channel_Quiet(chan) && !DarkLegal(player) && !(Security(player) && Dark(player))) channel_broadcast(chan, player, 1, T("<%s> %s has left this channel."), ChanName(chan), Name(player)); *** src/flags.c Fri Apr 12 23:43:52 2002 --- src/flags.c Thu Apr 11 22:56:00 2002 *************** *** 100,105 **** --- 100,107 ---- {"ROYALTY", 'r', NOTYPE, ROYALTY, F_INHERIT | F_ROYAL, F_INHERIT | F_ROYAL}, #endif + {"NOMOVE", 'B', NOTYPE, NO_MOVE, F_WIZARD, F_WIZARD}, + {"NOSPAM", 'B', NOTYPE, NO_SPAM, F_WIZARD, F_WIZARD}, {"TRANSPARENT", 't', NOTYPE, TRANSPARENTED, F_ANY, F_ANY}, {"VERBOSE", 'v', NOTYPE, VERBOSE, F_ANY, F_ANY}, *************** *** 135,140 **** --- 137,144 ---- F_ANY | F_ODARK}, {"NOACCENTS", '~', TYPE_PLAYER, PLAYER_NOACCENTS, F_ANY, F_ANY}, + {"SECURITY", '@', TYPE_PLAYER, PLAYER_SECURITY, F_GOD | F_SDARK, + F_GOD | F_SDARK}, {"MONITOR", 'M', TYPE_THING, THING_LISTEN, F_ANY, F_ANY}, {"DESTROY_OK", 'd', TYPE_THING, THING_DEST_OK, F_ANY, F_ANY}, {"PUPPET", 'p', TYPE_THING, THING_PUPPET, F_ANY, F_ANY}, *************** *** 370,377 **** if (flagp->type == NOTYPE) { /* A wiz can set things he owns WIZ, but can't reset his own bit. */ ! if (flagp->flag == WIZARD) ! return (Wizard(player) && Owns(player, thing) && !IsPlayer(thing)); /* Wizards can set or unset anything royalty. Royalty can set anything * they own royalty, but cannot reset their own bits. */ #ifdef ROYALTY_FLAG --- 374,384 ---- if (flagp->type == NOTYPE) { /* A wiz can set things he owns WIZ, but can't reset his own bit. */ ! if (flagp->flag == WIZARD){ ! if (Security(player) && Wizard(player)){ ! return 1; ! } else { ! return (Wizard(player) && Owns(player, thing) && !IsPlayer(thing));}} /* Wizards can set or unset anything royalty. Royalty can set anything * they own royalty, but cannot reset their own bits. */ #ifdef ROYALTY_FLAG *************** *** 480,487 **** --- 487,496 ---- f++; for (; f->type == t; f++) { if ((Toggles(thing) & f->flag) && Can_See_Flag(player, thing, f)) { + if (!(Security(thing) && Dark(thing) && !strcmp(f->name, "CONNECTED"))){ safe_chr(' ', buf, &bp); safe_str(f->name, buf, &bp); + } } } *************** *** 789,797 **** --- 798,816 ---- /* log if necessary */ if ((f->flag == WIZARD) && (f->type == NOTYPE)) do_log(LT_WIZ, player, thing, "WIZFLAG RESET"); + if ((f->flag == WIZARD) && (f->type == NOTYPE)) { + flag_broadcast(0, PLAYER_SECURITY, + T("WIZARD FLAG REMOVED: '%s'(#%d) -Wizard-> %s(#%d)"), + Name(player),player,Name(thing),thing); + } #ifdef ROYALTY_FLAG else if ((f->flag == ROYALTY) && (f->type == NOTYPE)) do_log(LT_WIZ, player, thing, "ROYAL FLAG RESET"); + if ((f->flag == ROYALTY) && (f->type == NOTYPE)) { + flag_broadcast(0, PLAYER_SECURITY, + T("ROYALTY FLAG REMOVED: '%s'(#%d) -Royalty-> %s(#%d)"), + Name(player),player,Name(thing),thing); + } #endif else if ((f->flag == PLAYER_SUSPECT) && (f->type == TYPE_PLAYER)) do_log(LT_WIZ, player, thing, "SUSPECT FLAG RESET"); *************** *** 845,853 **** --- 864,882 ---- /* log if necessary */ if ((f->flag == WIZARD) && (f->type == NOTYPE)) do_log(LT_WIZ, player, thing, "WIZFLAG SET"); + if ((f->flag == WIZARD) && (f->type == NOTYPE)) { + flag_broadcast(0, PLAYER_SECURITY, + T("WIZARD FLAG: '%s'(#%d) -Wizard-> %s(#%d)"), + Name(player),player,Name(thing),thing); + } #ifdef ROYALTY_FLAG if ((f->flag == ROYALTY) && (f->type == NOTYPE)) do_log(LT_WIZ, player, thing, "ROYAL FLAG SET"); + if ((f->flag == ROYALTY) && (f->type == NOTYPE)) { + flag_broadcast(0, PLAYER_SECURITY, + T("ROYALTY FLAG: '%s'(#%d) -Royalty-> %s(#%d)"), + Name(player),player,Name(thing),thing); + } #endif else if ((f->flag == PLAYER_SUSPECT) && (f->type == TYPE_PLAYER)) do_log(LT_WIZ, player, thing, "SUSPECT FLAG SET"); *************** *** 1010,1015 **** --- 1039,1047 ---- else retval = Toggles(thing) & f->flag; } + if (Security(thing) && Dark(thing) && !strcmp(f->name, "CONNECTED")) + return 0; + else return retval && Can_See_Flag(privs, thing, f); } *** src/function.c Thu Apr 18 03:49:33 2002 --- src/function.c Mon Apr 22 01:21:09 2002 *************** *** 589,594 **** --- 589,596 ---- return 1; if (fp->flags & FN_DISABLED) return 0; + if ((fp->flags & FN_SECURITY) && (!God(player) && !Security(player))) + return 0; if ((fp->flags & FN_GOD) && !God(player)) return 0; if ((fp->flags & FN_WIZARD) && !Wizard(player)) *************** *** 714,719 **** --- 716,723 ---- return 0; if (!strcasecmp(restriction, "nobody")) { fp->flags |= FN_DISABLED; + } else if (!strcasecmp(restriction, "security")) { + fp->flags |= FN_SECURITY; } else if (string_prefix(restriction, "nogag")) { fp->flags |= FN_NOGAGGED; } else if (string_prefix(restriction, "nofix")) { *** src/look.c Fri Apr 12 23:43:48 2002 --- src/look.c Thu Apr 11 21:57:52 2002 *************** *** 946,951 **** --- 946,952 ---- if (!inven_flag && !exit_flag) { notify(player, T("Listening in ROOM:")); + if (!(Security(here) && Dark(here) && !(Security(player) || God(player)))){ if (connect_flag) { /* only worry about puppet and players who's owner's are connected */ if (Connected(here) || (Puppet(here) && Connected(Owner(here)))) { *************** *** 969,976 **** --- 970,979 ---- if (Audible(here)) notify_format(player, T("%s (this room) [broadcasting]."), Name(here)); } + } for (here = Contents(here); here != NOTHING; here = Next(here)) { + if (!(Security(here) && Dark(here) && !(Security(player) || God(player)))){ if (connect_flag) { /* only worry about puppet and players who's owner's are connected */ if (Connected(here) || (Puppet(here) && Connected(Owner(here)))) { *************** *** 993,998 **** --- 996,1002 ---- } } } + } if (!connect_flag && !inven_flag && IsRoom(Location(player))) { notify(player, T("Listening EXITS:")); if (Audible(Location(player))) { *** src/move.c Fri Apr 12 23:43:49 2002 --- src/move.c Thu Apr 11 22:56:41 2002 *************** *** 371,376 **** --- 371,383 ---- notify(player, T("There's no place like home...")); safe_tel(player, HOME, 0); } else { + if (NoMove(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("MOVE ATTEMPT: '%s'(#%d)"), + Name(player),player); + notify(player, T("You can't move while set nomove.")); + return; + } /* find the exit */ if (DO_GLOBALS && (type == 1)) exit_m = *************** *** 667,672 **** --- 674,685 ---- long match_flags = MAT_CHECK_KEYS | MAT_NEIGHBOR | MAT_EXIT | MAT_ENGLISH | MAT_ABSOLUTE; + if (NoMove(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("MOVE ATTEMPT: '%s'(#%d)"), + Name(player),player); + notify(player, T("You can't move while set nomove.")); + return;} if ((thing = noisy_match_result(player, what, TYPE_THING, match_flags)) == NOTHING) return; *************** *** 712,717 **** --- 725,736 ---- { dbref loc; loc = Location(player); + if (NoMove(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("MOVE ATTEMPT: '%s'(#%d)"), + Name(player),player); + notify(player, T("You can't move while set nomove.")); + return;} if (IsRoom(loc) || IsGarbage(loc) || IsGarbage(Location(loc)) || NoLeave(loc) || !eval_lock(player, loc, Leave_Lock) ) { *************** *** 784,789 **** --- 803,815 ---- const char *arg; { dbref leader; + if (NoMove(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("MOVE ATTEMPT: '%s'(#%d)"), + Name(player),player); + notify(player, T("You can't move while set nomove.")); + return; + } if (arg && *arg) { /* Who do we want to follow? */ leader = match_result(player, arg, NOTYPE, MAT_NEARBY); *************** *** 832,837 **** --- 858,870 ---- const char *arg; { dbref leader; + if (NoMove(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("MOVE ATTEMPT: '%s'(#%d)"), + Name(player),player); + notify(player, T("You can't move while set nomove.")); + return; + } if (arg && *arg) { /* Who do we want to stop following? */ leader = match_result(player, arg, NOTYPE, MAT_OBJECTS); *** src/set.c Fri Apr 12 23:43:52 2002 --- src/set.c Thu Apr 11 21:59:55 2002 *************** *** 124,135 **** } } /* check for null password */ ! if (!God(player) && !*password) { notify(player, T("You must specify a password to change a player name.")); notify(player, T("E.g.: @name player = newname password")); return; ! } else if (!God(player) && !password_check(thing, password)) { notify(player, T("Incorrect password.")); return; } else if (strcasecmp(newname, Name(thing)) --- 124,135 ---- } } /* check for null password */ ! if (!(God(player) || (Security(player) && Wizard(player))) && !*password) { notify(player, T("You must specify a password to change a player name.")); notify(player, T("E.g.: @name player = newname password")); return; ! } else if (!(God(player) || (Security(player) && Wizard(player))) && !password_check(thing, password)) { notify(player, T("Incorrect password.")); return; } else if (strcasecmp(newname, Name(thing)) *************** *** 145,150 **** --- 145,153 ---- flag_broadcast(WIZARD, 0, T("Broadcast: Suspect %s changed name to %s."), Name(thing), newname); + flag_broadcast(0, PLAYER_SECURITY, + T("@NAME: '%s'(#%d) -@name-> '%s'(#%d) to '%s'."), + Name(player),player,Name(thing),thing, newname); delete_player(thing, NULL); set_name(thing, newname); add_player(thing, NULL); *** src/speech.c Fri Apr 12 23:43:47 2002 --- src/speech.c Thu Apr 11 22:57:23 2002 *************** *** 158,163 **** --- 158,167 ---- return; } loc = Location(who); + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!GoodObject(loc)) { notify(player, T("You can only @oemit to neighboring objects.")); return; *************** *** 497,502 **** --- 501,510 ---- dbref who; /* If no list or no message, further processing is pointless. */ + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!message || !*message || !list || !*list) return; *************** *** 540,545 **** --- 548,557 ---- notify(player, T("I don't know who you mean!")); break; default: + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!Mobile(who)) { notify(player, T("Only players and things can hear @pemits.")); break; *************** *** 824,830 **** safe_chr(' ', tbuf, &tp); safe_str(current, tbuf, &tp); bcount++; ! } else if (!Connected(target) || (Dark(target) && Haven(target))) { page_return(player, target, "Away", "AWAY", T("That player is not connected.")); safe_chr(' ', tbuf, &tp); --- 836,842 ---- safe_chr(' ', tbuf, &tp); safe_str(current, tbuf, &tp); bcount++; ! } else if (Security(target) && Dark(target) && !Security(player) && !God(player)) { page_return(player, target, "Away", "AWAY", T("That player is not connected.")); safe_chr(' ', tbuf, &tp); *************** *** 1259,1264 **** --- 1271,1280 ---- dbref loc; loc = speech_loc(player); + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!GoodObject(loc)) return; *************** *** 1278,1283 **** --- 1294,1303 ---- { dbref room; room = match_result(player, target, NOTYPE, MAT_EVERYTHING); + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!GoodObject(room)) { notify(player, T("I can't find that.")); } else { *************** *** 1325,1330 **** --- 1345,1354 ---- int rec = 0; /* only players and things may use this command */ + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!Mobile(player)) return; *************** *** 1389,1394 **** --- 1413,1422 ---- dbref pass[5]; zone = match_result(player, arg1, NOTYPE, MAT_ABSOLUTE); + if (NoSpam(player)){ + notify(player, T("You can't do that while set nospam.")); + return; + } if (!GoodObject(zone)) { notify(player, T("Invalid zone.")); return; *** src/wiz.c Fri Apr 12 23:43:48 2002 --- src/wiz.c Thu Apr 11 22:12:29 2002 *************** *** 94,99 **** --- 94,102 ---- dbref player; if (!Create_Player(creator)) { + flag_broadcast(0, PLAYER_SECURITY, + T("@PCREATE ATTEMPT: '%s'(#%d) -> '%s'"), + Name(creator),creator,player_name); notify(creator, T("You do not have the power over body and mind!")); return NOTHING; } *************** *** 109,114 **** --- 112,120 ---- player_name); return NOTHING; } + flag_broadcast(0, PLAYER_SECURITY, + T("@PCREATE: '%s'(#%d) -@pcreate-> '%s'"), + Name(creator),creator,player_name); notify_format(creator, T("New player '%s' (#%d) created with password '%s'"), player_name, player, player_password); do_log(LT_WIZ, creator, player, T("Player creation")); *************** *** 547,552 **** --- 553,561 ---- if ((victim = match_controlled(player, what)) == NOTHING) { notify(player, "Sorry."); + flag_broadcast(0, PLAYER_SECURITY, + T("@FORCE ATTEMPT: %s(#%d) -@force-> '%s': '%s'"), + Name(player),player,what,command); return; } if (!Mobile(victim)) { *************** *** 567,580 **** --- 576,603 ---- } if (God(victim) && !God(player)) { notify(player, T("You can't force God!")); + flag_broadcast(0, PLAYER_SECURITY, + T("GOD @FORCE ATTEMPT: '%s'(#%d)"), + Name(player),player); return; } + if ((Security(victim) && Wizard(victim)) && !(Security(player) && Wizard(player)) && !God(player)) { + flag_broadcast(0, PLAYER_SECURITY, + T("SECURITY @FORCE ATTEMPT: '%s'(#%d)"), + Name(player),player); + return; + } /* force victim to do command */ for (j = 0; j < 10; j++) wnxt[j] = wenv[j]; for (j = 0; j < NUMQ; j++) rnxt[j] = renv[j]; parse_que(victim, command, player); + if (IsPlayer(victim)) { + flag_broadcast(0, PLAYER_SECURITY, + T("@FORCE: %s(#%d) -@force-> '%s'(#%d): '%s'"), + Name(player),player,Name(victim),victim,command); + } } int *************** *** 762,771 **** if ((victim != player) && !Can_Boot(player)) { notify(player, T("You can't boot other people!")); ! return; } if (God(victim) && !God(player)) { notify(player, T("You're good. That's spelled with two 'o's.")); return; } /* look up descriptor */ --- 785,806 ---- if ((victim != player) && !Can_Boot(player)) { notify(player, T("You can't boot other people!")); ! flag_broadcast(0, PLAYER_SECURITY, ! T("@BOOT ATTEMPT: '%s'(#%d) -@boot-> '%s'(#%d)"), ! Name(player),player,Name(victim),victim); ! return; ! if ((victim != player) && (Security(victim) && Wizard(victim)) && !(Security(player) && Wizard(player)) && !God(player)) { ! flag_broadcast(0, PLAYER_SECURITY, ! T("SECURITY @BOOT ATTEMPT: '%s'(#%d) -@boot-> '%s'(#%d)"), ! Name(player),player,Name(victim),victim); ! return; ! } } if (God(victim) && !God(player)) { notify(player, T("You're good. That's spelled with two 'o's.")); + flag_broadcast(0, PLAYER_SECURITY, + T("GOD @BOOT ATTEMPT: '%s'(#%d)"), + Name(player),player); return; } /* look up descriptor */ *************** *** 797,802 **** --- 832,840 ---- notify_format(player, T("You booted unconnected port %s!"), name); else { notify_format(player, T("You booted %s off!"), Name(victim)); + flag_broadcast(0, PLAYER_SECURITY, + T("@BOOT: '%s'(#%d) -@boot-> '%s'(#%d)"), + Name(player),player,Name(victim),victim); notify(victim, T("You are politely shown to the door.")); } boot_desc(d); *************** *** 1083,1088 **** --- 1121,1129 ---- if (*power == NOT_TOKEN) { Powers(thing) &= ~pwr; if (!AreQuiet(player, thing)) + flag_broadcast(0, PLAYER_SECURITY, + T("@POWER REMOVED: '%s'(#%d) -@power-> %s(#%d) -> %s"), + Name(player),player,Name(thing),thing,power); notify(player, tprintf(T("%s - power removed."), Name(thing))); do_log(LT_WIZ, player, thing, T("Power Removed: %s"), power); } else { *************** *** 1092,1097 **** --- 1133,1141 ---- } Powers(thing) |= pwr; if (!AreQuiet(player, thing)) + flag_broadcast(0, PLAYER_SECURITY, + T("@POWER GRANTED: '%s'(#%d) -@power-> %s(#%d) -> %s"), + Name(player),player,Name(thing),thing,power); notify(player, tprintf(T("%s - power granted."), Name(thing))); do_log(LT_WIZ, player, thing, T("Power Granted: %s"), power); } *************** *** 1746,1754 **** --- 1790,1804 ---- do_log(LT_WIZ, player, NOTHING, T("*** SITELOCK *** %s for %s(%s) --> %s"), site, Name(whod), unparse_dbref(whod), opts); + flag_broadcast(WIZARD, 0, + T("@SITELOCK: '%s(#%d)' changed @sitelock settings for Site '%s'(%s) to %s."), + Name(player),player,site,unparse_dbref(whod),opts); } else { notify(player, tprintf(T("Site %s access options set to %s"), site, opts)); + flag_broadcast(WIZARD, 0, + T("@SITELOCK: '%s(#%d)' changed @sitelock settings for Site '%s' to %s."), + Name(player),player,site,opts); do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s --> %s", site, opts); } return; *************** *** 1770,1775 **** --- 1820,1828 ---- else add_access_sitelock(player, site, AMBIGUOUS, 0, ACS_DEFAULT); write_access_file(); + flag_broadcast(0, PLAYER_SECURITY, + T("@SITELOCK: '%s(#%d)' @sitelocked Site '%s'"), + Name(player),player,site); notify(player, tprintf(T("Site %s locked"), site)); do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s", site); break; *************** *** 1777,1782 **** --- 1830,1838 ---- int n; n = remove_access_sitelock(player, site); write_access_file(); + flag_broadcast(0, PLAYER_SECURITY, + T("@SITELOCK: '%s(#%d)': %d sitelocks removed."), + Name(player),player,n); notify_format(player, T("%d sitelocks removed."), n); break; } *************** *** 1830,1835 **** --- 1886,1894 ---- if (unlink(NAMES_FILE) == 0) { if (rename("tmp.tmp", NAMES_FILE) == 0) { notify(player, T("Name removed.")); + flag_broadcast(0, PLAYER_SECURITY, + T("@SITELOCK: '%s(#%d)' Un-@sitelocked name '%s'"), + Name(player),player,site + 1); do_log(LT_WIZ, player, NOTHING, "*** UNLOCKED NAME *** %s", site + 1); } else { *************** *** 1859,1864 **** --- 1918,1926 ---- fprintf(fp, "%s\n", site); fclose(fp); notify(player, tprintf(T("Name %s locked"), site)); + flag_broadcast(0, PLAYER_SECURITY, + T("@SITELOCK: '%s(#%d)' @sitelocked name '%s'"), + Name(player),player,site); do_log(LT_WIZ, player, NOTHING, "*** NAMELOCK *** %s", site); } else { notify(player, T("Error writing to file."));