TinyMUSH 3.3
TinyMUSH Server
Loading...
Searching...
No Matches
Functions
funobj.c File Reference

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>
Include dependency graph for funobj.c:

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...
 

Detailed Description

Object functions.

Author
TinyMUSH development team (https://github.com/TinyMUSH)
Version
3.3
Date
2021-01-04

Function Documentation

◆ atr_has_flag()

bool atr_has_flag ( dbref  player,
dbref  thing,
ATTR attr,
int  aowner,
int  aflags,
char *  flagname 
)

Auxiliary function for fun_hasflag.

Parameters
playerDBref of player
thingDBref of thing
attrAttributes
aownerAttribute owner
aflagsAttribute flags
flagnameFlag Name
Returns
true Attribute found
false Attribute not found

◆ do_ufun()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot 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.

◆ fun_children()

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>.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber of command's arguments

◆ fun_con()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_controls()

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?

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_default()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsCommand's arguments
ncargsNomber 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.

◆ fun_edefault()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsCommand's arguments
ncargsNomber 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.

◆ fun_elock()

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>.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

Parse lock supplier into obj + lock

Get the victim and ensure we can do it

◆ fun_elockstr()

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>

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_entrances()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot used

◆ fun_eval()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber of command's arguments

◆ fun_exit()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_findable()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_flags()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_hasattr()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_hasflag()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_hasflags()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot 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).

◆ fun_haspower()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_hastype()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_home()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot used

◆ fun_lastcreate()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

Automatically checks for GoodObj

◆ fun_lcon()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber of command's arguments

◆ fun_lexits()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber of command's arguments

Return info for all parent levels

Look for exits at each level

◆ fun_localize()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsCommand's arguments
ncargsNomber of command's arguments

◆ fun_locate()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot 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

◆ fun_lock()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

Parse the argument into obj + lock

Get the attribute and decode it if we can read it

◆ fun_lparent()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber of command's arguments

◆ fun_money()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot used

◆ fun_nearby()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_next()

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

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_num()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_objcall()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot used

First arg: <obj>/<attr> or <attr> or #lambda/

Find our perspective.

Evaluate using the rest of the passed function args.

◆ fun_objeval()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsCommand's arguments
ncargsNomber 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.

◆ fun_objid()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_objmem()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_owner()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_parent()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_pfind()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_playmem()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_pmatch()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot 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.

◆ fun_private()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsCommand's arguments
ncargsNomber of command's arguments

◆ fun_rloc()

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)

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_room()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref oc cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_search()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

Set up for the search. If any errors, abort.

Do the search and report the results

◆ fun_sees()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_speak()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber 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.

◆ fun_stats()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_type()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_udefault()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber 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.

◆ fun_v()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsCommand's arguments
ncargsNomber 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>

◆ fun_visible()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ fun_writable()

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>.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot 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.

◆ fun_xcon()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber of command's arguments

Move to the first object that we want

Grab objects until we reach the last one we want

◆ fun_zfun()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeNot used
fargsFunction's arguments
nfargsNumber of function's arguments
cargsNot used
ncargsNot 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.

◆ fun_zone()

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).

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ handle_flaglists()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref oc cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot 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.

◆ handle_lattr()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerDBref of caller
causeDBref of cause
fargsFunction's arguments
nfargsNumber of function's arguments
cargsCommand's arguments
ncargsNomber 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.

◆ handle_loc()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeDBref of cause
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ handle_name()

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).

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ handle_okpres()

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?

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ handle_pronoun()

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).

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ handle_timestamp()

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).

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ mem_usage()

size_t mem_usage ( dbref  thing)

Memory usage of an object.

Parameters
thing
Returns
int

◆ mem_usage_attr()

size_t mem_usage_attr ( dbref  player,
char *  str 
)

Memory usage of an attribute.

Parameters
playerDBref of the player
strAttribute
Returns
size_t

Player must be able to read attribute with 'examine'

◆ perform_get()

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)

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot 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.

◆ scan_zone()

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.

Parameters
buffOutput buffer
bufcOutput buffer tracker
playerDBref of player
callerNot used
causeNot used
fargsFunction's arguments
nfargsNot used
cargsNot used
ncargsNot used

◆ transform_say()

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 
)
Parameters
speakerDBref of speaker
snameSpeaker's name
strText being said
keySay or pose key
say_strSay string
trans_strTransform string
empty_strBuffer String
open_sepOpen Separator
close_sepClose Separator
playerDBref of player
callerDBref of caller
causeDBref of cause
buffOutput buffer
bufcOutput 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.