Added support to CORE of Neo for NICK changes, updated ConnectServ to show
NICK changes in same fashion all other CS options work.
This commit is contained in:
parent
a8fd29944a
commit
710e935f64
7 changed files with 83 additions and 9 deletions
|
@ -1,6 +1,8 @@
|
||||||
NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rants)
|
NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rants)
|
||||||
|
|
||||||
|
|
||||||
* NeoStats * Shmad & Fish * Version ????
|
* NeoStats * Shmad & Fish * Version ????
|
||||||
|
- Modified users.c so we could call NICK changes to events :) (S)
|
||||||
- fixed 'make install' now copies the html template over (reported by eggy) (S)
|
- fixed 'make install' now copies the html template over (reported by eggy) (S)
|
||||||
- Changed stats.pid to NeoStats.pid (reported by eggy) (S)
|
- Changed stats.pid to NeoStats.pid (reported by eggy) (S)
|
||||||
- StatServ STATS DEL will now only delete OFFLINE servers for sanitys sake (S)
|
- StatServ STATS DEL will now only delete OFFLINE servers for sanitys sake (S)
|
||||||
|
|
2
TODO
2
TODO
|
@ -5,6 +5,4 @@ NeoStats - TODO Log:
|
||||||
Shmad:
|
Shmad:
|
||||||
------
|
------
|
||||||
|
|
||||||
- STATS DEL crashbug (fixed) must make it regen stats now.
|
|
||||||
- RESET (statserv again) doesnt work at all lol!
|
|
||||||
- Just Bug fixes right now.
|
- Just Bug fixes right now.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
DEFAULT #bah Hey
|
DEFAULT #NeoStats Welcome to the NeoStats Developmental Testing Server
|
||||||
OPER #opopop
|
OPER #services Welcome oper!
|
||||||
#IGNORE
|
#IGNORE
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
ConnectServ Module for NeoStats 2.x ChangeLog
|
ConnectServ Module for NeoStats 2.x ChangeLog
|
||||||
Shmad & ^Enigma^
|
Shmad & ^Enigma^
|
||||||
|
|
||||||
|
* Version 1.5 * September 12th, 2002
|
||||||
|
- Added NICK watching support for nick changes (Shmad)
|
||||||
|
- Fixed other misc bugs.
|
||||||
|
|
||||||
* Version 1.4 * July 17th, 2002
|
* Version 1.4 * July 17th, 2002
|
||||||
- Moved to new Event API (Fish)
|
- Moved to new Event API (Fish)
|
||||||
- Stopped it flooding the net when neo starts up (Fish)
|
- Stopped it flooding the net when neo starts up (Fish)
|
||||||
|
|
61
dl/cs/cs.c
61
dl/cs/cs.c
|
@ -20,7 +20,7 @@
|
||||||
** USA
|
** USA
|
||||||
**
|
**
|
||||||
** NeoStats CVS Identification
|
** NeoStats CVS Identification
|
||||||
** $Id: cs.c,v 1.10 2002/09/04 08:40:27 fishwaldo Exp $
|
** $Id: cs.c,v 1.11 2002/09/12 15:42:36 shmad Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -38,15 +38,18 @@ int cs_new_user(char **av, int ac);
|
||||||
int cs_user_modes(char **av, int ac);
|
int cs_user_modes(char **av, int ac);
|
||||||
int cs_del_user(char **av, int ac);
|
int cs_del_user(char **av, int ac);
|
||||||
int cs_user_kill(char **av, int ac);
|
int cs_user_kill(char **av, int ac);
|
||||||
|
int cs_user_nick(char *nick, char *newnick);
|
||||||
|
|
||||||
static void cs_status(User *);
|
static void cs_status(User *);
|
||||||
static void cs_signwatch(User *u);
|
static void cs_signwatch(User *u);
|
||||||
static void cs_killwatch(User *u);
|
static void cs_killwatch(User *u);
|
||||||
static void cs_modewatch(User *u);
|
static void cs_modewatch(User *u);
|
||||||
|
static void cs_nickwatch(User *u);
|
||||||
|
|
||||||
int sign_watch;
|
int sign_watch;
|
||||||
int kill_watch;
|
int kill_watch;
|
||||||
int mode_watch;
|
int mode_watch;
|
||||||
|
int nick_watch;
|
||||||
|
|
||||||
void cslog(char *, ...);
|
void cslog(char *, ...);
|
||||||
void SaveSettings();
|
void SaveSettings();
|
||||||
|
@ -64,7 +67,7 @@ int ConfigCount = 0;
|
||||||
Module_Info my_info[] = { {
|
Module_Info my_info[] = { {
|
||||||
"ConnectServ",
|
"ConnectServ",
|
||||||
"Network Connection & Mode Monitoring Service",
|
"Network Connection & Mode Monitoring Service",
|
||||||
"1.4"
|
"1.5"
|
||||||
} };
|
} };
|
||||||
|
|
||||||
int new_m_version(char *origin, char **av, int ac) {
|
int new_m_version(char *origin, char **av, int ac) {
|
||||||
|
@ -89,6 +92,9 @@ int __Bot_Message(char *origin, char **av, int ac)
|
||||||
} else if (ac <= 2) {
|
} else if (ac <= 2) {
|
||||||
privmsg_list(u->nick, s_ConnectServ, cs_help);
|
privmsg_list(u->nick, s_ConnectServ, cs_help);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (!strcasecmp(av[2], "NICKWATCH") && (UserLevel(u) >= 185)) {
|
||||||
|
privmsg_list(u->nick, s_ConnectServ, cs_help_nickwatch);
|
||||||
|
return 1;
|
||||||
} else if (!strcasecmp(av[2], "SIGNWATCH") && (UserLevel(u) >= 185)) {
|
} else if (!strcasecmp(av[2], "SIGNWATCH") && (UserLevel(u) >= 185)) {
|
||||||
privmsg_list(u->nick, s_ConnectServ, cs_help_signwatch);
|
privmsg_list(u->nick, s_ConnectServ, cs_help_signwatch);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -110,6 +116,8 @@ int __Bot_Message(char *origin, char **av, int ac)
|
||||||
|
|
||||||
if (!strcasecmp(av[1], "ABOUT")) {
|
if (!strcasecmp(av[1], "ABOUT")) {
|
||||||
privmsg_list(u->nick, s_ConnectServ, cs_help_about);
|
privmsg_list(u->nick, s_ConnectServ, cs_help_about);
|
||||||
|
} else if (!strcasecmp(av[1], "NICKWATCH") && (UserLevel(u) >= 185)) {
|
||||||
|
cs_nickwatch(u);
|
||||||
} else if (!strcasecmp(av[1], "SIGNWATCH") && (UserLevel(u) >= 185)) {
|
} else if (!strcasecmp(av[1], "SIGNWATCH") && (UserLevel(u) >= 185)) {
|
||||||
cs_signwatch(u);
|
cs_signwatch(u);
|
||||||
} else if (!strcasecmp(av[1], "KILLWATCH") && (UserLevel(u) >= 185)) {
|
} else if (!strcasecmp(av[1], "KILLWATCH") && (UserLevel(u) >= 185)) {
|
||||||
|
@ -141,6 +149,7 @@ EventFnList my_event_list[] = {
|
||||||
{ "UMODE", cs_user_modes},
|
{ "UMODE", cs_user_modes},
|
||||||
{ "SIGNOFF", cs_del_user},
|
{ "SIGNOFF", cs_del_user},
|
||||||
{ "KILL", cs_user_kill},
|
{ "KILL", cs_user_kill},
|
||||||
|
{ "NICK", cs_user_nick},
|
||||||
{ NULL, NULL}
|
{ NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -203,6 +212,7 @@ void SaveSettings()
|
||||||
fprintf(fp, ":SIGNWATCH %i\n", sign_watch);
|
fprintf(fp, ":SIGNWATCH %i\n", sign_watch);
|
||||||
fprintf(fp, ":KILLWATCH %i\n", kill_watch);
|
fprintf(fp, ":KILLWATCH %i\n", kill_watch);
|
||||||
fprintf(fp, ":MODEWATCH %i\n", mode_watch);
|
fprintf(fp, ":MODEWATCH %i\n", mode_watch);
|
||||||
|
fprintf(fp, ":NICKWATCH %i\n", nick_watch);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,6 +410,43 @@ int cs_user_kill(char **av, int ac) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If a user has changed their nick say so */
|
||||||
|
int cs_user_nick(char *nick, char *newnick) {
|
||||||
|
/* Approximate Segfault Location */
|
||||||
|
strcpy(segv_location, "cs_user_nick");
|
||||||
|
|
||||||
|
if (nick_watch) if (is_synced) chanalert(s_ConnectServ, "\2NICK\2 %s Changed their nick to %s", nick, newnick);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void cs_nickwatch(User *u)
|
||||||
|
{
|
||||||
|
/* Approximate Segfault Location */
|
||||||
|
strcpy(segv_location, "cs_nickwatch");
|
||||||
|
if (!(UserLevel(u) >= 185)) {
|
||||||
|
prefmsg(u->nick, s_ConnectServ, "Permission Denied, you need to be a TechAdmin or a Network Administrator to do that!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* The user has passed the minimum requirements for the ENABLE/DISABLE */
|
||||||
|
|
||||||
|
if (!nick_watch) {
|
||||||
|
nick_watch = 1;
|
||||||
|
if (is_synced) chanalert(s_ConnectServ, "\2NICK WATCH\2 Activated by %s",u->nick);
|
||||||
|
cslog("%s!%s@%s Activated NICK WATCH", u->nick, u->username, u->hostname);
|
||||||
|
SaveSettings();
|
||||||
|
prefmsg(u->nick, s_ConnectServ, "\2NICK WATCH\2 Activated");
|
||||||
|
} else {
|
||||||
|
nick_watch = 0;
|
||||||
|
if (is_synced) chanalert(s_ConnectServ, "\2NICK WATCH\2 Deactivated by %s",u->nick);
|
||||||
|
cslog("%s!%s@%s Deactivated NICK WATCH", u->nick, u->username, u->hostname);
|
||||||
|
SaveSettings();
|
||||||
|
prefmsg(u->nick, s_ConnectServ, "\2NICK WATCH\2 Deactivated");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Routine for Signon/Signoff ENABLE or DISABLE */
|
/* Routine for Signon/Signoff ENABLE or DISABLE */
|
||||||
static void cs_signwatch(User *u)
|
static void cs_signwatch(User *u)
|
||||||
|
@ -517,6 +564,14 @@ static void cs_status(User *u)
|
||||||
prefmsg(u->nick, s_ConnectServ, "\2MODE WATCH\2 is Currently Active");
|
prefmsg(u->nick, s_ConnectServ, "\2MODE WATCH\2 is Currently Active");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* NICKWATCH Check */
|
||||||
|
if (!nick_watch) {
|
||||||
|
prefmsg(u->nick, s_ConnectServ, "\2NICK WATCH\2 is Not Currently Active");
|
||||||
|
}
|
||||||
|
if (nick_watch) {
|
||||||
|
prefmsg(u->nick, s_ConnectServ, "\2NICK WATCH\2 is Currently Active");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load ConnectServ Config file and set defaults if does not exist */
|
/* Load ConnectServ Config file and set defaults if does not exist */
|
||||||
|
@ -537,6 +592,8 @@ void Loadconfig()
|
||||||
kill_watch = atoi(Config[1]);
|
kill_watch = atoi(Config[1]);
|
||||||
} else if (!strcasecmp(Config[0], "MODEWATCH")) {
|
} else if (!strcasecmp(Config[0], "MODEWATCH")) {
|
||||||
mode_watch = atoi(Config[1]);
|
mode_watch = atoi(Config[1]);
|
||||||
|
} else if (!strcasecmp(Config[0], "NICKWATCH")) {
|
||||||
|
nick_watch = atoi(Config[1]);
|
||||||
} else {
|
} else {
|
||||||
cslog("%s is not a valid connect.db option!", Config[0]);
|
cslog("%s is not a valid connect.db option!", Config[0]);
|
||||||
if (is_synced) chanalert(s_Services, "%s is not a valid connect.db option! Please check your data/connect.db file!", Config[0]);
|
if (is_synced) chanalert(s_Services, "%s is not a valid connect.db option! Please check your data/connect.db file!", Config[0]);
|
||||||
|
|
|
@ -20,14 +20,14 @@
|
||||||
** USA
|
** USA
|
||||||
**
|
**
|
||||||
** NeoStats CVS Identification
|
** NeoStats CVS Identification
|
||||||
** $Id: cs_help.c,v 1.5 2002/09/04 08:40:27 fishwaldo Exp $
|
** $Id: cs_help.c,v 1.6 2002/09/12 15:42:37 shmad Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const char *cs_help[] = {
|
const char *cs_help[] = {
|
||||||
"\2ConnectServ HELP\2",
|
"\2ConnectServ HELP\2",
|
||||||
"",
|
"",
|
||||||
"COMMANDS:",
|
"COMMANDS:",
|
||||||
" SIGNWATCH KILLWATCH MODEWATCH",
|
" SIGNWATCH KILLWATCH MODEWATCH NICKWATCH",
|
||||||
"",
|
"",
|
||||||
" STATUS ABOUT",
|
" STATUS ABOUT",
|
||||||
"",
|
"",
|
||||||
|
@ -87,3 +87,14 @@ const char *cs_help_modewatch[] = {
|
||||||
"",
|
"",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *cs_help_nickwatch[] = {
|
||||||
|
"\2ConnectServ Help : NICKWATCH",
|
||||||
|
"\2Usage:\2 NICKWATCH",
|
||||||
|
"",
|
||||||
|
"Will enable or disable NICKWATCH. It is recommended you use the STATUS",
|
||||||
|
"command to check if this setting is enabled or disabled before you use",
|
||||||
|
"this command.",
|
||||||
|
"",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
3
users.c
3
users.c
|
@ -22,7 +22,7 @@
|
||||||
** USA
|
** USA
|
||||||
**
|
**
|
||||||
** NeoStats CVS Identification
|
** NeoStats CVS Identification
|
||||||
** $Id: users.c,v 1.37 2002/09/04 08:40:27 fishwaldo Exp $
|
** $Id: users.c,v 1.38 2002/09/12 15:42:36 shmad Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
|
@ -147,6 +147,7 @@ void Change_User(User *u, const char *newnick)
|
||||||
change_user_nick(findchan(lnode_get(cm)), (char *)newnick, u->nick);
|
change_user_nick(findchan(lnode_get(cm)), (char *)newnick, u->nick);
|
||||||
cm = list_next(u->chans, cm);
|
cm = list_next(u->chans, cm);
|
||||||
}
|
}
|
||||||
|
Module_Event("NICK", u->nick, newnick);
|
||||||
strcpy(segv_location, "Change_User_Return");
|
strcpy(segv_location, "Change_User_Return");
|
||||||
hash_delete(uh, un);
|
hash_delete(uh, un);
|
||||||
strcpy(u->nick, newnick);
|
strcpy(u->nick, newnick);
|
||||||
|
|
Reference in a new issue