1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Help system recode

This commit is contained in:
codemastr
2001-12-16 00:35:57 +00:00
parent d2a90a5101
commit 4291191149
9 changed files with 1138 additions and 1660 deletions
+1
View File
@@ -992,3 +992,4 @@ seen. gmtime warning still there
far. Problems, unloading, (delay), tkl doesn't always sweep it all,
- Some scan unloading stuff
- FIXED THE GOD DAMNED WHOIS BUG THAT I REPORTED *MONTHS* AGO! -Griev
- Added a new dynamic help system that allows you to add and modify /helpop items
+1 -1
View File
@@ -218,7 +218,7 @@ install: all
$(INSTALL) -m 0600 aliases/*.conf $(IRCDDIR)/aliases
$(TOUCH) $(IRCDDIR)/unrealircd.conf
chmod 0600 $(IRCDDIR)/unrealircd.conf
$(INSTALL) -m 0600 badwords.*.conf LICENSE Donation $(IRCDDIR)
$(INSTALL) -m 0600 badwords.*.conf help.conf LICENSE Donation $(IRCDDIR)
$(INSTALL) -m 0700 bugreport makeconf unreal $(IRCDDIR)
$(INSTALL) -m 0700 -d $(IRCDDIR)/modules
$(INSTALL) -m 0700 src/modules/*.so $(IRCDDIR)/modules
+1017
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -95,6 +95,7 @@ extern ConfigItem_unknown *conf_unknown;
extern ConfigItem_unknown_ext *conf_unknown_set;
extern ConfigItem_alias *conf_alias;
extern ConfigItem_include *conf_include;
extern ConfigItem_help *conf_help;
extern void clear_unknown();
extern EVENT(tkl_check_expire);
extern EVENT(e_unload_module_delayed);
@@ -111,6 +112,7 @@ ConfigItem_ban *Find_banEx(char *host, short type, short type2);
ConfigItem_vhost *Find_vhost(char *name);
ConfigItem_deny_channel *Find_channel_allowed(char *name);
ConfigItem_alias *Find_alias(char *name);
ConfigItem_help *find_help(char *command);
int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost);
int parse_netmask(const char *text, struct IN_ADDR *addr, int *b);
int match_ipv4(struct IN_ADDR *addr, struct IN_ADDR *mask, int b);
+8
View File
@@ -96,6 +96,7 @@ typedef struct _configitem_unknown_ext ConfigItem_unknown_ext;
typedef struct _configitem_alias ConfigItem_alias;
typedef struct _configitem_alias_format ConfigItem_alias_format;
typedef struct _configitem_include ConfigItem_include;
typedef struct _configitem_help ConfigItem_help;
typedef struct liststruct ListStruct;
typedef struct Watch aWatch;
@@ -1065,6 +1066,13 @@ struct _configitem_include {
char *file;
};
struct _configitem_help {
ConfigItem *prev, *next;
ConfigFlag flag;
char *command;
aMotd *text;
};
struct _irchook {
Hook *prev, *next;
ConfigFlag flag;
+1 -1
View File
@@ -530,7 +530,7 @@ ban nick { mask "Status"; reason "Bug in mIRC"; };
*/
include "badwords.channel.conf";
include "badwords.message.conf";
include "help.conf";
/*
* Some modules;
*/
+53 -1655
View File
File diff suppressed because it is too large Load Diff
-3
View File
@@ -900,9 +900,6 @@ int InitwIRCD(argc, argv)
}
strncpyzt(me.name, p, sizeof(me.name));
break;
case 'H':
unrealmanual();
exit(0);
#endif
#ifndef _WIN32
case 'P': {
+55
View File
@@ -104,6 +104,7 @@ int _conf_allow_channel (ConfigFile *conf, ConfigEntry *ce);
int _conf_loadmodule (ConfigFile *conf, ConfigEntry *ce);
int _conf_log (ConfigFile *conf, ConfigEntry *ce);
int _conf_alias (ConfigFile *conf, ConfigEntry *ce);
int _conf_help (ConfigFile *conf, ConfigEntry *ce);
aMotd *Find_file(char *, short);
extern int conf_debuglevel;
@@ -131,6 +132,7 @@ static ConfigCommand _ConfigCommands[] = {
{ "loadmodule", _conf_loadmodule },
{ "log", _conf_log },
{ "alias", _conf_alias },
{ "help", _conf_help },
{ NULL, NULL }
};
@@ -268,6 +270,7 @@ ConfigItem_unknown *conf_unknown = NULL;
ConfigItem_unknown_ext *conf_unknown_set = NULL;
ConfigItem_alias *conf_alias = NULL;
ConfigItem_include *conf_include = NULL;
ConfigItem_help *conf_help = NULL;
#ifdef STRIPBADWORDS
ConfigItem_badword *conf_badword_channel = NULL;
ConfigItem_badword *conf_badword_message = NULL;
@@ -2800,6 +2803,43 @@ int _conf_alias(ConfigFile *conf, ConfigEntry *ce)
AddListItem(alias, conf_alias);
}
int _conf_help(ConfigFile *conf, ConfigEntry *ce)
{
ConfigItem_help *help = NULL;
ConfigEntry *cep;
aMotd *last, *temp;
if (!ce->ce_entries) {
config_status("%s:%i: help entry without text",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
return 0;
}
if (Find_Help(ce->ce_vardata)) {
config_status("%s:%i: help for %s already exists",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata ? ce->ce_vardata : "index");
return 0;
}
help = MyMalloc(sizeof(ConfigItem_help));
if (!ce->ce_vardata)
help->command = NULL;
else
help->command = strdup(ce->ce_vardata);
help->text = NULL;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
{
temp = MyMalloc(sizeof(aMotd));
temp->line = strdup(cep->ce_varname);
temp->next = NULL;
if (!help->text)
help->text = temp;
else
last->next = temp;
last = temp;
}
AddListItem(help, conf_help);
}
/*
* Report functions
@@ -3318,6 +3358,7 @@ int rehash(aClient *cptr, aClient *sptr, int sig)
ConfigItem_log *log_ptr;
ConfigItem_alias *alias_ptr;
ConfigItem_include *include_ptr;
ConfigItem_help *help_ptr;
ListStruct t;
@@ -3574,6 +3615,20 @@ int rehash(aClient *cptr, aClient *sptr, int sig)
MyFree(include_ptr);
include_ptr = (ConfigItem_include *)&t;
}
for (help_ptr = conf_help; help_ptr; help_ptr = (ConfigItem_help *)help_ptr->next) {
aMotd *text;
ircfree(help_ptr->command);
while (help_ptr->text) {
text = help_ptr->text->next;
ircfree(help_ptr->text->line);
ircfree(help_ptr->text);
help_ptr->text = text;
}
t.next = DelListItem(help_ptr, conf_help);
MyFree(help_ptr);
help_ptr = (ConfigItem_help *)&t;
}
/* rehash_modules */
init_conf2(configfile);
module_loadall(0);