]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/protocol.h
Add call to protocol interface to get useful info on the server map. Return a std...
[user/henk/code/inspircd.git] / include / protocol.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __PROTOCOL_H__
15 #define __PROTOCOL_H__
16
17 #include "hashcomp.h"
18
19 class InspIRCd;
20
21 typedef std::deque<std::string> parameterlist;
22
23 class ProtoServer
24 {
25  public:
26         std::string servername;
27         std::string parentname;
28         unsigned int usercount;
29         unsigned int opercount;
30         unsigned int latencyms;
31 };
32
33 typedef std::list<ProtoServer> ProtoServerList;
34
35 class ProtocolInterface : public Extensible
36 {
37  protected:
38         InspIRCd* ServerInstance;
39  public:
40         ProtocolInterface(InspIRCd* Instance) : ServerInstance(Instance) { }
41         virtual ~ProtocolInterface() { }
42
43         virtual void SendEncapsulatedData(parameterlist &encap) { }
44
45         virtual void SendMetaData(void* target, int type, const std::string &key, const std::string &data) { }
46
47         virtual void SendTopic(Channel* channel, std::string &topic) { }
48
49         virtual void SendMode(const std::string &target, parameterlist &modedata) { }
50
51         virtual void SendModeStr(const std::string &target, const std::string &modeline)
52         {
53                 /* Convenience function */
54                 irc::spacesepstream x(modeline);
55                 parameterlist n;
56                 std::string v;
57                 while (x.GetToken(v))
58                         n.push_back(v);
59                 SendMode(target, n);
60         }
61
62         virtual void SendModeNotice(const std::string &modes, const std::string &text) { }
63
64         virtual void SendSNONotice(const std::string &snomask, const std::string &text) { }
65
66         virtual void PushToClient(User* target, const std::string &rawline) { }
67
68         virtual void SendChannelPrivmsg(Channel* target, char status, const std::string &text) { }
69
70         virtual void SendChannelNotice(Channel* target, char status, const std::string &text) { }
71
72         virtual void SendUserPrivmsg(User* target, const std::string &text) { }
73
74         virtual void SendUserNotice(User* target, const std::string &text) { }
75
76         virtual void GetServerList(ProtoServerList &sl) { }
77 };
78
79 #endif
80