[IRCServices Coding] coding... (svcs 5)

Andrew Church achurch at achurch.org
Sat Dec 15 10:45:50 PST 2001


     Not worth it.

>For services 5:
>
>I believe code like this (from operserv/main.c: do_killclones() )
>
>            if (match_usermask(clonemask, user) != 0) {
>                char killreason[32];
>                count++;
>                snprintf(killreason, sizeof(killreason),
>                         "Cloning [%d]", count);
>                kill_user(NULL, user->nick, killreason);
>            }
>
>should exist in seperate functions like:
>
>int kill_mask(const char *mask, const char *reason)
>{
>	int	count=0;
>	User	*user;
>
>        for (user = first_user(); user; user = next_user())
>	{
>		if (match_usermask(mask, user) != 0)
>		{
>			char	killreason[512];
>
>			count++;
>			snprintf(killreason, sizeof(killreason),
>				(reason == NULL ? "Cloning [%d]" : reason),
>				count);
>			kill_user(NULL, user->nick, killreason);
>		}
>	}
>
>	return(count);
>}
>
>3rd party modules should not use their own code for things like this, sin
>ce
>it exists allready.
>
><<V13>>
>------------------------------------------------------------------
>To unsubscribe or change your subscription options, visit:
>http://www.ircservices.za.net/mailman/listinfo/ircservices-coding

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/