Example #1
0
const char *
mfn_fullname(MFUNARGS)
{
    dbref obj;
    
    obj = tp_compatible_mpi
    	? mesg_dbref_raw(player, what, perms, argv[0])
    	: mesg_dbref_local(player, what, perms, argv[0])
	;

    if (obj == UNKNOWN)
	ABORT_MPI("NAME","Match failed");
    if (obj == PERMDENIED)
	ABORT_MPI("NAME",NOPERM_MESG);
    if (obj == NOTHING) {
	strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
	strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
	strcpy(buf, "#HOME#");
	return buf;
    }
    strcpy(buf, RNAME(obj));
    return buf;
}
Example #2
0
const char *
mfn_name(MFUNARGS)
{
    char *ptr;
    // dbref obj = mesg_dbref_proximity(player, what, perms, argv[0]);
    dbref obj = mesg_dbref_raw(player, what, perms, argv[0]);

    if (obj == UNKNOWN)
        ABORT_MPI("NAME","Match failed.");
    if (obj == NOTHING) {
        strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
        strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
        strcpy(buf, "#HOME#");
	return buf;
    }
    if (!(Typeof(obj) == TYPE_PLAYER) &&
        !mesg_proximity_perms(player, perms, obj))
        ABORT_MPI("NAME","Permission denied.");
    strcpy(buf, RNAME(obj));
    if (Typeof(obj) == TYPE_EXIT) {
        ptr = index(buf, ';');
        if (ptr) *ptr = '\0';
    }
    return buf;
}
Example #3
0
const char *
mfn_name(MFUNARGS)
{
    char *ptr;
    dbref obj;

    obj = tp_compatible_mpi
    	? mesg_dbref_raw(player, what, perms, argv[0])
    	: mesg_dbref_local(player, what, perms, argv[0])
	;

    if (obj == UNKNOWN)
	ABORT_MPI("NAME","Match failed");
    if (obj == PERMDENIED)
	ABORT_MPI("NAME",NOPERM_MESG);
    if (obj == NOTHING) {
	strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
	strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
	strcpy(buf, "#HOME#");
	return buf;
    }
    strcpy(buf, RNAME(obj));
    if (Typeof(obj) == TYPE_EXIT) {
	ptr = index(buf, ';');
	if (ptr) *ptr = '\0';
    }
    return buf;
}
Example #4
0
const char *
mfn_force(MFUNARGS)
{
    char *nxt, *ptr;
    dbref obj = mesg_dbref_raw(player, what, perms, argv[0]);
    if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME)
        ABORT_MPI("FORCE","Failed match. (arg1)");
    if (obj == PERMDENIED)
        ABORT_MPI("FORCE","Permission denied. (arg1)");
    if (Typeof(obj) != TYPE_THING && Typeof(obj) != TYPE_PLAYER)
        ABORT_MPI("FORCE","Bad object reference. (arg1)");
    if (!*argv[1])
        ABORT_MPI("FORCE","Null command string. (arg2)");
    if (!tp_zombies && !Wizperms(perms))
        ABORT_MPI("FORCE","Permission Denied.");
    if (!Wizperms(perms)) {
	const char *ptr = RNAME(obj);
	char objname[BUFFER_LEN], *ptr2;
	dbref loc = getloc(obj);

	if (Typeof(obj) == TYPE_THING) {
	    if (FLAGS(obj) & DARK)
		ABORT_MPI("FORCE","Cannot force a dark puppet.");
	    if ((FLAGS(OWNER(obj)) & ZOMBIE))
		ABORT_MPI("FORCE","Permission denied.");
	    if (loc != NOTHING && (FLAGS(loc) & ZOMBIE) &&
		    Typeof(loc) == TYPE_ROOM)
		ABORT_MPI("FORCE","Cannot force a Puppet in a no-puppets room.");
	    for (ptr2 = objname; *ptr && !isspace(*ptr);)
		*(ptr2++) = *(ptr++);
	    *ptr2 = '\0';
	    if (lookup_player(objname) != NOTHING)
		ABORT_MPI("FORCE","Cannot force a thing named after a player.");
	}
	if (!(FLAGS(obj) & XFORCIBLE)) {
	    ABORT_MPI("FORCE","Permission denied: forced object not @set Xforcible.");
	}
	if (!test_lock_false_default(perms, obj, "@/flk")) {
	    ABORT_MPI("FORCE","Permission denied: Object not force-locked to trigger.");
	}
    }
    if (God(obj))
	ABORT_MPI("FORCE","Permission denied: You can't force God.");
    if (force_level)
	ABORT_MPI("FORCE","Permission denied: You can't force recursively.");
    strcpy(buf, argv[1]);
    ptr = buf;
    do {
        nxt = index(ptr, '\r');
        if (nxt) *nxt++ = '\0';
        force_level++;
        if (*ptr) process_command(obj, ptr);
        force_level--;
        ptr = nxt;
    } while (ptr);
    *buf = '\0';
    return "";
}
char *
ref2str(dbref obj, char *buf)
{
    if (obj < -3 || obj >= db_top) {
        sprintf(buf, "Bad");
        return buf;
    }

    if (obj >= 0 && Typeof(obj) == TYPE_PLAYER) {
        sprintf(buf, "*%s", RNAME(obj));
    } else {
        sprintf(buf, "#%d", obj);
    }
    return buf;
}
Example #6
0
const char *
mfn_fullname(MFUNARGS)
{
    dbref obj = mesg_dbref_proximity(player, what, perms, argv[0]);

    if (obj == UNKNOWN)
        ABORT_MPI("NAME","Match failed.");
    if (obj == PERMDENIED)
        ABORT_MPI("NAME","Permission denied.");
    if (obj == NOTHING) {
        strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
        strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
        strcpy(buf, "#HOME#");
	return buf;
    }
    strcpy(buf, RNAME(obj));
    return buf;
}
Example #7
0
inline void print_inst_ST_RS_IM13_RD(char *mnemonic, int rd, int rs1, int im13)
{
    DBG("%s %s [%s + 0x%x]\n", mnemonic, RNAME(rd), RNAME(rs1), im13);
}
Example #8
0
inline void print_inst_ST_RS_RS_RD(char *mnemonic, int rd,  int rs1, int rs2)
{
    DBG("%s [%s + %s], %s\n", mnemonic, RNAME(rd), RNAME(rs1), RNAME(rs2));
}
Example #9
0
inline void print_inst_LS_RS_IM13_RD(char *mnemonic, int rs1, int im13, int rd)
{
    DBG("%s [%s + 0x%x], %s\n", mnemonic, RNAME(rs1), im13, RNAME(rd));
}
Example #10
0
void print_inst_RD_IMM(char *mnemonic, int rd, int im)
{
    DBG("%s %s, [0x%x]\n", mnemonic, RNAME(rd), im);
}
Example #11
0
void print_inst_IMM_RD(char *mnemonic, int im, int rd)
{
    DBG("%s 0x%x, %s\n", mnemonic, im, RNAME(rd));
}
Example #12
0
inline void print_inst_RS_RS_RD(char *mnemonic, int rs1, int rs2, int rd)
{
    DBG("%s %s, %s, %s\n", mnemonic, RNAME(rs1), RNAME(rs2), RNAME(rd));
}
Example #13
0
inline void print_inst_RD(char *mnemonic, int rd)
{
    DBG("%s %s\n", mnemonic, RNAME(rd));
}