TinyMUSH 3.3
TinyMUSH Server
|
Object functions. More...
#include "config.h"
#include "constants.h"
#include "typedefs.h"
#include "macros.h"
#include "externs.h"
#include "prototypes.h"
#include <stdbool.h>
#include <ctype.h>
#include <string.h>
Functions | |
void | fun_objid (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns an object's objectID. More... | |
void | fun_con (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns first item in contents list of object/room. More... | |
void | fun_exit (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns first exit in exits list of room. More... | |
void | fun_next (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
return next thing in contents or exits chain More... | |
void | handle_loc (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
loc(): Returns the location of something. More... | |
void | fun_rloc (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns the recursed location of something (specifying levels) More... | |
void | fun_room (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Find the room an object is ultimately in. More... | |
void | fun_owner (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Return the owner of an object. More... | |
void | fun_controls (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Does x control y? More... | |
void | fun_sees (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Can X see Y in the normal Contents list of the room. If X or Y do not exist, 0 is returned. More... | |
void | fun_nearby (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Return whether or not obj1 is near obj2. More... | |
void | handle_okpres (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Handle presence functions. hears(<object>, <speaker>): Can <object> hear <speaker> speak? knows(<object>, <target>): Can <object> know about <target>? moves(<object>, <mover>): Can <object> see <mover> move? More... | |
void | handle_name (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Get object name (NAME, FULLNAME). name(): Return the name of an object. fullname(): Return the fullname of an object (good for exits). More... | |
void | handle_pronoun (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Perform pronoun sub for object (OBJ, POSS, SUBJ, APOSS). More... | |
void | fun_lock (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Handle locks. More... | |
void | fun_elock (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Checks if <actor> would pass the named lock on <object>. More... | |
void | fun_elockstr (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Checks if <actor> would pass a lock on <locked object> with syntax <lock string> More... | |
void | fun_xcon (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
Return a partial list of contents of an object, starting from a specified element in the list and copying a specified number of elements. More... | |
void | fun_lcon (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
Return a list of contents. More... | |
void | fun_lexits (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
Return a list of exits. More... | |
void | fun_entrances (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Approximate equivalent of @entrances command. Borrowed in part from PennMUSH. More... | |
void | fun_home (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Return an object's home. More... | |
void | fun_money (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Return an object's value. More... | |
void | fun_findable (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Can X locate Y. More... | |
void | fun_visible (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Can X examine Y. If X does not exist, 0 is returned. If Y, the object, does not exist, 0 is returned. If Y the object exists, but the optional attribute does not, X's ability to return Y the object is returned. More... | |
void | fun_writable (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns 1 if player could set <obj>/<attr>. More... | |
void | fun_flags (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns the flags on an object. Because @switch is case-insensitive, not quite as useful as it could be. More... | |
void | handle_flaglists (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
andflags, orflags: Check a list of flags. More... | |
bool | atr_has_flag (dbref player, dbref thing, ATTR *attr, int aowner, int aflags, char *flagname) |
Auxiliary function for fun_hasflag. More... | |
void | fun_hasflag (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns true if object <object> has the flag named <flag> set on it, or, if <flag> is PLAYER, THING, ROOM, or EXIT, if <object> is of the specified type. More... | |
void | fun_haspower (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns true if object <object> has the flag named <flag> set on it, or, if <flag> is PLAYER, THING, ROOM, or EXIT, if <object> is of the specified type. More... | |
void | fun_hasflags (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
This function returns 1 if <object> has all the flags in <flag list 1>, or all the flags in <flag list 2>, and so forth (up to eight lists). Otherwise, it returns 0. More... | |
void | handle_timestamp (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Get timestamps (LASTACCESS, LASTMOD, CREATION). More... | |
void | fun_parent (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
This function returns 1 if <object> has all the flags in <flag list 1>, or all the flags in <flag list 2>, and so forth (up to eight lists). Otherwise, it returns 0. More... | |
void | fun_lparent (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
This function returns the list of dbrefs of the object's "parent
chain", including itself: i.e., its own dbref, the dbref of the object it is @parent'd to, its parent's parent (grandparent), and so forth. Note that the function will always return at least one element, the dbref of the object itself. More... | |
void | fun_children (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
This function returns a list of objects that are parented to <object>. More... | |
void | fun_zone (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns the dbref of <object>'s zone (the dbref of the master object which defines the zone). More... | |
void | scan_zone (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Scan zone for content. More... | |
void | fun_zfun (char *buff, char **bufc, dbref player, dbref caller, dbref cause __attribute__((unused)), char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Evaluates an attribute on the caller's Zone object. More... | |
void | fun_hasattr (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Does object X have attribute Y. More... | |
void | fun_v (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[], int ncargs) |
Function form of %-substitution. More... | |
void | perform_get (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Get attribute from object: GET, XGET, GET_EVAL, EVAL(obj,atr) More... | |
void | fun_eval (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
The first form of this function is identical to get_eval(), but splits the <object> and <attribute> into two arguments, rather than having an <object>/<attribute> pair. It is provided for PennMUSH compatibility. More... | |
void | do_ufun (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Call a user-defined function: U, ULOCAL, UPRIVATE. More... | |
void | fun_objcall (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Call the text of a u-function from a specific object's perspective. (i.e., get the text as the player, but execute it as the specified object. More... | |
void | fun_localize (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[], int ncargs) |
Evaluate a function with local scope (i.e., preserve and restore the r-registers). Essentially like calling ulocal() but with the function string directly. More... | |
void | fun_private (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[], int ncargs) |
Evaluate a function with a strictly local scope – do not pass global registers and discard any changes made to them. Like calling uprivate() but with the function string directly. More... | |
void | fun_default (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[], int ncargs) |
This function returns the value of <obj>/<attr>, as if retrieved via the get() function, if the attribute exists and is readable by Player. More... | |
void | fun_edefault (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[], int ncargs) |
This function returns the evaluated value of <obj>/<attr>, as if retrieved via the get_eval() function, if the attribute exists and is readable by you. Otherwise, it evaluates the default case, and returns that. The default case is only evaluated if the attribute does not exist or cannot be read. More... | |
void | fun_udefault (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
This function returns the value of the user-defined function as defined by <attr> (or <obj>/<attr>), as if retrieved via the u() function, with <args>, if the attribute exists and is readable by you. More... | |
void | fun_objeval (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[], int ncargs) |
Evaluate from a specific object's perspective. More... | |
void | fun_num (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns the dbref number of the object, which must be in the same room as the object executing num. More... | |
void | fun_pmatch (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Given the partial name of a player, it returns that player's dbref number. More... | |
void | fun_pfind (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
If <object> is a dbref, if the dbref is valid, that dbref will be returned. If the dbref is not valid, #-1 will be returned. More... | |
void | fun_locate (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Search for things with the perspective of another obj. More... | |
void | handle_lattr (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
Handler for lattr/nattr lattr: Return list of attributes I can see on the object. nattr: Ditto, but just count 'em up. More... | |
void | fun_search (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause, char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Search the db for things, returning a list of what matches. More... | |
void | fun_stats (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Get database size statistics. More... | |
size_t | mem_usage (dbref thing) |
Memory usage of an object. More... | |
size_t | mem_usage_attr (dbref player, char *str) |
Memory usage of an attribute. More... | |
void | fun_objmem (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
If no attribute pattern is specified, this returns the number of bytes of memory consumed by an object, including both attribute text and object overhead. More... | |
void | fun_playmem (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns the sum total of the size, in bytes, of all objects in the database that are owned by <player> (equivalent to doing an objmem() on everything that player owns). You must be a Wizard, or have the Search power, in order to use this on another player. More... | |
void | fun_type (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns a string indicating the object type of <object>, either EXIT, PLAYER, ROOM, or THING. More... | |
void | fun_hastype (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Returns 1 if <object> is of type <type>, and 0 otherwise. Valid types are: ROOM, EXIT, THING, and PLAYER. If an invalid type is given, the function returns #-1. More... | |
void | fun_lastcreate (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs __attribute__((unused)), char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused))) |
Return the last object of type Y that X created. More... | |
void | transform_say (dbref speaker, char *sname, char *str, int key, char *say_str, char *trans_str, char *empty_str, const Delim *open_sep, const Delim *close_sep, dbref player, dbref caller, dbref cause, char *buff, char **bufc) |
void | fun_speak (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
This function is used to format speech-like constructs, and is capable of transforming text within a speech string; it is useful for implementing "language code" and the like. More... | |
Object functions.
bool atr_has_flag | ( | dbref | player, |
dbref | thing, | ||
ATTR * | attr, | ||
int | aowner, | ||
int | aflags, | ||
char * | flagname | ||
) |
Auxiliary function for fun_hasflag.
player | DBref of player |
thing | DBref of thing |
attr | Attributes |
aowner | Attribute owner |
aflags | Attribute flags |
flagname | Flag Name |
void do_ufun | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Call a user-defined function: U, ULOCAL, UPRIVATE.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
We need at least one argument
First arg: <obj>/<attr> or <attr> or #lambda/
If we're evaluating locally, preserve the global registers. If we're evaluating privately, preserve and wipe out.
If the trace flag is on this attr, set the object Trace
Evaluate it using the rest of the passed function args
Reset the trace flag if we need to
If we're evaluating locally, restore the preserved registers. If we're evaluating privately, free whatever data we had and restore.
void fun_children | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
This function returns a list of objects that are parented to <object>.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
void fun_con | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns first item in contents list of object/room.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_controls | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Does x control y?
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_default | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char * | cargs[], | ||
int | ncargs | ||
) |
This function returns the value of <obj>/<attr>, as if retrieved via the get() function, if the attribute exists and is readable by Player.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
First we check to see that the attribute exists on the object. If so, we grab it and use it.
If we've hit this point, we've not gotten anything useful, so we go and evaluate the default.
void fun_edefault | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char * | cargs[], | ||
int | ncargs | ||
) |
This function returns the evaluated value of <obj>/<attr>, as if retrieved via the get_eval() function, if the attribute exists and is readable by you. Otherwise, it evaluates the default case, and returns that. The default case is only evaluated if the attribute does not exist or cannot be read.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
First we check to see that the attribute exists on the object. If so, we grab it and use it.
If we've hit this point, we've not gotten anything useful, so we go and evaluate the default.
void fun_elock | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Checks if <actor> would pass the named lock on <object>.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Parse lock supplier into obj + lock
Get the victim and ensure we can do it
void fun_elockstr | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Checks if <actor> would pass a lock on <locked object> with syntax <lock string>
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_entrances | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int | nfargs, | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Approximate equivalent of @entrances command. Borrowed in part from PennMUSH.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
void fun_eval | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
The first form of this function is identical to get_eval(), but splits the <object> and <attribute> into two arguments, rather than having an <object>/<attribute> pair. It is provided for PennMUSH compatibility.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
void fun_exit | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns first exit in exits list of room.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_findable | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Can X locate Y.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_flags | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns the flags on an object. Because @switch is case-insensitive, not quite as useful as it could be.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_hasattr | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Does object X have attribute Y.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_hasflag | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns true if object <object> has the flag named <flag> set on it, or, if <flag> is PLAYER, THING, ROOM, or EXIT, if <object> is of the specified type.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_hasflags | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int | nfargs, | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
This function returns 1 if <object> has all the flags in <flag list 1>, or all the flags in <flag list 2>, and so forth (up to eight lists). Otherwise, it returns 0.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
Walk through each of the lists we've been passed. We need to have all the flags in a particular list (AND) in order to consider that list true. We return 1 if any of the lists are true. (i.e., we OR the list results).
void fun_haspower | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns true if object <object> has the flag named <flag> set on it, or, if <flag> is PLAYER, THING, ROOM, or EXIT, if <object> is of the specified type.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_hastype | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns 1 if <object> is of type <type>, and 0 otherwise. Valid types are: ROOM, EXIT, THING, and PLAYER. If an invalid type is given, the function returns #-1.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_home | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Return an object's home.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
void fun_lastcreate | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Return the last object of type Y that X created.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Automatically checks for GoodObj
void fun_lcon | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Return a list of contents.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
void fun_lexits | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Return a list of exits.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
Return info for all parent levels
Look for exits at each level
void fun_localize | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Evaluate a function with local scope (i.e., preserve and restore the r-registers). Essentially like calling ulocal() but with the function string directly.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
void fun_locate | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Search for things with the perspective of another obj.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Find the thing to do the looking, make sure we control it.
Get pre- and post-conditions and modifiers
Set up for the search
Search for each requested thing
Get the result and return it to the caller
void fun_lock | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Handle locks.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Parse the argument into obj + lock
Get the attribute and decode it if we can read it
void fun_lparent | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
This function returns the list of dbrefs of the object's "parent chain", including itself: i.e., its own dbref, the dbref of the object it is @parent'd to, its parent's parent (grandparent), and so forth. Note that the function will always return at least one element, the dbref of the object itself.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
void fun_money | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Return an object's value.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
void fun_nearby | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Return whether or not obj1 is near obj2.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_next | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
return next thing in contents or exits chain
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_num | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns the dbref number of the object, which must be in the same room as the object executing num.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_objcall | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Call the text of a u-function from a specific object's perspective. (i.e., get the text as the player, but execute it as the specified object.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
First arg: <obj>/<attr> or <attr> or #lambda/
Find our perspective.
Evaluate using the rest of the passed function args.
void fun_objeval | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Evaluate from a specific object's perspective.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
In order to evaluate from something else's viewpoint, you must have the same owner as it, or be a wizard (unless objeval_requires_control is turned on, in which case you must control it, period). Otherwise, we default to evaluating from our own viewpoint. Also, you cannot evaluate things from the point of view of God.
void fun_objid | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns an object's objectID.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_objmem | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
If no attribute pattern is specified, this returns the number of bytes of memory consumed by an object, including both attribute text and object overhead.
If an attribute wildcard pattern is specified, this returns the number of bytes of memory consumed by attribute text for those attributes on <object>. To just get a count of the number of bytes used by all attribute text on an object, use 'objmem(<object> / *)'. You must be able to read an attribute in order to check its size.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_owner | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Return the owner of an object.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_parent | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
This function returns 1 if <object> has all the flags in <flag list 1>, or all the flags in <flag list 2>, and so forth (up to eight lists). Otherwise, it returns 0.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_pfind | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
If <object> is a dbref, if the dbref is valid, that dbref will be returned. If the dbref is not valid, #-1 will be returned.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_playmem | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns the sum total of the size, in bytes, of all objects in the database that are owned by <player> (equivalent to doing an objmem() on everything that player owns). You must be a Wizard, or have the Search power, in order to use this on another player.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_pmatch | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Given the partial name of a player, it returns that player's dbref number.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
If we have a valid dbref, it's okay if it's a player.
If we have *name, just advance past the *; it doesn't matter
Look up the full name
We've got it. Check to make sure it's a good object.
We haven't found anything. Now we try a partial match.
void fun_private | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Evaluate a function with a strictly local scope – do not pass global registers and discard any changes made to them. Like calling uprivate() but with the function string directly.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
void fun_rloc | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns the recursed location of something (specifying levels)
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_room | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Find the room an object is ultimately in.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref oc cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_search | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Search the db for things, returning a list of what matches.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Set up for the search. If any errors, abort.
Do the search and report the results
void fun_sees | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Can X see Y in the normal Contents list of the room. If X or Y do not exist, 0 is returned.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_speak | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
This function is used to format speech-like constructs, and is capable of transforming text within a speech string; it is useful for implementing "language code" and the like.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
Delimiter processing here is different. We have to do some funky stuff to make sure that a space delimiter is really an intended space, not delim_check() defaulting.
We have three possible cases for the speaker: <thing string>&<name string> &<name string> (speaker defaults to player) <thing string> (name string defaults to name of thing)
name only
thing only
thing and name
Must have an input string. Otherwise silent fail.
Check if there's a string substituting for "says,".
Find the u-function. If we have a problem with it, we just default to no transformation.
Do some up-front work on the empty-case u-function, too.
Take care of the easy case, no u-function.
Now for the nasty stuff.
void fun_stats | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Get database size statistics.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_type | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns a string indicating the object type of <object>, either EXIT, PLAYER, ROOM, or THING.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_udefault | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
This function returns the value of the user-defined function as defined by <attr> (or <obj>/<attr>), as if retrieved via the u() function, with <args>, if the attribute exists and is readable by you.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
must have at least two arguments
First we check to see that the attribute exists on the object. If so, we grab it and use it.
Now we have a problem – we've got to go eval all of those arguments to the function.
We have the args, now call the ufunction. Obey the trace flag on the attribute if there is one.
Then clean up after ourselves.
If we've hit this point, we've not gotten anything useful, so we go and evaluate the default.
void fun_v | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Function form of %-substitution.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
Fetch an attribute from me. First see if it exists, returning a null string if it does not.
If we can access it, return it, otherwise return a null string
Not an attribute, process as %<arg>
void fun_visible | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Can X examine Y. If X does not exist, 0 is returned. If Y, the object, does not exist, 0 is returned. If Y the object exists, but the optional attribute does not, X's ability to return Y the object is returned.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void fun_writable | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns 1 if player could set <obj>/<attr>.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Possibilities: retval is 0, which means we didn't match a thing. retval is NOTHING, which means we matched a thing but have a non-existent attribute. retval is 1; atr is either NOTHING (non-existent attribute or no permission to see), or a valid attr number. In the case of NOTHING we can't tell which it is, so must continue.
Non-existent attribute. Go see if it's settable.
void fun_xcon | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Return a partial list of contents of an object, starting from a specified element in the list and copying a specified number of elements.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
Move to the first object that we want
Grab objects until we reach the last one we want
void fun_zfun | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int | nfargs, | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Evaluates an attribute on the caller's Zone object.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | Not used |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Not used |
ncargs | Not used |
find the user function attribute
Behavior here is a little wacky. The enactor was always the player, not the cause. You can still get the caller, though.
void fun_zone | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Returns the dbref of <object>'s zone (the dbref of the master object which defines the zone).
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void handle_flaglists | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
andflags, orflags: Check a list of flags.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref oc cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
Check for a negation sign. If we find it, we note it and increment the pointer to the next character.
Either we got a '!' that wasn't followed by a letter, or we couldn't find that flag. For AND, since we've failed a check, we can return false. Otherwise we just go on.
does the object have this flag?
Four ways to satisfy that test: AND, don't want flag but we have it; AND, do want flag but don't have it; OR, don't want flag and don't have it; OR, do want flag and do have it.
Otherwise, move on to check the next flag.
void handle_lattr | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | fargs[], | ||
int | nfargs, | ||
char * | cargs[], | ||
int | ncargs | ||
) |
Handler for lattr/nattr lattr: Return list of attributes I can see on the object. nattr: Ditto, but just count 'em up.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Number of function's arguments |
cargs | Command's arguments |
ncargs | Nomber of command's arguments |
We have two possible syntaxes: lattr(<whatever>[,<odelim>]) lattr(<whatever>,<start>,<count>[,<odelim>])
Check for wildcard matching. parse_attrib_wild checks for read permission, so we don't have to. Have p_a_w assume the slash-star if it is missing.
void handle_loc | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref | cause, | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
loc(): Returns the location of something.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | DBref of cause |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void handle_name | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Get object name (NAME, FULLNAME). name(): Return the name of an object. fullname(): Return the fullname of an object (good for exits).
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void handle_okpres | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Handle presence functions. hears(<object>, <speaker>): Can <object> hear <speaker> speak? knows(<object>, <target>): Can <object> know about <target>? moves(<object>, <mover>): Can <object> see <mover> move?
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void handle_pronoun | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Perform pronoun sub for object (OBJ, POSS, SUBJ, APOSS).
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void handle_timestamp | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Get timestamps (LASTACCESS, LASTMOD, CREATION).
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
size_t mem_usage | ( | dbref | thing | ) |
Memory usage of an object.
thing |
size_t mem_usage_attr | ( | dbref | player, |
char * | str | ||
) |
Memory usage of an attribute.
player | DBref of the player |
str | Attribute |
Player must be able to read attribute with 'examine'
void perform_get | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Get attribute from object: GET, XGET, GET_EVAL, EVAL(obj,atr)
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
There used to be code here to handle AF_IS_LOCK attributes, but parse_attrib can never return one of those. Use fun_lock instead.
void scan_zone | ( | char * | buff, |
char ** | bufc, | ||
dbref | player, | ||
dbref caller | __attribute__(unused), | ||
dbref cause | __attribute__(unused), | ||
char * | fargs[], | ||
int nfargs | __attribute__(unused), | ||
char *cargs[] | __attribute__(unused), | ||
int ncargs | __attribute__(unused) | ||
) |
Scan zone for content.
buff | Output buffer |
bufc | Output buffer tracker |
player | DBref of player |
caller | Not used |
cause | Not used |
fargs | Function's arguments |
nfargs | Not used |
cargs | Not used |
ncargs | Not used |
void transform_say | ( | dbref | speaker, |
char * | sname, | ||
char * | str, | ||
int | key, | ||
char * | say_str, | ||
char * | trans_str, | ||
char * | empty_str, | ||
const Delim * | open_sep, | ||
const Delim * | close_sep, | ||
dbref | player, | ||
dbref | caller, | ||
dbref | cause, | ||
char * | buff, | ||
char ** | bufc | ||
) |
speaker | DBref of speaker |
sname | Speaker's name |
str | Text being said |
key | Say or pose key |
say_str | Say string |
trans_str | Transform string |
empty_str | Buffer String |
open_sep | Open Separator |
close_sep | Close Separator |
player | DBref of player |
caller | DBref of caller |
cause | DBref of cause |
buff | Output buffer |
bufc | Output buffer tracker |
should never happen; caller should check
Find the start of the speech string. Copy up to it.
Find the end of the speech string.
If there's more, find it and copy it. sp will point to the beginning of the next speech string.