int do_echo_to(string str)
{
  string who, what;
  object ob;

  // Radix cause Piper & Taniwha wanted it...
  if (this_player(1)->query_object_type() == O_CODER)
  {
    notify_fail("Echoto no esta disponible para programadores.\n");
    return(0);
  }

  if (!strlen(str))
  {
    notify_fail("Sintaxis: echoto <jugador> <texto>\n");
    return 0;
  }

  if (sscanf(str, "%s %s", who, what) != 2) 
  {
    notify_fail("Sintaxis: echoto <jugador> <texto>\n");
    return 0;
  }

  who = lower_case(who);
  who = (string)this_player()->expand_nickname(who);
  ob = find_player(who);
  
  if (!ob)
  {
    notify_fail("No se ha podido encontrar a '"+who+"'.\n");
    return 0;
  }
  
  log_file("echoes", this_player()->query_cap_name()+
    " echoto's "+who+": " +what+" ["+ctime(time(),4)+"]\n");
  
  what += "%^RESET%^";
  write("Haces echo a " + who + ":\n" + what + "\n");
  event(ob, "player_echo_to", what + "\n");

  return 1;
} /* do_echo_to() */
Example #2
0
int main(object me, string str)
{
   object ob, where, *ob_list;
   int i;

   if (!str)
     return where_all();
        notify_fail("峺綜鯉塀�where <繁麗賜亀兆>\n"); 
   ob = find_player(str);
   if( !ob ) ob = find_living(str);

   if( !ob ) ob = LOGIN_D->find_body(str);
   /*  added by mon. 2/23/97 */

//   if( !ob || !me->visible(ob)) {
   if( !ob ) {
     str = resolve_path(me->query("cwd"), str);
     ob_list = children(str);
     
     if(sizeof(ob_list)<1)
         return notify_fail("Can't find such player or file.\n");

     for(i=0; i<sizeof(ob_list); i++) {
        if( !ob = environment(ob_list[i]) ) continue;
        printf("%O\n", ob );
     }
     return 1;
   }

//   if (!ob) return notify_fail("�壓短宸倖繁。\n");

   where = environment(ob);
   if (!where) return notify_fail("宸倖繁("+file_name(ob)+
      ")音岑祇壓椎戦勳。。。\n");
   printf("%s(%s)�壓壓%s(%s).\n",
     (string)ob->name(),
     (string)ob->query("id"),
     undefinedp(where->query("short"))?
                  where->short():
                  where->query("short"),
     (string)file_name(where));
   return 1;
}
Example #3
0
int main(object me, string arg)
{
    string name, reason;
    int day;
    object ob;

    if( me!=this_player(1) )
        return notify_fail("你没有权力使用这个指令。\n");

    if( !arg ) return notify_fail(SYNTAX);

    if( sscanf(arg, "%d", day) && day >= 10) return do_purge_wizards(day, 1);

    if( sscanf(arg, "look %d", day) ) return do_purge_wizards(day, 0);

    if( sscanf(arg, "%s because %s", name, reason)!=2 )
        return notify_fail(SYNTAX);

    seteuid(getuid());
    if( file_size(DATA_DIR + "login/" + name[0..0] + "/" + name + __SAVE_EXTENSION__)<0 )
        return notify_fail("没有这位使用者。\n");

    if(SECURITY_D->get_status(name) == "(player)")
        return notify_fail("这个指令只能 purge 巫师。\n");

    if(SECURITY_D->get_status(name) == "(admin)"
            || SECURITY_D->get_status(name) == "(guest)"
            || SECURITY_D->get_status(name) == "(manager)")
        return notify_fail("这个指令不能 purge ADMIN 以上的巫师。\n");

    if(ob=find_player(name))
        destruct(ob);

    SECURITY_D->set_player(name);
    rm(DATA_DIR + "login/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
    rm(DATA_DIR + "user/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
    write( "使用者 " + capitalize(name) + " 删除掉了。\n");
    log_file("static/PURGE_WIZ", sprintf("[%s] %s purged %s because %s.\n",
                                         ctime(time())[0..15], geteuid(this_player(1)), name, reason));

    return 1;
}
Example #4
0
File: hp.c Project: heypnus/xkx2001
int main(object me, string arg)
{
	object ob;
	mapping my;
 
	seteuid(getuid(me));
 
	if(!arg)
		ob = me;
	else if (wizardp(me)) {
		ob = present(arg, environment(me));
		if (!ob) ob = find_player(arg);
		if (!ob) ob = find_living(arg);
        if (!ob) return notify_fail("你要察看谁的状态?\n");
	} else
		return notify_fail("只有巫师能察看别人的状态。\n");
 
	my = ob->query_entire_dbase();
 
    printf(" 精: %s%4d/ %4d %s(%3d%%)" NOR "    精力: %s%4d / %4d (+%d)\n" NOR,
		status_color(my["jing"], my["eff_jing"]), my["jing"], my["eff_jing"],
		status_color(my["eff_jing"], my["max_jing"]),	my["eff_jing"] * 100 / my["max_jing"],
		status_color(my["jingli"], my["max_jingli"]),	my["jingli"], my["max_jingli"],
		my["jiajin"] );
    printf(" 气: %s%4d/ %4d %s(%3d%%)" NOR "    内力: %s%4d / %4d (+%d)\n" NOR,
		status_color(my["qi"], my["eff_qi"]), my["qi"], my["eff_qi"],
		status_color(my["eff_qi"], my["max_qi"]), my["eff_qi"] * 100 / my["max_qi"],
		status_color(my["neili"], my["max_neili"]), my["neili"], my["max_neili"],
		my["jiali"] );
    printf(" 食物: %s%4d/ %4d      " NOR "   潜能: %s%4d / %4d\n" NOR,
        status_color(my["food"], ob->max_food_capacity()),
        my["food"], ob->max_food_capacity(),
        HIY,
        (int)ob->query("potential"),
        (int)ob->query("max_potential"));
    printf(" 饮水: %s%4d/ %4d      " NOR "   经验: %s%d\n" NOR,
        status_color(my["water"], ob->max_water_capacity()),
        my["water"], ob->max_water_capacity(),
        HIM,
        my["combat_exp"] );
	return 1;
}
Example #5
0
void die()
{
        object ob, me, killer;

        me = this_object();
        
        if (! ob = find_player(me->query("waiting"))) 
                find_living(me->query("waiting"));

        if (ob && ob->query("slough/task"))
        {
                killer = find_living(ob->query("slough/id"));
                if (killer) 
                        killer->set_temp("baixing_killed", 1);
        }

        message_vision(HIC "$N惨号一声,倒在地上死了!\n" NOR, me);
        remove_call_out("escape_me");
        destruct(me);
}
Example #6
0
int register_user(string wizid, string name, string email)
{
	object ob, body;

       	if( objectp(body = find_player(name)) && geteuid(body)==name ) 
		return notify_fail("你只能在玩家离线时才能给他登记。\n");

	ob = new(LOGIN_OB);
	ob->set("id", name);
	if (!ob->restore())
		return 0;
	else {
		ob->set("registered", 1);
		ob->set("email", email);
		ob->set("registered_by", wizid);
		ob->save();
		destruct(ob);
		return 1; 
	}
}
Example #7
0
int
cmd_dbxwhere(string str) {
    mapping error;
    object ob;
    int i;

    if (str) {
        ob = find_player(str);
        if (!ob) {
            write("No such player.");
            return 1;
        }
    } else
        ob = this_player();
    if (error = (mapping)ob->query_error()) {

        printf("%s\n", master()->standard_trace(error, 1));
    } else write("No error.\n");
    return 1;
}
Example #8
0
int cmd_loadup(string who) {
   int i;
   object *u, ob;
   if(!who || who=="") return notify_fail(SYNTAX);
   if(find_player(who)) return notify_fail(who+" is online FP=1.\n");
   u=children("/std/user");
   for(i=0; i < sizeof(u); i++) {
     if(u[i]->query_name() == who) return notify_fail(who+" is online FP=0.\n");
   }
   ob=new("/std/user");
   seteuid("Root");
   if(geteuid() != "Root") return notify_fail("Unable to get root access to perform action.\n");
   ob->set_name(who);
   master()->load_player_from_file(who, ob);
   ob->set_invis();
   ob->setup();
   ob->net_dead();
   write(ob->query_name()+" has been loaded into "+identify(ob));
   return 1;
}
Example #9
0
int main( string str ) {
   string pname, comm;
   object ob;

   if(this_player()->query_level() < WIZLEVEL) {
      msg("==> [Error] Access denied");
      return 0;
   }

   if(!str || sscanf(str, "%s %s", pname, comm) != 2) {
      msg("==> [Format] force player command");
      return 1;
   }

   ob = find_player(pname);
   if( !ob )  ob = find_living(pname);
   if(!ob) {
      msg("==> [Error] Could not find that player or creature.");
      return 1;
   }

   if(ob->query_level() < this_player()->query_level() || this_player()->query_level() >= ADMLEVEL ) {
      set_actor( this_player() );
      set_listener( ob );
      msg_object(ob, "~Name forces you to "+comm+".");
      msg("You force them to "+comm);
      ob->receive( "\n"+this_player()->query_specific()+" forces you to '"+comm+"':\n" );
      command(comm, ob);
      if( ob )
         ob->receive( ob->query_prompt() );
   } else {
      msg("==> [Error] Access denied.");
       set_actor( this_player() );
      set_listener( ob );
      msg_object(ob, "~CWRN~Name tried to force you to ~CCOM"+comm+"~CWRN.~CDEF");
      msg("~CWRNThey have been notified of your attempt.~CDEF");

   }

   return 1;
}
Example #10
0
void read_call_back(int sock,string s,string peer)
{
  int req, port;
  string msg, full_data, id, who, ip, data;
  object player;

#ifdef DEBUG
  tell_room(environment(),"Identd got: "+s+" from "+peer+".\n");
#endif
  if(peer != IDENTSERVER) return;

  if(sscanf(s,"%d %d%*s:%s:%*s:%s", req, port, msg, full_data) == 6)
  {
    if(sscanf(lower_case(msg),"%*serror%*s"))
      return;
    
    sscanf(full_data,"%s\r",full_data);
    sscanf(full_data,"%s\n",full_data);
    sscanf(full_data," %s",full_data);
    sscanf(data=full_data,"%s,",data);
    sscanf(data,"%s ",data);
    if(data[0]=='[' && data[-1]==']')
    {
      data="[]";
    }

    id=requests[req];
    if(!id) return;
    sscanf(id,"%s@%s",who,ip);
    player=find_player(who);
    if(!player) return;
    if(query_ip_number(player) != ip) return;
    if(query_ip_port(player) != port+"") return;

    ident_info[id]=data;
    requests=m_delete(requests,id);
    requests=m_delete(requests,req);
    player->set_ident(full_data);
    tell_room(environment(),"The identdaemon finds out that "+capitalize(who)+" is called "+full_data+".\n");
  }
}
Example #11
0
void req_handler(mixed *packet)
{
    object o_user;

    if(!packet[I3_T_USER] || !(o_user = find_player(packet[I3_T_USER])))
    {
        find_object(I3_ERROR)->send_error(
          0,
          packet[I3_O_MUD],
          packet[I3_O_USER],
          "unk-user",
          packet[I3_T_USER] + "@" + packet[I3_T_MUD] + " was not found!",
          packet
        );

        return;
    }

    tell_object(o_user, "%^BOLD%^BEEP!%^RESET%^%^BEEP%^\n");
    tell_object(o_user, capitalize(packet[6]) + "@" + packet[I3_O_MUD] + " just beeped you!\n");
}
void		display_info_player(char *str, t_player *player, int flag)
{
    int i;
    int j;
    char nb[10];

    while (str[i])
    {
        while (str[i] >= '0' && str[i] <= '9')
        {
            nb[j] = str[i];
            i++;
            j++;
        }
        i++;
    }
    nb[j] = '\0';
    if (j > 10)
        return ;
    find_player(player, atoi(nb), flag);
}
Example #13
0
int main(object me, string arg)
{
        object ob;
        object room;
        string name,reason;
        if (!wizardp(me)) return notify_fail("你没有权力使用这个指令。\n");
        if (!arg) return notify_fail(SYNTAX);
        if (sscanf(arg, "%s because %s", name, reason)!=2 )
                return notify_fail(SYNTAX);
        ob = find_player(name);
        if (!ob) return notify_fail("找不到这个玩家。\n");
        message_vision("$N手一挥,一阵微风将$n吹入风云监狱...\n",me,ob);
        seteuid( geteuid(this_player(1)) );
        if(!(room =find_object(AREA_WIZ"jail")))
        room = load_object(AREA_WIZ"jail");
        ob->move(room);
        ob -> save();
        log_file("static/imprison", sprintf("[%s] %s imprison %s(%s) because %s.\n",
                ctime(time())[0..15], me->query("id"), ob->query("name"), ob->query("id"), reason));    
        return 1;
}
Example #14
0
File: dntg.c Project: lostsnow/dtxy
int main(object me, string arg)
{
    object ob;

    if( !arg ) {
        ob = me;
        name = "你";
    } else if (wizardp (me)) {
        ob = find_player(arg);
        if(!ob) ob = find_living(arg);
        if(!ob) ob = LOGIN_D->find_body(arg);
        if(!ob || !me->visible(ob)) return notify_fail("没有这个人。\n");
        name = ob->query("name");
    } else
        return 0;

    telling1(ob);
    telling2(ob);

    return 1;
}
Example #15
0
File: support.c Project: xxx/cdlib
/*
 * support_a
 */
int support_a(mapping p)
{
    string id, tx;
    object ob;

    id = p["ANSWERID"];
    if (!strlen(id))
	return 0;

    ob = find_player(id);
    if (ob)
    {
	tx = p["CMD"] + " " +
	    (strlen(p["PARAM"]) ? " (" + p["PARAM"] + ") " : "");
	if (p["SUPPORTED"])
	    tell_object(ob, p["NAME"] + " supports " + tx + "\n");
	else
	    tell_object(ob, p["NAME"] + " does not support " + tx + "\n");
    }
    return 1;
}
void eventReceiveError(mixed *packet) {
    object ob;
    string error_code, mud, target, msg;

    if( packet[5] ) {
	target = (string)packet[5];
	if( !(ob = find_player(target)) ) return;
    }
    mud = packet[2];
    error_code = packet[6];
    msg = packet[7];
    packet = packet[8];
    switch(error_code) {
	case "unk-dst": case "not-imp": case "unk-src": case "bad-pkt": case "bad-proto":
	log_file("errors/intermud", error_code + ": " + msg + "\n");
        log_file("errors/intermud", "Name of sending mud: "+mud+"\n");
        if (!packet) return;
        log_file("errors/intermud", "Offending packet: "+
            sprintf("%O\n", packet));
	return;
        case "unk-channel":
        log_file("errors/intermud", error_code + ": " + msg + "\n");
        if (!packet) return;
        log_file("errors/intermud", "Channel name: "+packet[6]+"\n");
	case "unk-type":
    	log_file("errors/intermud", 
            error_code + ": " + msg + "\n");
        log_file("errors/intermud", 
            "Name of sending mud: "+mud+"\n");
        if (!packet) return;
        log_file( "errors/intermud", 
            "Type of offending packet: "+packet[0]+"\n");
	return;
	case "unk-user":
	if( !ob ) return;
	tell_object(ob, (msg ? msg : "Unknown user reported from " + mud +
			   "."));
	return;
    }
}
Example #17
0
int main(object me, string arg)
{
        string name, reason;
        int day;
        object ob;

        if( me!=this_player(1))
                return notify_fail("你没有权力使用这个指令。\n");

        if( !arg ) return notify_fail(SYNTAX);

        if (arg == "(player)") return do_purge_all_players();
        if( sscanf(arg, "%d", day) && day >= 0) return do_purge_players(day);

        if( sscanf(arg, "%s because %s", name, reason)!=2 )
                return notify_fail(SYNTAX);

        if (SECURITY_D->get_status(name) != "(player)")
                return notify_fail("请用 purgewiz 的指令来 purge 巫师。\n");

        seteuid(getuid());
        if( file_size(DATA_DIR + "login/" + name[0..0] + "/" + name + __SAVE_EXTENSION__)<0 )
                return notify_fail("没有这位使用者。\n");

        if(ob=find_player(name))
                destruct(ob);

        cp(DATA_DIR + "login/" + name[0..0] + "/" + name + __SAVE_EXTENSION__, "/data/backup/login/" +  name[0..0] + "/" + name +__SAVE_EXTENSION__);
        cp(DATA_DIR + "user/" + name[0..0] + "/" + name + __SAVE_EXTENSION__, "/data/backup/user/" +  name[0..0] + "/" + name + __SAVE_EXTENSION__);
        rm(DATA_DIR + "login/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
        rm(DATA_DIR + "user/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
        write( "使用者 " + capitalize(name) + " 删除掉了。\n");

tell_object(users(),"【"HIC"闲聊"NOR"】"HIC"清秀小岚美眉(Anmy)说道:"HIC+ capitalize(name) +HIC"受到"HIW"天谴"HIC",消失于狂想空间了。\n"NOR);
        log_file("static/PURGE", sprintf("[%s] %s purged %s because %s.\n",
                ctime(time())[0..15], geteuid(this_player(1)), name, reason));

        return 1;
}
Example #18
0
int remote_tell(string cname, string from, string mud, string to, string msg)
{
	object ob;
	
	if( ob = find_player(to) ) {
		if( wizardp(ob) && ob->query("env/block")=="YES" )
			return 0;
			
		if( ob->query("env/block")=="ALL" )
    		    return notify_fail(ob->name()+"现在不想和人说话。\n");

		if( cname )
			tell_object(ob, sprintf(HIG "%s(%s@%s)千里传音告诉你:%s\n" NOR,
				cname, capitalize(from), mud, msg ));
		else
			tell_object(ob, sprintf(HIG "%s@%s 告诉你:%s\n" NOR,
				capitalize(from), mud, msg ));
		ob->set_temp("reply", from + "@" + mud);
		return 1;
	} else
		return 0;
}
Example #19
0
File: trans.c Project: Elohim/FGmud
mixed cmd(string args) {
    object ob;

    if( !args || args == "" ) return "Trans whom?";
    if( !(ob = find_player(convert_name(args))) && !(ob = find_living(args)) )
        return "No such being exists anywhere presently.";
    if( environment(ob) == environment(this_player()) ) 
        return ob->GetCapName() + " is right here.";
    if(archp(ob) && !archp(this_player())){
        write("You can't trans an admin.");
        tell_player(ob, this_player()->GetName()+" just tried to trans you.");
        return 1;
    }
    ob->SetProperty("ReturnSite",base_name(environment(ob)));
    message("system", "You have been summoned by " + 
            this_player()->GetName() + ".", ob);
    if( !(ob->eventMoveLiving(environment(this_player()))) )
        return "Failed to move " + ob->GetCapName() + ".";
    else message("system", "You trans " + ob->GetCapName() + 
            " to you.", this_player());
    return 1;
}
Example #20
0
mixed cmd(string str) {
    object target;
    int arch = adminp(this_player());
    int ret, curr;

    if(!sizeof(str)) str = "me";
    if(str == "me") str = this_player()->GetKeyName();
    if(!target = present(str, environment(this_player()))){
        if(arch && (target = find_player(str))){
            write("User found.");
        }
        else {
            write("They're not here.");
            return 1;
        }
    }
    if(living(target) && !arch && target != this_player()){
        write("You can only unanchor yourself with this command.");
        return 1;
    }
    if(!(curr = target->GetAnchored())){
        if(target != this_player()) str = nominative(target)+"'s";
        else str = "You're ";
        write(capitalize(str) + " already unanchored.");
        return 1;
    }
    ret = target->SetAnchored(0);
    if(ret == curr){
        write("Nothing happens");
        return 1;
    }
    if(target != this_player()){ 
        tell_object(target, capitalize(this_player()->GetName())+
                " unanchors you.");
    }
    else str = "yourself";
    write("You unanchor "+str+".");
    return 1;
}
Example #21
0
int main(object me, string arg)
{
  object ob, body;
  int    r=0;

  if (arg) arg = lower_case(arg);

  if( !arg )
    return notify_fail("fingers <人名>\n");
  if ( !(ob = find_player(arg)) ) {
    ob = new(LOGIN_OB);
    ob->set("id", arg);
    if ( !ob->restore() )
      return notify_fail ("没有这个玩家。\n");
    body = LOGIN_D->make_body(ob);
    if (body->restore()) ob = body;
    else return notify_fail (arg+" 的档案出问题了, 请检查看看.\n");
    r = 1;
  }
  "/cmds/std/score"->wiz_score(ob);
  if (r) destruct(ob);
  return 1;
}
Example #22
0
int main(object me, string arg)
{
  object obj;

  if (!arg)
    return notify_fail("你要接受谁的公开邀请?\n");

  obj = find_player(arg);
  if (!obj)
    obj = find_living(arg);    
  if (!obj)
    obj = LOGIN_D->find_body(arg);
  if (!obj)
    return notify_fail("没有这个人。\n");

  if (obj->query_temp("invite") != "public")
    return notify_fail(obj->query("name")+"现在并没有公开邀请别人。\n");

  tell_object (me,"你接受"+obj->query("name")+"的公开邀请。\n");
  tell_object (obj, me->query("name")+"现在接受你的公开邀请。\n");
  me->set_temp("accept",obj->query("id"));
  return 1;
}
Example #23
0
/** Converts a reference into an object pointer. You should only
 * pass in one parameter; the second \a rcheck parameter is used
 * internally.
 *
 * \return The object referenced by \a str, or 0 on failure.
 */
varargs object find_thing(string str, status rcheck) {
   object ob;
   string a, b;

   if(!str) return 0;
   if( this_player() ) {
      ob = present(str, this_player());
      if(environment(this_player())) {  /* Believe it or not, this was necessary. */
         if(!ob) ob = present(str, environment(this_player()));
         if(!ob && (environment(this_player())->id(str) == environment(this_player()) || str == "env"))
            ob = environment(this_player());
      }
   }
   if(!ob) {
      ob = find_player(str);
   }
   if(!ob) {
      ob = find_living(str);
   }
   if(!ob) {
      ob = find_object(str);
   }
   if(!ob) {
      ob = find_objectref(str);
   }
   if(!ob && sscanf(str, "%s %s",a,b)!=2 && file_exists(str+".c") ) {
      call_other(str, "this_function_does_not_exist\n");
      ob = find_object(str);
   }
   if(!ob && str == "me") ob = this_player();
   if(!ob) ob = find_room( str, this_player() );
   if(!ob) ob = single_present( str, this_player() );
   if(!ob) ob = single_present( str, environment(this_player()) );
   if(!rcheck && !ob && this_player() )
      ob = find_thing(this_player()->make_path_absolute(str), 1);
   return ob;
}
Example #24
0
int main(object me, string arg)
{
    object ob;

    if( !arg ) {
        if( objectp(ob = query_snooping(me)) )
            write("你现在正在监听" + ob->query("name") + "所收到的讯息。\n");
        return 1;
    } else if( arg=="none" ) {
        if( objectp(ob = query_snooping(me))
                &&	wiz_level(ob) >= wiz_level(me) )
            tell_object(ob, HIW + me->name(1) + "停止监听你所收到的讯息。\n" NOR);
        snoop(me);
        write("Ok.\n");
        return 1;
    }

    ob = find_player(arg);
    if(!ob) ob = find_living(arg);
    if(!ob || !me->visible(ob)) return notify_fail("没有这个人。\n");

    if( wizhood(me) != "(admin)"
            &&	wiz_level(me) <= wiz_level(ob) )
        return notify_fail("你没有监听" + ob->name() + "所收听讯息的权利。\n");

    if( me==ob ) return notify_fail("请用 snoop none 解除监听。\n");

    snoop(me, ob);
    write("你现在开始窃听" + ob->name(1) + "所收到的讯息。\n");
    if( userp(ob) ) log_file("SNOOP_PLAYER",
                                 sprintf("%s(%s) snoops %s on %s.\n", me->name(1), geteuid(me), ob->name(1),
                                         ctime(time()) ) );
    if( wizardp(ob) && wizhood(me) != "(admin)")
        tell_object(ob, HIW + me->name(1) + "开始监听你所收到的讯息。\n" + NOR);

    return 1;
}
Example #25
0
int cmd_userid(string str) {
   mixed *all;
   object who;
   string name;
   int loop;
 
   seteuid(getuid(this_object()));
 
   if(!adminp(geteuid(this_player()))) return 0;
 
   if(!str || str == "") {
  
      all = users();

      write(underscore("Present Active User's Source Accounts") + "\n\n");
 
      for(loop=0; loop<sizeof(all); loop++) {
	name = (string)all[loop]->link_data("cap_name");
	if(!name) continue;

	if(strlen(name) > 6) 
	  write(" " + name + "\t" + get_userid(all[loop]) + "\n");
	else write(" " + name + "\t\t" + get_userid(all[loop]) + "\n");
      }

   return 1; }
 
   who = find_player(str);
 
   if(!who) {
     notify_fail("Userid: No such user is presently online.\n");
   return 0; }
 
   write((string)who->link_data("cap_name") + "'s userid is " +
	 lower_case(get_userid(who)) + ".\n");
 
return 1; }
Example #26
0
int cmd(string str) {
    object ob;
    string who;
    int num, i;
    string ret = "";

    if (!str || (sscanf(str, "%d", num)==0 && sscanf(str, "%s %d", who, num)==0)) {
        write("dbxframe [who] <frame>");
        return 1;
    }
    if (who) {
        ob = find_player(who);
        if (!ob) {
            write("No such player.");
            return 1;
        }
    }
    else ob = this_player();
    frame = ob->GetLastError();
    if (!frame) {
        write("No error.");
        return 1;
    }
    if (num<0 || num>=sizeof(frame["trace"]))
        return notify_fail("No such frame.\n");
    frame = frame["trace"][num];

    ret += sprintf("------\n%s:%i - %s(%s)\n", frame["program"], frame["line"],
            frame["function"],frame["arguments"]);
    ret += sprintf("----------------------------------------------------------------\n");
    ret += sprintf("%s=>%s%s",
            unguarded( (: read_file(frame["program"], frame["line"]-5, 5) :) ),
            unguarded( (: read_file(frame["program"], frame["line"], 1) :) ),
            unguarded( (: read_file(frame["program"], frame["line"]+1, 5) :) ));
    tell_object(this_player(),ret);
    return 1;
}
Example #27
0
int do_invite(string arg)
{
        object me;
        string invitelist;
        me= this_player();
        if((string)me->query("id") != (string)query("owner"))
        return 0;
        if( !arg )
        {
                write("��Ҫ����˭? \n");
                return 1;
        }
        invitelist = (string)query("invite");
        if(strlen(invitelist) && strsrch(invitelist,"["+arg+"]") != -1)
        {
                //if the person has already been invited, remove it from invite list.
                invitelist = replace_string(invitelist,"["+arg+"]","");
                set("invite",invitelist);
                write("�㽫"+arg+"��������������г�ȥ��\n");
        }else
        {
                //invite the person.
                if( find_player(arg))
                {
                        if(!strlen(invitelist))
                                set("invite","["+arg+"]");
                        else
                                set("invite",invitelist+"["+arg+"]");
                   write("������"+arg+"����ķ��䡣\n");
                }else
                {
                        write("��... ���������?\n");
                }
        }
        return 1;
} 
Example #28
0
int do_invite(string arg)
{
        object me;
        string invitelist;
        me= this_player();
        if((string)me->query("id") != (string)query("owner"))
        return 0;
        if( !arg )
        {
                write("你要邀请谁? \n");
                return 1;
        }
        invitelist = (string)query("invite");
        if(strlen(invitelist) && strsrch(invitelist,"["+arg+"]") != -1)
        {
                //if the person has already been invited, remove it from invite list.
                invitelist = replace_string(invitelist,"["+arg+"]","");
                set("invite",invitelist);
                write("你将"+arg+"从你的邀请名单中除去。\n");
        }else
        {
                //invite the person.
                if( find_player(arg))
                {
                        if(!strlen(invitelist))
                                set("invite","["+arg+"]");
                        else
                                set("invite",invitelist+"["+arg+"]");
                        write("你邀请"+arg+"来你的房间。\n");
                }else
                {
                        write("咦... 有这个人吗?\n");
                }
        }
   return 1;
} 
Example #29
0
int main(string dest) {
   object ob,item;
   string buf;
   int age,x,ac,width;

   ob = this_player();

   if( dest && this_player()->query_level() >= WIZLEVEL ) {
      ob = find_player(dest);
      if( !ob ) ob = find_living( dest );
	  if( !ob ) {
         ob = single_present( dest, environment(this_player()) );
		 if( ob && !ob->query_is_living() )
            ob = 0;
	  }
      if (!ob) {
         msg(capitalize(dest)+" was not found.");
         return 1;
      }
   }

   age = ob->query_age()-ob->query_last_login();
   if( age ) age += time();
   width = this_player()->query_term_width();

   buf = "~CSC2"+tab("-",width-3)+"\n";
   buf += pad("~CSC3"+ob->query_pretitle()+"~CSC4 "+capitalize(""+ob->query_name())+" ~CSC3"+ob->query_title(),width+12,2)+"\n";
   buf += "~CSC2"+tab("-",width-3)+"\n";
   buf += "~CSC4Level: ~CSC3"+query_personal_title(ob);
   if (this_player()->query_level() >= WIZLEVEL)
     buf += " ("+(string)ob->query_level()+")";

   buf +=  "\n~CSC4Str: " + make_stat(ob, "strength");
   buf +=  "~CSC4Dex: " + make_stat(ob, "dexterity");
   buf +=  "~CSC4Con: " + make_stat(ob, "constitution");
   buf +=  "~CSC4Spd: " + make_stat(ob, "speed") + "\n";

   buf +=  "~CSC4Wil: " + make_stat(ob, "will");
   buf +=  "~CSC4Int: " + make_stat(ob, "intelligence");
   buf +=  "~CSC4Emp: " + make_stat(ob, "empathy");
   buf +=  "~CSC4Cha: " + make_stat(ob, "charm") + "\n";

   buf += "~CSC4Alignment: ~CSC3"+ob->query_alignment_string();
   if (this_player()->query_level() >= WIZLEVEL)
     buf += "~CSC2 (lawful: "+ob->query_lawful_alignment()+", good: "+ob->query_good_alignment()+")\n";
   else
     buf += "\n";

   if( age != 0 )
      buf += "~CSC4Age:    ~CSC3"+int_to_time(age)+"\n";
   buf += pad("~CSC4Sex:    ~CSC3"+gender_string(ob->query_gender()), 32, 0);
   buf += pad(" ~CSC4Race: ~CSC3"+capitalize(ob->query_race()), 31, 0);
   buf += " ~CSC4Deaths: ~CSC3"+ob->query_deaths()+"\n";
   buf += "~CSC4Weight: ~CSC3"+ob->query_us_weight()+" lbs";
   if (this_player()->query_level() >= WIZLEVEL)
     buf += "~CSC2 ("+ob->query_weight()+" grams)\n";
   else
     buf += "~CSC2 ("+(ob->query_weight()/1000)+" kg)\n";

   buf += "~CSC4Carried:  ~CSC3" + carry_string(ob) + "\n";

   buf += "/bin/hp"->hp_string(ob)+"\n";

   buf += "~CSC2Food:   " + meter( ob, "food" ) + "\n";
   buf += "~CSC2Water:  " + meter( ob, "drink" ) + "\n";

   buf += "~CSC4Defense: ~CSC3" + ac_string(ob) + "\n";
   buf += pad("~CSC4Form:    ~CSC3" + capitalize(ob->query_form()),32,0);

   if (ob->query_skill("other.endurance"))
     buf += pad(" ~CSC4Soak: ~CSC3" + (ob->query_soak()?"on":"off"),32,0);
   buf += "~CSC4Wimpy: ~CSC3" + (ob->query_wimpy()?ob->query_wimpy()+"%":"off") + "\n";

   if( find_objectref(ob->query_env_var("home")) ) {
       object home_room = find_objectref(ob->query_env_var("home"));
       object home_bldg = environment(home_room);
       object home_zone;
	   buf += "~CSC4Home:    ~CSC3"+home_room->query_short();
       if( home_bldg ) {
          home_zone = environment(home_bldg);
		  string owner;
          if( home_bldg->query_owner() )
            owner = capitalize(home_bldg->query_owner())+"'s";
          else
            owner = "An unowned";
          buf += ", "+owner+" "+home_bldg->query_name()+", "+home_zone->query_short();
       }
       buf += "\n";
   }

   // stance
   buf += "~CSC3"+pronoun_string(ob);
   switch (ob->query_stance()) {
     case ST_STANDING: buf += "standing up."; break;
     case ST_SITTING: buf += "sitting down."; break;
     case ST_LYING: buf += "lying down."; break;
     case ST_CROUCHING: buf += "crouching."; break;
     case ST_JUMPING: buf += "jumping."; break;
     case ST_FALLING: buf += "falling."; break;
	 case ST_FLYING: buf += "flying."; break;
     case ST_UNBALANCED: buf += "unbalanced."; break;
     default: buf += "tilted at some obnoxiously uncomfortable angle."; break;
   }

   // party
   if( ob->query_env_var("party") ) {
     string party = ob->query_env_var("party");
     string pupil = ob->query_env_var("mentoring");
     string leader = PARTY_DAEMON->query_party_leader(party);
     buf += "\n~CSC3" + pronoun_string(ob) +
            (leader == ob->query_name() ? "the leader" : "a member") +
            " of the party ~CSC2" + capitalize(party) + "~CSC3";
     if( pupil )
       buf += ", and are mentoring ~CSC2" + capitalize(pupil) + "~CSC3.";
     else if( pupil = PARTY_DAEMON->query_mentor(ob->query_name()) ) {
       buf += ", " + (ob==this_player()?"and":"is") +
			  " are being mentored by ~CSC2" + capitalize(pupil) + "~CSC3.";
	 } else
       buf += ".";
   }

   buf += "\n~CSC2"+tab("-",width-3);

   msg(buf+"~CDEF");
   return 1;
}
Example #30
0
int main(object me, string arg)
{
	string target, mud;
	object obj;
        string no_tell, can_tell;
        string reply_out;

	if (! arg || arg == "")
		return notify_fail("你要回答什么?\n");

	if (! stringp(target = me->query_temp("reply")) )
		return notify_fail("刚才没有人和你说过话。\n");

	if (sscanf(target, "%s@%s", target, mud) == 2)
	{
		GTELL->send_gtell(lower_case(mud), lower_case(target), me, arg);
		write("网路讯息已送出,可能要稍候才能得到回应。\n");
		return 1;
	}

	obj = find_player(target);
	if (! obj || ! me->visible(obj))
	{
		if (MESSAGE_D->send_msg_to(me, target, arg))
			return 1;
		return notify_fail("刚才和你说话的人现在已经离开游戏了。\n");
	}

        no_tell = obj->query("env/no_tell");
	if (! wizardp(me) && (no_tell == "all" || no_tell == "ALL" ||
	    is_sub(me->query("id"), no_tell)))
        {
                can_tell = obj->query("env/can_tell");
                if (! is_sub(me->query("id"), can_tell))
		        return notify_fail("这个人不想听你罗嗦啦。\n");
        }

	if (playerp(obj) && obj->is_net_dead())
		return notify_fail("这个人现在不在线上,听不到你的话。\n");

	if (! living(obj))
		return notify_fail("这人现在恐怕听不到你说的话了...\n");

	reply_out = sprintf(HIG "%s回答你:%s\n" NOR,
                            me->name(1) + HIG "(" + me->query("id") + ")", arg);
        if (! TELL_CMD->notice_user(me->name(1), me->query("id"), obj, reply_out))
                return 1;

        // 成功的回答了
	write(HIG "你回答" + obj->name(1) + HIG + "(" + obj->query("id") +
              "):" + arg + "\n" NOR);

        if (query_idle(obj) >= 120)
                write(YEL "可是" + obj->name(1) +
                      YEL "已经在猪圈中发呆有" + chinese_number(query_idle(obj) / 60) +
                      "分钟了,恐怕没法听到你的话。\n");

        // 如果选择的不是全阻塞(2),则自动忽略这条信息,显示
        // 下一条信息。
        if (me->query("env/jam_talk") != 2)
                SKIP_CMD->main(me, "");

	return 1;
}