Esempio n. 1
0
const char *
mfn_ontime(MFUNARGS)
{
	dbref obj = mesg_dbref_raw(descr, player, what, perms, argv[0]);
	int conn;

	if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME)
		return "-1";
	if (obj == PERMDENIED)
		ABORT_MPI("ONTIME", "Permission denied.");
	if (Typeof(obj) != TYPE_PLAYER)
		obj = OWNER(obj);
	conn = least_idle_player_descr(obj);
	if (!conn)
		return "-1";
	snprintf(buf, BUFFER_LEN, "%d", pontime(conn));
	return buf;
}
Esempio n. 2
0
void 
prim_contime(PRIM_PROTOTYPE)
{
    /* int -- int */
    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 = pontime(result);
    CHECKOFLOW(1);
    CLEAR(oper1);
    PushInt(result);
}