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 configFileName;
71 String userListFileName;
72 String shitListFileName;
77 String scriptLogFileName;
78 String autoexecFileName;
81 std::ofstream logFile;
88 ChannelList * channelList;
91 ServerList * serverList;
94 BotInterp * botInterp;
96 std::list<class userFunction *> userFunctions;
98 std::map<String, wantedChannel *, std::less<String> > wantedChannels;
100 std::map<String, unsigned int, std::less<String> > ignoredUserhosts;
101 std::map<String, Person *, std::less<String> > spyList;
103 std::time_t startTime, currentTime, lastNickNameChange, lastChannelJoin;
105 ServerConnection * serverConnection;
106 std::list<DCCConnection *> dccConnections;
108 std::map<unsigned long, String, std::less<unsigned long> > userhostMap;
109 unsigned long sentUserhostID;
110 unsigned long receivedUserhostID;
112 static const unsigned int MAX_MESSAGES = 2;
113 static const std::time_t NICK_CHANGE = 60;
114 static const std::time_t CHANNEL_JOIN = 60;
115 static const std::time_t IGNORE_DELAY = 180;
116 static const std::time_t DCC_DELAY = 300;
117 static const std::time_t PING_TIME = 90;
118 static const std::time_t TIMEOUT = 120;
122 Bot(String, bool=false);
129 void logLine(String);
135 friend class DCCParser;
137 friend class Channel;
139 friend class ServerConnection;
140 friend class UserCommands;
141 friend class Commands;
144 bool canChangeServer();
148 void addDCC(Person *, unsigned long, int);
151 String getUserhost(String, String);