Пример #1
0
void
do_pose(int descr, dbref player, const char *message)
{
    dbref loc;
    char buf[BUFFER_LEN], buf2[BUFFER_LEN];

    if ((loc = getloc(player)) == NOTHING)
        return;
    tct(message, buf2);
    /* notify everybody */
    sprintf(buf, "^SAY/POSE^%s %s", PNAME(player), buf2);
    anotify_except(DBFETCH(loc)->contents, NOTHING, buf, player);
}
Пример #2
0
void 
do_pose(dbref player, const char *message)
{
    dbref   loc;
    char    buf[BUFFER_LEN], buf2[BUFFER_LEN];

    if ((loc = getloc(player)) == NOTHING)
	return;

    do_parse_mesg(player, player, message, "(pose)", buf, MPI_ISPRIVATE);
    tct(buf,buf2);

    /* notify everybody */
    sprintf(buf, CAQUA "%s%s%.3900s", PNAME(player),
		isalpha(buf2[0]) ? " " : "", buf2);
    anotify_except(DBFETCH(loc)->contents, NOTHING, buf, player);
}
Пример #3
0
void
do_say(int descr, dbref player, const char *message)
{
    dbref loc;
    char buf[BUFFER_LEN], buf2[BUFFER_LEN];

    if ((loc = getloc(player)) == NOTHING)
        return;
    tct(message, buf2);
    /* notify everybody */
    sprintf(buf, "^SAY/POSE^You say, ^SAY/QUOTES^\"^SAY/TEXT^%s^SAY/QUOTES^\"",
            buf2);
    anotify(player, buf);

    sprintf(buf, "^SAY/POSE^%s says, ^SAY/QUOTES^\"^SAY/TEXT^%s^SAY/QUOTES^\"",
            PNAME(player), buf2);
    anotify_except(DBFETCH(loc)->contents, player, buf, player);
}
Пример #4
0
void 
do_say(dbref player, const char *message)
{
    dbref   loc;
    char    buf[BUFFER_LEN], buf2[BUFFER_LEN];

    if ((loc = getloc(player)) == NOTHING)
	return;

    do_parse_mesg(player, player, message, "(say)", buf, MPI_ISPRIVATE);
    tct(buf,buf2);

    /* Notify player */
    sprintf(buf, CAQUA "You say, \"" CYELLOW "%.3900s" CAQUA "\"", buf2);
    anotify(player, buf);

    /* notify everybody else */
    sprintf(buf, CAQUA "%s says, \"" CYELLOW "%.3900s" CAQUA "\"", PNAME(player), buf2);
    anotify_except(DBFETCH(loc)->contents, player, buf, player);
}
Пример #5
0
dbref
create_player(const char *name, const char *password)
{
    char buf[80];
    dbref player;

    if (!ok_player_name(name) || !ok_password(password))
        return NOTHING;
    if (!tp_building || tp_db_readonly) return NOTHING;

    /* else he doesn't already exist, create him */
    player = new_object();

    /* initialize everything */
    NAME(player) = alloc_string(name);
    FLAGS(player) = TYPE_PLAYER | PCREATE_FLAGS;
    FLAG2(player) = PCREATE_FLAG2;
    DBFETCH(player)->location = RootRoom;	/* home */
    OWNER(player) = player;
    DBFETCH(player)->sp.player.home = RootRoom;
    DBFETCH(player)->exits = NOTHING;
    DBFETCH(player)->sp.player.pennies = tp_start_pennies;
    DBFETCH(player)->sp.player.password = alloc_string(password);
    DBFETCH(player)->sp.player.curr_prog = NOTHING;
    DBFETCH(player)->sp.player.insert_mode = 0;

    /* link him to tp_player_start */
    PUSH(player, DBFETCH(RootRoom)->contents);
    add_player(player);
    DBDIRTY(player);
    DBDIRTY(RootRoom);

    sprintf(buf, CNOTE "%s is born!", PNAME(player));
    anotify_except(DBFETCH(RootRoom)->contents, NOTHING, buf, player);

    return player;
}
Пример #6
0
dbref
create_player(dbref creator, const char *name, const char *password)
{
    char buf[BUFFER_LEN];

    struct object *newp;

    dbref player;

    if (!ok_player_name(name) || !ok_password(password) || tp_db_readonly)
        return NOTHING;

    /* remove any existing alias with this name */
    clear_alias(0, name);

    /* else he doesn't already exist, create him */
    player = new_object(creator);
    newp = DBFETCH(player);

    /* initialize everything */
    NAME(player) = alloc_string(name);
    FLAGS(player) = TYPE_PLAYER;

    if (OkObj(tp_player_prototype)
        && (Typeof(tp_player_prototype) == TYPE_PLAYER)) {
        FLAGS(player) = FLAGS(tp_player_prototype);
        FLAG2(player) = FLAG2(tp_player_prototype);

        if (tp_pcreate_copy_props) {
            newp->properties = copy_prop(tp_player_prototype);
#ifdef DISKBASE
            newp->propsfpos = 0;
            newp->propsmode = PROPS_UNLOADED;
            newp->propstime = 0;
            newp->nextold = NOTHING;
            newp->prevold = NOTHING;
            dirtyprops(player);
#endif
        }
    }

    if (OkObj(tp_player_start)) {
        DBFETCH(player)->location = tp_player_start;
        DBFETCH(player)->sp.player.home = tp_player_start;
    } else {
        DBFETCH(player)->location = GLOBAL_ENVIRONMENT;
        DBFETCH(player)->sp.player.home = GLOBAL_ENVIRONMENT;
    }

    OWNER(player) = player;
    newp->exits = NOTHING;
    newp->sp.player.pennies = tp_start_pennies;
    newp->sp.player.password = NULL; /* this has to stay here. -hinoserm */
    newp->sp.player.curr_prog = NOTHING;
    newp->sp.player.insert_mode = 0;
#ifdef IGNORE_SUPPORT
    newp->sp.player.ignoretime = 0;
#endif /* IGNORE_SUPPORT */

    /* set password */
    set_password(player, password);

    /* link him to tp_player_start */
    PUSH(player, DBFETCH(tp_player_start)->contents);
    add_player(player);
    DBDIRTY(player);
    DBDIRTY(tp_player_start);

    sprintf(buf, CNOTE "%s is born!", NAME(player));
    anotify_except(DBFETCH(tp_player_start)->contents, NOTHING, buf, player);

    return player;
}