7 /** If you make a change which breaks the protocol, increment this.
8 * If you completely change the protocol, completely change the number.
10 * IMPORTANT: If you make changes, document your changes here, without fail:
11 * http://www.inspircd.org/wiki/List_of_protocol_changes_between_versions
13 * Failure to document your protocol changes will result in a painfully
14 * painful death by pain. You have been warned.
16 const long ProtocolVersion = 1105;
18 /** Forward declarations
21 class SpanningTreeUtilities;
26 /** This is the main class for the spanningtree module
28 class ModuleSpanningTree : public Module
32 unsigned int max_local;
33 unsigned int max_global;
34 cmd_rconnect* command_rconnect;
35 SpanningTreeUtilities* Utils;
38 /** Timer for clock syncs
40 TimeSyncTimer *SyncTimer;
44 ModuleSpanningTree(InspIRCd* Me);
48 void ShowLinks(TreeServer* Current, userrec* user, int hops);
50 /** Counts local servers
52 int CountLocalServs();
54 /** Counts local and remote servers
58 /** Handle LINKS command
60 void HandleLinks(const char** parameters, int pcnt, userrec* user);
62 /** Handle LUSERS command
64 void HandleLusers(const char** parameters, int pcnt, userrec* user);
66 /** Show MAP output to a user (recursive)
68 void ShowMap(TreeServer* Current, userrec* user, int depth, char matrix[128][80], float &totusers, float &totservers);
70 /** Handle remote MOTD
72 int HandleMotd(const char** parameters, int pcnt, userrec* user);
74 /** Handle remote ADMIN
76 int HandleAdmin(const char** parameters, int pcnt, userrec* user);
78 /** Handle remote STATS
80 int HandleStats(const char** parameters, int pcnt, userrec* user);
82 /** Handle MAP command
84 void HandleMap(const char** parameters, int pcnt, userrec* user);
88 int HandleSquit(const char** parameters, int pcnt, userrec* user);
92 int HandleTime(const char** parameters, int pcnt, userrec* user);
94 /** Handle remote WHOIS
96 int HandleRemoteWhois(const char** parameters, int pcnt, userrec* user);
98 /** Ping all local servers
100 void DoPingChecks(time_t curtime);
102 /** Connect a server locally
104 void ConnectServer(Link* x);
106 /** Check if any servers are due to be autoconnected
108 void AutoConnectServers(time_t curtime);
110 /** Handle remote VERSON
112 int HandleVersion(const char** parameters, int pcnt, userrec* user);
116 int HandleConnect(const char** parameters, int pcnt, userrec* user);
118 /** Send out time sync to all servers
120 void BroadcastTimeSync();
123 ** *** MODULE EVENTS ***
126 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line);
127 virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, CmdResult result, const std::string &original_line);
128 virtual void OnGetServerDescription(const std::string &servername,std::string &description);
129 virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel);
130 virtual void OnPostLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic);
131 virtual void OnWallops(userrec* user, const std::string &text);
132 virtual void OnUserNotice(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
133 virtual void OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
134 virtual void OnBackgroundTimer(time_t curtime);
135 virtual void OnUserJoin(userrec* user, chanrec* channel);
136 virtual void OnChangeHost(userrec* user, const std::string &newhost);
137 virtual void OnChangeName(userrec* user, const std::string &gecos);
138 virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage);
139 virtual void OnUserConnect(userrec* user);
140 virtual void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message);
141 virtual void OnUserPostNick(userrec* user, const std::string &oldnick);
142 virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason);
143 virtual void OnRemoteKill(userrec* source, userrec* dest, const std::string &reason);
144 virtual void OnRehash(userrec* user, const std::string ¶meter);
145 virtual void OnOper(userrec* user, const std::string &opertype);
146 void OnLine(userrec* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason);
147 virtual void OnAddGLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask);
148 virtual void OnAddZLine(long duration, userrec* source, const std::string &reason, const std::string &ipmask);
149 virtual void OnAddQLine(long duration, userrec* source, const std::string &reason, const std::string &nickmask);
150 virtual void OnAddELine(long duration, userrec* source, const std::string &reason, const std::string &hostmask);
151 virtual void OnDelGLine(userrec* source, const std::string &hostmask);
152 virtual void OnDelZLine(userrec* source, const std::string &ipmask);
153 virtual void OnDelQLine(userrec* source, const std::string &nickmask);
154 virtual void OnDelELine(userrec* source, const std::string &hostmask);
155 virtual void OnMode(userrec* user, void* dest, int target_type, const std::string &text);
156 virtual int OnStats(char statschar, userrec* user, string_list &results);
157 virtual void OnSetAway(userrec* user);
158 virtual void OnCancelAway(userrec* user);
159 virtual void ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline);
160 virtual void ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata);
161 virtual void OnEvent(Event* event);
162 virtual ~ModuleSpanningTree();
163 virtual Version GetVersion();
164 void Implements(char* List);
165 Priority Prioritize();