本文整理汇总了C++中IsClient函数的典型用法代码示例。如果您正苦于以下问题:C++ IsClient函数的具体用法?C++ IsClient怎么用?C++ IsClient使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsClient函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: xline_remove
/* static int remove_tkline_match(const char *host, const char *user)
*
* Inputs: gecos
* Output: returns YES on success, NO if no tkline removed.
* Side effects: Any matching tklines are removed.
*/
static void
xline_remove(struct Client *source_p, const struct aline_ctx *aline)
{
struct GecosItem *gecos;
if ((gecos = gecos_find(aline->mask, irccmp)) == NULL)
{
if (IsClient(source_p))
sendto_one_notice(source_p, &me, ":No X-Line for %s", aline->mask);
return;
}
if (gecos->in_database == false)
{
if (IsClient(source_p))
sendto_one_notice(source_p, &me, ":The X-Line for %s is in the configuration file and must be removed by hand",
gecos->mask);
return;
}
if (IsClient(source_p))
sendto_one_notice(source_p, &me, ":X-Line for [%s] is removed", gecos->mask);
sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE,
"%s has removed the X-Line for: [%s]",
get_oper_name(source_p), gecos->mask);
ilog(LOG_TYPE_RESV, "%s removed X-Line for [%s]",
get_oper_name(source_p), gecos->mask);
gecos_delete(gecos, false);
}
开发者ID:ircd-hybrid,项目名称:ircd-hybrid,代码行数:38,代码来源:m_unxline.c
示例2: mo_chgident
static void
mo_chgident(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
struct Client *target_p = NULL;
if (MyClient(source_p) && !IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "CHGIDENT");
return;
}
if (EmptyString(parv[2]))
{
parv[2] = parv[1];
target_p = source_p;
if (!IsClient(target_p))
return;
}
else {
target_p = find_client(parv[1]);
if (target_p == NULL || !IsClient(target_p))
{
sendto_one(source_p, form_str(ERR_NOSUCHNICK),
me.name, source_p->name, parv[1]);
return;
}
}
if (strlen(parv[2]) > USERLEN || !*parv[2] || !valid_username(parv[2]))
{
sendto_one(source_p, ":%s NOTICE %s :Invalid username",
me.name, source_p->name);
return;
}
if (IsUserHostIp(target_p))
delete_user_host(target_p->username, target_p->host, !MyConnect(target_p));
strlcpy(target_p->username, parv[2], sizeof(target_p->username));
add_user_host(target_p->username, target_p->host, !MyConnect(target_p));
SetUserHost(target_p);
if (MyClient(source_p))
{
sendto_server(client_p, NULL, NOCAPS, NOCAPS, ":%s ENCAP * CHGIDENT %s %s",
source_p->name, target_p->name, parv[2]);
sendto_one(source_p, ":%s NOTICE %s :%s changed to %[email protected]%s",
me.name, source_p->name, target_p->name, target_p->username,
target_p->host);
}
if (MyConnect(target_p) && IsClient(source_p))
sendto_one(target_p, ":%s NOTICE %s :You are now %[email protected]%s",
me.name, target_p->name, target_p->username, target_p->host);
}
开发者ID:mdharris,项目名称:ircd,代码行数:60,代码来源:m_change.c
示例3: CastToClient
void Mob::ExpendAlternateAdvancementCharge(uint32 aa_id) {
for(auto &iter : aa_ranks) {
AA::Ability *ability = zone->GetAlternateAdvancementAbility(iter.first);
if(ability && aa_id == ability->id) {
if(iter.second.second > 0) {
iter.second.second -= 1;
if(iter.second.second == 0) {
if(IsClient()) {
AA::Rank *r = ability->GetRankByPointsSpent(iter.second.first);
if(r) {
CastToClient()->GetEPP().expended_aa += r->cost;
}
}
if (IsClient()) {
auto c = CastToClient();
c->RemoveExpendedAA(ability->first_rank_id);
}
aa_ranks.erase(iter.first);
}
if(IsClient()) {
Client *c = CastToClient();
c->SaveAA();
c->SendAlternateAdvancementPoints();
}
}
return;
}
}
}
开发者ID:af4t,项目名称:Server,代码行数:32,代码来源:aa.cpp
示例4: ms_topic
static void
ms_topic(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
struct Channel *chptr = NULL;
const char *from, *to;
char topic_info[USERHOST_REPLYLEN];
if (IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
{
from = me.id;
to = source_p->id;
}
else
{
from = me.name;
to = source_p->name;
}
if (EmptyString(parv[1]))
{
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
from, to, "TOPIC");
return;
}
if ((chptr = hash_find_channel(parv[1])) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL),
from, to, parv[1]);
return;
}
if (!IsClient(source_p))
strlcpy(topic_info, source_p->name, sizeof(topic_info));
else
snprintf(topic_info, sizeof(topic_info), "%s!%[email protected]%s", source_p->name,
source_p->username, source_p->host);
set_channel_topic(chptr, parv[2], topic_info, CurrentTime, 0);
sendto_server(client_p, CAP_TS6, NOCAPS, ":%s TOPIC %s :%s",
ID(source_p), chptr->chname,
chptr->topic);
sendto_server(client_p, NOCAPS, CAP_TS6, ":%s TOPIC %s :%s",
source_p->name, chptr->chname,
chptr->topic);
if (!IsClient(source_p))
sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s TOPIC %s :%s",
source_p->name,
chptr->chname, chptr->topic);
else
sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s!%[email protected]%s TOPIC %s :%s",
source_p->name,
source_p->username,
source_p->host,
chptr->chname, chptr->topic);
}
开发者ID:jmaurice,项目名称:ircd-hybrid,代码行数:59,代码来源:m_topic.c
示例5: GetPlayerRaceValue
bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
AA::Ability *ability = rank->base_ability;
if(!ability)
return false;
if(!(ability->classes & (1 << GetClass()))) {
return false;
}
// Passive and Active Shroud AAs
// For now we skip them
if(ability->category == 3 || ability->category == 4) {
return false;
}
//the one titanium hack i will allow
//just to make sure we dont crash the client with newer aas
//we'll exclude any expendable ones
if(IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::maskTitaniumAndEarlier) {
if(ability->charges > 0) {
return false;
}
}
if(IsClient()) {
if(rank->expansion && !(CastToClient()->GetPP().expansions & (1 << (rank->expansion - 1)))) {
return false;
}
} else {
if(rank->expansion && !(RuleI(World, ExpansionSettings) & (1 << (rank->expansion - 1)))) {
return false;
}
}
auto race = GetPlayerRaceValue(GetBaseRace());
race = race > 16 ? 1 : race;
if(!(ability->races & (1 << (race - 1)))) {
return false;
}
auto deity = GetDeityBit();
if(!(ability->deities & deity)) {
return false;
}
if(IsClient() && CastToClient()->Admin() < ability->status) {
return false;
}
if(GetBaseRace() == 522) {
//drakkin_heritage
if(!(ability->drakkin_heritage & (1 << GetDrakkinHeritage()))) {
return false;
}
}
return true;
}
开发者ID:af4t,项目名称:Server,代码行数:59,代码来源:aa.cpp
示例6: CastToClient
void Mob::RemoveAura(int spawn_id, bool skip_strip, bool expired)
{
for (int i = 0; i < aura_mgr.count; ++i) {
auto &aura = aura_mgr.auras[i];
if (aura.spawn_id == spawn_id) {
if (aura.aura)
aura.aura->Depop(skip_strip);
if (expired && IsClient()) {
CastToClient()->SendColoredText(
CC_Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color
// need to update client UI too
auto app = new EQApplicationPacket(OP_UpdateAura, sizeof(AuraDestory_Struct));
auto ads = (AuraDestory_Struct *)app->pBuffer;
ads->action = 1; // delete
ads->entity_id = spawn_id;
CastToClient()->QueuePacket(app);
safe_delete(app);
}
while (aura_mgr.count - 1 > i) {
i++;
aura.spawn_id = aura_mgr.auras[i].spawn_id;
aura.icon = aura_mgr.auras[i].icon;
aura.aura = aura_mgr.auras[i].aura;
aura_mgr.auras[i].aura = nullptr;
strn0cpy(aura.name, aura_mgr.auras[i].name, 64);
}
aura_mgr.count--;
return;
}
}
for (int i = 0; i < trap_mgr.count; ++i) {
auto &aura = trap_mgr.auras[i];
if (aura.spawn_id == spawn_id) {
if (aura.aura)
aura.aura->Depop(skip_strip);
if (expired && IsClient())
CastToClient()->SendColoredText(
CC_Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color
while (trap_mgr.count - 1 > i) {
i++;
aura.spawn_id = trap_mgr.auras[i].spawn_id;
aura.icon = trap_mgr.auras[i].icon;
aura.aura = trap_mgr.auras[i].aura;
trap_mgr.auras[i].aura = nullptr;
strn0cpy(aura.name, trap_mgr.auras[i].name, 64);
}
trap_mgr.count--;
return;
}
}
return;
}
开发者ID:SecretsOTheP,项目名称:Server,代码行数:54,代码来源:aura.cpp
示例7: RemoveAllAuras
void Mob::RemoveAllAuras()
{
if (IsClient()) {
database.SaveAuras(CastToClient());
EQApplicationPacket outapp(OP_UpdateAura, 4);
outapp.WriteUInt32(2);
CastToClient()->QueuePacket(&outapp);
}
// this is sent on camp/zone, so it just despawns?
if (aura_mgr.count) {
for (auto &e : aura_mgr.auras) {
if (e.aura)
e.aura->Depop();
}
}
aura_mgr.count = 0;
if (trap_mgr.count) {
for (auto &e : trap_mgr.auras) {
if (e.aura)
e.aura->Depop();
}
}
trap_mgr.count = 0;
return;
}
开发者ID:SecretsOTheP,项目名称:Server,代码行数:30,代码来源:aura.cpp
示例8: PlayAction
//------------------------------------------------------------------------
void CGunTurret::OnTargetLocked(IEntity *pTarget)
{
if(pTarget)
PlayAction(g_pItemStrings->lock);
if(IsServer())
{
// if this turret has others linked, notify them about acquired target
for(IEntityLink *pLink = GetEntity()->GetEntityLinks(); pLink; pLink = pLink->next)
{
if(0 != strcmp(pLink->name, "TargetInfo"))
continue;
IItem *pItem = g_pGame->GetIGameFramework()->GetIItemSystem()->GetItem(pLink->entityId);
if(pItem)
{
SGameObjectEvent event(pTarget?eCGE_Turret_LockedTarget:eCGE_Turret_LostTarget, eGOEF_ToExtensions);
event.ptr = pTarget;
pItem->GetGameObject()->SendEvent(event);
}
}
}
if(IsClient())
{
m_pGameFramework->GetMusicLogic()->SetEvent(eMUSICLOGICEVENT_PLAYER_TURRET_ATTACK);
}
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:30,代码来源:GunTurret.cpp
示例9: me_chghost
static void
me_chghost(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
{
struct Client *target_p = NULL;
if(parc < 3)
return;
if(!IsServer(source_p))
return;
if((target_p = find_client(parv[1])) == NULL)
return;
if(!IsClient(target_p))
return;
if(strlen(parv[2]) > HOSTLEN || !*parv[2] || !valid_hostname(parv[2]))
return;
if(!strcmp(target_p->host, parv[2]))
return;
if(ConfigChannel.cycle_on_hostchange)
do_hostchange_quits(target_p);
strlcpy(target_p->host, parv[2], sizeof(target_p->host));
if(ConfigChannel.cycle_on_hostchange)
do_hostchange_joins(target_p);
}
开发者ID:diegoagudo,项目名称:redebr-ircd,代码行数:31,代码来源:m_chghost.c
示例10: m_away
/*
** m_away
** parv[1] = away message
*/
static int
m_away(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(MyClient(source_p) && source_p->localClient->next_away &&
!IsFloodDone(source_p))
flood_endgrace(source_p);
if(!IsClient(source_p))
return 0;
if(parc < 2 || EmptyString(parv[1])) {
/* Marking as not away */
if(source_p->user->away != NULL) {
/* we now send this only if they were away before --is */
sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
":%s AWAY", use_id(source_p));
free_away(source_p);
sendto_common_channels_local_butone(source_p, CLICAP_AWAY_NOTIFY, NOCAPS, ":%s!%[email protected]%s AWAY",
source_p->name, source_p->username, source_p->host);
}
if(MyConnect(source_p))
sendto_one_numeric(source_p, RPL_UNAWAY, form_str(RPL_UNAWAY));
return 0;
}
/* Rate limit this because it is sent to common channels. */
if (MyClient(source_p)) {
if(!IsOper(source_p) &&
source_p->localClient->next_away > rb_current_time()) {
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "AWAY");
return 0;
}
if(source_p->localClient->next_away < rb_current_time() -
ConfigFileEntry.away_interval)
source_p->localClient->next_away = rb_current_time();
else
source_p->localClient->next_away = rb_current_time() +
ConfigFileEntry.away_interval;
}
if(source_p->user->away == NULL)
allocate_away(source_p);
if(strncmp(source_p->user->away, parv[1], AWAYLEN - 1)) {
rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
":%s AWAY :%s", use_id(source_p), source_p->user->away);
}
if(MyConnect(source_p))
sendto_one_numeric(source_p, RPL_NOWAWAY, form_str(RPL_NOWAWAY));
sendto_common_channels_local_butone(source_p, CLICAP_AWAY_NOTIFY, NOCAPS, ":%s!%[email protected]%s AWAY :%s",
source_p->name, source_p->username, source_p->host,
source_p->user->away);
return 0;
}
开发者ID:CustomIRCd,项目名称:elemental-ircd,代码行数:64,代码来源:m_away.c
示例11: check_clean_nick
/* check_clean_nick()
*
* input - pointer to source
* -
* - nickname
* - truncated nickname
* - origin of client
* - pointer to server nick is coming from
* output - none
* side effects - if nickname is erroneous, or a different length to
* truncated nickname, return 1
*/
static int
check_clean_nick(struct Client *source_p, char *nick, struct Client *server_p)
{
/*
* The old code did some wacky stuff here, if the nick is invalid, kill it
* and don't bother messing at all
*/
if (!valid_nickname(nick, 0))
{
++ServerStats.is_kill;
sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
"Bad/long Nick: %s From: %s(via %s)",
nick, server_p->name, source_p->from->name);
sendto_one(source_p, ":%s KILL %s :%s (Bad Nickname)",
me.name, nick, me.name);
/* Bad nick change */
if (IsClient(source_p) && !MyConnect(source_p))
{
sendto_server(source_p, 0, 0, ":%s KILL %s :%s (Bad Nickname)",
me.id, source_p->id, me.name);
AddFlag(source_p, FLAGS_KILLED);
exit_client(source_p, "Bad Nickname");
}
return 1;
}
return 0;
}
开发者ID:qistchan,项目名称:ircd-hybrid,代码行数:43,代码来源:m_nick.c
示例12: ms_away
static void
ms_away(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
if (!IsClient(source_p))
return;
if (parc < 2 || EmptyString(parv[1]))
{
/* Marking as not away */
if (source_p->away[0])
{
/* we now send this only if they were away before --is */
sendto_server(client_p, CAP_TS6, NOCAPS,
":%s AWAY", ID(source_p));
sendto_server(client_p, NOCAPS, CAP_TS6,
":%s AWAY", source_p->name);
source_p->away[0] = '\0';
}
return;
}
strlcpy(source_p->away, parv[1], sizeof(source_p->away));
sendto_server(client_p, CAP_TS6, NOCAPS,
":%s AWAY :%s", ID(source_p), source_p->away);
sendto_server(client_p, NOCAPS, CAP_TS6,
":%s AWAY :%s", source_p->name, source_p->away);
}
开发者ID:mindspeaker,项目名称:oftc-hybrid,代码行数:30,代码来源:m_away.c
示例13: me_undline
static void
me_undline(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
const char *addr = NULL;
if (parc != 3 || EmptyString(parv[2]))
return;
addr = parv[2];
if (!IsClient(source_p) || match(parv[1], me.name))
return;
if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE,
source_p->servptr->name,
source_p->username, source_p->host,
SHARED_UNDLINE))
{
if (remove_dline_match(addr))
{
sendto_one(source_p,
":%s NOTICE %s :D-Line for [%s] is removed",
me.name, source_p->name, addr);
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s has removed the D-Line for: [%s]",
get_oper_name(source_p), addr);
ilog(LOG_TYPE_DLINE, "%s removed temporary D-Line for [%s]",
get_oper_name(source_p), addr);
}
else
sendto_one(source_p, ":%s NOTICE %s :No D-Line for [%s] found",
me.name, source_p->name, addr);
}
}
开发者ID:jmaurice,项目名称:ircd-hybrid,代码行数:35,代码来源:m_dline.c
示例14: UpdateFPCharacter
//------------------------------------------------------------------------
void CItem::UpdateFPCharacter(float frameTime)
{
if (IsClient())
{
ICharacterInstance *pCharacter = GetEntity()->GetCharacter(eIGS_FirstPerson);
if (pCharacter && !m_idleAnimation[eIGS_FirstPerson].empty() && pCharacter->GetISkeletonAnim()->GetNumAnimsInFIFO(0)<1)
PlayAction(m_idleAnimation[eIGS_FirstPerson], 0, true);
}
// need to explicitly update characters at this point
// cause the entity system update occered earlier, with the last position
for (int i=0; i<eIGS_Last; i++)
{
if (GetEntity()->GetSlotFlags(i)&ENTITY_SLOT_RENDER)
{
ICharacterInstance *pCharacter = GetEntity()->GetCharacter(i);
if (pCharacter)
{
Matrix34 mloc = GetEntity()->GetSlotLocalTM(i,false);
Matrix34 m34=GetEntity()->GetWorldTM()*mloc;
QuatT renderLocation = QuatT(m34);
pCharacter->GetISkeletonPose()->SetForceSkeletonUpdate(8);
pCharacter->SkeletonPreProcess(renderLocation, renderLocation, GetISystem()->GetViewCamera(),0x55 );
pCharacter->SetPostProcessParameter(renderLocation, renderLocation, 0, 1.0f, 0x55 );
}
}
}
IEntityRenderProxy *pProxy=GetRenderProxy();
if (pProxy)
pProxy->InvalidateLocalBounds();
}
开发者ID:AiYong,项目名称:CryGame,代码行数:34,代码来源:ItemView.cpp
示例15: change_remote_nick
/*!
*
* \param source_p Pointer to allocated Client struct from which the message
* originally comes from. This can be a local or remote client.
* \param parc Integer holding the number of supplied arguments.
* \param parv Argument vector where parv[0] .. parv[parc-1] are non-NULL
* pointers.
* \note Valid arguments for this command are:
*
* - parv[0] = command
* - parv[1] = nickname
* - parv[2] = timestamp
*/
static void
change_remote_nick(struct Client *source_p, char *parv[])
{
int samenick = !irccmp(source_p->name, parv[1]);
assert(!EmptyString(parv[1]));
assert(IsClient(source_p));
assert(source_p->name[0]);
/* Client changing their nick */
if (!samenick)
{
DelUMode(source_p, UMODE_REGISTERED);
watch_check_hash(source_p, RPL_LOGOFF);
source_p->tsinfo = atol(parv[2]);
assert(source_p->tsinfo > 0);
}
sendto_common_channels_local(source_p, 1, 0, ":%s!%[email protected]%s NICK :%s",
source_p->name, source_p->username,
source_p->host, parv[1]);
whowas_add_history(source_p, 1);
sendto_server(source_p, 0, 0, ":%s NICK %s :%lu",
source_p->id, parv[1], (unsigned long)source_p->tsinfo);
/* Set the new nick name */
hash_del_client(source_p);
strlcpy(source_p->name, parv[1], sizeof(source_p->name));
hash_add_client(source_p);
if (!samenick)
watch_check_hash(source_p, RPL_LOGON);
}
开发者ID:qistchan,项目名称:ircd-hybrid,代码行数:47,代码来源:m_nick.c
示例16: stripcodes_packet
int stripcodes_packet(aClient *from, aClient *to, char **msg, int length)
{
static char buf[512];
if((from != &me && (!IsClient(from) && IsRegistered(from))) || (to != &me && !IsClient(to)))
return HOOK_CONTINUE;
if (to != &me && IsColorBlind(to)) {
strcpy(buf, StripControlCodes(*msg));
length = strlen(buf);
*msg = buf;
}
return HOOK_CONTINUE;
}
开发者ID:Courgetteandratatouille,项目名称:Unrealircd-NoColorUmode,代码行数:16,代码来源:nocolorumode.4.c
示例17: MakeNewPositionAndSendUpdate
bool Mob::CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ) {
if(IsNPC() || IsClient() || IsPet()) {
pRunAnimSpeed = (int8)(speed*NPC_RUNANIM_RATIO);
speed *= NPC_SPEED_MULTIPLIER;
}
return MakeNewPositionAndSendUpdate(x, y, z, speed, checkZ);
}
开发者ID:Leere,项目名称:Server,代码行数:8,代码来源:waypoints.cpp
示例18: me_resv
/* me_resv()
*
* inputs - server
* - client (oper)
* - parc number of arguments
* - parv list of arguments
* via parv[]
* parv[0] = client name applying resv
* parv[1] = tkline_time
* parv[2] = name
* parv[3] = 0
* parv[4] = reason
* parc should be 5
*
* outputs - NONE
* side effects -
*/
static void
me_resv(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
{
if(parc != 5 || !IsClient(source_p))
return;
parse_resv(source_p, parv[2], atoi(parv[1]), parv[4]);
}
开发者ID:asterIRC,项目名称:hamsterbox,代码行数:25,代码来源:m_resv.c
示例19: msg_client
/* msg_client()
*
* inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC
* say NOTICE must not auto reply
* - pointer to source_p source (struct Client *)
* - pointer to target_p target (struct Client *)
* - pointer to text
* output - NONE
* side effects - message given channel either chanop or voice
*/
static void
msg_client(int p_or_n, struct Client *source_p, struct Client *target_p,
const char *text)
{
if (MyClient(source_p))
{
if (target_p->away[0] && p_or_n != NOTICE)
sendto_one_numeric(source_p, &me, RPL_AWAY, target_p->name, target_p->away);
if (HasUMode(target_p, UMODE_REGONLY) && target_p != source_p)
{
if (!HasUMode(source_p, UMODE_REGISTERED | UMODE_OPER))
{
if (p_or_n != NOTICE)
sendto_one_numeric(source_p, &me, ERR_NONONREG, target_p->name);
return;
}
}
}
if (MyClient(target_p) && IsClient(source_p))
{
if (HasUMode(target_p, UMODE_CALLERID | UMODE_SOFTCALLERID) &&
!accept_message(source_p, target_p))
{
const int callerid = !!HasUMode(target_p, UMODE_CALLERID);
/* check for accept, flag recipient incoming message */
if (p_or_n != NOTICE)
sendto_one_numeric(source_p, &me, RPL_TARGUMODEG,
target_p->name,
callerid ? "+g" : "+G",
callerid ? "server side ignore" :
"server side ignore with the exception of common channels");
if ((target_p->connection->last_caller_id_time +
ConfigGeneral.caller_id_wait) < CurrentTime)
{
if (p_or_n != NOTICE)
sendto_one_numeric(source_p, &me, RPL_TARGNOTIFY, target_p->name);
sendto_one_numeric(target_p, &me, RPL_UMODEGMSG,
source_p->name, source_p->username, source_p->host,
callerid ? "+g" : "+G");
target_p->connection->last_caller_id_time = CurrentTime;
}
/* Only so opers can watch for floods */
flood_attack_client(NOTICE, source_p, target_p);
return;
}
if (flood_attack_client(p_or_n, source_p, target_p))
return;
}
sendto_anywhere(target_p, source_p, command[p_or_n], ":%s", text);
}
开发者ID:akiraaisha,项目名称:ircd-hybrid,代码行数:68,代码来源:m_message.c
示例20: switch
//healing and buffing aggro
int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) {
uint16 spell_id = spellid;
int32 AggroAmount = 0;
for (int o = 0; o < EFFECT_COUNT; o++) {
switch(spells[spell_id].effectid[o]) {
case SE_CurrentHP: {
AggroAmount += spells[spell_id].mana;
break;
}
case SE_Rune: {
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[0], spells[spell_id].base[0], spells[spell_id].max[o], this->GetLevel(), spellid) * 2;
break;
}
case SE_HealOverTime:{
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
break;
}
default:{
break;
}
}
}
if (IsBardSong(spell_id))
AggroAmount = AggroAmount * RuleI(Aggro, SongAggroMod) / 100;
if (GetOwner() && IsPet())
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
if(AggroAmount > 0)
{
int HateMod = RuleI(Aggro, SpellAggroMod);
if(IsClient())
{
HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id);
}
//Live AA - Spell casting subtlety
HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod;
AggroAmount = (AggroAmount * HateMod) / 100;
//made up number probably scales a bit differently on live but it seems like it will be close enough
//every time you cast on live you get a certain amount of "this is a spell" aggro
//confirmed by EQ devs to be 100 exactly at level 85. From their wording it doesn't seem like it's affected
//by hate modifiers either.
//AggroAmount += (slevel*slevel/72); // Moved Below
}
if(AggroAmount < 0)
return 0;
else
return AggroAmount;
}
开发者ID:badcaptain,项目名称:Server,代码行数:58,代码来源:aggro.cpp
注:本文中的IsClient函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论