#include "defs.h" #include "prims.h" PRIM(notify) { struct inst *vwho; struct inst *vstring; NARGS(2); vstring = TOS(0); vwho = TOS(1); if (!valid_object(vwho)) ABORT_INTERP("Non-object argument. (1)"); if (vstring->type != PROG_STRING) ABORT_INTERP("Non-string argument. (2)"); if (vstring->data.string) { add_proglock(program,player,PROGLOCK_READ); notify_listener(player,vwho->data.objref,vstring->data.string); if (interp_errored()) return; remove_proglock(program,player); } POP(2); } PRIM(notify_except) { struct inst *vloc; struct inst *vstring; struct inst *vexc; NARGS(3); vstring = TOS(0); vexc = TOS(1); vloc = TOS(2); if (!valid_object(vloc) || (Typeof(vloc->data.objref) != TYPE_ROOM)) ABORT_INTERP("Non-room argument (1)"); if (vexc->type != PROG_OBJECT) ABORT_INTERP("Invalid object argument (2)"); if (vstring->type != PROG_STRING) ABORT_INTERP("Non-string argument (3)"); if (vstring->data.string) { add_proglock(program,player,PROGLOCK_READ); notify_except(player,vloc->data.objref,vexc->data.objref,vstring->data.string); if (interp_errored()) return; remove_proglock(program,player); } POP(3); } PRIM(notify_exclude) { ABORT_INTERP("NOTIFY_EXCLUDE unimplemented"); }