-
Notifications
You must be signed in to change notification settings - Fork 0
Driver Applies
A driver apply is an API. It is an API that a mudlib implements and that the driver calls to either: (1) do something, or (2) return some information.
Apples are generally split into several categories:
- Apples specific to the master object,
- Applies that are specific to living objects,
- Applies that may be optionally implemented by any "physical" object in the game.
-
applyCompileVirtual(filename, args[]): This method is called in the master object if a physical file cannot be found to load an object for a particular request. This gives the mudlib the opportunity to dynamically create an object. Players are generally created dynamically (e.g. loadObjectAsync('/players/f/foo') clones /lib/player. The default name of this apply is 'compileVirtualObject'
-
applyConvertUnits(unitCount, unitType): This apply in the master object is used to standardize units of measurement in the game. For example, an underlying mudlib may store all values in metric but may accept English units from a particular client. Example: Player requests '10 pounds of floor' and thus a command would call units(10, 'Pounds') to get the mass in grams. Usually this apply is defined in the master object as 'convertUnits' (although as with most applies, the name can be overridden in the configuration file).
-
applyErrorHandler(error, caught): The error handler apply gets called in the master object when an exception occurs in the game. The default name for this apply is 'errorHandler'