MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | NAME |
| 2 | master for LPMud 3.2.1 |
| 3 | |
| 4 | DESCRIPTION |
| 5 | This directory contains descriptions for the functions that |
| 6 | Amylaar's version of the LPC parser, expects to find in the |
| 7 | master object (similar to lfuns, but for the master object |
| 8 | only). The name of the master object is hardcoded in the |
| 9 | parser (to "secure/master"). |
| 10 | |
| 11 | The master is the gateway between the interpreter and the |
| 12 | mudlib to perform actions with mudlib specific effects. Calls |
| 13 | to the master by the interpreter have an automatic catch() in |
| 14 | effect. |
| 15 | |
| 16 | Note that the master is loaded first of all objects. Thus you |
| 17 | shouldn't inherit an other object, nor is the compiler able to |
| 18 | search include files (read: they must be specified with full |
| 19 | path). |
| 20 | |
| 21 | Amylaar says: actually, you can inherit, but the file will be |
| 22 | loaded then before the master, which isn't good for most |
| 23 | files. |
| 24 | |
| 25 | A short survey of the things that happen at system startup |
| 26 | time: |
| 27 | |
| 28 | The Initialisation functions are called after (re)loading the |
| 29 | master to establish the most basic operation parameters. |
| 30 | |
| 31 | The initialisation of LPMud on startup follows this schedule: |
| 32 | - The interpreter evaluates the commandline options and |
| 33 | initializes itself. |
| 34 | - The master is loaded, but since the driverhooks are not set yet, |
| 35 | no standard initialisation lfun is called. |
| 36 | - get_master_uid() is called. If the result is valid, it becomes the |
| 37 | - inaugurate_master() is called. |
| 38 | - flag() is called for each given '-f' commandline option. |
| 39 | - get_simul_efun() is called. |
| 40 | - the WIZLIST is read in. |
| 41 | - epilog() is called. If it returns an array of strings, |
| 42 | they are given one at a time as argument to preload(). |
| 43 | Traditionally, these strings are the filenames of the objects to |
| 44 | preload, which preload() then does. |
| 45 | - The interpreter sets up the IP communication and enters |
| 46 | the backend loop. |
| 47 | |
| 48 | If the master is reloaded during system operation, this |
| 49 | actions are taken: |
| 50 | - The master is loaded, and its initialisation lfun is |
| 51 | called according to the settings of the driverhooks (if set). |
| 52 | - Any auto-include string and all driverhooks are cleared. |
| 53 | - get_master_uid() is called. If the result is valid, it becomes the |
| 54 | masters uid and euid. |
| 55 | - inaugurate_master() is called. |
| 56 | |
| 57 | If the master was destructed, but couldn't be reloaded, the old |
| 58 | master object could be reactivated. In that case: |
| 59 | - reactivate_destructed_master() is called. |
| 60 | - inaugurate_master() is called. |
| 61 | |
| 62 | |
| 63 | Security hint: most of this functions are not useful to be |
| 64 | called directly from other objects and can be made private or |
| 65 | static. Unlike create(), these functions that are applied to |
| 66 | the master object are found by the interpreter even if not |
| 67 | publicly accessible. |
| 68 | |
| 69 | |
| 70 | |
| 71 | A short reference to all expected master functions... |
| 72 | ---------------------------------------------------------------- |
| 73 | Initialisation |
| 74 | |
| 75 | void inaugurate_master () |
| 76 | Perform mudlib specific setup of the master. |
| 77 | |
| 78 | string get_master_uid () |
| 79 | Return the string to be used as uid (and -euid) of a |
| 80 | (re)loaded master. |
| 81 | |
| 82 | void flag (string arg) |
| 83 | Evaluate an argument given as option '-f' to the driver. |
| 84 | |
| 85 | string *define_include_dirs () |
| 86 | Define where the include files are searched. |
| 87 | |
| 88 | string *epilog (int eflag) |
| 89 | Perform final actions before opening the system to users. |
| 90 | |
| 91 | void preload (string file) |
| 92 | Preload a given object. |
| 93 | |
| 94 | void external_master_reload () |
| 95 | Called after a reload of the master on external request. |
| 96 | |
| 97 | void reactivate_destructed_master (int removed) |
| 98 | Reactivate a formerly destructed master. |
| 99 | |
| 100 | string|string * get_simul_efun () |
| 101 | Load the simul_efun object and return one or more paths of it. |
| 102 | |
| 103 | ---------------------------------------------------------------- |
| 104 | Handling of user connections |
| 105 | |
| 106 | object connect () |
| 107 | Handle the request for a new connection. |
| 108 | |
| 109 | void disconnect (object obj) |
| 110 | Handle the loss of an IP connection. |
| 111 | |
| 112 | void remove_player (object user) |
| 113 | Remove a user object from the system. |
| 114 | |
| 115 | void stale_erq (closure callback) |
| 116 | Notify the loss of the erq demon. |
| 117 | |
| 118 | ----------------------------------------------------------------- |
| 119 | Runtime Support |
| 120 | |
| 121 | object compile_object (string filename) |
| 122 | Compile an virtual object. |
| 123 | |
| 124 | string get_wiz_name (string file) |
| 125 | Return the author of a file. |
| 126 | |
| 127 | string object_name (object obj) |
| 128 | Return a printable name for an object. |
| 129 | |
| 130 | mixed prepare_destruct (object obj) |
| 131 | Prepare the destruction of the given object. |
| 132 | |
| 133 | void quota_demon (void) |
| 134 | Handle quotas in times of memory shortage. |
| 135 | |
| 136 | void receive_udp (string host, string msg, int port) |
| 137 | Handle a received IMP message. |
| 138 | |
| 139 | void slow_shut_down (int minutes) |
| 140 | Schedule a shutdown for the near future. |
| 141 | |
| 142 | void notify_shutdown () |
| 143 | Notify the master about an immediate shutdown. |
| 144 | |
| 145 | ----------------------------------------------------------------- |
| 146 | Error Handling |
| 147 | |
| 148 | void dangling_lfun_closure () |
| 149 | Handle a dangling lfun-closure. |
| 150 | |
| 151 | void log_error (string file, string err) |
| 152 | Announce a compiler-time error. |
| 153 | |
| 154 | mixed heart_beat_error (object culprit, string err, |
| 155 | string prg, string curobj, int line) |
| 156 | Announce an error in the heart_beat() function. |
| 157 | |
| 158 | void runtime_error (string err, string prg, string curobj, int line) |
| 159 | Announce a runtime error. |
| 160 | |
| 161 | ----------------------------------------------------------------- |
| 162 | Security and Permissions |
| 163 | |
| 164 | int privilege_violation (string op, mixed who, mixed arg3, mixed arg4) |
| 165 | Validate the execution of a privileged operation. |
| 166 | |
| 167 | int query_allow_shadow (object victim) |
| 168 | Validate a shadowing. |
| 169 | |
| 170 | int query_player_level (string what) |
| 171 | Check if the user is of high enough level for several things. |
| 172 | |
| 173 | int valid_exec (string name) |
| 174 | Validate the rebinding of an IP connection by usage of efun |
| 175 | exec(). |
| 176 | |
| 177 | int valid_query_snoop (object obj) |
| 178 | Validate if the snoopers of an object may be revealed by |
| 179 | usage of the efun query_snoop(). |
| 180 | |
| 181 | int valid_snoop (object snoopee, object snooper) |
| 182 | Validate the start/stop of a snoop. |
| 183 | |
| 184 | ------------------------------------------------------------------ |
| 185 | Userids and depending Security |
| 186 | |
| 187 | string get_bb_uid() // euids |
| 188 | Return the string to be used as root-uid. |
| 189 | |
| 190 | int valid_seteuid (object obj, string neweuid) // euids |
| 191 | Validate the change of an objects euid by efun seteuid(). |
| 192 | |
| 193 | int|string valid_read (string path, string euid, string fun, object caller) |
| 194 | int|string valid_write (string path, string euid, string fun, object caller) |
| 195 | Validate a reading/writing file operation. |
| 196 | |
| 197 | ----------------------------------------------------------------- |
| 198 | ed() Support |
| 199 | |
| 200 | string make_path_absolute (string str) |
| 201 | Absolutize a relative filename given to the editor. |
| 202 | |
| 203 | int save_ed_setup (object who, int code) |
| 204 | Save individual settings of ed for a wizard. |
| 205 | |
| 206 | int retrieve_ed_setup (object who) |
| 207 | Retrieve individual settings of ed for a wizard. |
| 208 | |
| 209 | string get_ed_buffer_save_object_name (string file) |
| 210 | Return a filename for the ed buffer to be saved into. |
| 211 | |
| 212 | ---------------------------------------------------------------- |
| 213 | parse_command() Support (!compat, SUPPLY_PARSE_COMMAND defined) |
| 214 | |
| 215 | string *parse_command_id_list () |
| 216 | Return generic singular ids. |
| 217 | |
| 218 | string *parse_command_plural_id_list () |
| 219 | Return generic plural ids. |
| 220 | |
| 221 | string *parse_command_adjectiv_id_list () |
| 222 | Return generic adjective ids. |
| 223 | |
| 224 | string *parse_command_prepos_list () |
| 225 | Return common prepositions. |
| 226 | |
| 227 | string parse_command_all_word() |
| 228 | Return the one(!) 'all' word. |
| 229 | |
| 230 | SEE ALSO |
| 231 | master(M), efun(E), applied(A), concepts(C), driver(D), lpc(LPC) |