connectserv didn't like other modules reading the UMODE variables, and was killing it.... fixed. FINALLY SOLVED INCORRECT OPERCOUNT PROBLEMS

This commit is contained in:
fishwaldo 2003-07-15 10:34:24 +00:00
parent 7c1f6e8e81
commit 78b3b9d5e2
5 changed files with 33 additions and 23 deletions

View file

@ -21,6 +21,7 @@ NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rant
- ModNum Structure created for tracking module numbers for module data pointers in users/server/channels/modes pointers
- Unreal works (it seems)
- Ultimate2/3 Works
- Fixed the wrong oper counts with StatServ. ConnectServ was the culprit
* NeoStats * Fish * Version 2.5.3
- Added ability to turn off StatServ wallops. "/msg statserv set msgthrottle off" - BugID#6

View file

@ -20,7 +20,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: cs.c,v 1.25 2003/06/13 13:07:56 fishwaldo Exp $
** $Id: cs.c,v 1.26 2003/07/15 10:34:23 fishwaldo Exp $
*/
#include <stdio.h>
@ -344,7 +344,7 @@ int cs_del_user(char **av, int ac)
int cs_user_modes(char **av, int ac)
{
int add = 1;
char *modes;
char *modes, *modes1;
User *u;
/* Approximate Segfault Location */
@ -366,7 +366,8 @@ int cs_user_modes(char **av, int ac)
if (!u->modes)
return -1;
modes = u->modes;
switch (*av[1]) {
modes1 = (char *)(av[1]);
switch (*modes1) {
case '+':
add = 1;
break;
@ -375,8 +376,8 @@ int cs_user_modes(char **av, int ac)
break;
}
while (*av[1]++) {
switch (*av[1]) {
while (*modes1++) {
switch (*modes1) {
case '+':
add = 1;
break;
@ -528,10 +529,10 @@ int cs_user_modes(char **av, int ac)
#ifdef ULTIMATE3
/* smode support for Ultimate3 */
int cs_user_smodes(char **av, int ac)
int cs_user_smodes(const char **av, const int ac)
{
int add = 1;
char *modes;
char *modes, *modes1;
User *u;
/* Approximate Segfault Location */
@ -550,7 +551,8 @@ int cs_user_smodes(char **av, int ac)
if (!u->modes)
return -1;
modes = u->modes;
switch (*av[1]) {
modes1 = (char *)(av[1]);
switch (*modes1) {
case '+':
add = 1;
break;
@ -559,8 +561,8 @@ int cs_user_smodes(char **av, int ac)
break;
}
while (*av[1]++) {
switch (*av[1]) {
while (*modes1++) {
switch (*modes1) {
case '+':
add = 1;
break;

View file

@ -20,7 +20,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: stats.c,v 1.40 2003/06/13 14:49:33 fishwaldo Exp $
** $Id: stats.c,v 1.41 2003/07/15 10:34:24 fishwaldo Exp $
*/
#include "statserv.h"
@ -312,6 +312,7 @@ int s_user_kill(char **av, int ac)
s = findstats(u->server->name);
if (is_oper(u)) {
nlog(LOG_DEBUG2, LOG_MOD, "Decreasing OperCount on %s due to kill", u->server->name);
DecreaseOpers(s);
}
DecreaseUsers(s);
@ -349,9 +350,17 @@ int s_user_modes(char **av, int ac)
"Changing modes for unknown user: %s", u->nick);
return -1;
}
#if 0
/* old code, lets try the new code */
if (!u->modes)
return -1;
modes = u->modes;
#endif
if (ac < 2) {
nlog(LOG_WARNING, LOG_MOD, "Didn't get mode for Umode Event");
return -1;
}
modes = av[1];
while (*modes) {
switch (*modes) {
case '+':
@ -363,6 +372,7 @@ int s_user_modes(char **av, int ac)
case 'O':
case 'o':
if (add) {
nlog(LOG_DEBUG1, LOG_MOD, "Increasing OperCount for %s", u->server->name);
IncreaseOpers(findstats(u->server->name));
s = findstats(u->server->name);
if (stats_network.maxopers <
@ -392,6 +402,7 @@ int s_user_modes(char **av, int ac)
}
} else {
if (is_oper(u)) {
nlog(LOG_DEBUG1, LOG_MOD, "Decreasing OperCount for %s", u->server->name);
DecreaseOpers(findstats
(u->server->name));
}
@ -426,6 +437,7 @@ int s_del_user(char **av, int ac)
if (!u->modes)
return -1;
if (is_oper(u)) {
nlog(LOG_DEBUG2, LOG_MOD, "Decreasing OperCount on %s due to signoff", u->server->name);
DecreaseOpers(s);
}
DecreaseUsers(s);
@ -553,13 +565,8 @@ int Online(char **av, int ac)
strcpy(segv_location, "StatServ-Online");
#ifdef ULTIMATE3
init_bot(s_StatServ, StatServ.user, StatServ.host, StatServ.rname,
"+oS", SSMNAME);
#else
init_bot(s_StatServ, StatServ.user, StatServ.host, StatServ.rname,
"+oS", SSMNAME);
#endif
StatServ.onchan = 1;
/* now that we are online, setup the timer to save the Stats database every so often */
add_mod_timer("SaveStats", "Save_Stats_DB", SSMNAME, 600);

4
ircd.c
View file

@ -22,7 +22,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: ircd.c,v 1.131 2003/07/15 09:16:15 fishwaldo Exp $
** $Id: ircd.c,v 1.132 2003/07/15 10:34:23 fishwaldo Exp $
*/
#include <setjmp.h>
#include "stats.h"
@ -101,8 +101,6 @@ int init_bot(char *nick, char *user, char *host, char *rname, char *modes,
int del_bot(char *nick, char *reason)
{
User *u;
char **av;
int ac = 0;
strcpy(segv_location, "del_bot");
u = finduser(nick);
nlog(LOG_DEBUG1, LOG_CORE, "Killing %s for %s", nick, reason);

10
users.c
View file

@ -22,7 +22,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: users.c,v 1.55 2003/07/11 14:06:45 fishwaldo Exp $
** $Id: users.c,v 1.56 2003/07/15 10:34:23 fishwaldo Exp $
*/
#include <fnmatch.h>
@ -153,6 +153,11 @@ void doDelUser(const char *nick, int i)
return;
}
u = hnode_get(un);
list_process(u->chans, u, part_u_chan);
/* run the event to delete a user */
AddStringToList(&av, u->nick, &ac);
if (i == 0) {
@ -162,9 +167,6 @@ void doDelUser(const char *nick, int i)
}
free(av);
list_process(u->chans, u, part_u_chan);
hash_delete(uh, un);
hnode_destroy(un);
list_destroy(u->chans);