2 // Copyright (c) 1997, 1998 Etienne BERNARD
3 // Copyright (c) 2002,2003 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
34 #include "ServerList.H"
35 #include "ChannelList.H"
42 #include "BotInterp.H"
44 // FIXME: remove guile/gh once transition is complete
45 // This is the last reference to this header!
49 #define VERSION_STRING PACKAGE" version "VERSION" by unknown_lamer@FreeNode <clinton@unknownlamer.org>\n1.97 and below by eb@IRCNet <eb@via.ecp.fr>"
50 #define COPYRIGHT_STRING PACKAGE" version "VERSION", Copyright (C) 1997-2000 Etienne BERNARD\nCopyright (C) 2002,2003,2004,2005 Clinton Ebadi"
57 class ServerConnection;
64 String wantedNickName;
72 String userListFileName;
73 String shitListFileName;
77 std::ofstream logFile;
84 ChannelList * channelList;
87 ServerList * serverList;
90 BotInterp * botInterp;
92 std::map<std::string, class userFunction*,
93 std::less<std::string> > userFunctions;
94 std::map<String, wantedChannel *, std::less<String> > wantedChannels;
96 std::map<String, unsigned int, std::less<String> > ignoredUserhosts;
97 std::map<String, Person *, std::less<String> > spyList;
99 std::time_t startTime, currentTime, lastNickNameChange, lastChannelJoin;
101 ServerConnection * serverConnection;
102 DCCManager* dccConnections;
104 std::map<unsigned long, String, std::less<unsigned long> > userhostMap;
105 unsigned long sentUserhostID;
106 unsigned long receivedUserhostID;
108 static unsigned int MAX_MESSAGES;
109 static unsigned int MAX_NICKLENGTH;
110 static const std::time_t NICK_CHANGE = 60;
111 static const std::time_t CHANNEL_JOIN = 60;
112 static const std::time_t IGNORE_DELAY = 180;
113 static const std::time_t DCC_DELAY = 300;
114 static const std::time_t PING_TIME = 90;
115 static const std::time_t TIMEOUT = 120;
120 String configFileName;
122 String scriptLogFileName;
123 String autoexecFileName;
128 Bot(String, bool=false);
135 void logLine(String);
140 // getters and setters
141 void set_log_dir (String);
142 void set_log_file (String);
145 friend class DCCParser;
147 friend class Channel;
148 friend class ServerConnection;
149 friend class UserCommands;
150 friend class Commands;
153 bool canChangeServer();
157 enum DCC_TYPE { CHAT };
158 void addDCC(Person *, unsigned long, int, int);
161 String getUserhost(String, String);
164 void init_user_functions ();
165 void destroy_user_functions ();