本文整理汇总了C++中call_other函数的典型用法代码示例。如果您正苦于以下问题:C++ call_other函数的具体用法?C++ call_other怎么用?C++ call_other使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了call_other函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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", "???" );
}
示例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"]);
}
示例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;
}
示例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;
}
}
示例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"]))
}
示例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());
}
示例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);
}
示例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());
}
}
}
}
示例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);
}
示例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();
}
示例11: reset
void reset() {
::reset();
if(!dug) return;
dug = 0;
RemoveItem("hole");
RemoveExit("down");
call_other("/domains/Praxis/hole", "fixing_a_hole");
}
示例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;
}
}
示例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;
}
示例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]);
}
}
示例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;
}