• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sendto_one_numeric函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: mo_info

/*
** mo_info
**  parv[0] = sender prefix
**  parv[1] = servername
*/
static int
mo_info(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) == HUNTED_ISME)
	{
		info_spy(source_p);
		SetCork(source_p);
		send_info_text(source_p);

		if(IsOper(source_p))
		{
			send_conf_options(source_p);
			sendto_one_numeric(source_p, RPL_INFO, ":%s",
					rb_lib_version());
                }
		send_birthdate_online_time(source_p);
		ClearCork(source_p);
		sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
	}

	return 0;
}
开发者ID:ircnet,项目名称:not-ratbox,代码行数:27,代码来源:m_info.c


示例2: m_info

/*
** m_info
**  parv[0] = sender prefix
**  parv[1] = servername
*/
static int
m_info(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	static time_t last_used = 0L;
	static int count;

	if (!check_limit(source_p, &last_used, &count, "INFO")) {
		sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
		return 0;
	}

	if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
		return 0;

	info_spy(source_p);
	SetCork(source_p);
	send_info_text(source_p);
	send_birthdate_online_time(source_p);
	ClearCork(source_p);
	sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
	return 0;
}
开发者ID:ircnet,项目名称:not-ratbox,代码行数:27,代码来源:m_info.c


示例3: m_message

/*
 * inputs       - flag privmsg or notice
 *              - pointer to command "PRIVMSG" or "NOTICE"
 *              - pointer to source_p
 *              - pointer to channel
 */
static void
m_message(int p_or_n, const char *command, struct Client *source_p, int parc, char *parv[])
{
  if (parc < 2 || EmptyString(parv[1]))
  {
    if (p_or_n != NOTICE)
      sendto_one_numeric(source_p, &me, ERR_NORECIPIENT, command);
    return;
  }

  if (parc < 3 || EmptyString(parv[2]))
  {
    if (p_or_n != NOTICE)
      sendto_one_numeric(source_p, &me, ERR_NOTEXTTOSEND);
    return;
  }

  /* Finish the flood grace period... */
  if (MyClient(source_p) && !IsFloodDone(source_p))
    flood_endgrace(source_p);

  if (build_target_list(p_or_n, command, source_p, parv[1], parv[2]) < 0)
    return;

  for (unsigned int i = 0; i < ntargets; ++i)
  {
    switch (targets[i].type)
    {
      case ENTITY_CLIENT:
        msg_client(p_or_n, command, source_p, targets[i].ptr, parv[2]);
        break;

      case ENTITY_CHANNEL:
        msg_channel(p_or_n, command, source_p, targets[i].ptr,
                    targets[i].flags, parv[2]);
        break;
    }
  }
}
开发者ID:nask0,项目名称:ircd-hybrid,代码行数:45,代码来源:m_message.c


示例4: ms_tmode

static int
ms_tmode(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	struct Channel *chptr = NULL;
	struct membership *msptr;

	/* Now, try to find the channel in question */
	if(!IsChanPrefix(parv[2][0]) || !check_channel_name(parv[2]))
	{
		sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[2]);
		return 0;
	}

	chptr = find_channel(parv[2]);

	if(chptr == NULL)
	{
		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
				   form_str(ERR_NOSUCHCHANNEL), parv[2]);
		return 0;
	}

	/* TS is higher, drop it. */
	if(atol(parv[1]) > chptr->channelts)
		return 0;

	if(IsServer(source_p))
	{
		set_channel_mode(client_p, source_p, chptr, NULL, parc - 3, parv + 3);
	}
	else
	{
		msptr = find_channel_membership(chptr, source_p);

		set_channel_mode(client_p, source_p, chptr, msptr, parc - 3, parv + 3);
	}

	return 0;
}
开发者ID:fgt-transit,项目名称:aFailIRCd,代码行数:39,代码来源:m_mode.c


示例5: m_version

/*! \brief VERSION command handler
 *
 * \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/servername
 */
static int
m_version(struct Client *source_p, int parc, char *parv[])
{
  static time_t last_used = 0;

  if ((last_used + ConfigGeneral.pace_wait_simple) > CurrentTime)
  {
    sendto_one_numeric(source_p, &me, RPL_LOAD2HI, "VERSION");
    return 0;
  }

  last_used = CurrentTime;

  if (!ConfigServerHide.disable_remote_commands)
    if (hunt_server(source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME)
      return 0;

  sendto_one_numeric(source_p, &me, RPL_VERSION, ircd_version, serno,
                     me.name, serveropts);
  isupport_show(source_p);
  return 0;
}
开发者ID:chipyzs,项目名称:ircd-hybrid,代码行数:33,代码来源:m_version.c


示例6: mo_version

/*
 * mo_version - VERSION command handler
 *      parv[1] = remote server
 */
static int
mo_version(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
    if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) == HUNTED_ISME) {
        sendto_one_numeric(source_p, RPL_VERSION, form_str(RPL_VERSION),
                           ircd_version, serno,
                           me.name, confopts(source_p), TS_CURRENT,
                           ServerInfo.sid);
        show_isupport(source_p);
    }

    return 0;
}
开发者ID:Cloudxtreme,项目名称:elemental-ircd,代码行数:17,代码来源:m_version.c


示例7: mo_locops

/*! \brief LOCOPS command handler
 *
 * \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] = message text
 */
static int
mo_locops(struct Client *source_p, int parc, char *parv[])
{
  const char *const message = parv[1];

  if (!HasOFlag(source_p, OPER_FLAG_LOCOPS))
  {
    sendto_one_numeric(source_p, &me, ERR_NOPRIVS, "locops");
    return 0;
  }

  if (EmptyString(message))
  {
    sendto_one_numeric(source_p, &me, ERR_NEEDMOREPARAMS, "LOCOPS");
    return 0;
  }

  sendto_realops_flags(UMODE_LOCOPS, L_ALL, SEND_LOCOPS, "from %s: %s",
                       source_p->name, message);
  cluster_distribute(source_p, "LOCOPS", 0, CLUSTER_LOCOPS, message);
  return 0;
}
开发者ID:ircd-hybrid,项目名称:ircd-hybrid,代码行数:33,代码来源:m_locops.c


示例8: m_time

/*
 * m_time
 *      parv[1] = servername
 */
static int
m_time(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
    /* this is not rate limited, so end the grace period */
    if(MyClient(source_p) && !IsFloodDone(source_p))
        flood_endgrace(source_p);

    if(hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) == HUNTED_ISME)
        sendto_one_numeric(source_p, RPL_TIME, form_str(RPL_TIME),
                           me.name, date());

    return 0;
}
开发者ID:CustomIRCd,项目名称:elemental-ircd,代码行数:17,代码来源:m_time.c


示例9: mo_wallops

/*! \brief WALLOPS command handler
 *
 * \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] = message text
 */
static int
mo_wallops(struct Client *source_p, int parc, char *parv[])
{
  const char *message = parv[1];

  if (!HasOFlag(source_p, OPER_FLAG_WALLOPS))
  {
    sendto_one_numeric(source_p, &me, ERR_NOPRIVS, "wallops");
    return 0;
  }

  if (EmptyString(message))
  {
    sendto_one_numeric(source_p, &me, ERR_NEEDMOREPARAMS, "WALLOPS");
    return 0;
  }

  sendto_wallops_flags(UMODE_WALLOP, source_p, "%s", message);
  sendto_server(source_p, NOCAPS, NOCAPS, ":%s WALLOPS :%s",
                source_p->id, message);
  return 0;
}
开发者ID:caivega,项目名称:ircd-hybrid,代码行数:33,代码来源:m_wallops.c


示例10: forcepart_channels

static void
forcepart_channels(struct Client *client_p, struct Client *source_p, struct Client *target_p, const char *channels, const char *reason)
{
    struct Channel *chptr = NULL;
    struct membership *msptr = NULL;
    char *name;
    char *p = NULL;
    char *chanlist;

    chanlist = LOCAL_COPY(channels);
    for(name = rb_strtok_r(chanlist, ",", &p); name; name = rb_strtok_r(NULL, ",", &p))
    {
        if((chptr = find_channel(name)) == NULL)
        {
            sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
                               form_str(ERR_NOSUCHCHANNEL), name);
            continue;
        }

        if((msptr = find_channel_membership(chptr, target_p)) == NULL)
        {
            sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
                               form_str(ERR_USERNOTINCHANNEL),
                               target_p->name, name);
            continue;
        }

        sendto_server(target_p, chptr, NOCAPS, NOCAPS,
                      ":%s PART %s :%s", use_id(target_p), chptr->chname, reason);

        sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%[email protected]%s PART %s :%s",
                             target_p->name, target_p->username,
                             target_p->host, chptr->chname, reason);

        remove_user_from_channel(msptr);
    }

    return;
}
开发者ID:adamh1989,项目名称:sIRCd,代码行数:39,代码来源:m_forcepart.c


示例11: recurse_report_messages

static void
recurse_report_messages(struct Client *source_p, const struct MessageTree *mtree)
{
  if (mtree->msg)
    sendto_one_numeric(source_p, &me, RPL_STATSCOMMANDS,
                       mtree->msg->cmd,
                       mtree->msg->count, mtree->msg->bytes,
                       mtree->msg->rcount);

  for (unsigned int i = 0; i < MAXPTRLEN; ++i)
    if (mtree->pointers[i])
      recurse_report_messages(source_p, mtree->pointers[i]);
}
开发者ID:ircd-hybrid,项目名称:ircd-hybrid,代码行数:13,代码来源:parse.c


示例12: mr_starttls

static int
mr_starttls(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
#ifdef HAVE_LIBCRYPTO
	ssl_ctl_t *ctl;
	rb_fde_t *F[2];

	if (!MyConnect(client_p))
		return 0;

	if (rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &F[0], &F[1], "STARTTLS ssld session") == -1)
	{
		ilog_error("error creating SSL/TLS socketpair for ssld slave");
		sendto_one_numeric(client_p, ERR_STARTTLS, form_str(ERR_STARTTLS), "Unable to create SSL/TLS socketpair for ssld offload slave");
		return 1;
	}

	s_assert(client_p->localClient != NULL);

	/* clear out any remaining plaintext lines */
	rb_linebuf_donebuf(&client_p->localClient->buf_recvq);

	sendto_one_numeric(client_p, RPL_STARTTLS, form_str(RPL_STARTTLS));
	send_queued(client_p);

	ctl = start_ssld_accept(client_p->localClient->F, F[1], rb_get_fd(F[0]));
	if (ctl != NULL)
	{
		client_p->localClient->F = F[0];
		client_p->localClient->ssl_ctl = ctl;
		SetSSL(client_p);
	}
	else
		return 1;

#endif
	return 0;
}
开发者ID:dstrctrng,项目名称:charybdis,代码行数:38,代码来源:m_starttls.c


示例13: me_dehelper

static int me_dehelper(struct Client *client_p, struct Client *source_p, int parc, const char **parv)
{
	struct Client *target_p = find_person(parv[1]);
	if(!target_p)
	{
		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), me.name, parv[1]);
		return 0;
	}
	if(!MyClient(target_p))
		return 0;

	do_dehelper(source_p, target_p);
	return 0;
}
开发者ID:Cloudxtreme,项目名称:ircd-seven,代码行数:14,代码来源:m_dehelper.c


示例14: mo_globops

/*! \brief GLOBOPS command handler
 *
 * \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] = message text
 */
static int
mo_globops(struct Client *source_p, int parc, char *parv[])
{
  const char *const message = parv[1];

  if (!HasOFlag(source_p, OPER_FLAG_GLOBOPS))
  {
    sendto_one_numeric(source_p, &me, ERR_NOPRIVS, "globops");
    return 0;
  }

  if (EmptyString(message))
  {
    sendto_one_numeric(source_p, &me, ERR_NEEDMOREPARAMS, "GLOBOPS");
    return 0;
  }

  sendto_server(source_p, 0, 0, ":%s GLOBOPS :%s",
                source_p->id, message);
  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_GLOBAL, "from %s: %s",
                       source_p->name, message);
  return 0;
}
开发者ID:Indjov,项目名称:ircd-hybrid,代码行数:34,代码来源:m_globops.c


示例15: m_motd

/*
** m_motd
**	parv[0] = sender prefix
**	parv[1] = servername
*/
static int
m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	static time_t last_used = 0;

	if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
	{
		/* safe enough to give this on a local connect only */
		sendto_one_numeric(source_p, s_RPL(RPL_LOAD2HI), "MOTD");
		sendto_one_numeric(source_p, s_RPL(RPL_ENDOFMOTD));
		return 0;
	}
	else
		last_used = rb_current_time();

	if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
		return 0;

	motd_spy(source_p);
	send_user_motd(source_p);

	return 0;
}
开发者ID:thors,项目名称:ircd-ratbox,代码行数:28,代码来源:m_motd.c


示例16: m_time

/*! \brief TIME command handler
 *
 * \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/servername
 */
static int
m_time(struct Client *source_p, int parc, char *parv[])
{
  /* This is not rate limited, so end the grace period */
  if (!IsFloodDone(source_p))
    flood_endgrace(source_p);

  /* This is safe enough to use during non hidden server mode */
  if (!ConfigServerHide.disable_remote_commands)
    if (hunt_server(source_p, ":%s TIME :%s", 1, parc, parv) != HUNTED_ISME)
      return 0;

  sendto_one_numeric(source_p, &me, RPL_TIME, me.name, date(0));
  return 0;
}
开发者ID:codemstr,项目名称:eircd-hybrid-8,代码行数:26,代码来源:m_time.c


示例17: show_events

/* 
 * void show_events(struct Client *source_p)
 *
 * Input: Client requesting the event
 * Output: List of events
 * Side Effects: None
 */
void
show_events(struct Client *source_p)
{
	int i;

	if(last_event_ran)
		sendto_one_numeric(source_p, RPL_STATSDEBUG, 
				   "E :Last event to run: %s",
				   last_event_ran);

	sendto_one_numeric(source_p, RPL_STATSDEBUG,
			   "E :Operation                    Next Execution");

	for (i = 0; i < MAX_EVENTS; i++)
	{
		if(event_table[i].active)
		{
			sendto_one_numeric(source_p, RPL_STATSDEBUG, 
					   "E :%-28s %-4d seconds",
					   event_table[i].name, 
					   (int)(event_table[i].when - CurrentTime));
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:31,代码来源:event.c


示例18: ms_whowas

/*! \brief WHOWAS command handler
 *
 * \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] = count
 *      - parv[3] = nickname/servername
 */
static int
ms_whowas(struct Client *source_p, int parc, char *parv[])
{
  if (parc < 2 || EmptyString(parv[1]))
  {
    sendto_one_numeric(source_p, &me, ERR_NONICKNAMEGIVEN);
    return 0;
  }

  if (hunt_server(source_p, ":%s WHOWAS %s %s :%s", 3, parc, parv) != HUNTED_ISME)
    return 0;

  do_whowas(source_p, parc, parv);
  return 0;
}
开发者ID:Factoid,项目名称:ircd-hybrid,代码行数:28,代码来源:m_whowas.c


示例19: sendhelpfile

static void
sendhelpfile(struct Client *source_p, const char *path, const char *topic)
{
  FILE *file = NULL;
  char *p = NULL;
  char line[HELPLEN] = "";

  if ((file = fopen(path, "r")) == NULL)
  {
    sendto_one_numeric(source_p, &me, ERR_HELPNOTFOUND, topic);
    return;
  }

  if (fgets(line, sizeof(line), file) == NULL)
  {
    sendto_one_numeric(source_p, &me, ERR_HELPNOTFOUND, topic);
    fclose(file);
    return;
  }

  if ((p = strpbrk(line, "\r\n")))
    *p = '\0';

  sendto_one_numeric(source_p, &me, RPL_HELPSTART, topic, line);

  while (fgets(line, sizeof(line), file))
  {
    if ((p = strpbrk(line, "\r\n")))
      *p = '\0';

    sendto_one_numeric(source_p, &me, RPL_HELPTXT, topic, line);
  }

  fclose(file);
  sendto_one_numeric(source_p, &me, RPL_ENDOFHELP, topic);
}
开发者ID:Adam-,项目名称:ircd-hybrid,代码行数:36,代码来源:m_help.c


示例20: show_ports

/*
 * show_ports - send port listing to a client
 * inputs       - pointer to client to show ports to
 * output       - none
 * side effects - show ports
 */
void
show_ports(struct Client *source_p)
{
	struct Listener *listener = 0;

	for (listener = ListenerPollList; listener; listener = listener->next)
	{
		sendto_one_numeric(source_p, RPL_STATSPLINE,
			   form_str(RPL_STATSPLINE), 'P',
			   get_listener_port(listener),
			   IsOperAdmin(source_p) ? listener->name : me.name,
			   listener->ref_count, (listener->active) ? "active" : "disabled",
			   listener->ssl ? " ssl" : "");
	}
}
开发者ID:jdhore,项目名称:charybdis,代码行数:21,代码来源:listener.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sendto_realops函数代码示例发布时间:2022-05-30
下一篇:
C++ sendto_one_notice函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap