[project @ 2005-02-28 05:49:38 by unknown_lamer]
[clinton/bobotpp.git] / source / Bot.H
index 67bf12b..c49028e 100644 (file)
@@ -1,6 +1,6 @@
 // Bot.H  -*- C++ -*-
 // Copyright (c) 1997, 1998 Etienne BERNARD
-// Copyright (c) 2002 Clinton Ebadi
+// Copyright (c) 2002,2003 Clinton Ebadi
 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -26,6 +26,8 @@
 #include <ctime>
 #include <set>
 #include <fstream>
+#include <string>
+#include <map>
 
 #include "String.H"
 #include "Person.H"
 #include <guile/gh.h>
 #endif
 
-#define VERSION_STRING PACKAGE" version "VERSION" by unknown_lamer@OPN <clinton@unknownlamer.org>\n1.97 and below by eb@IRCNet <eb@via.ecp.fr>"
-#define COPYRIGHT_STRING PACKAGE" version "VERSION", Copyright (C) 1997-2000 Etienne BERNARD\nCopyright (C) 2002 Clinton Ebadi"
+#define VERSION_STRING PACKAGE" version "VERSION" by unknown_lamer@FreeNode <clinton@unknownlamer.org>\n1.97 and below by eb@IRCNet <eb@via.ecp.fr>"
+#define COPYRIGHT_STRING PACKAGE" version "VERSION", Copyright (C) 1997-2000 Etienne BERNARD\nCopyright (C) 2002,2003,2004,2005 Clinton Ebadi"
 
 class Channel;
 class DCCConnection;
 class Parser;
 class DCCParser;
+class DCCManager;
 class ServerConnection;
 class Commands;
 class UserCommands;
-class Utils;
 
 class Bot {
 public:
@@ -87,8 +89,8 @@ public:
 #ifdef USESCRIPTS
   BotInterp * botInterp;
 #endif
-  std::list<class userFunction *> userFunctions;
-
+  std::map<std::string, class userFunction*, 
+          std::less<std::string> > userFunctions;
   std::map<String, wantedChannel *, std::less<String> > wantedChannels;
 
   std::map<String, unsigned int, std::less<String> > ignoredUserhosts;
@@ -97,13 +99,13 @@ public:
   std::time_t startTime, currentTime, lastNickNameChange, lastChannelJoin;
 
   ServerConnection * serverConnection;
-  std::list<DCCConnection *> dccConnections;
+  DCCManager* dccConnections;
 
   std::map<unsigned long, String, std::less<unsigned long> > userhostMap;
   unsigned long sentUserhostID;
   unsigned long receivedUserhostID;
 
-  static const unsigned int MAX_MESSAGES = 2;
+  static unsigned int MAX_MESSAGES;
   static const std::time_t NICK_CHANGE  = 60;
   static const std::time_t CHANNEL_JOIN = 60;
   static const std::time_t IGNORE_DELAY = 180;
@@ -134,12 +136,14 @@ public:
 
   void reconnect();
 
+  // getters and setters
+  void set_log_dir (String);
+  void set_log_file (String);
 
   friend class Parser;
   friend class DCCParser;
   friend class Person;
   friend class Channel;
-  friend class Utils;
   friend class ServerConnection;
   friend class UserCommands;
   friend class Commands;
@@ -149,11 +153,15 @@ private:
   void nextServer();
   void connect(int);
 
-  void addDCC(Person *, unsigned long, int);
+  enum DCC_TYPE { CHAT };
+  void addDCC(Person *, unsigned long, int, int);
 
   void rehash();
   String getUserhost(String, String);
   bool iAmOp(String);
+
+  void init_user_functions ();
+  void destroy_user_functions ();
 };
 
 #endif