Esempio n. 1
0
/* SET SPLITMODE */
static void
quote_splitmode(struct Client *source_p, char *charval)
{
  if (charval)
  {
    int newval;

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

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

      splitmode = 0;
      splitchecking = 0;

      eventDelete(check_splitmode, NULL);
    }
    /* ON */
    else if (newval == 1)
    {
      sendto_realops_flags(UMODE_ALL, L_ALL,
                           "%s is enabling and activating splitmode",
	                   get_oper_name(source_p));
		 
      splitmode = 1;
      splitchecking = 0;

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

      splitchecking = 1;
      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(source_p, ":%s NOTICE %s :SPLITMODE is currently %s", 
               me.name, source_p->name, 
	       splitmode_status[(splitchecking + (splitmode*2))]);
}
Esempio n. 2
0
/* 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))]);
}
Esempio n. 3
0
/* SET SPLITUSERS */
static void
quote_splitusers(struct Client *source_p, const char *arg, int newval)
{
    if(newval >= 0) {
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "%s has changed SPLITUSERS to %i", source_p->name, newval);
        split_users = newval;

        if(splitchecking)
            check_splitmode(NULL);
    } else
        sendto_one_notice(source_p, ":SPLITUSERS is currently %i", split_users);
}
Esempio n. 4
0
/* SET SPLITNUM */
static void
quote_splitnum(struct Client *source_p, const char *arg, int newval)
{
	if(newval >= 0)
	{
		sendto_realops_flags(UMODE_ALL, L_ALL,
				     "%s has changed SPLITNUM to %i", source_p->name, newval);
		split_servers = newval;

		if(splitchecking)
			check_splitmode(NULL);
	}
	else
		sendto_one_notice(source_p, ":SPLITNUM is currently %i", split_servers);
}
Esempio n. 5
0
/* SET SPLITNUM */
static void
quote_splitnum(struct Client *source_p, int newval)
{
	if(newval >= 0)
	{
		sendto_realops_snomask(SNO_GENERAL, L_ALL,
				     "%s has changed SPLITNUM to %i", source_p->name, newval);
		split_servers = newval;

		if(splitchecking)
			check_splitmode(NULL);
	}
	else
		sendto_one(source_p, ":%s NOTICE %s :SPLITNUM is currently %i",
			   me.name, source_p->name, split_servers);
}
Esempio n. 6
0
/* SET SPLITUSERS */
static void quote_splitusers(struct Client *source_p, int newval)
{
  if(newval >= 0)
  {
    sendto_realops_flags(UMODE_ALL, L_ALL,
                         "%s has changed SPLITUSERS to %i", 
			 source_p->name, newval);
    split_users = newval;

    if(splitchecking)
      check_splitmode(NULL);
  }
  else
    sendto_one(source_p, ":%s NOTICE %s :SPLITUSERS is currently %i", 
               me.name, source_p->name, split_users);
}
Esempio n. 7
0
/* SET SPLITUSERS */
static void
quote_splitusers(struct Client *source_p, const char *arg, int newval)
{
  if (newval >= 0)
  {
    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
                         "%s has changed SPLITUSERS to %i",
                         get_oper_name(source_p), newval);
    split_users = newval;

    if (splitchecking)
      check_splitmode(NULL);
  }
  else
    sendto_one_notice(source_p, &me, ":SPLITUSERS is currently %i",
                      split_users);
}
Esempio n. 8
0
/*
 * update_client_exit_stats
 *
 * input	- pointer to client
 * output	- NONE
 * side effects	- 
 */
static void update_client_exit_stats(struct Client* client_p)
{
  if (IsServer(client_p))
    {
      --Count.server;
      sendto_realops_flags(FLAGS_EXTERNAL, L_ALL, 
                           "Server %s split from %s",
                           client_p->name, client_p->servptr->name);
    }
  else if (IsClient(client_p))
    {
      --Count.total;
      if (IsOper(client_p))
	--Count.oper;
      if (IsInvisible(client_p)) 
	--Count.invisi;
    }

  if(splitchecking && !splitmode)
    check_splitmode(NULL);
}