2 // Copyright (c) 1997, 1998 Etienne BERNARD
3 // Copyright (c) 2002 Clinton Ebadi
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 // (at your option) any later version.
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.
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
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
32 #include "ServerList.H"
33 #include "ChannelList.H"
40 #include "BotInterp.H"
42 // FIXME: remove guile/gh once transition is complete
43 // This is the last reference to this header!
47 #define VERSION_STRING PACKAGE" version "VERSION" by unknown_lamer@OPN <clinton@unknownlamer.org>\n1.97 and below by eb@IRCNet <eb@via.ecp.fr>"
48 #define COPYRIGHT_STRING PACKAGE" version "VERSION", Copyright (C) 1997-2000 Etienne BERNARD\nCopyright (C) 2002 Clinton Ebadi"
54 class ServerConnection;
62 String wantedNickName;
70 String userListFileName;
71 String shitListFileName;
75 std::ofstream logFile;
82 ChannelList * channelList;
85 ServerList * serverList;
88 BotInterp * botInterp;
90 std::list<class userFunction *> userFunctions;
92 std::map<String, wantedChannel *, std::less<String> > wantedChannels;
94 std::map<String, unsigned int, std::less<String> > ignoredUserhosts;
95 std::map<String, Person *, std::less<String> > spyList;
97 std::time_t startTime, currentTime, lastNickNameChange, lastChannelJoin;
99 ServerConnection * serverConnection;
100 std::list<DCCConnection *> dccConnections;
102 std::map<unsigned long, String, std::less<unsigned long> > userhostMap;
103 unsigned long sentUserhostID;
104 unsigned long receivedUserhostID;
106 static const unsigned int MAX_MESSAGES = 2;
107 static const std::time_t NICK_CHANGE = 60;
108 static const std::time_t CHANNEL_JOIN = 60;
109 static const std::time_t IGNORE_DELAY = 180;
110 static const std::time_t DCC_DELAY = 300;
111 static const std::time_t PING_TIME = 90;
112 static const std::time_t TIMEOUT = 120;
117 String configFileName;
119 String scriptLogFileName;
120 String autoexecFileName;
125 Bot(String, bool=false);
132 void logLine(String);
139 friend class DCCParser;
141 friend class Channel;
143 friend class ServerConnection;
144 friend class UserCommands;
145 friend class Commands;
148 bool canChangeServer();
152 void addDCC(Person *, unsigned long, int);
155 String getUserhost(String, String);