[project @ 2005-07-04 08:15:08 by unknown_lamer]
[clinton/bobotpp.git] / source / ServerQueue.H
CommitLineData
cb21075d 1// ServerQueue.H -*- C++ -*-
2// Copyright (c) 1997, 1998 Etienne BERNARD
3// Copyright (c) 2002 Clinton Ebadi
4
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// any later version.
9
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
133eff7a 17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18// 02110-1301, USA.
cb21075d 19
20#ifndef SERVERQUEUE_H
21#define SERVERQUEUE_H
22
23#include <list>
24
25#include "String.H"
26#include "Queue.H"
27#include "ServerQueueItem.H"
28
29enum {
30 QUIT_PRIORITY, USERMODE_PRIORITY, CHANNELMODE_PRIORITY,
31 KICK_PRIORITY, PONG_PRIORITY, TOPIC_PRIORITY, PART_PRIORITY,
32 NICK_PRIORITY, USERHOST_PRIORITY, WHO_PRIORITY,
33 JOIN_PRIORITY, PING_PRIORITY, INVITE_PRIORITY, PRIVMSG_PRIORITY,
34 NOTICE_PRIORITY
35};
36
37static const int QUIT_PENALTY = 1;
38static const int USERMODE_PENALTY = 2;
39static const int CHANNELMODE_PENALTY = 2;
40static const int KICK_PENALTY = 2;
41static const int PONG_PENALTY = 1;
42static const int TOPIC_PENALTY = 2;
43static const int PART_PENALTY = 1;
44static const int JOIN_PENALTY = 1;
45static const int USERHOST_PENALTY = 1;
46static const int WHO_PENALTY = 4;
47static const int WHOIS_PENALTY = 1;
48static const int NICK_PENALTY = 1;
49static const int PING_PENALTY = 1;
50static const int INVITE_PENALTY = 1;
51static const int PRIVMSG_PENALTY = 1;
52static const int NOTICE_PENALTY = 1;
53
54
55class ServerQueue : public Queue {
56
57 std::list<ServerQueueItem *> serverQueue;
58 int penalty;
59
60public:
61 ServerQueue(Socket *, bool);
62 ~ServerQueue();
63 void addItem(ServerQueueItem *);
64 void addLine(String, int, int, int);
65 bool flush();
66
67 void sendCTCP(String, String, String);
68 void sendCTCPReply(String, String, String);
69 void sendChannelMode(String);
70 void sendChannelMode(String, String, String);
71 void sendInvite(String, String);
72 void sendJoin(String, String);
73 void sendKick(String, String, String);
74 void sendNick(String);
75 void sendNotice(String, String);
76 void sendPart(String);
77 void sendPass(String);
78 void sendPing(String);
79 void sendPong(String);
80 void sendPrivmsg(String, String);
81 void sendQuit(String);
82 void sendTopic(String, String);
83 void sendUser(String, String);
84 void sendUserMode(String, String);
85 void sendUserhost(String);
86 void sendWho(String);
87 void sendWhois(String);
88};
89
90#endif