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


C++ sendto_realops_snomask函数代码示例

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


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

示例1: cancel_clients

/* cancel_clients()
 *
 * inputs	- client who sent us the message, client with fake
 *		  direction
 * outputs	- a given warning about the fake direction
 * side effects -
 */
static void
cancel_clients(struct Client *client_p, struct Client *source_p)
{
	/* ok, fake prefix happens naturally during a burst on a nick
	 * collision with TS5, we cant kill them because one client has to
	 * survive, so we just send an error.
	 */
	if(IsServer(source_p) || IsMe(source_p))
	{
		sendto_realops_snomask(SNO_DEBUG, L_ALL,
				     "Message for %s[%s] from %s",
				     source_p->name, source_p->from->name,
				     client_p->name);
	}
	else
	{
		sendto_realops_snomask(SNO_DEBUG, L_ALL,
				     "Message for %s[%[email protected]%s!%s] from %s (TS, ignored)",
				     source_p->name,
				     source_p->username,
				     source_p->host,
				     source_p->from->name,
				     client_p->name);
	}
}
开发者ID:kamilion,项目名称:charybdis,代码行数:32,代码来源:parse.c

示例2: m_error

/*
 * Note: At least at protocol level ERROR has only one parameter,
 * although this is called internally from other functions
 * --msa
 *
 *      parv[*] = parameters
 */
static void
m_error(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	const char *para;
	int hideit = ConfigFileEntry.hide_error_messages;

	para = (parc > 1 && *parv[1] != '\0') ? parv[1] : "<>";

	if (IsAnyServer(client_p))
	{
		ilog(L_SERVER, "Received ERROR message from %s: %s",
		     log_client_name(source_p, SHOW_IP), para);
	}

	if(is_safe_error(para))
		hideit = 0;
	if(IsAnyServer(client_p))
	{
		if (hideit < 2)
			sendto_realops_snomask(SNO_GENERAL, hideit ? L_ADMIN : (is_remote_connect(client_p) ? L_NETWIDE : L_ALL),
					"ERROR :from %s -- %s",
					client_p->name, para);
		if (hideit > 0)
			sendto_realops_snomask(SNO_GENERAL, (hideit == 1 ? L_OPER : L_ALL) | (is_remote_connect(client_p) ? L_NETWIDE : L_ALL),
					"ERROR :from %s -- <hidden>",
					client_p->name);
	}

	exit_client(client_p, source_p, source_p, "ERROR");
}
开发者ID:KeiroD,项目名称:charybdis,代码行数:37,代码来源:m_error.c

示例3: ms_error

static void
ms_error(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	const char *para;
	int hideit = ConfigFileEntry.hide_error_messages;

	para = (parc > 1 && *parv[1] != '\0') ? parv[1] : "<>";

	ilog(L_SERVER, "Received ERROR message from %s: %s",
	     log_client_name(source_p, SHOW_IP), para);

	if(is_safe_error(para))
		hideit = 0;
	if(hideit == 2)
		return;

	if(client_p == source_p)
	{
		sendto_realops_snomask(SNO_GENERAL, hideit ? L_ADMIN : L_ALL, "ERROR :from %s -- %s",
				     client_p->name, para);
	}
	else
	{
		sendto_realops_snomask(SNO_GENERAL, hideit ? L_ADMIN : L_ALL, "ERROR :from %s via %s -- %s",
				     source_p->name, client_p->name, para);
	}
}
开发者ID:KeiroD,项目名称:charybdis,代码行数:27,代码来源:m_error.c

示例4: quote_spamnum

/* SET SPAMNUM */
static void
quote_spamnum(struct Client *source_p, const char *arg, int newval)
{
	if(newval > 0)
	{
		if(newval == 0)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s has disabled ANTI_SPAMBOT", source_p->name);
			GlobalSetOptions.spam_num = newval;
			return;
		}
		if(newval < MIN_SPAM_NUM)
		{
			GlobalSetOptions.spam_num = MIN_SPAM_NUM;
		}
		else		/* if (newval < MIN_SPAM_NUM) */
		{
			GlobalSetOptions.spam_num = newval;
		}
		sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has changed SPAMNUM to %i",
				     source_p->name, GlobalSetOptions.spam_num);
	}
	else
	{
		sendto_one_notice(source_p, ":SPAMNUM is currently %i", GlobalSetOptions.spam_num);
	}
}
开发者ID:KeiroD,项目名称:charybdis,代码行数:29,代码来源:m_set.c

示例5: show_stats

void
show_stats(hook_data_int *data)
{
	char statchar = (char) data->arg2;
	if (statchar == 'L' || statchar == 'l') {
		const char *name = data->arg1;
		if (!EmptyString(name))
			sendto_realops_snomask(SNO_SPY, L_ALL,
			                       "STATS %c requested by %s (%[email protected]%s) [%s] on %s",
			                       statchar, data->client->name,
			                       data->client->username,
			                       data->client->host,
			                       data->client->servptr->name, name);
		else
			sendto_realops_snomask(SNO_SPY, L_ALL,
			                       "STATS %c requested by %s (%[email protected]%s) [%s]",
			                       statchar, data->client->name,
			                       data->client->username,
			                       data->client->host, data->client->servptr->name);
	} else {
		sendto_realops_snomask(SNO_SPY, L_ALL,
		                       "STATS %c requested by %s (%[email protected]%s) [%s]",
		                       statchar, data->client->name, data->client->username,
		                       data->client->host, data->client->servptr->name);
	}
}
开发者ID:Codyle,项目名称:elemental-ircd,代码行数:26,代码来源:spy_stats_notice.c

示例6: do_chghost

static int
do_chghost(struct Client *source_p, struct Client *target_p,
		const char *newhost, int is_encap)
{
	if (!clean_host(newhost))
	{
		sendto_realops_snomask(SNO_GENERAL, is_encap ? L_ALL : L_NETWIDE, "%s attempted to change hostname for %s to %s (invalid)",
				IsServer(source_p) ? source_p->name : get_oper_name(source_p),
				target_p->name, newhost);
		/* sending this remotely may disclose important
		 * routing information -- jilles */
		if (is_encap ? MyClient(target_p) : !ConfigServerHide.flatten_links)
			sendto_one_notice(target_p, ":*** Notice -- %s attempted to change your hostname to %s (invalid)",
					source_p->name, newhost);
		return 0;
	}
	change_nick_user_host(target_p, target_p->name, target_p->username, newhost, 0, "Changing host");
	if (irccmp(target_p->host, target_p->orighost))
	{
		SetDynSpoof(target_p);
		if (MyClient(target_p))
			sendto_one_numeric(target_p, RPL_HOSTHIDDEN, "%s :is now your hidden host (set by %s)", target_p->host, source_p->name);
	}
	else
	{
		ClearDynSpoof(target_p);
		if (MyClient(target_p))
			sendto_one_numeric(target_p, RPL_HOSTHIDDEN, "%s :hostname reset by %s", target_p->host, source_p->name);
	}
	if (MyClient(source_p))
		sendto_one_notice(source_p, ":Changed hostname for %s to %s", target_p->name, target_p->host);
	if (!IsServer(source_p) && !IsService(source_p))
		sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s changed hostname for %s to %s", get_oper_name(source_p), target_p->name, target_p->host);
	return 1;
}
开发者ID:ChatLounge,项目名称:ChatIRCd,代码行数:35,代码来源:m_chghost.c

示例7: quote_idletime

/* SET IDLETIME */
static void
quote_idletime(struct Client *source_p, int newval)
{
	if(newval >= 0)
	{
		if(newval == 0)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s has disabled idletime checking", source_p->name);
			GlobalSetOptions.idletime = 0;
		}
		else
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s has changed IDLETIME to %i",
					     source_p->name, newval);
			GlobalSetOptions.idletime = (newval * 60);
		}
	}
	else
	{
		sendto_one(source_p, ":%s NOTICE %s :IDLETIME is currently %i",
			   me.name, source_p->name, GlobalSetOptions.idletime / 60);
	}
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:26,代码来源:m_set.c

示例8: send_linebuf_remote

/* send_linebuf_remote()
 *
 * inputs	- client to attach to, sender, linebuf
 * outputs	-
 * side effects - client has linebuf attached
 */
static void
send_linebuf_remote(struct Client *to, struct Client *from, buf_head_t *linebuf)
{
    if(to->from)
        to = to->from;

    /* test for fake direction */
    if(!MyClient(from) && IsPerson(to) && (to == from->from))
    {
        if(IsServer(from))
        {
            sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                   "Send message to %s[%s] dropped from %s(Fake Dir)",
                                   to->name, to->from->name, from->name);
            return;
        }

        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "Ghosted: %s[%[email protected]%s] from %s[%[email protected]%s] (%s)",
                               to->name, to->username, to->host,
                               from->name, from->username, from->host, to->from->name);
        kill_client_serv_butone(NULL, to, "%s (%s[%[email protected]%s] Ghosted %s)",
                                me.name, to->name, to->username,
                                to->host, to->from->name);

        to->flags |= FLAGS_KILLED;

        exit_client(NULL, to, &me, "Ghosted client");
        return;
    }

    _send_linebuf(to, linebuf);
    return;
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:40,代码来源:send.c

示例9: ms_svinfo

/*
 * ms_svinfo - SVINFO message handler
 *      parv[1] = TS_CURRENT for the server
 *      parv[2] = TS_MIN for the server
 *      parv[3] = unused, send 0
 *      parv[4] = server's idea of UTC time
 */
static int
ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
    signed long deltat;
    time_t theirtime;
    char squitreason[120];

    /* SVINFO isnt remote. */
    if(source_p != client_p)
        return 0;

    if(TS_CURRENT < atoi(parv[2]) || atoi(parv[1]) < TS_MIN)
    {
        /* TS version is too low on one of the sides, drop the link */
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "Link %s dropped, wrong TS protocol version (%s,%s)",
                               source_p->name, parv[1], parv[2]);
        rb_snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)",
                    parv[1], parv[2]);
        exit_client(source_p, source_p, source_p, squitreason);
        return 0;
    }

    /*
     * since we're here, might as well set rb_current_time() while we're at it
     */
    rb_set_time();
    theirtime = atol(parv[4]);
    deltat = labs(theirtime - rb_current_time());

    if(deltat > ConfigFileEntry.ts_max_delta)
    {
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "Link %s dropped, excessive TS delta"
                               " (my TS=%ld, their TS=%ld, delta=%ld)",
                               source_p->name,
                               (long) rb_current_time(), (long) theirtime, deltat);
        ilog(L_SERVER,
             "Link %s dropped, excessive TS delta"
             " (my TS=%ld, their TS=%ld, delta=%ld)",
             log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
        rb_snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%ld)",
                    (long) rb_current_time(), (long) theirtime, deltat);
        disable_server_conf_autoconn(source_p->name);
        exit_client(source_p, source_p, source_p, squitreason);
        return 0;
    }

    if(deltat > ConfigFileEntry.ts_warn_delta)
    {
        sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                               "Link %s notable TS delta"
                               " (my TS=%ld, their TS=%ld, delta=%ld)",
                               source_p->name, (long) rb_current_time(), (long) theirtime, deltat);
    }

    return 0;
}
开发者ID:ntchambers,项目名称:charybdis,代码行数:65,代码来源:m_svinfo.c

示例10: quote_splitmode

/* SET SPLITMODE */
static void
quote_splitmode(struct Client *source_p, const char *charval, int intval)
{
	if(charval)
	{
		int newval;

		for (newval = 0; splitmode_values[newval]; newval++)
		{
			if(!irccmp(splitmode_values[newval], charval))
				break;
		}

		/* OFF */
		if(newval == 0)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s is disabling splitmode", get_oper_name(source_p));

			splitmode = false;
			splitchecking = false;

			rb_event_delete(check_splitmode_ev);
			check_splitmode_ev = NULL;
		}
		/* ON */
		else if(newval == 1)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s is enabling and activating splitmode",
					     get_oper_name(source_p));

			splitmode = true;
			splitchecking = false;

			/* we might be deactivating an automatic splitmode, so pull the event */
			rb_event_delete(check_splitmode_ev);
			check_splitmode_ev = NULL;
		}
		/* AUTO */
		else if(newval == 2)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s is enabling automatic splitmode",
					     get_oper_name(source_p));

			splitchecking = true;
			check_splitmode(NULL);
		}
	}
	else
		/* if we add splitchecking to splitmode*2 we get a unique table to
		 * pull values back out of, splitmode can be four states - but you can
		 * only set to three, which means we cant use the same table --fl_
		 */
		sendto_one_notice(source_p, ":SPLITMODE is currently %s",
			   splitmode_status[(splitchecking + (splitmode * 2))]);
}
开发者ID:KeiroD,项目名称:charybdis,代码行数:59,代码来源:m_set.c

示例11: _send_linebuf

/* send_linebuf()
 *
 * inputs	- client to send to, linebuf to attach
 * outputs	-
 * side effects - linebuf is attached to client
 */
static int
_send_linebuf(struct Client *to, buf_head_t *linebuf)
{
    if(IsMe(to))
    {
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "Trying to send message to myself!");
        return 0;
    }

    if(!MyConnect(to) || IsIOError(to))
        return 0;

    if(linebuf_len(&to->localClient->buf_sendq) > get_sendq(to))
    {
        if(IsServer(to))
        {
            sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                   "Max SendQ limit exceeded for %s: %u > %lu",
                                   get_server_name(to, HIDE_IP),
                                   linebuf_len(&to->localClient->buf_sendq),
                                   get_sendq(to));

            ilog(L_SERVER, "Max SendQ limit exceeded for %s: %u > %lu",
                 log_client_name(to, SHOW_IP),
                 linebuf_len(&to->localClient->buf_sendq),
                 get_sendq(to));
        }

        if(IsClient(to))
            to->flags |= FLAGS_SENDQEX;

        dead_link(to);
        return -1;
    }
    else
    {
        /* just attach the linebuf to the sendq instead of
         * generating a new one
         */
        linebuf_attach(&to->localClient->buf_sendq, linebuf);
    }

    /*
     ** Update statistics. The following is slightly incorrect
     ** because it counts messages even if queued, but bytes
     ** only really sent. Queued bytes get updated in SendQueued.
     */
    to->localClient->sendM += 1;
    me.localClient->sendM += 1;
    if(linebuf_len(&to->localClient->buf_sendq) > 0)
        send_queued_write(to->localClient->fd, to);
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:59,代码来源:send.c

示例12: show_trace

void
show_trace(hook_data_client *data)
{
	if(data->target)
		sendto_realops_snomask(SNO_SPY, L_ALL,
				"trace requested by %s (%[email protected]%s) [%s] on %s",
				data->client->name, data->client->username,
				data->client->host, data->client->servptr->name,
				data->target->name);
	else
		sendto_realops_snomask(SNO_SPY, L_ALL,
				"trace requested by %s (%[email protected]%s) [%s]",
				data->client->name, data->client->username,
				data->client->host, data->client->servptr->name);
}
开发者ID:DrRenX,项目名称:shadowircd-ac,代码行数:15,代码来源:spy_trace_notice.c

示例13: eventAdd

/*
 * void eventAdd(const char *name, EVH *func, void *arg, time_t when)
 *
 * Input: Name of event, function to call, arguments to pass, and frequency
 *	  of the event.
 * Output: None
 * Side Effects: Adds the event to the event list.
 */
void
eventAdd(const char *name, EVH * func, void *arg, time_t when)
{
	int i;

	/* find first inactive index */
	for (i = 0; i < MAX_EVENTS; i++)
	{
		if(event_table[i].active == 0)
		{
			event_table[i].func = func;
			event_table[i].name = name;
			event_table[i].arg = arg;
			event_table[i].when = CurrentTime + when;
			event_table[i].frequency = when;
			event_table[i].active = 1;

			if((event_table[i].when < event_time_min) || (event_time_min == -1))
				event_time_min = event_table[i].when;

			return;
		}
	}

	/* erk! couldnt add to event table */
	sendto_realops_snomask(SNO_DEBUG, L_ALL, "Unable to add event [%s] to event table", name);

}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:36,代码来源:event.c

示例14: do_modreload

static void
do_modreload(struct Client *source_p, const char *module)
{
	int modindex;
	int check_core;
	char *m_bn = rb_basename(module);

	if((modindex = findmodule_byname(m_bn)) == -1)
	{
		sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	check_core = modlist[modindex]->core;

	if(unload_one_module(m_bn, true) == false)
	{
		sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	if((load_one_module(m_bn, modlist[modindex]->origin, check_core) == false) && check_core)
	{
		sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
				     "Error reloading core module: %s: terminating ircd", m_bn);
		ilog(L_MAIN, "Error loading core module %s: terminating ircd", m_bn);
		exit(0);
	}

	rb_free(m_bn);
}
开发者ID:kleopatra999,项目名称:charybdis,代码行数:33,代码来源:m_modules.c

示例15: quote_max

/* SET MAX */
static void
quote_max(struct Client *source_p, const char *arg, int newval)
{
    if(newval > 0) {
        if(newval > maxconnections - MAX_BUFFER) {
            sendto_one_notice(source_p,
                              ":You cannot set MAXCLIENTS to > %d",
                              maxconnections - MAX_BUFFER);
            return;
        }

        if(newval < 32) {
            sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to < 32 (%d:%d)",
                              GlobalSetOptions.maxclients, rb_getmaxconnect());
            return;
        }

        GlobalSetOptions.maxclients = newval;

        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "%s!%[email protected]%s set new MAXCLIENTS to %d (%lu current)",
                               source_p->name, source_p->username, source_p->host,
                               GlobalSetOptions.maxclients,
                               rb_dlink_list_length(&lclient_list));

        return;
    } else {
        sendto_one_notice(source_p, ":Current Maxclients = %d (%lu)",
                          GlobalSetOptions.maxclients, rb_dlink_list_length(&lclient_list));
    }
}
开发者ID:Cloudxtreme,项目名称:elemental-ircd,代码行数:32,代码来源:m_set.c


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