MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | /** \file /file.c |
| 3 | * Kurzbeschreibung. |
| 4 | * Langbeschreibung... |
| 5 | * \author <Autor> |
| 6 | * \date <date> |
| 7 | * \version $Id$ |
| 8 | */ |
| 9 | /* Changelog: |
| 10 | */ |
| 11 | #pragma strict_types,save_types,rtt_checks |
| 12 | #pragma no_clone |
| 13 | #pragma no_inherit |
| 14 | #pragma no_shadow |
| 15 | #pragma pedantic |
| 16 | #pragma range_check |
| 17 | |
| 18 | #include <functionlist.h> |
| 19 | #include <lpctypes.h> |
| 20 | |
| 21 | #include <defines.h> |
| 22 | #include <wizlevels.h> |
| 23 | |
| 24 | /** \def DEBUG |
| 25 | Outputs debug message to Maintainer, if Mainteiner is logged in. |
| 26 | */ |
| 27 | #ifndef DEBUG |
| 28 | #define DEBUG(x) if (find_player("zesstra"))\ |
| 29 | tell_object(find_player("zesstra"),\ |
| 30 | "DDBG: "+x+"\n") |
| 31 | #endif |
| 32 | |
| 33 | /** \fn set_object_next_reset(ob,zeit) |
| 34 | \brief setzt den naechsten Reset auf 'zeit' |
| 35 | \details setzt in Objekten den naechsten Reset - nur fuer EM+ |
| 36 | \param[in] ob |
| 37 | (object) Objekt des Reset geaendert wird. |
| 38 | \param[in] zeit |
| 39 | (int) Zeit bis zum naechsten Reset. |
| 40 | \return (string) Gibt die uebergebene Zeit bis zum bisherigen Reset. |
| 41 | \author Zesstra |
| 42 | \date 06.10.2007 |
| 43 | \sa set_object_heart_beat() |
| 44 | */ |
| 45 | // * Reset eines Objektes ein/ausschalten |
| 46 | int set_object_next_reset(mixed ob, int zeit) { |
| 47 | |
| 48 | if (stringp(ob)) |
| 49 | ob=find_object(ob); |
| 50 | |
| 51 | if (objectp(ob) && ELDER_SECURITY) |
| 52 | //if (objectp(ob) && SPECIAL_SECURITY && !clonep(ob)) |
| 53 | return funcall(bind_lambda(#'efun::set_next_reset,ob),zeit); |
| 54 | |
| 55 | return -2; |
| 56 | } |
| 57 | |
| 58 | mixed query_variable(object ob, string var) |
| 59 | { |
| 60 | if (!previous_object() || !IS_ARCH(geteuid(previous_object())) |
| 61 | || !this_interactive() || !IS_ARCH(this_interactive()) |
| 62 | || getuid(ob)==ROOTID ) |
| 63 | { |
| 64 | write("Du bist kein EM oder Gott!\n"); |
| 65 | return 0; |
| 66 | } |
| 67 | |
| 68 | log_file("ARCH/QV", sprintf("%s: %O inquires var %s in %O\n", |
| 69 | ctime(time()),this_interactive(),var,ob)); |
| 70 | |
| 71 | mixed res = variable_list(ob, RETURN_FUNCTION_NAME|RETURN_FUNCTION_FLAGS| |
| 72 | RETURN_FUNCTION_TYPE|RETURN_VARIABLE_VALUE); |
| 73 | int index = member(res,var); |
| 74 | if (index > -1) |
| 75 | { |
| 76 | return ({res[index],res[index+1],res[index+2],res[index+3]}); |
| 77 | } |
| 78 | |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | protected void create() { |
| 83 | // secure_level() in *_SECURITY() prueft auf die EUID |
| 84 | seteuid(getuid(ME)); |
| 85 | } |
| 86 | |