Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

channels.h

Go to the documentation of this file.
00001 /*       +------------------------------------+
00002  *       | Inspire Internet Relay Chat Daemon |
00003  *       +------------------------------------+
00004  *
00005  *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
00006  *                       E-mail:
00007  *                <brain@chatspike.net>
00008  *                <Craig@chatspike.net>
00009  *     
00010  * Written by Craig Edwards, Craig McLure, and others.
00011  * This program is free but copyrighted software; see
00012  *            the file COPYING for details.
00013  *
00014  * ---------------------------------------------------
00015  */
00016 
00017 #include "inspircd_config.h"
00018 #include "base.h"
00019 #include <time.h>
00020 #include <vector>
00021 #include <string>
00022 
00023 #ifndef __CHANNELS_H__
00024 #define __CHANNELS_H__
00025 
00026 #define CM_TOPICLOCK 1
00027 #define CM_NOEXTERNAL 2
00028 #define CM_INVITEONLY 4
00029 #define CM_MODERATED 8
00030 #define CM_SECRET 16
00031 #define CM_PRIVATE 32
00032 
00036 class HostItem : public classbase
00037 {
00038  public:
00039         time_t set_time;
00040         char set_by[NICKMAX];
00041         char data[MAXBUF];
00042 
00043         HostItem() { /* stub */ }
00044         virtual ~HostItem() { /* stub */ }
00045 };
00046 
00047 // banlist is inherited from HostList mainly for readability
00048 // reasons only
00049 
00052 class BanItem : public HostItem
00053 {
00054 };
00055 
00056 // same with this...
00057 
00060 class ExemptItem : public HostItem
00061 {
00062 };
00063 
00064 // and this...
00065 
00068 class InviteItem : public HostItem
00069 {
00070 };
00071 
00072 
00077 class ModeParameter : public classbase
00078 {
00079  public:
00080         char mode;
00081         char parameter[MAXBUF];
00082         char channel[CHANMAX];
00083 };
00084 
00087 typedef std::vector<BanItem>    BanList;
00088 
00091 typedef std::vector<ExemptItem> ExemptList;
00092 
00095 typedef std::vector<InviteItem> InviteList;
00096 
00101 class chanrec : public Extensible
00102 {
00103  public:
00106         char name[CHANMAX]; /* channel name */
00110         char custom_modes[MAXMODES];     /* modes handled by modules */
00111 
00115         std::vector<char*> internal_userlist;
00116         
00120         char topic[MAXBUF];
00123         time_t created;
00127         time_t topicset;
00131         char setby[NICKMAX];
00132 
00136         short int limit;
00137         
00141         char key[32];
00142         
00145         char binarymodes;
00146         
00149         BanList bans;
00150         
00155         void SetCustomMode(char mode,bool mode_on);
00156 
00162         void SetCustomModeParam(char mode,char* parameter,bool mode_on);
00163  
00168         bool IsCustomModeSet(char mode);
00169 
00180         std::string GetModeParameter(char mode);
00181 
00189         long GetUserCounter();
00190 
00198         void AddUser(char* castuser);
00199 
00207         void DelUser(char* castuser);
00208 
00218         std::vector<char*> *GetUsers();
00219 
00222         chanrec();
00223 
00224         virtual ~chanrec() { /* stub */ }
00225 };
00226 
00227 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
00228  * needs to come AFTER struct chanrec */
00229 
00230 #define UCMODE_OP      1
00231 #define UCMODE_VOICE   2
00232 #define UCMODE_HOP     4
00233 #define UCMODE_PROTECT 8
00234 #define UCMODE_FOUNDER 16
00235  
00241 class ucrec : public classbase
00242 {
00243  public:
00247         char uc_modes;
00248         
00252         chanrec *channel;
00253 
00254         ucrec() { /* stub */ }
00255         virtual ~ucrec() { /* stub */ }
00256 };
00257 
00258 #endif
00259 

Generated on Wed Dec 14 14:49:16 2005 for InspIRCd by  doxygen 1.4.4-20050815