当前位置: 首页>>代码示例>>C++>>正文


C++ OWNER函数代码示例

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


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

示例1: Button_Processor

extern MRESULT EXPENTRY Button_Processor ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {

   static PWINDOWPROC DefaultProcessor = 0 ;

   switch ( msg ) {

      case WM_CREATE: {
         CLASSINFO ClassInfo ;
         WinQueryClassInfo ( WinQueryAnchorBlock(hwnd), WC_BUTTON, &ClassInfo ) ;
         DefaultProcessor = ClassInfo.pfnWindowProc ;
         break; }

      case WM_SETFOCUS: {
         USHORT Id = WinQueryWindowUShort ( hwnd, QWS_ID ) ;
         if ( mp2 ) {
            Sys_SendMessage( hwnd, BM_SETDEFAULT, MPFROMSHORT(TRUE), 0 ) ;
            Sys_SendMessage( OWNER(hwnd), WM_CONTROL, MPFROM2SHORT(Id,BN_SETFOCUS), 0 ) ;
         } else {
            Sys_SendMessage( hwnd, BM_SETDEFAULT, MPFROMSHORT(FALSE), 0 ) ;
            Sys_SendMessage( OWNER(hwnd), WM_CONTROL, MPFROM2SHORT(Id,BN_KILLFOCUS), 0 ) ;
         } /* endif */
         break; }

   } /* endswitch */

   return ( DefaultProcessor ? DefaultProcessor ( hwnd, msg, mp1, mp2 ) : 0 ) ;
}
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:27,代码来源:CONTROLS.CPP

示例2: mfn_controls

const 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,代码来源:mfuns2.c

示例3: onInit

Core::Command* Jumping::
onInit()
{
    // TODO return command to change texture
    Base::EventManager::process(new MakeTriggerForPlatforms(OWNER(), true));
    return new Jump(OWNER(), 20 * m_power);
}
开发者ID:hop-,项目名称:Mercurius,代码行数:7,代码来源:states.cpp

示例4: mesg_read_perms

int
mesg_read_perms(dbref player, dbref perms, dbref obj)
{
    if ((obj == 0) || (obj == player) || (obj == perms)) return 1;
    if (OWNER(perms) == OWNER(obj)) return 1;
    if (Wizperms(perms)) return 1;
    return 0;
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:8,代码来源:msgparse.c

示例5: blessprops_wildcard

int
blessprops_wildcard(dbref player, dbref thing, const char *dir, const char *wild, int blessp)
{
	char propname[BUFFER_LEN];
	char wld[BUFFER_LEN];
	char buf[BUFFER_LEN];
	char buf2[BUFFER_LEN];
	char *ptr, *wldcrd = wld;
	PropPtr propadr, pptr;
	int i, cnt = 0;
	int recurse = 0;

#ifdef GOD_PRIV
	if(tp_strict_god_priv && !God(player) && God(OWNER(thing))) {
		notify(player,"Only God may touch what is God's.");
		return 0;
	}
#endif

	strcpyn(wld, sizeof(wld), wild);
	i = strlen(wld);
	if (i && wld[i - 1] == PROPDIR_DELIMITER)
		strcatn(wld, sizeof(wld), "*");
	for (wldcrd = wld; *wldcrd == PROPDIR_DELIMITER; wldcrd++) ;
	if (!strcmp(wldcrd, "**"))
		recurse = 1;

	for (ptr = wldcrd; *ptr && *ptr != PROPDIR_DELIMITER; ptr++) ;
	if (*ptr)
		*ptr++ = '\0';

	propadr = first_prop(thing, (char *) dir, &pptr, propname, sizeof(propname));
	while (propadr) {
		if (equalstr(wldcrd, propname)) {
			snprintf(buf, sizeof(buf), "%s%c%s", dir, PROPDIR_DELIMITER, propname);
			if (!Prop_System(buf) && ((!Prop_Hidden(buf) && !(PropFlags(propadr) & PROP_SYSPERMS))
				|| Wizard(OWNER(player)))) {
				if (!*ptr || recurse) {
					cnt++;
					if (blessp) {
						set_property_flags(thing, buf, PROP_BLESSED);
						snprintf(buf2, sizeof(buf2), "Blessed %s", buf);
					} else {
						clear_property_flags(thing, buf, PROP_BLESSED);
						snprintf(buf2, sizeof(buf2), "Unblessed %s", buf);
					}
					notify(player, buf2);
				}
				if (recurse)
					ptr = "**";
				cnt += blessprops_wildcard(player, thing, buf, ptr, blessp);
			}
		}
		propadr = next_prop(pptr, propadr, propname, sizeof(propname));
	}
	return cnt;
}
开发者ID:hyena,项目名称:fuzzball,代码行数:57,代码来源:wiz.c

示例6: safegetprop_strict

const char *
safegetprop_strict(dbref player, dbref what, dbref perms, const char *inbuf)
{
    const char *ptr;
    char  bbuf[BUFFER_LEN];
    char  vl[32];

    if (!inbuf) {
        notify_nolisten(player, "PropFetch: Propname required.", 1);
        return NULL;
    }
    while (*inbuf == PROPDIR_DELIMITER)
        inbuf++;
    if (!*inbuf) {
        notify_nolisten(player, "PropFetch: Propname required.", 1);
        return NULL;
    }
    strcpy(bbuf, inbuf);
    if (!Archperms(perms)) {
        if (Prop_Hidden(bbuf)) {
            notify_nolisten(player, "PropFetch: Permission denied.", 1);
            return NULL;
        }
        if (Prop_Private(bbuf) && OWNER(perms) != OWNER(what)) {
            notify_nolisten(player, "PropFetch: Permission denied.", 1);
            return NULL;
        }
    }
    ptr = get_property_class(what, bbuf);
    if (!ptr) {
        int i;

	i = get_property_value(what, bbuf);
	if (!i) {
	    dbref dd;

	    dd = get_property_dbref(what, bbuf);
	    if (dd == NOTHING) {
		*vl = '\0';
		ptr = vl;
		return ptr;
	    } else {
		sprintf(vl, "#%d", dd);
		ptr = vl;
	    }
	} else {
	    sprintf(vl, "%d", i);
	    ptr = vl;
	}
    }

#ifdef COMPRESS
    ptr = uncompress(ptr);
#endif
    return ptr;
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:56,代码来源:msgparse.c

示例7: mesg_local_perms

int
mesg_local_perms(dbref player, dbref perms, dbref obj)
{
    if (OWNER(perms) == OWNER(getloc(obj))) return 1;
    if (isneighbor(perms, obj)) return 1;
    if (isneighbor(player, obj)) return 1;
    if (Mageperms(perms)) return 1;
    if (mesg_read_perms(player, perms, obj)) return 1;
    return 0;
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:10,代码来源:msgparse.c

示例8: onKeyEvent2

void OnLadder::
onKeyEvent2(Base::Event* e)
{
    Core::KeyEvent* k = Core::KeyEvent::cast(e);
    assert(0 != k);
    if (k->mode() == Core::KeyEvent::Mode::Down
            && k->key() == Core::InputManager::Key::Jump) {
        Base::EventManager::process(new Core::OnAir(OWNER()));
        OWNER()->changeState(this, new Jumping);
    }
}
开发者ID:hop-,项目名称:Mercurius,代码行数:11,代码来源:states.cpp

示例9: mesg_read_perms

int
mesg_read_perms(dbref player, dbref perms, dbref obj, int mesgtyp)
{
	if ((obj == 0) || (obj == player) || (obj == perms))
		return 1;
	if (OWNER(perms) == OWNER(obj))
		return 1;
	if ((mesgtyp & MPI_ISBLESSED))
		return 1;
	return 0;
}
开发者ID:PyroMuddypaw,项目名称:fuzzball,代码行数:11,代码来源:msgparse.c

示例10: atTheSwitch

void SwitchActive::
atTheSwitch(Base::Event* e)
{
    AtTheSwitch* as = AtTheSwitch::cast(e);
    assert(0 != as);
    if (as->switchObject() != OWNER()
            && as->status() == true) {
        return;
    }
    OWNER()->changeState(this, new SwitchInactive);
}
开发者ID:hop-,项目名称:Mercurius,代码行数:11,代码来源:states.cpp

示例11: onToggle

void SwitchState::
onToggle(Base::Event* e)
{
    ToggleTheSwitch* t = ToggleTheSwitch::cast(e);
    assert(0 != t);
    if (t->switchObject() != OWNER()) {
        return;
    }
    assert(0 != OWNER());
    OWNER()->changeState(this, new SwitchState(!m_status));
}
开发者ID:hop-,项目名称:Mercurius,代码行数:11,代码来源:states.cpp

示例12: mesg_dbref_strict

dbref
mesg_dbref_strict(int descr, dbref player, dbref what, dbref perms, char *buf)
{
    dbref obj = mesg_dbref_raw(descr, player, what, perms, buf);

    if (obj == UNKNOWN) return obj;
    if (!Wizperms(perms) && OWNER(perms) != OWNER(obj)) {
        obj = PERMDENIED;
    }
    return obj;
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:11,代码来源:msgparse.c

示例13: mesg_dbref_strict

dbref
mesg_dbref_strict(int descr, dbref player, dbref what, dbref perms, char *buf, int mesgtyp)
{
	dbref obj = mesg_dbref_raw(descr, player, what, perms, buf);

	if (obj == UNKNOWN)
		return obj;
	if (!(mesgtyp & MPI_ISBLESSED) && OWNER(perms) != OWNER(obj)) {
		obj = PERMDENIED;
	}
	return obj;
}
开发者ID:PyroMuddypaw,项目名称:fuzzball,代码行数:12,代码来源:msgparse.c

示例14: msg_unparse_macro

static void
msg_unparse_macro(dbref player, dbref what, dbref perms, char *name, int argc, argv_typ argv, char *rest, int maxchars)
{
    const char   *ptr;
    char *ptr2;
    char    buf[BUFFER_LEN];
    char    buf2[BUFFER_LEN];
    dbref   obj;
    int     i, p = 0;

    strcpy(buf, rest);
    sprintf(buf2, "_msgmacs/%s", name);
    obj = what;
    ptr = get_mfunc(name);
    if (!ptr || !*ptr) ptr = safegetprop_strict(player, OWNER(obj), perms, buf2);
    if (!ptr || !*ptr) ptr = safegetprop_limited(player, obj, OWNER(obj), perms, buf2);
    if (!ptr || !*ptr) ptr = safegetprop_strict(player, 0, perms, buf2);
    while (ptr && *ptr && p < (maxchars - 1)) {
        if (*ptr == '\\') {
            if (*(ptr+1) == 'r') {
                rest[p++] = '\r';
		ptr++; ptr++;
            } else {
                rest[p++] = *(ptr++);
                rest[p++] = *(ptr++);
            }
        } else if (*ptr == MFUN_LEADCHAR) {
            if (*(ptr+1) == MFUN_ARGSTART && isdigit(*(ptr + 2)) &&
                    *(ptr + 3) == MFUN_ARGEND) {
                ptr++; ptr++;
                i = *(ptr++) - '1';
                ptr++;
                if (i >= argc || i < 0) {
                    ptr2 = NULL;
                } else {
                    ptr2 = argv[i];
                }
                while (ptr2 && *ptr2 && p < (maxchars - 1)) {
                    rest[p++] = *(ptr2++);
                }
            } else {
                rest[p++] = *(ptr++);
            }
        } else {
            rest[p++] = *(ptr++);
        }
    }
    ptr2 = buf;
    while (ptr2 && *ptr2 && p < (maxchars - 1)) {
        rest[p++] = *(ptr2++);
    }
    rest[p] = '\0';
}
开发者ID:TealWizard,项目名称:TinyMUCK-Tapestries,代码行数:53,代码来源:msgparse.c

示例15: mesg_local_perms

int
mesg_local_perms(dbref player, dbref perms, dbref obj, int mesgtyp)
{
	if (getloc(obj) != NOTHING && OWNER(perms) == OWNER(getloc(obj)))
		return 1;
	if (isneighbor(perms, obj))
		return 1;
	if (isneighbor(player, obj))
		return 1;
	if (mesg_read_perms(player, perms, obj, mesgtyp))
		return 1;
	return 0;
}
开发者ID:PyroMuddypaw,项目名称:fuzzball,代码行数:13,代码来源:msgparse.c


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