[btech-checkins] CVS: btechmux/src funceval.c,1.3.2.2,1.3.2.3 functions.c,1.5.2.9,1.5.2.10 wiz.c,1.1
Brought to you by:
twouters
From: Thomas W. <two...@us...> - 2003-09-30 01:38:39
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1:/tmp/cvs-serv2119/src Modified Files: Tag: btmux_1_4-branch funceval.c functions.c wiz.c Removed Files: Tag: btmux_1_4-branch .depend Makefile.in configure configure.in Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. Index: funceval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/funceval.c,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** funceval.c 30 Jul 2002 20:29:48 -0000 1.3.2.2 --- funceval.c 30 Sep 2003 01:38:35 -0000 1.3.2.3 *************** *** 3334,3335 **** --- 3334,3430 ---- } } + + /* + * --------------------------------------------------------------------------- + * fun_setlock: Set lock from a function (like @lock) + */ + + extern NAMETAB lock_sw; + + FUNCTION(fun_setlock) + { + int switchkey = 0; + dbref thing, aowner; + int atr, aflags; + ATTR *ap; + struct boolexp *okey; + + if (*fargs[0]) { + switchkey = search_nametab(player, &lock_sw, fargs[0]); + if (switchkey < 0) { + safe_str("#-1 SWITCH ERROR", buff, bufc); + return; + } + } + + if (parse_attrib(player, fargs[1], &thing, &atr)) { + if (atr != NOTHING) { + if (!atr_get_info(thing, atr, &aowner, &aflags)) { + safe_str("#-1 ATTR NOT FOUND", buff, bufc); + return; + } + ap = atr_num(atr); + + /* + * You may lock an attribute iff: you could write the + * attribute if it were stored on yourself --and-- you own + * the attribute or are a wizard as long as you are not #1 + * and are trying to do something to #1. + */ + + if (ap && (God(player) || (!God(thing) && + (Set_attr(player, player, ap, 0) && (Wizard(player) + || aowner == Owner(player)))))) { + if (*fargs[2]) + aflags |= AF_LOCK; + else + aflags &= ~AF_LOCK; + atr_set_flags(thing, atr, aflags); + safe_str("1", buff, bufc); + } else { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + } + return; + } + } + init_match(player, fargs[1], NOTYPE); + match_everything(MAT_EXIT_PARENTS); + thing = match_result(); + + switch (thing) { + case NOTHING: + safe_str("#-1 NOT FOUND", buff, bufc); + return; + case AMBIGUOUS: + safe_str("#-1 AMBIGUOUS MATCH", buff, bufc); + return; + default: + if (!controls(player, thing)) { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + return; + } + } + + if (!switchkey) + switchkey = A_LOCK; + + if (!*fargs[2]) { + atr_clr(thing, switchkey); + safe_str("1", buff, bufc); + return; + } + + okey = parse_boolexp(player, fargs[2], 0); + if (okey == TRUE_BOOLEXP) { + safe_str("#-1 KEY ERROR", buff, bufc); + } else { + + /* + * everything ok, do it + */ + + atr_add_raw(thing, switchkey, unparse_boolexp_quiet(player, okey)); + safe_str("1", buff, bufc); + } + free_boolexp(okey); + } Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.5.2.9 retrieving revision 1.5.2.10 diff -C2 -d -r1.5.2.9 -r1.5.2.10 *** functions.c 21 Jul 2002 20:43:48 -0000 1.5.2.9 --- functions.c 30 Sep 2003 01:38:35 -0000 1.5.2.10 *************** *** 76,79 **** --- 76,82 ---- XFUNCTION(fun_btlostohex) XFUNCTION(fun_btlostomech) + XFUNCTION(fun_btaddparts) + XFUNCTION(fun_btloadmap) + XFUNCTION(fun_btloadmech) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 90,93 **** --- 93,97 ---- XFUNCTION(fun_create); XFUNCTION(fun_set); + XFUNCTION(fun_setlock); #endif XFUNCTION(fun_last); *************** *** 5122,5125 **** --- 5126,5132 ---- {"BTLOSTOHEX", fun_btlostohex, 3, 0, CA_WIZARD}, {"BTLOSTOMECH", fun_btlostomech, 2, 0, CA_WIZARD}, + {"BTADDPARTS", fun_btaddparts, 3, 0, CA_WIZARD}, + {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, + {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, *************** *** 5295,5298 **** --- 5302,5306 ---- {"SETDIFF", fun_setdiff, 0, FN_VARARGS, CA_PUBLIC}, {"SETINTER", fun_setinter, 0, FN_VARARGS, CA_PUBLIC}, + {"SETLOCK", fun_setlock, 3, 0, CA_WIZARD}, {"SETQ", fun_setq, 2, 0, CA_PUBLIC}, {"SETR", fun_setr, 2, 0, CA_PUBLIC}, Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** wiz.c 3 Jan 2002 00:59:35 -0000 1.1.1.1 --- wiz.c 30 Sep 2003 01:38:35 -0000 1.1.1.1.2.1 *************** *** 62,66 **** } else { init_match(player, arg1, NOTYPE); ! match_everything(MAT_NO_EXITS); victim = noisy_match_result(); --- 62,66 ---- } else { init_match(player, arg1, NOTYPE); ! match_everything(0); victim = noisy_match_result(); --- .depend DELETED --- --- Makefile.in DELETED --- --- configure DELETED --- --- configure.in DELETED --- |