mirror of
https://github.com/anope/anope.git
synced 2026-07-09 15:03:13 +02:00
Merge branch 'anopeng-config' of http://git.inspircd.org/git/anope/ into anopeng-config
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1449 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -272,7 +272,6 @@ CREATE TABLE anope_ns_core (
|
||||
memocount smallint(5) unsigned NOT NULL default '0',
|
||||
memomax smallint(5) unsigned NOT NULL default '0',
|
||||
channelcount smallint(5) unsigned NOT NULL default '0',
|
||||
channelmax smallint(5) unsigned NOT NULL default '0',
|
||||
greet text NOT NULL,
|
||||
active tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (nc_id),
|
||||
|
||||
+4
-54
@@ -227,9 +227,6 @@ typedef struct c_elist EList;
|
||||
typedef struct c_elist_entry Entry;
|
||||
typedef struct ModuleData_ ModuleData; /* ModuleData struct */
|
||||
typedef struct memo_ Memo;
|
||||
typedef struct nickrequest_ NickRequest;
|
||||
typedef struct nickalias_ NickAlias;
|
||||
typedef struct nickcore_ NickCore;
|
||||
typedef struct chaninfo_ ChannelInfo;
|
||||
typedef struct badword_ BadWord;
|
||||
typedef struct bandata_ BanData;
|
||||
@@ -462,59 +459,12 @@ typedef struct {
|
||||
Memo *memos;
|
||||
} MemoInfo;
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* NickServ nickname structures. */
|
||||
|
||||
|
||||
struct nickrequest_ {
|
||||
NickRequest *next, *prev;
|
||||
char *nick;
|
||||
char *passcode;
|
||||
char password[PASSMAX];
|
||||
char *email;
|
||||
time_t requested;
|
||||
time_t lastmail; /* Unsaved */
|
||||
};
|
||||
|
||||
struct nickalias_ {
|
||||
NickAlias *next, *prev;
|
||||
char *nick; /* Nickname */
|
||||
char *last_quit; /* Last quit message */
|
||||
char *last_realname; /* Last realname */
|
||||
char *last_usermask; /* Last usermask */
|
||||
time_t time_registered; /* When the nick was registered */
|
||||
time_t last_seen; /* When it was seen online for the last time */
|
||||
uint16 status; /* See NS_* below */
|
||||
NickCore *nc; /* I'm an alias of this */
|
||||
/* Not saved */
|
||||
ModuleData *moduleData; /* Module saved data attached to the nick alias */
|
||||
User *u; /* Current online user that has me */
|
||||
};
|
||||
|
||||
struct nickcore_ {
|
||||
NickCore *next, *prev;
|
||||
|
||||
char *display; /* How the nick is displayed */
|
||||
char pass[PASSMAX]; /* Password of the nicks */
|
||||
char *email; /* E-mail associated to the nick */
|
||||
char *greet; /* Greet associated to the nick */
|
||||
uint32 icq; /* ICQ # associated to the nick */
|
||||
char *url; /* URL associated to the nick */
|
||||
uint32 flags; /* See NI_* below */
|
||||
uint16 language; /* Language selected by nickname owner (LANG_*) */
|
||||
uint16 accesscount; /* # of entries */
|
||||
char **access; /* Array of strings */
|
||||
MemoInfo memos;
|
||||
uint16 channelcount; /* Number of channels currently registered */
|
||||
uint16 channelmax; /* Maximum number of channels allowed */
|
||||
|
||||
/* Unsaved data */
|
||||
ModuleData *moduleData; /* Module saved data attached to the NickCore */
|
||||
time_t lastmail; /* Last time this nick record got a mail */
|
||||
SList aliases; /* List of aliases */
|
||||
};
|
||||
|
||||
// For NickServ
|
||||
#include "account.h"
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
+1
-2
@@ -1574,8 +1574,7 @@ void cs_remove_nick(const NickCore * nc)
|
||||
if (ci->founder == nc) {
|
||||
if (ci->successor) {
|
||||
NickCore *nc2 = ci->successor;
|
||||
if (!nick_is_services_admin(nc2) && nc2->channelmax > 0
|
||||
&& nc2->channelcount >= nc2->channelmax) {
|
||||
if (!nick_is_services_admin(nc2) && CSMaxReg && nc2->channelcount >= CSMaxReg) {
|
||||
alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", s_ChanServ, nc2->display, ci->name);
|
||||
delchan(ci);
|
||||
continue;
|
||||
|
||||
@@ -116,11 +116,9 @@ int do_register(User * u)
|
||||
} else if (!chan_has_user_status(c, u, CUS_OP)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_MUST_BE_CHANOP);
|
||||
|
||||
} else if (!is_servadmin && nc->channelmax > 0
|
||||
&& nc->channelcount >= nc->channelmax) {
|
||||
} else if (!is_servadmin && CSMaxReg && nc->channelcount >= CSMaxReg) {
|
||||
notice_lang(s_ChanServ, u, nc->channelcount >
|
||||
nc->channelmax ? CHAN_EXCEEDED_CHANNEL_LIMIT :
|
||||
CHAN_REACHED_CHANNEL_LIMIT, nc->channelmax);
|
||||
CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, CSMaxReg);
|
||||
} else if (stricmp(u->nick, pass) == 0
|
||||
|| (StrictPasswords && strlen(pass) < 5)) {
|
||||
notice_lang(s_ChanServ, u, MORE_OBSCURE_PASSWORD);
|
||||
|
||||
+1
-2
@@ -296,8 +296,7 @@ int do_set_founder(User * u, ChannelInfo * ci, char *param)
|
||||
}
|
||||
|
||||
nc = na->nc;
|
||||
if (nc->channelmax > 0 && nc->channelcount >= nc->channelmax
|
||||
&& !is_services_admin(u)) {
|
||||
if (CSMaxReg && nc->channelcount >= CSMaxReg && !is_services_admin(u)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_SET_FOUNDER_TOO_MANY_CHANS, param);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -320,8 +320,9 @@ int do_confirm(User * u)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
na->nc->memos.memomax = MSMaxMemos;
|
||||
na->nc->channelmax = CSMaxReg;
|
||||
|
||||
if (forced == 1) {
|
||||
na->last_usermask = sstrdup("*@*");
|
||||
na->last_realname = sstrdup("unknown");
|
||||
|
||||
+6
-7
@@ -335,22 +335,22 @@ int db_mysql_save_ns_core(NickCore * nc)
|
||||
/* Update the existing records */
|
||||
ret = db_mysql_try("UPDATE anope_ns_core "
|
||||
"SET pass = %s, email = '%s', greet = '%s', icq = %d, url = '%s', flags = %d, language = %d, accesscount = %d, memocount = %d, "
|
||||
" memomax = %d, channelcount = %d, channelmax = %d, active = 1 "
|
||||
" memomax = %d, channelcount = %d, active = 1 "
|
||||
"WHERE display = '%s'",
|
||||
epass, q_email, q_greet, nc->icq, q_url, nc->flags,
|
||||
nc->language, nc->accesscount, nc->memos.memocount,
|
||||
nc->memos.memomax, nc->channelcount, nc->channelmax,
|
||||
nc->memos.memomax, nc->channelcount,
|
||||
q_display);
|
||||
|
||||
/* Our previous UPDATE affected no rows, therefore this is a new record */
|
||||
if (ret && (mysql_affected_rows(mysql) == 0)) {
|
||||
ret = db_mysql_try("INSERT DELAYED INTO anope_ns_core "
|
||||
"(display, pass, email, greet, icq, url, flags, language, accesscount, memocount, memomax, channelcount, channelmax, active) "
|
||||
"(display, pass, email, greet, icq, url, flags, language, accesscount, memocount, memomax, channelcount, active) "
|
||||
"VALUES ('%s', %s, '%s', '%s', %d, '%s', %d, %d, %d, %d, %d, %d, %d, 1)",
|
||||
q_display, epass, q_email, q_greet, nc->icq, q_url,
|
||||
nc->flags, nc->language, nc->accesscount,
|
||||
nc->memos.memocount, nc->memos.memomax,
|
||||
nc->channelcount, nc->channelmax);
|
||||
nc->channelcount);
|
||||
}
|
||||
|
||||
/* Now let's do the access */
|
||||
@@ -1695,7 +1695,7 @@ int db_mysql_load_ns_dbase(void)
|
||||
if (!do_mysql)
|
||||
return 0;
|
||||
|
||||
ret = db_mysql_try("SELECT display, pass, email, icq, url, flags, language, accesscount, memocount, memomax, channelcount, channelmax, greet "
|
||||
ret = db_mysql_try("SELECT display, pass, email, icq, url, flags, language, accesscount, memocount, memomax, channelcount, greet "
|
||||
"FROM anope_ns_core "
|
||||
"WHERE active = 1");
|
||||
|
||||
@@ -1724,9 +1724,8 @@ int db_mysql_load_ns_dbase(void)
|
||||
nc->memos.memocount = strtol(mysql_row[8], (char **) NULL, 10);
|
||||
nc->memos.memomax = strtol(mysql_row[9], (char **) NULL, 10);
|
||||
|
||||
/* Channelcount, channelmax, greet */
|
||||
/* Channelcount, greet */
|
||||
nc->channelcount = strtol(mysql_row[10], (char **) NULL, 10);
|
||||
nc->channelmax = strtol(mysql_row[11], (char **) NULL, 10);
|
||||
if (mysql_row[12] && *(mysql_row[12]))
|
||||
nc->greet = sstrdup(mysql_row[12]);
|
||||
|
||||
|
||||
+3
-5
@@ -350,10 +350,9 @@ void load_old_ns_dbase(void)
|
||||
/* We read the channel count, but don't take care of it.
|
||||
load_cs_dbase will regenerate it correctly. */
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
SAFE(read_int16(&nc->channelmax, f));
|
||||
if (ver == 5)
|
||||
nc->channelmax = CSMaxReg;
|
||||
|
||||
/* formerly nc->channelmax, RIP */
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
SAFE(read_int16(&nc->language, f));
|
||||
|
||||
if (ver >= 11 && ver < 13) {
|
||||
@@ -546,7 +545,6 @@ void load_ns_dbase(void)
|
||||
|
||||
SAFE(read_int16(&nc->channelcount, f));
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
nc->channelmax = CSMaxReg;
|
||||
|
||||
if (ver < 13) {
|
||||
/* Used to be dead authentication system */
|
||||
@@ -693,7 +691,7 @@ void save_ns_dbase(void)
|
||||
}
|
||||
|
||||
SAFE(write_int16(nc->channelcount, f));
|
||||
SAFE(write_int16(nc->channelmax, f));
|
||||
SAFE(write_int16(nc->channelcount, f)); // write this twice to avoid having to revbump the NickServ DB from anope 1.7, hack alert XXX
|
||||
|
||||
} /* for (nc) */
|
||||
|
||||
|
||||
@@ -209,7 +209,6 @@ struct nickcore_ {
|
||||
char **access; /* Array of strings */
|
||||
MemoInfo memos; /* Memo information */
|
||||
uint16 channelcount; /* Number of channels currently registered */
|
||||
uint16 channelmax; /* Maximum number of channels allowed */
|
||||
int unused; /* Used for nick collisions */
|
||||
int aliascount; /* How many aliases link to us? Remove the core if 0 */
|
||||
};
|
||||
@@ -675,7 +674,7 @@ int main(int argc, char *argv[])
|
||||
SAFE(write_string(memos->text, f));
|
||||
}
|
||||
SAFE(write_int16(nc->channelcount, f));
|
||||
SAFE(write_int16(nc->channelmax, f));
|
||||
SAFE(write_int16(nc->channelcount, f)); // BK with anope1.7, hack alert XXX
|
||||
} /* for (nc) */
|
||||
SAFE(write_int8(0, f));
|
||||
} /* for (i) */
|
||||
|
||||
Reference in New Issue
Block a user