MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | // |
| 3 | // virtual_compiler.c -- Virtueller Compiler fuer die Todesraeume |
| 4 | // |
| 5 | // $Id.$ |
| 6 | |
| 7 | |
| 8 | #pragma strong_types |
| 9 | |
| 10 | inherit "/std/virtual/v_compiler"; |
| 11 | |
| 12 | #include <defines.h> |
| 13 | #include <v_compiler.h> |
| 14 | |
| 15 | int NoParaObjects() {return 1;} |
| 16 | |
| 17 | void create() |
| 18 | { |
| 19 | if (IS_CLONE(this_object())) return; |
| 20 | ::create(); |
| 21 | SetProp(P_STD_OBJECT, "/room/death/death_room_vc"); |
| 22 | seteuid(getuid()); |
| 23 | return; |
| 24 | } |
| 25 | |
| 26 | string Validate(string file) { |
| 27 | string base, room, who; |
| 28 | |
| 29 | file = ::Validate(file); |
| 30 | if(sscanf(file, "death_room_%s",who)!=1 || |
| 31 | ((who[0..3]!="gast") && |
| 32 | (!"/secure/master"->get_userinfo(who)))) return 0; |
| 33 | return file; |
| 34 | } |
| 35 | |
| 36 | mixed CustomizeObject() |
| 37 | { |
| 38 | string base,room,who,file,fun; |
| 39 | |
| 40 | if(!(file = ::CustomizeObject()) || |
| 41 | !Validate(file)) return 0; |
| 42 | return file; |
| 43 | } |
| 44 | |