这篇教程C++ IsMember函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中IsMember函数的典型用法代码示例。如果您正苦于以下问题:C++ IsMember函数的具体用法?C++ IsMember怎么用?C++ IsMember使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了IsMember函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: VALUESvoid PHPEntityVariable::Store(wxSQLite3Database& db){ // we keep only the function arguments in the databse and globals if(IsFunctionArg() || IsMember()) { try { wxSQLite3Statement statement = db.PrepareStatement("INSERT OR REPLACE INTO VARIABLES_TABLE VALUES (NULL, " ":SCOPE_ID, :FUNCTION_ID, :NAME, :FULLNAME, :SCOPE, :TYPEHINT, " ":FLAGS, :DOC_COMMENT, :LINE_NUMBER, :FILE_NAME)"); statement.Bind(statement.GetParamIndex(":SCOPE_ID"), IsMember() ? Parent()->GetDbId() : wxLongLong(-1)); statement.Bind(statement.GetParamIndex(":FUNCTION_ID"), IsFunctionArg() ? Parent()->GetDbId() : wxLongLong(-1)); statement.Bind(statement.GetParamIndex(":NAME"), GetShortName()); statement.Bind(statement.GetParamIndex(":FULLNAME"), GetFullName()); statement.Bind(statement.GetParamIndex(":SCOPE"), GetScope()); statement.Bind(statement.GetParamIndex(":TYPEHINT"), GetTypeHint()); statement.Bind(statement.GetParamIndex(":FLAGS"), (int)GetFlags()); statement.Bind(statement.GetParamIndex(":DOC_COMMENT"), GetDocComment()); statement.Bind(statement.GetParamIndex(":LINE_NUMBER"), GetLine()); statement.Bind(statement.GetParamIndex(":FILE_NAME"), GetFilename().GetFullPath()); statement.ExecuteUpdate(); SetDbId(db.GetLastRowId()); } catch(wxSQLite3Exception& exc) { wxUnusedVar(exc); } }}
开发者ID:timfenlon,项目名称:codelite,代码行数:28,
示例2: CheckArguments//// This file contains the C++ code from Program 12.20 of// "Data Structures and Algorithms// with Object-Oriented Design Patterns in C++"// by Bruno R. Preiss.//// Copyright (c) 1998 by Bruno R. Preiss, P.Eng. All rights reserved.//// http://www.pads.uwaterloo.ca/Bruno.Preiss/books/opus4/programs/pgm12_20.cpp//void PartitionAsForest::CheckArguments ( PartitionTree const& s, PartitionTree const& t){ if (!IsMember (s) || s.parent != 0 || !IsMember (t) || t.parent != 0 || s == t) throw invalid_argument ("incompatible sets");}
开发者ID:lbaby,项目名称:codeGarden,代码行数:17,
示例3: NewMemberBOOL CParty::NewMember( u_long uPlayerId, LONG nLevel, LONG nJob, BYTE nSex, LPSTR szName )#endif // __SYS_PLAYER_DATA{#if __VER < 11 // __SYS_PLAYER_DATA if( szName == NULL ) return FALSE;#endif // __SYS_PLAYER_DATA if( IsMember( uPlayerId ) == FALSE && m_nSizeofMember < MAX_PTMEMBER_SIZE ) { m_aMember[m_nSizeofMember].m_uPlayerId = uPlayerId;#if __VER < 11 // __SYS_PLAYER_DATA m_aMember[m_nSizeofMember].m_nLevel = nLevel; m_aMember[m_nSizeofMember].m_nJob = nJob; m_aMember[m_nSizeofMember].m_nSex = nSex;#endif // __SYS_PLAYER_DATA m_aMember[m_nSizeofMember].m_bRemove = FALSE;#if __VER < 11 // __SYS_PLAYER_DATA strcpy( m_aMember[m_nSizeofMember].m_szName, szName );#endif // __SYS_PLAYER_DATA m_nSizeofMember++; return TRUE; } return FALSE;}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:25,
示例4: UnitDeviceAddBOOL CNBLogicalDevice::UnitDeviceAdd(CNBUnitDevice *pUnitDevice){ UINT32 iSequence; if(pUnitDevice->IsGroup()) { if(m_mapUnitDevices.size() && !IsMember(pUnitDevice)) { ATLASSERT(FALSE); return FALSE; } iSequence = pUnitDevice->m_DIB.iSequence; } else { iSequence = 0; } m_mapUnitDevices[iSequence] = pUnitDevice; ATLTRACE(_T("CNBLogicalDevice(%p).m_mapUnitDevices[%d] = (%p) : %s/n"), this, iSequence, pUnitDevice, pUnitDevice->GetName()); pUnitDevice->m_pLogicalDevice = this; return TRUE;}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:28,
示例5: indentStringvoid PHPEntityVariable::PrintStdout(int indent) const{ wxString indentString(' ', indent); wxPrintf("%s%s: %s", indentString, IsMember() ? "Member" : "Variable", GetShortName()); if(!GetTypeHint().IsEmpty()) { wxPrintf(", TypeHint: %s", GetTypeHint()); } if(!GetExpressionHint().IsEmpty()) { wxPrintf(", ExpressionHint: %s", GetExpressionHint()); } if(IsReference()) { wxPrintf(", Reference"); } if(!GetDefaultValue().IsEmpty()) { wxPrintf(", Default: %s", GetDefaultValue()); } wxPrintf(", Ln. %d", GetLine()); wxPrintf("/n"); PHPEntityBase::List_t::const_iterator iter = m_children.begin(); for(; iter != m_children.end(); ++iter) { (*iter)->PrintStdout(indent + 4); }}
开发者ID:timfenlon,项目名称:codelite,代码行数:25,
示例6: safelist_one_channel/* * safelist_one_channel() * * inputs - client pointer and channel pointer * outputs - none * side effects - a channel is listed if it meets the * requirements */static void safelist_one_channel(struct Client *source_p, struct Channel *chptr){ struct ListClient *safelist_data = source_p->localClient->safelist_data; int visible; visible = !SecretChannel(chptr) || IsMember(source_p, chptr); if (!visible && !safelist_data->operspy) return; if ((unsigned int)chptr->members.length < safelist_data->users_min || (unsigned int)chptr->members.length > safelist_data->users_max) return; if (safelist_data->topic_min && chptr->topic_time < safelist_data->topic_min) return; /* If a topic TS is provided, don't show channels without a topic set. */ if (safelist_data->topic_max && (chptr->topic_time > safelist_data->topic_max || chptr->topic_time == 0)) return; if (safelist_data->created_min && chptr->channelts < safelist_data->created_min) return; if (safelist_data->created_max && chptr->channelts > safelist_data->created_max) return; list_one_channel(source_p, chptr, visible);}
开发者ID:ShutterQuick,项目名称:charybdis,代码行数:37,
示例7: safelist_channel_named/* * safelist_channel_named() * * inputs - client pointer, channel name, operspy * outputs - none * side effects - a named channel is listed */static void safelist_channel_named(struct Client *source_p, const char *name, int operspy){ struct Channel *chptr; char *p; int visible; sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name); if ((p = strchr(name, ','))) *p = '/0'; if (*name == '/0') { sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), name); sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); return; } chptr = find_channel(name); if (chptr == NULL) { sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), name); sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); return; } visible = !SecretChannel(chptr) || IsMember(source_p, chptr); if (visible || operspy) list_one_channel(source_p, chptr, visible); sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); return;}
开发者ID:ShutterQuick,项目名称:charybdis,代码行数:41,
示例8: PState/* PState: parse state and add all matches in models to ilist */static void PState(ILink models, ILink *ilist, char *type, HMMSet *hset){ IntSet states; int j; HMMDef *hmm; ILink h; states = CreateSet(maxStates); PIndex(states); SkipSpaces(); if (ch == '.') { ReadCh(); PStatecomp(models,ilist,type,states,hset); } else { ChkType('s',type); for (h=models; h!=NULL; h=h->next) { hmm = h->owner; for (j=2; j<hmm->numStates; j++) if (IsMember(states,j)) { /* tie ->info */ if (trace & T_ITM) printf(" %12s.state[%d]/n", HMMPhysName(hset,hmm),j); AddItem(hmm,hmm->svec+j,ilist); } } } FreeSet(states);}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:29,
示例9: ShowChannelstatic char *first_visible_channel(aClient *sptr, aClient *acptr, int *flg){ Membership *lp; *flg = 0; for (lp = acptr->user->channel; lp; lp = lp->next) { aChannel *chptr = lp->chptr; int cansee = ShowChannel(sptr, chptr); if (cansee && (acptr->umodes & UMODE_HIDEWHOIS) && !IsMember(sptr, chptr)) cansee = 0; if (!cansee) { if (OPCanSeeSecret(sptr)) *flg |= FVC_HIDDEN; else continue; } return chptr->chname; } /* no channels that they can see */ return "*";}
开发者ID:Adam-,项目名称:unrealircd,代码行数:26,
示例10: DoRecordvoid SimulationOutput::DoRecord(const ComponentFrame* frame, const Bunch* bunch){ if(frame->IsComponent()) { string id = (*frame).GetComponent().GetQualifiedName(); if(output_all || IsMember(id)) { Record(frame,bunch); } }}
开发者ID:MERLIN-Collaboration,项目名称:MERLIN,代码行数:12,
示例11: ParentwxString PHPEntityVariable::GetScope() const{ PHPEntityBase* parent = Parent(); if(parent && parent->Is(kEntityTypeFunction) && IsFunctionArg()) { return parent->Cast<PHPEntityFunction>()->GetScope(); } else if(parent && parent->Is(kEntityTypeClass) && IsMember()) { return parent->GetFullName(); } else { return ""; }}
开发者ID:timfenlon,项目名称:codelite,代码行数:13,
示例12: wordsint WordSet::operator==(const WordSet &rhs) const{ //----------------------------------------- // false if sets have different cardinality //----------------------------------------- if (rhs.NumberOfEntries() != NumberOfEntries()) return 0; //----------------------------------------- // false if some word in rhs is not in lhs //----------------------------------------- WordSetIterator words(&rhs); unsigned long *word; for (; (word = words.Current()); words++) if (IsMember(*word) == 0) return 0; return 1; // equal otherwise}
开发者ID:wjcsharp,项目名称:hpctoolkit,代码行数:16,
示例13: eb_channelstatic int eb_channel(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type){ struct Channel *chptr2; (void)chptr; (void)mode_type; if (data == NULL) return EXTBAN_INVALID; chptr2 = find_channel(data); if (chptr2 == NULL) return EXTBAN_INVALID; /* privacy! don't allow +s/+p channels to influence another channel */ if (!PubChannel(chptr2)) return EXTBAN_INVALID; return IsMember(client_p, chptr2) ? EXTBAN_MATCH : EXTBAN_NOMATCH;}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:17,
示例14: eb_channelstatic int eb_channel(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type){ struct Channel *chptr2; (void)chptr; (void)mode_type; if (data == NULL) return EXTBAN_INVALID; chptr2 = find_channel(data); if (chptr2 == NULL) return EXTBAN_INVALID; /* require consistent target */ if (chptr->chname[0] == '#' && data[0] == '&') return EXTBAN_INVALID; return IsMember(client_p, chptr2) ? EXTBAN_MATCH : EXTBAN_NOMATCH;}
开发者ID:KeiroD,项目名称:charybdis,代码行数:17,
示例15: list_all_channels/* * list_all_channels * inputs - pointer to client requesting list * output - 0/1 * side effects - list all channels to source_p */static int list_all_channels(struct Client *source_p){ struct Channel *chptr; sendto_one(source_p, form_str(source_p,RPL_LISTSTART), me.name, source_p->name); for ( chptr = GlobalChannelList; chptr; chptr = chptr->nextch ) { if ( !source_p->user || (SecretChannel(chptr) && !IsMember(source_p, chptr))) continue; list_one_channel(source_p,chptr); } sendto_one(source_p, form_str(source_p,RPL_LISTEND), me.name, source_p->name); return 0;}
开发者ID:Cloudxtreme,项目名称:ircd-3,代码行数:23,
示例16: UpdatePlayerOnlineStatusvoid Group::UpdatePlayerOnlineStatus(Player* player, bool online /*= true*/){ if (!player) return; const ObjectGuid guid = player->GetObjectGuid(); if (!IsMember(guid)) return; SendUpdate(); if (online) { player->SetGroupUpdateFlag(GROUP_UPDATE_FULL); UpdatePlayerOutOfRange(player); } else if (IsLeader(guid)) m_leaderLastOnline = time(nullptr);}
开发者ID:Ghaster,项目名称:mangos-classic,代码行数:17,
示例17: AddMembervoid CBotSquad::AddMember ( edict_t *pEdict ){ if ( !IsMember(pEdict) ) { MyEHandle newh; //CBot *pBot; newh = pEdict; m_theSquad.Push(newh); /*if ( (pBot=CBots::getBotPointer(pEdict))!=NULL ) { pBot->clearSquad(); pBot->setSquad(this); }*/ }}
开发者ID:chrizonix,项目名称:RCBot2,代码行数:18,
示例18: do_channel_whostatic void do_channel_who(aClient *sptr, aChannel *channel, char *mask){ Member *cm = channel->members; if (IsMember(sptr, channel) || IsNetAdmin(sptr)) who_flags |= WF_ONCHANNEL; for (cm = channel->members; cm; cm = cm->next) { aClient *acptr = cm->cptr; char status[20]; int cansee; if ((cansee = can_see(sptr, acptr, channel)) & WHO_CANTSEE) continue; make_who_status(sptr, acptr, channel, cm, status, cansee); send_who_reply(sptr, acptr, channel->chname, status, ""); }}
开发者ID:Adam-,项目名称:unrealircd,代码行数:18,
示例19: GetForegroundWindowResultType WinGroup::CloseAndGoToNext(bool aStartWithMostRecent)// If the foreground window is a member of this group, close it and activate// the next member.{ if (IsEmpty()) return OK; // OK since this is the expected behavior in this case. // Otherwise: // Don't call Update(), let (De)Activate() do that. HWND fore_win = GetForegroundWindow(); // Even if it's NULL, don't return since the legacy behavior is to continue on to the final part below. WindowSpec *win_spec = IsMember(fore_win, *g); if ( (mIsModeActivate && win_spec) || (!mIsModeActivate && !win_spec) ) { // If the user is using a GroupActivate hotkey, we don't want to close // the foreground window if it's not a member of the group. Conversely, // if the user is using GroupDeactivate, we don't want to close a // member of the group. This precaution helps prevent accidental closing // of windows that suddenly pop up to the foreground just as you've // realized (too late) that you pressed the "close" hotkey. // MS Visual Studio/C++ gets messed up when it is directly sent a WM_CLOSE, // probably because the wrong window (it has two mains) is being sent the close. // But since that's the only app I've ever found that doesn't work right, // it seems best not to change our close method just for it because sending // keys is a fairly high overhead operation, and not without some risk due to // not knowing exactly what keys the user may have physically held down. // Also, we'd have to make this module dependent on the keyboard module, // which would be another drawback. // Try to wait for it to close, otherwise the same window may be activated // again before it has been destroyed, defeating the purpose of the // "ActivateNext" part of this function's job: // SendKeys("!{F4}"); if (fore_win) { WinClose(fore_win, 500); DoWinDelay; } } //else do the activation below anyway, even though no close was done. return mIsModeActivate ? Activate(aStartWithMostRecent, win_spec) : Deactivate(aStartWithMostRecent);}
开发者ID:469306621,项目名称:Languages,代码行数:42,
示例20: eb_channelstatic int eb_channel(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type){ struct Channel *chptr2; (void)chptr; (void)mode_type; if (data == NULL) return EXTBAN_INVALID; chptr2 = find_channel(data); if (chptr2 == NULL) return EXTBAN_INVALID; /* require consistent target */ if (chptr->chname[0] == '#' && data[0] == '&') return EXTBAN_INVALID; /* privacy! don't allow +s/+p channels to influence another channel */ if (!PubChannel(chptr2) && chptr2 != chptr) return EXTBAN_INVALID; return IsMember(client_p, chptr2) ? EXTBAN_MATCH : EXTBAN_NOMATCH;}
开发者ID:jdhore,项目名称:charybdis,代码行数:20,
示例21: has_common_channelsstatic int has_common_channels(aClient *c1, aClient *c2){ Membership *lp; for (lp = c1->user->channel; lp; lp = lp->next) { if (IsMember(c2, lp->chptr)) { if (c1 == c2) return 1; /* We must ensure that c1 is allowed to "see" c2 */ if ((lp->chptr->mode.mode & MODE_AUDITORIUM) && !is_chan_op(c2, lp->chptr) && !is_chan_op(c1, lp->chptr)) break; return 1; } } return 0;}
开发者ID:Adam-,项目名称:unrealircd,代码行数:20,
示例22: mo_ojoin/* mo_ojoin() * parv[0] = sender prefix * parv[1] = channels separated by commas (#ifdef OJOIN_MULTIJOIN) */static voidmo_ojoin(struct Client *client_p, struct Client *source_p, int parc, char *parv[]){ struct Channel *chptr; char *name = parv[1], modeletter;#ifdef OJOIN_MULTIJOIN char *t;#endif short move_me = 1; unsigned int tmp_flags; /* admins only */ if (!IsAdmin(source_p)) { sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, source_p->name); return; }#ifdef OJOIN_MULTIJOIN for (name = strtoken (&t, name, ","); name; name = strtoken (&t, NULL, ",")) {#endif move_me = 1; switch (*name) {#ifndef DISABLE_CHAN_OWNER case '!': tmp_flags = CHFL_CHANOWNER; modeletter = 'u'; name++; break;#endif case '@': tmp_flags = CHFL_CHANOP; modeletter = 'o'; name++; break; case '+': tmp_flags = CHFL_VOICE; modeletter = 'v'; name++; break; case '%': tmp_flags = CHFL_HALFOP; modeletter = 'h'; name++; break; case '#': case '&': tmp_flags = 0; modeletter = '/0'; break; /* We're not joining a channel, or we don't know the mode, * what ARE we joining? */ default: sendto_one (source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, name);#ifdef OJOIN_MULTIJOIN continue;#else return;#endif } /* Error checking here */ if ((chptr = hash_find_channel(name)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, name); } else if (IsMember(source_p, chptr)) { sendto_one(source_p, ":%s NOTICE %s :Please part %s before using OJOIN", me.name, source_p->name, name); } else { if (move_me == 1) name--; add_user_to_channel(chptr, source_p, tmp_flags); if (chptr->chname[0] == '#') { sendto_server(client_p, CAP_TS6, NOCAPS, ":%s SJOIN %lu %s + :%c%s",//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:shadowircd,代码行数:101,
示例23: PStatecomp/* PStatecomp: parse a statecomp */static void PStatecomp(ILink models, ILink *ilist, char *type, IntSet states, HMMSet *hset){ HMMDef *hmm; ILink h; int s,j; IntSet streams; Keyword kw; switch(kw=GetKey()) { case MIX_KEY: case STREAM_KEY: if (hset->hsKind==TIEDHS || hset->hsKind==DISCRETEHS) HError(7231,"PStatecomp: Cannot specify streams or mixes unless continuous"); streams = CreateSet(SMAX); if(kw==STREAM_KEY) { PIndex(streams); SkipSpaces(); if (ch != '.') EdError(". expected after stream spec"); ReadCh(); if (GetKey() != MIX_KEY) EdError("Mix expected after Stream index"); } else AddMember(streams,1); SkipSpaces(); if (ch=='[') PMix(models,ilist,type,states,streams,hset); else { ChkType('p',type); for (h=models; h!=NULL; h=h->next) { hmm = h->owner; for (j=2; j<hmm->numStates; j++) if (IsMember(states,j)) for (s=1; s<=hset->swidth[0];s++) if (IsMember(streams,s)) { /* tie -> spdf */ if (trace & T_ITM) printf(" %12s.state[%d].stream[%d]/n", HMMPhysName(hset,hmm),j,s); AddItem(hmm,hmm->svec[j].info->pdf+s,ilist); } } } FreeSet(streams); break; case DUR_KEY: ChkType('d',type); for (h=models; h!=NULL; h=h->next) { hmm = h->owner; for (j=2; j<hmm->numStates; j++) if (IsMember(states,j)) { /* tie ->dur */ if (trace & T_ITM) printf(" %12s.state[%d].dur/n", HMMPhysName(hset,hmm),j); AddItem(hmm,hmm->svec[j].info,ilist); } } break; case WEIGHTS_KEY: ChkType('w',type); for (h=models; h!=NULL; h=h->next) { hmm = h->owner; for (j=2; j<hmm->numStates; j++) if (IsMember(states,j)) { /* tie ->stream weights */ if (trace & T_ITM) printf(" %12s.state[%d].weights/n", HMMPhysName(hset,hmm),j); AddItem(hmm,hmm->svec[j].info,ilist); } } break; default: EdError("dur, weight, stream or mix expected"); }}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:76,
示例24: PMix/* PMix: parse a mixture spec */static void PMix(ILink models, ILink *ilist, char *type, IntSet states, IntSet streams,HMMSet *hset){ IntSet mixes; HMMDef *hmm; ILink h; int s,j,m; MixtureElem *me; StreamElem *ste; enum {TMIX, TMEAN, TCOV} what; mixes = CreateSet(maxMixes); PIndex(mixes); SkipSpaces(); what = TMIX; if (ch == '.') { ReadCh(); switch(GetKey()) { case MEAN_KEY: what = TMEAN; ChkType('u',type); break; case COV_KEY: what = TCOV; ChkType('a',type); break; default: EdError("Mean or Cov expected"); } } else ChkType('m',type); for (h=models; h!=NULL; h=h->next) { hmm = h->owner; for (j=2; j<hmm->numStates; j++) if (IsMember(states,j)) { ste = hmm->svec[j].info->pdf+1; for (s=1; s<=hset->swidth[0]; s++,ste++) if (IsMember(streams,s)) { me = ste->spdf.cpdf+1; for (m=1; m<=ste->nMix; m++,me++) if (me->weight>MINMIX && IsMember(mixes,m)) { switch (what) { case TMIX: /* tie ->mpdf */ if (trace & T_ITM) printf(" %12s.state[%d].stream[%d].mix[%d]/n", HMMPhysName(hset,hmm),j,s,m); AddItem(hmm,me,ilist); break; case TMEAN: /* tie ->mean */ ChkType('u',type); if (trace & T_ITM) printf(" %12s.state[%d].stream[%d].mix[%d].mean/n", HMMPhysName(hset,hmm),j,s,m); AddItem(hmm,me->mpdf,ilist); break; case TCOV: /* tie ->cov */ switch (me->mpdf->ckind) { case INVDIAGC: case DIAGC: ChkType('v',type); break; case FULLC: ChkType('i',type); break; case LLTC: ChkType('c',type); break; case XFORMC: ChkType('x',type); break; } if (trace & T_ITM) printf(" %12s.state[%d].stream[%d].mix[%d].%c/n", HMMPhysName(hset,hmm),j,s,m,*type); AddItem(hmm,me->mpdf,ilist); break; } } } } } FreeSet(mixes);}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:77,
示例25: ms_lljoin//.........这里部分代码省略......... vchan_chptr = select_vchan(chptr, target_p, vkey, chname); } else#endif { chptr = vchan_chptr = get_or_create_channel(target_p, chname, NULL); flags = CHFL_CHANOP; } #ifdef VCHANS if (vchan_chptr != chptr) { root_vchan = chptr; chptr = vchan_chptr; } else#endif root_vchan = chptr; if(!chptr || !root_vchan) return; if (chptr->users == 0) flags = CHFL_CHANOP; else flags = 0; /* XXX in m_join.c :( */ /* check_spambot_warning(target_p, chname); */ /* They _could_ join a channel twice due to lag */ if(chptr) { if (IsMember(target_p, chptr)) /* already a member, ignore this */ return; } else { sendto_one(target_p, form_str(ERR_UNAVAILRESOURCE), me.name, nick, root_vchan->chname); return; } if( (i = can_join(target_p, chptr, key)) ) { sendto_one(target_p, form_str(i), me.name, nick, root_vchan->chname); return; } } if ((target_p->user->joined >= ConfigChannel.max_chans_per_user) && (!IsOper(target_p) || (target_p->user->joined >= ConfigChannel.max_chans_per_user*3))) { sendto_one(target_p, form_str(ERR_TOOMANYCHANNELS), me.name, nick, root_vchan->chname ); return; } if(flags == CHFL_CHANOP) { chptr->channelts = CurrentTime; /* * XXX - this is a rather ugly hack. *
开发者ID:Cloudxtreme,项目名称:ircd-ratbox,代码行数:67,
示例26: BuffTeam// apply a team buff for the main and affected zonesvoid OutdoorPvP::BuffTeam(Team team, uint32 spellId, bool remove /*= false*/, bool onlyMembers /*= true*/, uint32 area /*= 0*/){ for (GuidZoneMap::iterator itr = m_zonePlayers.begin(); itr != m_zonePlayers.end(); ++itr) { Player* player = sObjectMgr.GetPlayer(itr->first); if (!player) continue; if (player && (team == TEAM_NONE || player->GetTeam() == team) && (!onlyMembers || IsMember(player->GetObjectGuid()))) { if (!area || area == player->GetAreaId()) { if (remove) player->RemoveAurasDueToSpell(spellId); else player->CastSpell(player, spellId, true); } } }}
开发者ID:beyourself,项目名称:RustEmu-Core,代码行数:21,
示例27: m_topic/* * m_topic * parv[0] = sender prefix * parv[1] = channel name * parv[2] = new topic, if setting topic */static intm_topic(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]){ struct Channel *chptr = NULL; struct membership *msptr; char *p = NULL; if((p = strchr(parv[1], ','))) *p = '/0'; if(MyClient(source_p) && !IsFloodDone(source_p)) flood_endgrace(source_p); if(!IsChannelName(parv[1])) { sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), parv[1]); return 0; } chptr = find_channel(parv[1]); if(chptr == NULL) { sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), parv[1]); return 0; } /* setting topic */ if(parc > 2) { msptr = find_channel_membership(chptr, source_p); if(msptr == NULL) { sendto_one_numeric(source_p, ERR_NOTONCHANNEL, form_str(ERR_NOTONCHANNEL), parv[1]); return 0; } if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr) || !MyClient(source_p)) { char topic_info[USERHOST_REPLYLEN]; ircsprintf(topic_info, "%s!%[email C++ IsMine函数代码示例 C++ IsMainThread函数代码示例
|