这篇教程C++ ABORT_MPI函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ABORT_MPI函数的典型用法代码示例。如果您正苦于以下问题:C++ ABORT_MPI函数的具体用法?C++ ABORT_MPI怎么用?C++ ABORT_MPI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ABORT_MPI函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mfn_holdsconst char *mfn_holds(MFUNARGS){ dbref obj1 = mesg_dbref_raw(descr, player, what, perms, argv[0]); dbref obj2 = player; if (argc > 1) obj2 = mesg_dbref_local(descr, player, what, perms, argv[1], mesgtyp); if (obj1 == UNKNOWN || obj1 == AMBIGUOUS || obj1 == NOTHING || obj1 == HOME) ABORT_MPI("HOLDS", "Match failed (1)."); if (obj1 == PERMDENIED) ABORT_MPI("HOLDS", "Permission Denied (1)."); if (obj2 == UNKNOWN || obj2 == AMBIGUOUS || obj2 == NOTHING || obj2 == HOME) ABORT_MPI("HOLDS", "Match failed (2)."); if (obj2 == PERMDENIED) ABORT_MPI("HOLDS", "Permission Denied (2)."); if (obj2 == getloc(obj1)) { return "1"; } else { return "0"; }}
开发者ID:rhencke,项目名称:fuzzball,代码行数:25,
示例2: mfn_nameconst char *mfn_name(MFUNARGS){ char *ptr; // dbref obj = mesg_dbref_proximity(player, what, perms, argv[0]); dbref obj = mesg_dbref_raw(player, what, perms, argv[0]); if (obj == UNKNOWN) ABORT_MPI("NAME","Match failed."); if (obj == NOTHING) { strcpy(buf, "#NOTHING#"); return buf; } if (obj == AMBIGUOUS) { strcpy(buf, "#AMBIGUOUS#"); return buf; } if (obj == HOME) { strcpy(buf, "#HOME#"); return buf; } if (!(Typeof(obj) == TYPE_PLAYER) && !mesg_proximity_perms(player, perms, obj)) ABORT_MPI("NAME","Permission denied."); strcpy(buf, RNAME(obj)); if (Typeof(obj) == TYPE_EXIT) { ptr = index(buf, ';'); if (ptr) *ptr = '/0'; } return buf;}
开发者ID:TealWizard,项目名称:TinyMUCK-Tapestries,代码行数:31,
示例3: mfn_controlsconst char *mfn_controls(MFUNARGS){dbref obj; dbref obj2; obj = mesg_dbref_raw(player, what, perms, argv[0]); if (obj == AMBIGUOUS || obj == NOTHING || obj == UNKNOWN) ABORT_MPI("CONTROLS","Match failed. (1)"); if (obj == PERMDENIED) ABORT_MPI("CONTROLS","Permission denied. (1)"); if (obj == HOME) obj = DBFETCH(player)->sp.player.home; if (argc > 1) { obj2 = mesg_dbref_raw(player, what, perms, argv[1]); if (obj2 == AMBIGUOUS || obj2 == NOTHING || obj2 == UNKNOWN) ABORT_MPI("CONTROLS","Match failed. (2)"); if (obj2 == PERMDENIED) ABORT_MPI("CONTROLS","Permission denied. (2)"); if (obj2 == HOME) obj2 = DBFETCH(player)->sp.player.home; if (Typeof(obj2) != TYPE_PLAYER) obj2 = OWNER(obj2); } else { obj2 = OWNER(perms); } if (controls(obj2, obj)) { return "1"; } else { return "0"; }}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:30,
示例4: mfn_centerconst char *mfn_center(MFUNARGS){ /* {center:string,fieldwidth,padstr} */ /* Center justify string to a fieldwidth, filling with padstr */ char *ptr; char *fptr; int i, len, halflen; char *fillstr; len = (argc > 1) ? atoi(argv[1]) : 78; if (len > BUFFER_LEN - 1) ABORT_MPI("CENTER", "Fieldwidth too big."); halflen = len / 2; fillstr = (argc > 2) ? argv[2] : " "; if (!*fillstr) ABORT_MPI("CENTER", "Null pad string."); for (ptr = buf, fptr = fillstr, i = strlen(argv[0]) / 2; i < halflen; i++) { *ptr++ = *fptr++; if (!*fptr) fptr = fillstr; } strcpyn(ptr, buflen - (ptr - buf), argv[0]); for (i = strlen(buf), ptr = &buf[i], fptr = fillstr; i < len; i++) { *ptr++ = *fptr++; if (!*fptr) fptr = fillstr; } *ptr = '/0'; return buf;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:34,
示例5: mfn_testlockconst char *mfn_testlock(MFUNARGS){ struct boolexp *lok; dbref who = player; dbref obj = mesg_dbref_local(player, what, perms, argv[0]); if (argc > 2) who = mesg_dbref_local(player, what, perms, argv[2]); if (who == AMBIGUOUS || who == UNKNOWN || who == NOTHING || who == HOME) ABORT_MPI("TESTLOCK","Match failed. (1)"); if (who == PERMDENIED) ABORT_MPI("TESTLOCK","Permission denied. (1)"); if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME) ABORT_MPI("TESTLOCK","Match failed. (2)"); if (obj == PERMDENIED) ABORT_MPI("TESTLOCK","Permission denied. (2)"); lok = get_property_lock(obj, argv[1]); if (argc > 3 && lok == TRUE_BOOLEXP) return (argv[3]); if (eval_boolexp(who, lok, obj)) { return "1"; } else { return "0"; }}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:26,
示例6: mfn_withconst char *mfn_with(MFUNARGS){ char vbuf[BUFFER_LEN]; char *ptr, *valptr; int v, cnt; ptr = MesgParse(argv[0], argv[0]); CHECKRETURN(ptr,"WITH","arg 1"); v = new_mvar(ptr, vbuf); if (v == 1) ABORT_MPI("WITH","Variable name too long"); if (v == 2) ABORT_MPI("WITH","Too many variables already defined"); valptr = MesgParse(argv[1], argv[1]); CHECKRETURN(valptr,"WITH","arg 2"); *buf = '/0'; strcpy(vbuf, valptr); for (cnt = 2; cnt < argc; cnt++) { ptr = MesgParse(argv[cnt],argv[cnt]); if (!ptr) { sprintf(buf, "%s %cWITH%c (%d)", get_mvar("how"), MFUN_LEADCHAR, MFUN_ARGEND, cnt); notify(player, buf); return NULL; } } free_top_mvar(); return ptr;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:30,
示例7: mfn_lunionconst char *mfn_lunion(MFUNARGS){ int iter_limit = MAX_MFUN_LIST_LEN; char *ptr, *ptr2, *p; int len; int outlen, nextlen; *buf = '/0'; outlen = 0; ptr = argv[0]; while (*ptr) { for (ptr2 = ptr; *ptr2 && *ptr2 != '/r'; ptr2++); if (*ptr2) *(ptr2++) = '/0'; len = strlen(ptr); p = buf; do { if (string_prefix(p, ptr) && (!p[len] || p[len] == '/r')) break; while (*p && *p != '/r') p++; if (*p) p++; } while (*p); if (!*p) { nextlen = strlen(ptr); if (outlen + nextlen > BUFFER_LEN - 3) break; if (outlen) strcat((buf+(outlen++)), "/r"); strcat((buf+outlen), ptr); outlen += nextlen; } ptr = ptr2; if (!(--iter_limit)) ABORT_MPI("LUNION","Iteration limit exceeded"); } ptr = argv[1]; while (*ptr) { for (ptr2 = ptr; *ptr2 && *ptr2 != '/r'; ptr2++); if (*ptr2) *(ptr2++) = '/0'; len = strlen(ptr); p = buf; do { if (string_prefix(p, ptr) && (!p[len] || p[len] == '/r')) break; while (*p && *p != '/r') p++; if (*p) p++; } while (*p); if (!*p) { nextlen = strlen(ptr); if (outlen + nextlen > BUFFER_LEN - 3) break; if (outlen) strcat((buf+(outlen++)), "/r"); strcat((buf+outlen), ptr); outlen += nextlen; } ptr = ptr2; if (!(--iter_limit)) ABORT_MPI("LUNION","Iteration limit exceeded"); } return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:60,
示例8: mfn_showlistconst char *mfn_showlist(MFUNARGS){ dbref obj; const char *m = NULL; int lines=0; if(argc > 1) { obj = mesg_dbref_mage(player, what, perms, argv[1]); if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME) ABORT_MPI("SHOWLIST","Match failed"); if (obj == PERMDENIED) ABORT_MPI("SHOWLIST",NOPERM_MESG); } else obj = what; if (Prop_Hidden(argv[0]) && (Permlevel(perms) < tp_hidden_prop_mlevel)) ABORT_MPI("SHOWLIST",NOPERM_MESG); while ( (lines < MAX_MFUN_LIST_LEN) && (!lines || (m && *m)) ) { sprintf(buf, "%s#/%d", argv[0], ++lines); m = safegetprop_strict(player, obj, perms, buf); if( m && *m ) { notify_nolisten(player, m, 1); } } buf[0] = '/0'; return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:27,
示例9: mfn_lexecconst char *mfn_lexec(MFUNARGS){ dbref trg = (dbref) 0, obj = what; char *pname; const char *ptr; int blessed = 0; pname = argv[0]; if (argc == 2) { obj = mesg_dbref(descr, player, what, perms, argv[1], mesgtyp); } if (obj == PERMDENIED) ABORT_MPI("LEXEC", "Permission denied."); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME) ABORT_MPI("LEXEC", "Match failed."); while (*pname == PROPDIR_DELIMITER) pname++; ptr = get_concat_list(player, what, perms, obj, (char *)pname, buf, BUFFER_LEN, 2, mesgtyp, &blessed); if (!ptr) ptr = ""; trg = what; if (blessed) { mesgtyp |= MPI_ISBLESSED; } else { mesgtyp &= ~MPI_ISBLESSED; } if (Prop_ReadOnly(pname) || Prop_Private(pname) || Prop_SeeOnly(pname) || Prop_Hidden(pname)) trg = obj; ptr = mesg_parse(descr, player, obj, trg, ptr, buf, BUFFER_LEN, mesgtyp); CHECKRETURN(ptr, "LEXEC", "listval"); return ptr;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:33,
示例10: mfn_fullnameconst char *mfn_fullname(MFUNARGS){ dbref obj; obj = tp_compatible_mpi ? mesg_dbref_raw(player, what, perms, argv[0]) : mesg_dbref_local(player, what, perms, argv[0]) ; if (obj == UNKNOWN) ABORT_MPI("NAME","Match failed"); if (obj == PERMDENIED) ABORT_MPI("NAME",NOPERM_MESG); if (obj == NOTHING) { strcpy(buf, "#NOTHING#"); return buf; } if (obj == AMBIGUOUS) { strcpy(buf, "#AMBIGUOUS#"); return buf; } if (obj == HOME) { strcpy(buf, "#HOME#"); return buf; } strcpy(buf, RNAME(obj)); return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:29,
示例11: mfn_funcconst char *mfn_func(MFUNARGS){ char *funcname; char *ptr=NULL, *def; char namebuf[BUFFER_LEN]; char argbuf[BUFFER_LEN]; char defbuf[BUFFER_LEN]; int i; funcname = MesgParse(argv[0], namebuf, sizeof(namebuf)); CHECKRETURN(funcname, "FUNC", "name argument (1)"); def = argv[argc - 1]; for (i = 1; i < argc - 1; i++) { ptr = MesgParse(argv[i], argbuf, sizeof(argbuf)); CHECKRETURN(ptr, "FUNC", "variable name argument"); snprintf(defbuf, sizeof(defbuf), "{with:%.*s,{:%d},%.*s}", MAX_MFUN_NAME_LEN, ptr, i, (BUFFER_LEN - MAX_MFUN_NAME_LEN - 20), def); } i = new_mfunc(funcname, defbuf); if (i == 1) ABORT_MPI("FUNC", "Function Name too long."); if (i == 2) ABORT_MPI("FUNC", "Too many functions defined."); return "";}
开发者ID:rhencke,项目名称:fuzzball,代码行数:28,
示例12: mfn_nameconst char *mfn_name(MFUNARGS){ char *ptr; dbref obj; obj = tp_compatible_mpi ? mesg_dbref_raw(player, what, perms, argv[0]) : mesg_dbref_local(player, what, perms, argv[0]) ; if (obj == UNKNOWN) ABORT_MPI("NAME","Match failed"); if (obj == PERMDENIED) ABORT_MPI("NAME",NOPERM_MESG); if (obj == NOTHING) { strcpy(buf, "#NOTHING#"); return buf; } if (obj == AMBIGUOUS) { strcpy(buf, "#AMBIGUOUS#"); return buf; } if (obj == HOME) { strcpy(buf, "#HOME#"); return buf; } strcpy(buf, RNAME(obj)); if (Typeof(obj) == TYPE_EXIT) { ptr = index(buf, ';'); if (ptr) *ptr = '/0'; } return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:34,
示例13: mfn_rightconst char *mfn_right(MFUNARGS){ /* {right:string,fieldwidth,padstr} */ /* Right justify string to a fieldwidth, filling with padstr */ char *ptr; char *fptr; int i, len; char *fillstr; len = (argc > 1) ? atoi(argv[1]) : 78; if (len > BUFFER_LEN - 1) ABORT_MPI("RIGHT", "Fieldwidth too big."); fillstr = (argc > 2) ? argv[2] : " "; if (!*fillstr) ABORT_MPI("RIGHT", "Null pad string."); for (ptr = buf, fptr = fillstr, i = strlen(argv[0]); i < len; i++) { *ptr++ = *fptr++; if (!*fptr) fptr = fillstr; } strcpyn(ptr, buflen - (ptr - buf), argv[0]); return buf;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:25,
示例14: mfn_leftconst char *mfn_left(MFUNARGS){ /* {left:string,fieldwidth,padstr} */ /* Left justify string to a fieldwidth, filling with padstr */ char *ptr; char *fptr; int i, len; char *fillstr; len = (argc > 1) ? atoi(argv[1]) : 78; if (len > BUFFER_LEN - 1) ABORT_MPI("LEFT", "Fieldwidth too big."); fillstr = (argc > 2) ? argv[2] : " "; if (!*fillstr) ABORT_MPI("LEFT", "Null pad string."); strcpyn(buf, buflen, argv[0]); for (i = strlen(argv[0]), ptr = &buf[i], fptr = fillstr; i < len; i++) { *ptr++ = *fptr++; if (!*fptr) fptr = fillstr; } *ptr = '/0'; return buf;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:26,
示例15: mfn_nearbyconst char *mfn_nearby(MFUNARGS){ dbref obj; dbref obj2; obj = mesg_dbref_raw(descr, player, what, perms, argv[0]); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING) ABORT_MPI("NEARBY", "Match failed (arg1)."); if (obj == PERMDENIED) ABORT_MPI("NEARBY", "Permission denied (arg1)."); if (obj == HOME) obj = PLAYER_HOME(player); if (argc > 1) { obj2 = mesg_dbref_raw(descr, player, what, perms, argv[1]); if (obj2 == UNKNOWN || obj2 == AMBIGUOUS || obj2 == NOTHING) ABORT_MPI("NEARBY", "Match failed (arg2)."); if (obj2 == PERMDENIED) ABORT_MPI("NEARBY", "Permission denied (arg2)."); if (obj2 == HOME) obj2 = PLAYER_HOME(player); } else { obj2 = what; } if (!(mesgtyp & MPI_ISBLESSED) && !isneighbor(obj, what) && !isneighbor(obj2, what) && !isneighbor(obj, player) && !isneighbor(obj2, player) ) { ABORT_MPI("NEARBY", "Permission denied. Neither object is local."); } if (isneighbor(obj, obj2)) { return "1"; } else { return "0"; }}
开发者ID:rhencke,项目名称:fuzzball,代码行数:35,
示例16: mfn_randconst char *mfn_rand(MFUNARGS){ int num = 0; dbref trg = (dbref) 0, obj = what; const char *pname, *ptr; int blessed = 0; pname = argv[0]; if (argc == 2) { obj = mesg_dbref(descr, player, what, perms, argv[1], mesgtyp); } if (obj == PERMDENIED) ABORT_MPI("RAND", "Permission denied."); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME) ABORT_MPI("RAND", "Match failed."); num = get_list_count(what, obj, perms, (char *)pname, mesgtyp, &blessed); if (!num) ABORT_MPI("RAND", "Failed list read."); ptr = get_list_item(what, obj, perms, (char *)pname, (((RANDOM() / 256) % num) + 1), mesgtyp, &blessed); if (!ptr) ABORT_MPI("RAND", "Failed list read."); trg = what; if (blessed) { mesgtyp |= MPI_ISBLESSED; } else { mesgtyp &= ~MPI_ISBLESSED; } if (Prop_ReadOnly(ptr) || Prop_Private(ptr) || Prop_SeeOnly(ptr) || Prop_Hidden(ptr)) trg = obj; ptr = mesg_parse(descr, player, obj, trg, ptr, buf, BUFFER_LEN, mesgtyp); CHECKRETURN(ptr, "RAND", "listval"); return ptr;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:34,
示例17: mfn_filterconst char *mfn_filter(MFUNARGS){ int iter_limit = MAX_MFUN_LIST_LEN; char buf2[BUFFER_LEN]; char tmp[BUFFER_LEN]; char *ptr, *ptr2, *dptr; char *sepin = argv[3]; char *sepbuf = argv[4]; int seplen, v; ptr = MesgParse(argv[0],argv[0]); CHECKRETURN(ptr,"FILTER","arg 1"); v = new_mvar(ptr, tmp); if (v == 1) ABORT_MPI("FILTER","Variable name too long."); if (v == 2) ABORT_MPI("FILTER","Too many variables already defined."); dptr = MesgParse(argv[1],argv[1]); CHECKRETURN(dptr,"FILTER","arg 2"); if (argc > 3) { ptr = MesgParse(sepin,sepin); CHECKRETURN(ptr,"FILTER","arg 4"); if (!*ptr) ABORT_MPI("FILTER","Can't use Null seperator string"); } else { strcpy(sepin, "/r"); } if (argc > 4) { ptr = MesgParse(sepbuf,sepbuf); CHECKRETURN(ptr,"FILTER","arg 5"); } else { strcpy(sepbuf, sepin); } seplen = strlen(sepin); *buf = '/0'; ptr = dptr; while (*ptr) { for (ptr2 = ptr; *ptr2 && strncmp(ptr2, sepin, seplen); ptr2++); if (*ptr2) { *ptr2 = '/0'; ptr2 += seplen; } strcpy(tmp, ptr); dptr = MesgParse(argv[2],buf2); CHECKRETURN(dptr,"FILTER","arg 3"); if (truestr(buf2)) { if (*buf) strcat(buf, sepbuf); strcat(buf, ptr); } ptr = ptr2; if (!(--iter_limit)) ABORT_MPI("FILTER","Iteration limit exceeded"); } free_top_mvar(); return buf;}
开发者ID:TealWizard,项目名称:TinyMUCK-Tapestries,代码行数:58,
示例18: mfn_mufconst char *mfn_muf(MFUNARGS){ char *ptr; struct inst *rv = NULL; dbref obj = mesg_dbref_raw(player, what, perms, argv[0]); if (obj == UNKNOWN) ABORT_MPI("MUF","Match failed"); if (obj <= NOTHING || Typeof(obj) != TYPE_PROGRAM) ABORT_MPI("MUF","Bad program reference"); if (!(FLAGS(obj) & LINK_OK) && !controls(perms,obj)) ABORT_MPI("MUF",NOPERM_MESG); if ((mesgtyp & (MPI_ISLISTENER | MPI_ISLOCK)) && (MLevel(obj) < LM3)) ABORT_MPI("MUF",NOPERM_MESG); if (++mpi_muf_call_levels > 18) ABORT_MPI("MUF","Too many call levels"); strcpy(match_args, argv[1]); ptr = get_mvar("how"); strcpy(match_cmdname, ptr); strcat(match_cmdname, "(MPI)"); rv = interp(player, DBFETCH(player)->location, obj, perms, PREEMPT, STD_HARDUID, 1); mpi_muf_call_levels--; if (!rv) return ""; switch(rv->type) { case PROG_STRING: if (rv->data.string) { strcpy(buf, rv->data.string->data); CLEAR(rv); return buf; } else { CLEAR(rv); return ""; } break; case PROG_INTEGER: sprintf(buf, "%d", rv->data.number); CLEAR(rv); return buf; break; case PROG_OBJECT: ptr = ref2str(rv->data.objref, buf); CLEAR(rv); return ptr; break; default: CLEAR(rv); return ""; break; } return "";}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:58,
示例19: mfn_commasconst char *mfn_commas(MFUNARGS){ int v, i, count; char *ptr; char buf2[BUFFER_LEN]; char tmp[BUFFER_LEN]; if (argc == 3) ABORT_MPI("COMMAS","Takes 1, 2, or 4 arguments"); ptr = MesgParse(argv[0], argv[0]); CHECKRETURN(ptr,"COMMAS","arg 1"); count = countlitems(argv[0], "/r"); if (count == 0) return ""; if (argc > 1) { ptr = MesgParse(argv[1], argv[1]); CHECKRETURN(ptr,"COMMAS","arg 2"); } else { strcpy(argv[1], " and "); } if (argc > 2) { ptr = MesgParse(argv[2], buf2); CHECKRETURN(ptr,"COMMAS","arg 3"); v = new_mvar(ptr, tmp); if (v == 1) ABORT_MPI("COMMAS","Variable name too long"); if (v == 2) ABORT_MPI("COMMAS","Too many variables already defined"); } *buf = '/0'; for (i = 1; i <= count; i++) { ptr = getlitem(buf2, argv[0], "/r", i); if (argc > 2) { strcpy(tmp, ptr); ptr = MesgParse(argv[3], buf2); CHECKRETURN(ptr,"COMMAS","arg 3"); } strcat(buf, ptr); switch (count - i) { case 0: if (argc > 2) free_top_mvar(); return buf; break; case 1: strcat(buf, argv[1]); break; default: strcat(buf, ", "); break; } } if (argc > 2) free_top_mvar(); return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:58,
示例20: mfn_flagsconst char *mfn_flags(MFUNARGS){ dbref obj = mesg_dbref_local(descr, player, what, perms, argv[0], mesgtyp); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME) ABORT_MPI("FLAGS", "Match failed."); if (obj == PERMDENIED) ABORT_MPI("FLAGS", "Permission denied."); return unparse_flags(obj);}
开发者ID:rhencke,项目名称:fuzzball,代码行数:11,
示例21: mfn_contentsconst char *mfn_contents(MFUNARGS){ char buf2[50]; int list_limit = MAX_MFUN_LIST_LEN; dbref obj = mesg_dbref_local(player, what, perms, argv[0]); int typchk, ownroom; int outlen, nextlen; if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME) ABORT_MPI("CONTENTS","Match failed"); if (obj == PERMDENIED) ABORT_MPI("CONTENTS",NOPERM_MESG); typchk = NOTYPE; if (argc > 1) { if (!string_compare(argv[1], "Room")) { typchk = TYPE_ROOM; } else if (!string_compare(argv[1], "Exit")) { typchk = TYPE_EXIT; /* won't find any, though */ } else if (!string_compare(argv[1], "Player")) { typchk = TYPE_PLAYER; } else if (!string_compare(argv[1], "Program")) { typchk = TYPE_PROGRAM; } else if (!string_compare(argv[1], "Thing")) { typchk = TYPE_THING; } else { ABORT_MPI("CONTENTS","Type must be 'player', 'room', 'thing', 'program', or 'exit'. (2)"); } } strcpy(buf, ""); outlen = 0; ownroom = controls(perms, obj); obj = DBFETCH(obj)->contents; while (obj != NOTHING && list_limit) { if ((typchk == NOTYPE || Typeof(obj) == typchk) && (ownroom || controls(perms, obj) || !((FLAGS(obj) & DARK) || (FLAGS(getloc(obj)) & DARK) || (Typeof(obj) == TYPE_PROGRAM && !(FLAGS(obj) & LINK_OK)))) && !(Typeof(obj) == TYPE_ROOM && typchk != TYPE_ROOM)) { ref2str(obj, buf2); nextlen = strlen(buf2); if ((outlen + nextlen) >= (BUFFER_LEN - 3)) break; if (outlen) strcat((buf+(outlen++)), "/r"); strcat((buf + outlen), buf2); outlen += nextlen; list_limit--; } obj = DBFETCH(obj)->next; } return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:53,
示例22: mfn_locconst char *mfn_loc(MFUNARGS){ dbref obj; obj = mesg_dbref_local(descr, player, what, perms, argv[0], mesgtyp); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME) ABORT_MPI("LOC", "Match failed."); if (obj == PERMDENIED) ABORT_MPI("LOC", "Permission denied."); return ref2str(getloc(obj), buf, BUFFER_LEN);}
开发者ID:rhencke,项目名称:fuzzball,代码行数:12,
示例23: mfn_pronounsconst char *mfn_pronouns(MFUNARGS){ dbref obj = player; if (argc > 1) { obj = mesg_dbref_local(descr, player, what, perms, argv[1], mesgtyp); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME) ABORT_MPI("PRONOUNS", "Match failed."); if (obj == PERMDENIED) ABORT_MPI("PRONOUNS", "Permission Denied."); } return pronoun_substitute(descr, obj, argv[0]);}
开发者ID:rhencke,项目名称:fuzzball,代码行数:14,
示例24: mfn_ownerconst char *mfn_owner(MFUNARGS){ dbref obj; obj = mesg_dbref_raw(player, what, perms, argv[0]); if (obj == AMBIGUOUS || obj == NOTHING || obj == UNKNOWN) ABORT_MPI("OWNER","Failed match"); if (obj == PERMDENIED) ABORT_MPI("OWNER",NOPERM_MESG); if (obj == HOME) obj = DBFETCH(player)->sp.player.home; return ref2str(OWNER(obj), buf);}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:14,
示例25: mfn_usecountconst char *mfn_usecount(MFUNARGS){ dbref obj; obj = mesg_dbref(descr, player, what, perms, argv[0], mesgtyp); if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME) ABORT_MPI("USECOUNT", "Match failed."); if (obj == PERMDENIED) ABORT_MPI("USECOUNT", "Permission denied."); snprintf(buf, BUFFER_LEN, "%d", DBFETCH(obj)->ts.usecount); return buf;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:15,
示例26: mfn_linksconst char *mfn_links(MFUNARGS){ char buf2[BUFFER_LEN]; dbref obj; int i, cnt; obj = mesg_dbref(player, what, perms, argv[0]); if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME) ABORT_MPI("LINKS","Match failed"); if (obj == PERMDENIED) ABORT_MPI("LINKS",NOPERM_MESG); switch (Typeof(obj)) { case TYPE_ROOM: obj = DBFETCH(obj)->sp.room.dropto; break; case TYPE_PLAYER: obj = DBFETCH(obj)->sp.player.home; break; case TYPE_THING: obj = DBFETCH(obj)->sp.thing.home; break; case TYPE_EXIT: { dbref obj2; *buf = '/0'; cnt = DBFETCH(obj)->sp.exit.ndest; if (cnt) { for (i = 0; i < cnt; i++) { obj2 = DBFETCH(obj)->sp.exit.dest[i]; ref2str(obj2, buf2); if (strlen(buf) + strlen(buf2) + 2 < BUFFER_LEN) { if (*buf) strcat(buf, "/r"); strcat(buf, buf2); } else break; } return buf; } else { return "#-1"; } break; } case TYPE_PROGRAM: default: return "#-1"; break; } return ref2str(obj, buf);}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:48,
示例27: mfn_typeconst char *mfn_type(MFUNARGS){ dbref obj = mesg_dbref_local(player, what, perms, argv[0]); if (obj == NOTHING || obj == AMBIGUOUS || obj == UNKNOWN) return("Bad"); if (obj == HOME) return("Room"); if (obj == PERMDENIED) ABORT_MPI("TYPE",NOPERM_MESG); switch(Typeof(obj)) { case TYPE_PLAYER: return "Player"; break; case TYPE_ROOM: return "Room"; break; case TYPE_EXIT: return "Exit"; break; case TYPE_THING: return "Thing"; break; case TYPE_PROGRAM: return "Program"; break; default: return "Bad"; break; } return "Bad";}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:33,
示例28: mfn_istypeconst char *mfn_istype(MFUNARGS){ dbref obj = mesg_dbref_raw(player, what, perms, argv[0]); if (obj == NOTHING || obj == AMBIGUOUS || obj == UNKNOWN) return(string_compare(argv[1], "Bad") ? "0" : "1"); if (obj == PERMDENIED) ABORT_MPI("TYPE",NOPERM_MESG); if (obj == HOME) return(string_compare(argv[1], "Room") ? "0" : "1"); switch(Typeof(obj)) { case TYPE_PLAYER: return(string_compare(argv[1], "Player") ? "0" : "1"); break; case TYPE_ROOM: return(string_compare(argv[1], "Room") ? "0" : "1"); break; case TYPE_EXIT: return(string_compare(argv[1], "Exit") ? "0" : "1"); break; case TYPE_THING: return(string_compare(argv[1], "Thing") ? "0" : "1"); break; case TYPE_PROGRAM: return(string_compare(argv[1], "Program") ? "0" : "1"); break; default: return(string_compare(argv[1], "Bad") ? "0" : "1"); break; } return(string_compare(argv[1], "Bad") ? "0" : "1");}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:34,
示例29: mfn_lockedconst char *mfn_locked(MFUNARGS){ dbref who = mesg_dbref_local(player, what, perms, argv[0]); dbref obj = mesg_dbref_local(player, what, perms, argv[1]); if (who == AMBIGUOUS || who == UNKNOWN || who == NOTHING || who == HOME) ABORT_MPI("LOCKED","Match failed. (1)"); if (who == PERMDENIED) ABORT_MPI("LOCKED","Permission denied. (1)"); if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME) ABORT_MPI("LOCKED","Match failed. (2)"); if (obj == PERMDENIED) ABORT_MPI("LOCKED","Permission denied. (2)"); sprintf(buf, "%d", !could_doit(who, obj)); return buf;}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:16,
示例30: mfn_distconst char *mfn_dist(MFUNARGS){ int a, b, c; int a2, b2, c2; double result; a2 = b2 = c = c2 = 0; a = atoi(argv[0]); b = atoi(argv[1]); if (argc == 3) { c = atoi(argv[2]); } else if (argc == 4) { a2 = atoi(argv[2]); b2 = atoi(argv[3]); } else if (argc == 6) { c = atoi(argv[2]); a2 = atoi(argv[3]); b2 = atoi(argv[4]); c2 = atoi(argv[5]); } else if (argc != 2) { ABORT_MPI("DIST", "Takes 2,3,4, or 6 arguments."); } a -= a2; b -= b2; c -= c2; result = sqrt((double) (a * a) + (double) (b * b) + (double) (c * c)); snprintf(buf, BUFFER_LEN, "%.0f", floor(result + 0.5)); return buf;}
开发者ID:rhencke,项目名称:fuzzball,代码行数:31,
注:本文中的ABORT_MPI函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ABR函数代码示例 C++ ABORT_FINALIZE函数代码示例 |