/** * @file irc.h * @brief IRC client header for UFO:AI */ /* All original materal Copyright (C) 2002-2007 UFO: Alien Invasion team. Most of this stuff comes from Warsow 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef IRC_NET_H #define IRC_NET_H #ifdef _WIN32 # include typedef SOCKET irc_socket_t; #else typedef int irc_socket_t; #endif #define IRC_SEND_BUF_SIZE 512 #define IRC_RECV_BUF_SIZE 1024 #define IRC_DEFAULT_MESSAGE_BUCKET_SIZE 100 /* max 100 messages in bucket */ #define IRC_DEFAULT_MESSAGE_BUCKET_BURST 5 /* max burst size is 5 messages */ #define IRC_DEFAULT_MESSAGE_BUCKET_RATE 0.5 /* per second (5 messages in 10 seconds) */ #define IRC_DEFAULT_CHARACTER_BUCKET_SIZE 2500 /* max 2,500 characters in bucket */ #define IRC_DEFAULT_CHARACTER_BUCKET_BURST 250 /* max burst size is 250 characters */ #define IRC_DEFAULT_CHARACTER_BUCKET_RATE 10 /* per second (100 characters in 10 seconds) */ #define IRC_TRANSMIT_INTERVAL 10 #define IRC_API_VERSION 0 typedef struct irc_user_s { char key[MAX_VAR]; struct irc_user_s *next; } irc_user_t; typedef struct irc_channel_s { char name[MAX_VAR]; char topic[256]; int users; irc_user_t *user; } irc_channel_t; /* numeric commands as specified by RFC 1459 - Internet Relay Chat Protocol */ typedef enum irc_numeric_e { /* command replies */ RPL_WELCOME = 1, /* ":Welcome to the Internet Relay Network !@" */ RPL_YOURHOST = 2, /* ":Your host is , running version " */ RPL_CREATED = 3, /* ":This server was created " */ RPL_MYINFO = 4, /* " " */ RPL_ISUPPORT = 5, /* " * :are supported by this server" */ RPL_HELLO = 20, /* ":Please wait while we process your connection" */ RPL_NONE = 300, RPL_USERHOST = 302, /* ":[{}]" */ RPL_ISON = 303, /* ":[ {}]" */ RPL_AWAY = 301, /* " :" */ RPL_UNAWAY = 305, /* ":You are no longer marked as being away" */ RPL_NOWAWAY = 306, /* ":You have been marked as being away" */ RPL_WHOISUSER = 311, /* " * :" */ RPL_WHOISSERVER = 312, /* " :" */ RPL_WHOISOPERATOR = 313, /* " :is an IRC operator" */ RPL_WHOISIDLE = 317, /* " :seconds idle" */ RPL_ENDOFWHOIS = 318, /* " :End of /WHOIS list" */ RPL_WHOISCHANNELS = 319, /* " :{[@|+]}" */ RPL_WHOWASUSER = 314, /* " * :" */ RPL_ENDOFWHOWAS = 369, /* " :End of WHOWAS" */ RPL_WHOISACCOUNT = 330, /* " :is logged in as" */ RPL_LISTSTART = 321, /* "Channel :Users Name" */ RPL_LIST = 322, /* " <# visible> :" */ RPL_LISTEND = 323, /* ":End of /LIST" */ RPL_CHANNELMODEIS = 324, /* " " */ RPL_NOTOPIC = 331, /* " :No topic is set" */ RPL_TOPIC = 332, /* " :" */ RPL_TOPICWHOTIME = 333, /* "