MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | #include <defines.h> |
| 2 | #include <v_compiler.h> |
| 3 | inherit "/std/virtual/v_compiler"; |
| 4 | |
| 5 | void create() { |
| 6 | ::create(); |
| 7 | SetProp(P_STD_OBJECT, "/room/welcome/std"); |
| 8 | } |
| 9 | |
| 10 | string Validate(string file) { |
| 11 | |
| 12 | file=::Validate(file); |
| 13 | |
| 14 | // keine Unterverzeichnisse, gueltige Charnamen |
| 15 | if (strstr(file,"/") == -1 |
| 16 | && sizeof(file) <= 11 // charnamen <=11 zeichen |
| 17 | && (regmatch(file,"[a-zA-Z]+") == file // nur A-Z,a-z |
| 18 | || strstr(file,"gast") == 0 // oder Gaeste |
| 19 | ) |
| 20 | ) |
| 21 | { |
| 22 | // Eigentlich P_COMPILER_PATH, aber hier geht jetzt auch __DIR__ |
| 23 | return __DIR__ + file; |
| 24 | } |
| 25 | return 0; |
| 26 | } |
| 27 | |