#ifndef _H_CBOT
#define _H_CBOT

class CBot;

#include "CNetServer.h"
#include "CModule.h"
#include "CListVars.h"
#include "CLog.h"

class CBot {
public:
  CBot (void);
  ~CBot (void);

  CLog *log_add (c_char);
  CLog *log_get (c_char);
  void log_delall (void);
  void write_botlog (const char *, ...);
  CModule *add_module (const char *);
  bool del_module (const char *);
  void parse_cmd (int argc, char *argv[]);
  void check_pid (void);
  void write_pid (void);
  void server_info (void);
  void conf_error (const char *);
  void conf_warn (const char *);
  void check_server (CNetServer *);
  void parse_conf (void);
  void work (void);

  CNetServer *servers[SERVER_MAX];
  int server_num;

  CList modules;

  CText conf;
  CString conf_file;
  CString pid_file;

  u_int line;		// to store the current configuration line
  char debug;		// if 1, doesn't go into bg and show read/writes

  time_t time_now;

private:

  struct log_type {
    CString name;
    CLog *l;
    log_type *next;
    log_type () : name (MSG_SIZE) {}
  } *log_list;

};

#endif
