コード例 #1
0
ファイル: p_connects.c プロジェクト: GlowMUCK/GlowMUCK
void 
prim_online(PRIM_PROTOTYPE)
{
    CHECKOP(0);
    if (mlev < (tp_compatible_muf ? LM3 : LM2))
	abort_interp(tp_compatible_muf ? "M3 prim" : "M2 prim");
    result = pcount();
    CHECKOFLOW(result + 1);
    while (result) {
	ref = pdbref(result--);
	PushObject(ref);
    }
    result = pcount();
    PushInt(result);
}
コード例 #2
0
ファイル: p_connects.c プロジェクト: GlowMUCK/GlowMUCK
void 
prim_condbref(PRIM_PROTOTYPE)
{
    /* int -- dbref */
    CHECKOP(1);
    oper1 = POP();
    if (mlev < (tp_compatible_muf ? LM3 : LM2))
	abort_interp(tp_compatible_muf ? "M3 prim" : "M2 prim");
    if (oper1->type != PROG_INTEGER)
	abort_interp("Argument not an integer (1)");
    result = oper1->data.number;
    if ((result < 1) || (result > pcount()))
	abort_interp("Invalid connection number (1)");
    result = pdbref(result);
    CHECKOFLOW(1);
    CLEAR(oper1);
    PushObject(result);
}
コード例 #3
0
ファイル: mfuns.c プロジェクト: rhencke/fuzzball
const char *
mfn_online(MFUNARGS)
{
	int list_limit = MAX_MFUN_LIST_LEN;
	int count = pcount();
	char buf2[BUFFER_LEN];

	if (!(mesgtyp & MPI_ISBLESSED))
		ABORT_MPI("ONLINE", "Permission denied.");
	*buf = '\0';
	while (count && list_limit--) {
		if (*buf)
			strcatn(buf, BUFFER_LEN, "\r");
		ref2str(pdbref(count), buf2, sizeof(buf2));
		if ((strlen(buf) + strlen(buf2)) >= (BUFFER_LEN - 3))
			break;
		strcatn(buf, BUFFER_LEN, buf2);
		count--;
	}
	return buf;
}