mirror of
https://github.com/anope/anope.git
synced 2026-06-30 06:16:38 +02:00
Fix bug #1009, patch inspired by DukePyrolator, add a TS6 SID generator from DukePyrolator, as well as change SendServer() to take a Server struct and use the result of new_server() in the SendServer() call instead.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2206 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -698,17 +698,17 @@ class BahamutIRCdProto : public IRCDProto
|
||||
}
|
||||
|
||||
/* SERVER */
|
||||
void SendServer(const char *servname, int hop, const char *descript)
|
||||
void SendServer(Server *server)
|
||||
{
|
||||
send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
|
||||
send_cmd(NULL, "SERVER %s %d :%s", server->name, server->hops, server->desc);
|
||||
}
|
||||
|
||||
void SendConnect()
|
||||
{
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
|
||||
bahamut_cmd_pass(uplink_server->password);
|
||||
bahamut_cmd_capab();
|
||||
SendServer(ServerName, 1, ServerDesc);
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
|
||||
SendServer(me_server);
|
||||
bahamut_cmd_svinfo();
|
||||
bahamut_cmd_burst();
|
||||
}
|
||||
|
||||
@@ -560,9 +560,9 @@ class InspIRCdProto : public IRCDProto
|
||||
|
||||
|
||||
/* SERVER services-dev.chatspike.net password 0 :Description here */
|
||||
void SendServer(const char *servname, int hop, const char *descript)
|
||||
void SendServer(Server *server)
|
||||
{
|
||||
send_cmd(ServerName, "SERVER %s %s %d :%s", servname, currentpass, hop, descript);
|
||||
send_cmd(ServerName, "SERVER %s %s %d :%s", server->name, currentpass, server->hops, server->desc);
|
||||
}
|
||||
|
||||
/* JOIN */
|
||||
@@ -604,10 +604,10 @@ class InspIRCdProto : public IRCDProto
|
||||
void SendConnect()
|
||||
{
|
||||
inspircd_cmd_pass(uplink_server->password);
|
||||
SendServer(ServerName, 0, ServerDesc);
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
|
||||
SendServer(me_server);
|
||||
send_cmd(NULL, "BURST");
|
||||
send_cmd(ServerName, "VERSION :Anope-%s %s :%s - %s (%s) -- %s", version_number, ServerName, ircd->name, version_flags, EncModule, version_build);
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
|
||||
}
|
||||
|
||||
/* CHGIDENT */
|
||||
|
||||
@@ -564,9 +564,9 @@ class InspIRCdProto : public IRCDProto
|
||||
}
|
||||
|
||||
/* SERVER services-dev.chatspike.net password 0 :Description here */
|
||||
void SendServer(const char *servname, int hop, const char *descript)
|
||||
void SendServer(Server *server)
|
||||
{
|
||||
send_cmd(NULL, "SERVER %s %s %d %s :%s", servname, currentpass, hop, TS6SID, descript);
|
||||
send_cmd(NULL, "SERVER %s %s %d %s :%s", server->name, currentpass, server->hops, server->suid, server->desc);
|
||||
}
|
||||
|
||||
/* JOIN */
|
||||
@@ -605,10 +605,10 @@ class InspIRCdProto : public IRCDProto
|
||||
void SendConnect()
|
||||
{
|
||||
inspircd_cmd_pass(uplink_server->password);
|
||||
SendServer(ServerName, 0, ServerDesc);
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
|
||||
SendServer(me_server);
|
||||
send_cmd(NULL, "BURST");
|
||||
send_cmd(TS6SID, "VERSION :Anope-%s %s :%s - %s (%s) -- %s", version_number, ServerName, ircd->name, version_flags, EncModule, version_build);
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
|
||||
}
|
||||
|
||||
/* CHGIDENT */
|
||||
|
||||
@@ -585,18 +585,18 @@ class RatboxProto : public IRCDTS6Proto
|
||||
}
|
||||
|
||||
/* SERVER name hop descript */
|
||||
void SendServer(const char *servname, int hop, const char *descript)
|
||||
void SendServer(Server *server)
|
||||
{
|
||||
send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
|
||||
send_cmd(NULL, "SERVER %s %d :%s", server->name, server->hops, server->desc);
|
||||
}
|
||||
|
||||
void SendConnect()
|
||||
{
|
||||
/* Make myself known to myself in the serverlist */
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
|
||||
ratbox_cmd_pass(uplink_server->password);
|
||||
ratbox_cmd_capab();
|
||||
SendServer(ServerName, 1, ServerDesc);
|
||||
/* Make myself known to myself in the serverlist */
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
|
||||
SendServer(me_server);
|
||||
ratbox_cmd_svinfo();
|
||||
}
|
||||
|
||||
|
||||
+14
-10
@@ -538,17 +538,17 @@ class UnrealIRCdProto : public IRCDProto
|
||||
--ac;
|
||||
if (!user || !modes) return; /* Prevent NULLs from doing bad things */
|
||||
if (debug) alog("debug: Changing mode for %s to %s", user->nick, modes);
|
||||
|
||||
|
||||
while (*modes) {
|
||||
uint32 backup = user->mode;
|
||||
|
||||
|
||||
/* This looks better, much better than "add ? (do_add) : (do_remove)".
|
||||
* At least this is readable without paying much attention :) -GD */
|
||||
if (add)
|
||||
user->mode |= umodes[static_cast<int>(*modes)];
|
||||
else
|
||||
user->mode &= ~umodes[static_cast<int>(*modes)];
|
||||
|
||||
|
||||
switch (*modes++)
|
||||
{
|
||||
case '+':
|
||||
@@ -682,10 +682,12 @@ class UnrealIRCdProto : public IRCDProto
|
||||
|
||||
/* SERVER name hop descript */
|
||||
/* Unreal 3.2 actually sends some info about itself in the descript area */
|
||||
void SendServer(const char *servname, int hop, const char *descript)
|
||||
void SendServer(Server *server)
|
||||
{
|
||||
if (Numeric) send_cmd(NULL, "SERVER %s %d :U0-*-%s %s", servname, hop, Numeric, descript);
|
||||
else send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
|
||||
if (Numeric)
|
||||
send_cmd(NULL, "SERVER %s %d :U0-*-%s %s", server->name, server->hops, Numeric, server->desc);
|
||||
else
|
||||
send_cmd(NULL, "SERVER %s %d :%s", server->name, server->hops, server->desc);
|
||||
}
|
||||
|
||||
/* JOIN */
|
||||
@@ -750,11 +752,13 @@ class UnrealIRCdProto : public IRCDProto
|
||||
|
||||
void SendConnect()
|
||||
{
|
||||
if (Numeric) me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, Numeric);
|
||||
else me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
|
||||
unreal_cmd_capab();
|
||||
unreal_cmd_pass(uplink_server->password);
|
||||
SendServer(ServerName, 1, ServerDesc);
|
||||
if (Numeric)
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, Numeric);
|
||||
else
|
||||
me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
|
||||
SendServer(me_server);
|
||||
}
|
||||
|
||||
/* SVSHOLD - set */
|
||||
@@ -1200,7 +1204,7 @@ int anope_event_sethost(const char *source, int ac, const char **av)
|
||||
*/
|
||||
/*
|
||||
do_nick(const char *source, char *nick, char *username, char *host,
|
||||
char *server, char *realname, time_t ts,
|
||||
char *server, char *realname, time_t ts,
|
||||
uint32 ip, char *vhost, char *uid)
|
||||
*/
|
||||
int anope_event_nick(const char *source, int ac, const char **av)
|
||||
|
||||
Reference in New Issue
Block a user