unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

svslusers.c (2016B)

      1 /*
      2  *   IRC - Internet Relay Chat, src/modules/svslusers.c
      3  *   (C) 2002 codemastr [Dominick Meglio] (codemastr@unrealircd.com)
      4  *
      5  *   SVSLUSERS command, allows remote setting of local and global max user count
      6  *
      7  *   See file AUTHORS in IRC package for additional names of
      8  *   the programmers.
      9  *
     10  *   This program is free software; you can redistribute it and/or modify
     11  *   it under the terms of the GNU General Public License as published by
     12  *   the Free Software Foundation; either version 1, or (at your option)
     13  *   any later version.
     14  *
     15  *   This program is distributed in the hope that it will be useful,
     16  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     17  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18  *   GNU General Public License for more details.
     19  *
     20  *   You should have received a copy of the GNU General Public License
     21  *   along with this program; if not, write to the Free Software
     22  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     23  */
     24 
     25 #include "unrealircd.h"
     26 
     27 CMD_FUNC(cmd_svslusers);
     28 
     29 #define MSG_SVSLUSERS 	"SVSLUSERS"	
     30 
     31 ModuleHeader MOD_HEADER
     32   = {
     33 	"svslusers",
     34 	"5.0",
     35 	"command /svslusers", 
     36 	"UnrealIRCd Team",
     37 	"unrealircd-6",
     38     };
     39 
     40 MOD_INIT()
     41 {
     42 	CommandAdd(modinfo->handle, MSG_SVSLUSERS, cmd_svslusers, MAXPARA, CMD_SERVER);
     43 	MARK_AS_OFFICIAL_MODULE(modinfo);
     44 	return MOD_SUCCESS;
     45 }
     46 
     47 MOD_LOAD()
     48 {
     49 	return MOD_SUCCESS;
     50 }
     51 
     52 MOD_UNLOAD()
     53 {
     54 	return MOD_SUCCESS;
     55 }
     56 
     57 /*
     58 ** cmd_svslusers
     59 **      parv[1] = server to update
     60 **      parv[2] = max global users
     61 **      parv[3] = max local users
     62 **      If -1 is specified for either number, it is ignored and the current count
     63 **      is kept.
     64 */
     65 CMD_FUNC(cmd_svslusers)
     66 {
     67         if (!IsSvsCmdOk(client) || parc < 4)
     68 		return;  
     69         if (hunt_server(client, NULL, "SVSLUSERS", 1, parc, parv) == HUNTED_ISME)
     70         {
     71 		int temp;
     72 		temp = atoi(parv[2]);
     73 		if (temp >= 0)
     74 			irccounts.global_max = temp;
     75 		temp = atoi(parv[3]);
     76 		if (temp >= 0) 
     77 			irccounts.me_max = temp;
     78         }
     79 }