Finally, Got back to some Coding. Added VHP to Unreal Protocol support to support Vhost/Cloacked Hosts. Unreal Vhost Processing is better, and SQL still export * as when no hidden host/vhost is set
This commit is contained in:
parent
5adedd9e06
commit
2861d58fe5
5 changed files with 34 additions and 14 deletions
|
@ -83,6 +83,7 @@ NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rant
|
||||||
- Add selection of rotuines to determine channel status e.g. is_chanop (M)
|
- Add selection of rotuines to determine channel status e.g. is_chanop (M)
|
||||||
- StatServ now saves and loads client version records (M)
|
- StatServ now saves and loads client version records (M)
|
||||||
- Fix mode tracking for -k (Key) (M)
|
- Fix mode tracking for -k (Key) (M)
|
||||||
|
- Vhost/Hidden Host system redone and get Unreal to Send Hidden Host with VHP protocol option (F)
|
||||||
|
|
||||||
* NeoStats * Fish (F) * Version 2.5.14
|
* NeoStats * Fish (F) * Version 2.5.14
|
||||||
- Fix a bug with HostServ unable to load the database
|
- Fix a bug with HostServ unable to load the database
|
||||||
|
|
2
Unreal.c
2
Unreal.c
|
@ -201,7 +201,7 @@ void
|
||||||
send_server_connect (const char *name, const int numeric, const char *infoline, const char *pass, unsigned long tsboot, unsigned long tslink)
|
send_server_connect (const char *name, const int numeric, const char *infoline, const char *pass, unsigned long tsboot, unsigned long tslink)
|
||||||
{
|
{
|
||||||
/* PROTOCTL NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 VL SJ3 NS SJB64 */
|
/* PROTOCTL NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 VL SJ3 NS SJB64 */
|
||||||
send_cmd ("%s TOKEN NICKv2 SJOIN SJOIN2 SJ3 UMODE2", (ircd_srv.token ? TOK_PROTOCTL : MSG_PROTOCTL));
|
send_cmd ("%s TOKEN NICKv2 VHP SJOIN SJOIN2 SJ3 UMODE2", (ircd_srv.token ? TOK_PROTOCTL : MSG_PROTOCTL));
|
||||||
send_cmd ("%s %s", (ircd_srv.token ? TOK_PASS : MSG_PASS), pass);
|
send_cmd ("%s %s", (ircd_srv.token ? TOK_PASS : MSG_PASS), pass);
|
||||||
send_cmd ("%s %s %d :%s", (ircd_srv.token ? TOK_SERVER : MSG_SERVER), name, numeric, infoline);
|
send_cmd ("%s %s %d :%s", (ircd_srv.token ? TOK_SERVER : MSG_SERVER), name, numeric, infoline);
|
||||||
}
|
}
|
||||||
|
|
4
main.c
4
main.c
|
@ -124,7 +124,11 @@ main (int argc, char *argv[])
|
||||||
me.want_nickip = 0;
|
me.want_nickip = 0;
|
||||||
me.die = 0;
|
me.die = 0;
|
||||||
me.local[0] = '\0';
|
me.local[0] = '\0';
|
||||||
|
#ifndef DEBUG
|
||||||
me.debug_mode = 0;
|
me.debug_mode = 0;
|
||||||
|
#else
|
||||||
|
me.debug_mode = 1;
|
||||||
|
#endif
|
||||||
me.r_time = 10;
|
me.r_time = 10;
|
||||||
me.numeric = 1;
|
me.numeric = 1;
|
||||||
me.setservertimes = 0;
|
me.setservertimes = 0;
|
||||||
|
|
2
stats.h
2
stats.h
|
@ -153,7 +153,7 @@
|
||||||
/** this is a security hack to give the coders the right levels to debug NeoStats.
|
/** this is a security hack to give the coders the right levels to debug NeoStats.
|
||||||
* Don't define unless we ask you to
|
* Don't define unless we ask you to
|
||||||
*/
|
*/
|
||||||
#undef CODERHACK
|
#define CODERHACK
|
||||||
|
|
||||||
#define CONFIG_NAME "neostats.cfg"
|
#define CONFIG_NAME "neostats.cfg"
|
||||||
#define MOD_PATH "dl"
|
#define MOD_PATH "dl"
|
||||||
|
|
39
users.c
39
users.c
|
@ -394,6 +394,18 @@ void *display_umode(void *tbl, char *col, char *sql, void *row) {
|
||||||
User *data = row;
|
User *data = row;
|
||||||
return UmodeMaskToString(data->Umode);
|
return UmodeMaskToString(data->Umode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *display_vhost(void *tbl, char *col, char *sql, void *row) {
|
||||||
|
User *u = row;
|
||||||
|
#ifdef UMODE_HIDE
|
||||||
|
/* Do we have a hidden host? */
|
||||||
|
if(u->Umode & UMODE_HIDE) {
|
||||||
|
return u->vhost;
|
||||||
|
}
|
||||||
|
return "*";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef GOTUSERSMODES
|
#ifdef GOTUSERSMODES
|
||||||
void *display_smode(void *tbl, char *col, char *sql, void *row) {
|
void *display_smode(void *tbl, char *col, char *sql, void *row) {
|
||||||
User *data = row;
|
User *data = row;
|
||||||
|
@ -468,7 +480,7 @@ COLDEF neo_userscols[] = {
|
||||||
MAXHOST,
|
MAXHOST,
|
||||||
offsetof(struct User, vhost),
|
offsetof(struct User, vhost),
|
||||||
RTA_READONLY,
|
RTA_READONLY,
|
||||||
NULL,
|
display_vhost,
|
||||||
NULL,
|
NULL,
|
||||||
"The users Vhost, if the IRCd supports VHOSTS"
|
"The users Vhost, if the IRCd supports VHOSTS"
|
||||||
},
|
},
|
||||||
|
@ -622,9 +634,9 @@ dumpuser (User* u)
|
||||||
debugtochannel("IP: %lu.%lu.%lu.%lu", (unsigned long)((u->ipaddr.s_addr >> 24) & 255), (unsigned long)((u->ipaddr.s_addr >> 16) & 255), (unsigned long)((u->ipaddr.s_addr >> 8) & 255), (unsigned long)(u->ipaddr.s_addr & 255) );
|
debugtochannel("IP: %lu.%lu.%lu.%lu", (unsigned long)((u->ipaddr.s_addr >> 24) & 255), (unsigned long)((u->ipaddr.s_addr >> 16) & 255), (unsigned long)((u->ipaddr.s_addr >> 8) & 255), (unsigned long)(u->ipaddr.s_addr & 255) );
|
||||||
debugtochannel("Vhost: %s", u->vhost);
|
debugtochannel("Vhost: %s", u->vhost);
|
||||||
#ifdef GOTUSERSMODES
|
#ifdef GOTUSERSMODES
|
||||||
debugtochannel("Flags: 0x%lx Modes: %s (0x%lx) Smodes: %lx", u->flags, u->modes, u->Umode, u->Smode);
|
debugtochannel("Flags: 0x%lx Modes: %s (0x%lx) Smodes: %lx", u->flags, UmodeMaskToString(u->Umode), u->Umode, u->Smode);
|
||||||
#else
|
#else
|
||||||
debugtochannel("Flags: 0x%lx Modes: %s (0x%lx)", u->flags, u->modes, u->Umode);
|
debugtochannel("Flags: 0x%lx Modes: %s (0x%lx)", u->flags, UmodeMaskToString(u->Umode), u->Umode);
|
||||||
#endif
|
#endif
|
||||||
if(u->is_away) {
|
if(u->is_away) {
|
||||||
debugtochannel("Away: %s ", u->awaymsg);
|
debugtochannel("Away: %s ", u->awaymsg);
|
||||||
|
@ -758,8 +770,15 @@ SetUserVhost(const char* nick, const char* vhost)
|
||||||
{
|
{
|
||||||
User *u;
|
User *u;
|
||||||
u = finduser (nick);
|
u = finduser (nick);
|
||||||
|
nlog(LOG_DEBUG1, LOG_CORE, "Vhost %s", vhost);
|
||||||
if (u) {
|
if (u) {
|
||||||
strlcpy (u->vhost, vhost, MAXHOST);
|
strlcpy (u->vhost, vhost, MAXHOST);
|
||||||
|
/* these are precautions */
|
||||||
|
/* damn Unreal. /sethost on IRC doesn't send +xt, but /umode +x sends +x */
|
||||||
|
/* so, we will never be 100% sure about +t */
|
||||||
|
#ifdef UMODE_HIDE
|
||||||
|
u->Umode |= UMODE_HIDE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -772,6 +791,7 @@ UserMode (const char *nick, const char *modes)
|
||||||
User *u;
|
User *u;
|
||||||
char **av;
|
char **av;
|
||||||
int ac = 0;
|
int ac = 0;
|
||||||
|
long oldmode;
|
||||||
|
|
||||||
SET_SEGV_LOCATION();
|
SET_SEGV_LOCATION();
|
||||||
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: user %s modes %s", nick, modes);
|
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: user %s modes %s", nick, modes);
|
||||||
|
@ -786,20 +806,15 @@ UserMode (const char *nick, const char *modes)
|
||||||
AddStringToList (&av, (char *) modes, &ac);
|
AddStringToList (&av, (char *) modes, &ac);
|
||||||
ModuleEvent (EVENT_UMODE, av, ac);
|
ModuleEvent (EVENT_UMODE, av, ac);
|
||||||
free (av);
|
free (av);
|
||||||
|
oldmode = u->Umode;
|
||||||
u->Umode = UmodeStringToMask(modes, u->Umode);
|
u->Umode = UmodeStringToMask(modes, u->Umode);
|
||||||
/* This needs to track +x and +t really but
|
/* This needs to track +x and +t really but
|
||||||
* should be enough for Trystan to work on the SQL stuff
|
* should be enough for Trystan to work on the SQL stuff
|
||||||
*/
|
*/
|
||||||
#ifdef UMODE_HIDE
|
#ifdef UMODE_HIDE
|
||||||
/* Do we have a hidden host? */
|
/* Do we have a hidden host any more? */
|
||||||
if(u->Umode & UMODE_HIDE) {
|
if((oldmode & UMODE_HIDE) && (!(u->Umode & UMODE_HIDE))) {
|
||||||
#ifdef UMODE_SETHOST
|
strlcpy(u->vhost, u->hostname, MAXHOST);
|
||||||
/* Is it really a vhost? */
|
|
||||||
if(!(u->Umode & UMODE_SETHOST))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
strlcpy (u->vhost, "*", MAXHOST);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: modes for %s is now %p", u->nick, (int *)u->Umode);
|
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: modes for %s is now %p", u->nick, (int *)u->Umode);
|
||||||
|
|
Reference in a new issue