]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/protocol.h
Add <gecos> field to <server> in XML stats output, also add to ProtoServer. Fixes...
[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 class User;
21
22 typedef std::deque<std::string> parameterlist;
23
24 class ProtoServer
25 {
26  public:
27         std::string servername;
28         std::string parentname;
29         std::string gecos;
30         unsigned int usercount;
31         unsigned int opercount;
32         unsigned int latencyms;
33 };
34
35 typedef std::list<ProtoServer> ProtoServerList;
36
37 class ProtocolInterface : public Extensible
38 {
39  protected:
40         InspIRCd* ServerInstance;
41  public:
42         ProtocolInterface(InspIRCd* Instance) : ServerInstance(Instance) { }
43         virtual ~ProtocolInterface() { }
44
45         virtual void SendEncapsulatedData(parameterlist &encap) { }
46
47         virtual void SendMetaData(void* target, int type, const std::string &key, const std::string &data) { }
48
49         virtual void SendTopic(Channel* channel, std::string &topic) { }
50
51         virtual void SendMode(const std::string &target, parameterlist &modedata) { }
52
53         virtual void SendModeStr(const std::string &target, const std::string &modeline)
54         {
55                 /* Convenience function */
56                 irc::spacesepstream x(modeline);
57                 parameterlist n;
58                 std::string v;
59                 while (x.GetToken(v))
60                         n.push_back(v);
61                 SendMode(target, n);
62         }
63
64         virtual void SendModeNotice(const std::string &modes, const std::string &text) { }
65
66         virtual void SendSNONotice(const std::string &snomask, const std::string &text) { }
67
68         virtual void PushToClient(User* target, const std::string &rawline) { }
69
70         virtual void SendChannelPrivmsg(Channel* target, char status, const std::string &text) { }
71
72         virtual void SendChannelNotice(Channel* target, char status, const std::string &text) { }
73
74         virtual void SendUserPrivmsg(User* target, const std::string &text) { }
75
76         virtual void SendUserNotice(User* target, const std::string &text) { }
77
78         virtual void GetServerList(ProtoServerList &sl) { }
79
80         virtual void Introduce(User* u) { }
81 };
82
83 #endif
84