• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ call_other函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中call_other函数的典型用法代码示例。如果您正苦于以下问题:C++ call_other函数的具体用法?C++ call_other怎么用?C++ call_other使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了call_other函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: create

void create()
{
  set ("short","二楼雅座");
        set("long", @LONG

这里摆设讲究,用的餐具都是从景德镇运来。摆的桌椅都是红木的,
在光照之下反射出淡淡的光泽。推窗望去,长安城中心尽收眼底。
一群酒客推杯换盏,正喝的热闹。

     三界主页 http://sjshmud.51.net/欢迎常去查看。

LONG);

        set("exits", ([
		"down" : "/d/city/kezhan",
                "east" : "/d/wiz/system",
                "west" : "/d/wiz/entrance3",
//              "up" : "/u/corpsed/home",
         ]) );
        set("no_time",1);
        set("no_fight", 1);
        set("no_magic", 1);
 //       set("valid_startroom", 1);

  set("objects", ([ /* sizeof() == 1 */
//    "/u/yudian/npc/new_jing" : 1,
//    "/d/wiz/npc/xmasman" : 1,
     "/u/stey/npc/seng" : 1,
//  "/d/wiz/obj/xmastree" : 1,
]));
        setup();
//          call_other( "/obj/board/query_bbs", "???" );
//          call_other( "/obj/board/xlqy_b", "???" );
          call_other( "/obj/board/xlqy_ah", "???" );
}
开发者ID:mudchina,项目名称:sjsh,代码行数:35,代码来源:entrance.c


示例2: update_day_phase

void update_day_phase()
{
	int i,j;
	object *inusers,envroom;
	string str;
	remove_call_out("update_day_phase");

	current_day_phase = (++current_day_phase) % sizeof(day_phase);
	if( !undefinedp(day_phase[current_day_phase]["event_fun"]) )
		call_other(this_object(), day_phase[current_day_phase]["event_fun"]);
        i=0;
        // here is modified by vikee 2001-2-15 13:15
        str=HIR"〖"HIY"窗外"HIR"〗:"NOR+day_phase[current_day_phase]["time_msg"];
        inusers=users();
        for (i;i<(j=sizeof(inusers));i++)
        {
            envroom=environment(inusers[i]);
            if (envroom)
           {
            if ( intp(envroom->query("outdoors")))
             {
               if (envroom->query("outdoors")<1)
             	tell_object(inusers[i],str+"\n");
               else 
               tell_object(inusers[i],day_phase[current_day_phase]["time_msg"]+"\n");
             }
            else
             {
             	tell_object(inusers[i],day_phase[current_day_phase]["time_msg"]+"\n");
             }
          }     
       }
       call_out("update_day_phase", day_phase[current_day_phase]["length"]);

}
开发者ID:mudchina,项目名称:sjsh,代码行数:35,代码来源:natured.c


示例3: cmd_hook

nomask static int cmd_hook(string cmd) {
   string file;
   string verb;
   int foo ;
   mapping before, after ;

   verb = query_verb();
 
   if (environment() && environment()->valid_exit(verb)) {
      verb = "go";
      cmd = query_verb();
   }

   file = (string)CMD_D->find_cmd(verb, explode(query("PATH"), ":"));
 
   if(file && file != "")
{
#ifdef PROFILING
   before = rusage() ;
#endif
      foo = (int)call_other(file, "cmd_" + verb, cmd);
 
#ifdef PROFILING
        after = rusage() ;
    	"/adm/daemons/profile"->log_cmd(verb,before,after) ;
#endif

	return foo ;
}

   if (environment() && environment()->query("quiet")) return 0 ;
#ifdef PROFILING
	before = rusage() ;
#endif
   foo = (int)EMOTE_D->parse(verb, cmd);
    if (foo) {
#ifdef PROFILING
    	after = rusage() ;
    	"/adm/daemons/profile"->log_cmd(verb,before,after) ;
#endif
	return foo ;
     }
#ifdef PROFILING
	before = rusage();
#endif
#ifndef INTERMUD
if(verb == "gwiz" || verb == "interwiz"){
		printf("Sorry, %s does not support intermud.\n",capitalize(mud_name()));
return 1;
}
#endif /* INTERMUD */
    foo = (int) CHANNELS_D -> parse_channel( verb, cmd );
#ifdef PROFILING
     if( foo ) {
	    after = rsuage();
	      "/adm/daemons/profile" -> log_cmd( verb, before, after );
     }
#endif
    return foo;
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:60,代码来源:user.c


示例4: main

int main(object me, string file)
{
	object obj;
	string err, msg;

	seteuid( geteuid(me) );

	if (!file) file = me->query("cwf");
	if (!file)
		return notify_fail("你要复制什么物件?\n");

	file = resolve_path(me->query("cwd"), file);
	if( sscanf(file, "%*s.c") != 1 ) file += ".c";
	me->set("cwf", file);

	if( file_size(file) < 0 )
		return notify_fail("没有这个档案(" + file + ")。\n");

	if( !find_object(file) ) {
		err = catch(call_other(file, "???"));
		if (err) {
			write("载入失败:" + err + "\n");
			return 1;
		}
	}
开发者ID:heypnus,项目名称:xkx2001,代码行数:25,代码来源:clone.c


示例5: incoming_request

// Support.  Do we support this protocol?
void incoming_request(mapping info)
{
        if(!ACCESS_CHECK(previous_object())) return; 
        if (stringp(info["NAME"]) && stringp(info["PORTUDP"])) {
                // dont want requests from ourself
                if(info["NAME"] == Mud_name()) return; 
                if(!DNS_MASTER->dns_mudp(info["NAME"]))
                        PING_Q->send_ping_q(info["HOSTADDRESS"], info["PORTUDP"]); 
                // if the file exists that is enough to know that we support
                // it, unless there is a param request, in which case we have
                // to call_other to the file to check.
                if( file_size(AUX_PATH+info["CMD"]+".c") <= 0
                ||      (!undefinedp(info["PARAM"])
                &&      call_other(AUX_PATH+info["CMD"], "support_"+info["PARAM"]))) {
                        // we don't support it
                        DNS_MASTER->send_udp(info["HOSTADDRESS"], info["PORTUDP"],
                                sprintf("@@@%s||NAME:%s||PORTUDP:%d||CMD:%s||NOTSUPPORTED:yes||ANSWERID:%[email protected]@@\n",
                                        DNS_SUPPORT_A, Mud_name(), udp_port(),
                                        info["CMD"]+ (!undefinedp(info["PARAM"]) ? "||PARAM:"+info["PARAM"] : ""),
                                        info["ANSWERID"]));
                } else {
                        // we do support it
                        DNS_MASTER->send_udp(info["HOSTADDRESS"], info["PORTUDP"],
                                sprintf("@@@%s||NAME:%s||PORTUDP:%d||CMD:%s||SUPPORTED:yes||ANSWERID:%[email protected]@@\n",
                                   DNS_SUPPORT_A, Mud_name(), udp_port(),
                                        info["CMD"]+(!undefinedp(info["PARAM"]) ? "||PARAM:"+info["PARAM"] : ""),
                                        info["ANSWERID"]));
                }
        } //if (stringp(info["NAME"]) && stringp(info["PORTUDP"]))
} 
开发者ID:mudchina,项目名称:fy4,代码行数:31,代码来源:support_q.c


示例6: create

void create()
{
	set("short", "巫师会客室");
	set("long", @LONG
这里是巫师和玩家交流的地方,如果你有什么问题需要向巫师请
教,可以在这里留言(post)。不过如果问题牵涉到解谜或者已经在帮
助文件里有详细说明,巫师们就不一定会回答。楼上是巫师休息室,
一般玩家到这里后就上不去了。西边是新建的BUG留言室,如果有发现
什么bug,或者想看看处理的结果,都可以过去逛逛。
LONG );

	set("exits", ([
		"up": __DIR__"wizard_room",
		"southeast": "/d/city/wumiao",
		"west" : __DIR__"bug_room",
        ]));
	set("item_desc", ([
		"up": "不要偷窥。\n",	
        ]));
//  set("objects", ([
//      "/clone/npc/qingyun" : 1,
//  ]));
	set("no_fight", "1");
	set("no_clean_up", 0);
	create_door("southeast", "竹门", "northwest", DOOR_CLOSED);
	setup();
	call_other("/clone/board/towiz_b", "???");
	"/clone/npc/qingyun"->move(this_object());
}
开发者ID:aricxu,项目名称:xkx100,代码行数:29,代码来源:guest_room.c


示例7: StartQuery

nomask void StartQuery()
{
  int i;
  object board, env;
  string envnam;

  if (!this_interactive() || !IS_ELDER(this_interactive())) {
    write("Das darf nur ein Erzmagier!\n");
    return;
  }

  for (i=sizeof(BOARD_ROOMS)-1; i>=0; i--) {
    envnam = BOARD_ROOMS[i];
    catch(call_other(envnam, "???"));
    if (env = find_object(envnam)) {
      if (!present("PartyBrett", env)) {
	board = clone_object("/p/service/rochus/party/brett");
	board->move(env, M_NOCHECK);
	OBJECTD->AddObject(board, envnam);
	printf("Partybrett in '%s.c' aufgestellt.\n", envnam);
      }
      else
	printf("In '%s.c' befindet sich schon ein Partybrett!\n", envnam);
    }
    else
      printf("Kann kein Partybrett in '%s.c' aufstellen!\nDer Raum laesst sich "
	     "nicht laden!\n", envnam);
  }
开发者ID:Shea690901,项目名称:MorgenGrauen,代码行数:28,代码来源:master.c


示例8: event_heart_beat

void event_heart_beat(void) {
   if (this_object()->query_hp() < 1) {
      if (this_object()->is_dead() && this_object()->is_player()) {
         heal_time++;
         if (heal_time > heal_rate) {
            heal_time = 0;
            this_object()->message("You are dead.  You must pray to get your "+
             "body back.\n");
         }
      } else {
         call_out("die", 0);
         return;
      }
   } else {
      heal_time++;
      if (heal_time > heal_rate) {
         heal_time = 0;

         if (this_object()->query_hp() < this_object()->query_max_hp()) {
            this_object()->increase_hp(random(heal_amount) + 1);
         }
         if (this_object()->query_mana() < this_object()->query_max_mana()) {
            this_object()->increase_mana(random(heal_amount) + 1);
         }
         if (this_object()->query_end() < this_object()->query_max_end()) {
            this_object()->increase_end(random(2 * heal_amount) + 1);
         }
      }

      /* allow monsters to talk, cast spells etc... */
      if (!this_object()->is_player()) {
         this_object()->do_extra_actions();
      }
		
		reduce_stunned();
		reduce_paralysed();

      /* Check here to see is we are in combat, if so, continue battle */
      if (!query_paralysed() && !query_stunned() &&
				this_object()->is_fighting() > 0) {
         this_object()->do_fight();
      } else {
         if (!query_paralysed() &&
					function_object("event_wander", this_object())) {
            call_other(this_object(), "event_wander");
         }
      }
   }

   /* A player ages when not idle */
   if (this_object()->is_player()) {
      if (this_object()->query_idle() < 60) {
         player_age += HEART_BEAT_INTERVAL;
         if (query_mortal(this_object())) {
            TOP_SCORE_D->save(this_object());
         }
      }
   }
}
开发者ID:bbailey,项目名称:gurbalib,代码行数:59,代码来源:heart_beat.c


示例9: event_exit

void event_exit(object ob, string mess) {
  mixed *bit;
  int i;

  bit = (mixed *)this_object()->query_actions("exit");
  for (i=0;i<sizeof(bit);i+=2)
    call_other(bit[i+1][0], bit[i+1][1], ob, mess);
}
开发者ID:quixadhal,项目名称:discworld,代码行数:8,代码来源:exit.c


示例10: notify_die

// if nothing set, remove this ob when the player dies
void notify_die(object killer) {
  if (notifyfun) {
    if (call_other(cmdob, notifyfun, killer, environment(this_object())) == -1)
      removeme();
  }
  else
    removeme();
}
开发者ID:ehershey,项目名称:pd,代码行数:9,代码来源:command.c


示例11: reset

void reset() {
    ::reset();
    if(!dug) return;
    dug = 0;
    RemoveItem("hole");
    RemoveExit("down");
    call_other("/domains/Praxis/hole", "fixing_a_hole");
}
开发者ID:quixadhal,项目名称:bloodlines,代码行数:8,代码来源:west_road2.c


示例12: do_block

int do_block(object who) {
   if (!call_other(this_player(),DIR + "/rooms/sub/query_trap", "query_trap")) {
      write("The door is blocked.\n");
      return 1;
   } else {
      return 0;
   }
}
开发者ID:drlaforge,项目名称:gurbalib,代码行数:8,代码来源:well.c


示例13: update_condition

nomask int update_condition()
{
	mixed *cnd, err;
	int i, flag, update_flag;
	object cnd_d;

	if( !mapp(conditions) || !(i=sizeof(conditions)) ) return 0;
	cnd = keys(conditions);
	update_flag = 0;
	while(i--) {

		// In order to not casue player lost heart beat occasionally while
		// calling external condition daemons, we take careful calling
		// convention here.

		cnd_d = find_object(CONDITION_D(cnd[i]));
		if( !cnd_d ) {
			err = catch(call_other(CONDITION_D(cnd[i]), "???"));
			cnd_d = find_object(CONDITION_D(cnd[i]));

			// If we failed to load the external condition daemon, remove
			// it before we stuff log files with error messages.

			if( err || !cnd_d ) {
				log_file("condition.err",
					sprintf("Failed to load condition daemon %s, removed from %O\nError: %s\n",
						CONDITION_D(cnd[i]), this_object(), err)
				);
				map_delete(conditions, cnd[i]);
				continue;
			}
		}

		// We assume since the condition daemon is loaded successfully, the
		// calling on its update_condition() should success as well. Because
		// catch() is somewhat costly, so we don't attempt to catch possible
		// error from the call_other. It is condition daemon's reponsibility
		// that don't cause error in users's heart beat.
		// If condition daemon returns 0 (or update_condition() not defined),
		// we can just assume the condition expired and remove it.
		
		flag = call_other(cnd_d, "update_condition", this_object(), conditions[cnd[i]]);
		if( !( flag & CND_CONTINUE ) ) map_delete(conditions, cnd[i]);
		update_flag |= flag;
	}
开发者ID:heypnus,项目名称:xkx2001,代码行数:45,代码来源:condition.c


示例14: main

void main( string arg ) {
   string *tmp;
   int i;
 
   tmp = explode(arg, " ");
   i = sizeof(tmp);
   if( i==1 ) {
      call_other(this_player(), tmp[0]); 
   } else if( i==2 ) {
      call_other(this_player(), tmp[0], tmp[1]); 
   } else if( i==3 ) {
      call_other(this_player(), tmp[0], tmp[1], tmp[2]); 
   } else if( i==4 ) {
      call_other(this_player(), tmp[0], tmp[1], tmp[2], tmp[3]); 
   } else if( i==5 ) {
      call_other(this_player(), tmp[0], tmp[1], tmp[2], tmp[3], tmp[4]); 
   } 
}
开发者ID:Shea690901,项目名称:gurbalib,代码行数:18,代码来源:call.c


示例15: event_fight_in_progress

int event_fight_in_progress(object ob, object ob1, object ob2) {
  mixed *bit;
  int i, ret;

  bit = (mixed *)this_object()->query_actions("event_fight");
  for (i=0;i<sizeof(bit);i+=2)
    ret += (int)call_other(bit[i+1][0], bit[i+1][1], ob, ob1, ob2);
  return ret;
}
开发者ID:quixadhal,项目名称:discworld,代码行数:9,代码来源:event_fight.c


示例16: get_simul_efun

/*
 * Give a path to a simul_efun file. Observe that it is a string returned,
 * not an object. But the object has to be loaded here. Return 0 if this
 * feature isn't wanted.
 */
string get_simul_efun() {
  string fname;
  fname = "/secure/simul_efun";
  if (catch(call_other(fname, "??"))) {
    write("Failed to load " + fname + "\n");
    shutdown();
    return 0;
  }
  return fname;
} /* get_simul_efun() */
开发者ID:quixadhal,项目名称:discworld,代码行数:15,代码来源:simul_efun.c


示例17: extra_reset

extra_reset() {
    object black_stone;
    if (!rat || !living(rat)) {
	rat = clone_object("obj/monster");
	call_other(rat, "set_name", "rat");
	call_other(rat, "set_alias", "black rat");
	call_other(rat, "set_level", 3);
	call_other(rat, "set_short", "An ugly black rat");
	call_other(rat, "set_wc", 5);
	call_other(rat, "set_agressive", 1);
	move_object(rat, this_object());
	black_stone = clone_object("obj/treasure");
	call_other(black_stone, "set_id", "stone");
	call_other(black_stone, "set_alias", "black stone");
	call_other(black_stone, "set_short", "A black stone");
	call_other(black_stone, "set_value", 60);
	move_object(black_stone, rat);
    }
}
开发者ID:unusual-thoughts,项目名称:freebsd-1.x-ports,代码行数:19,代码来源:after_trap.c


示例18: wield

wield() {
    if (call_other(this_player(), "query_alignment") > -200) {
	write("This sword is not for you. Your personality is much too nice.\n");
	return 0;
    }
    else {
	write("Beware! This sword might not be as good as you believe it is.\n");
	return 1;
    }
} /* wield */
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:10,代码来源:vasques_crossing.c


示例19: or

/*
    Description:
      Prove knowledge of some secret.
    Parameters:
         ( mixed secret, closure cl, mixed extra )
      or ( mixed secret, object ob,  string func, mixed extra )

      secret - something you want to prove knowledge of
      cl     - a closure
      ob     - an object in which to call func
      func   - a function to call in ob
      extra  - an extra parameter to pass

      Depending on which form is used, one of these will be done:
            ob->func( hash, extra )
        or  funcall( hash, extra )
      where hash is the hash value of the secret: hash( secret )

    Returns:
      The return value of the call/eval.
    Notes:
      None.
*/
varargs mixed
prove( mixed val, mixed ob_or_cl, mixed func_or_extra, mixed extra )
{
  if( closurep( ob_or_cl ) )
    return funcall( (closure) ob_or_cl, hash( val ), func_or_extra );
  if( !objectp( ob_or_cl ) || !stringp( func_or_extra ))
    return 0;
  return call_other( (object) ob_or_cl, (string) func_or_extra, 
                     hash( val ), extra );
}
开发者ID:carriercomm,项目名称:eotl-mudlib,代码行数:33,代码来源:hash.c


示例20: make_stat

string make_stat( object ob, string stat_name ) {
   int val_real, val_base, i;
   string ret;

   val_base = call_other(ob, "query_"+stat_name);
   val_real = call_other(ob, "query_real_"+stat_name);

   ret = "";

   if ( val_base < val_real )
      ret += "~[090";
   else if (val_base > val_real )
      ret += "~CBRT";
   else
      ret += "~CSC3";
   ret += sprintf("%2d~CSC4/~CSC3%-2d ",val_base,val_real);

   return ret;
}
开发者ID:shentino,项目名称:simud,代码行数:19,代码来源:score.c



注:本文中的call_other函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ call_out函数代码示例发布时间:2022-05-30
下一篇:
C++ call_orderTM函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap