Skip to content
Permalink
Browse files

Convert net-type to string

Patch by: michaelortmann, Geo

This patch removes references to the old 0-5 settings of net-type and replaces them with string vales, but still accepts the integers for backwards-compatibility reasons. Additionally, this patch updates the configured network settings with current ircd values, as well as adds network settings for Rizon, Freenode, and Quakenet.

Note to the next guy/gal who looks to update these settings: For most ircds now, max-modes is a summation of the individual modes. ie, in 005 you see MAXLIST=beI:100; that means the total combination of b+e+I can not exceed 100 (MAXLIST in this case sums all the modes set to get the maximum modes that can be set for a channel). If you see MAXLIST=b: 200,e:100,I:100, that means the total combination is still a summation of each of those modes, but each mode has its own limit. Thus, maxmodes is 400 (200+100+100), slightly different then the previous example.

* update default nick-len by net-type and enhance net-types - last station before 005
* make net-type a string
* Bump server.mod version
  • Loading branch information...
michaelortmann authored and vanosg committed Nov 3, 2019
1 parent 7830291 commit 050c4a820751c63ad51d9a4cec04965b76fd82a1
Showing with 217 additions and 96 deletions.
  1. +27 −14 eggdrop-basic.conf
  2. +57 −41 eggdrop.conf
  3. +1 −0 scripts/quotepass.tcl
  4. +1 −0 scripts/quotepong.tcl
  5. +40 −23 src/mod/irc.mod/irc.c
  6. +81 −13 src/mod/server.mod/server.c
  7. +10 −5 src/mod/server.mod/server.h
@@ -323,13 +323,18 @@ set chanfile "LamestBot.chan"
#### SERVER MODULE ####

## What is your network?
## 0 = EFnet
## 1 = IRCnet
## 2 = Undernet
## 3 = DALnet
## 4 = +e/+I/max-modes 20 Hybrid
## 5 = Others. See eggdrop.conf for settings related to this.
set net-type 0
## If your network is not specifically listed here, please see eggdrop.conf
## for more information on what the best selection is.
## Options are:
## EFnet
## IRCnet
## Undernet
## DALnet
## freenode
## QuakeNet
## Rizon
## Other (This is a good, sane option if your network/ircd is not listed here)
set net-type "EFnet"

## This is a Tcl script to be run immediately after connecting to a server.
bind evnt - init-server evnt:init_server
@@ -350,13 +355,13 @@ set default-port 6667

#### CTCP MODULE ####

## Set here how the ctcp module should answer ctcps. There are 3 possible
## operating modes:
## 0: Normal behavior is used.
## 1: The bot ignores all ctcps, except for CHAT and PING requests
## by users with the +o flag.
## 2: Normal behavior is used, however the bot will not answer more
## than X ctcps in Y seconds (defined by 'set flood-ctcp').
## Set here how the ctcp module should answer ctcps.
## Options are:
## 0 = Normal behavior is used.
## 1 = The bot ignores all ctcps, except for CHAT and PING requests
## by users with the +o flag.
## 2 = Normal behavior is used, however the bot will not answer more
## than X ctcps in Y seconds (defined by 'set flood-ctcp').
set ctcp-mode 0

#### IRC MODULE ####
@@ -409,6 +414,14 @@ if {[file exists aclocal.m4]} { die {You are attempting to run Eggdrop from the

if {[info exists net-type]} {
switch -- ${net-type} {
"EFnet" {
# EFnet
source scripts/quotepong.tcl
}
"Undernet" {
# Undernet
source scripts/quotepass.tcl
}
"0" {
# EFnet
source scripts/quotepong.tcl
@@ -312,10 +312,11 @@ set userfile-perm 0600
#listen 3333 all

# This setting defines whether or not people can boot users on the Eggdrop
# from other bots in your botnet. Valid settings are:
# 0 - allow *no* outside boots
# 1 - allow boots from sharebots
# 2 - allow any boots
# from other bots in your botnet.
# Options are:
# 0 = allow *no* outside boots
# 1 = allow boots from sharebots
# 2 = allow any boots
set remote-boots 2

# This setting allows remote bots to tell your Eggdrop to unlink from
@@ -517,9 +518,9 @@ set ssl-capath "/etc/ssl/"
# setting below. For the EXTERNAL method, the ssl certificates to use are set
# via the ssl-certificate and ssl-privatekey settings in the SSL section above.
# Options are:
# 0 - PLAIN
# 1 - ECDSA-NIST256P-CHALLENGE
# 2 - EXTERNAL
# 0 = PLAIN
# 1 = ECDSA-NIST256P-CHALLENGE
# 2 = EXTERNAL
#set sasl-mechanism 0

# Set username to authenticate to IRC NickServ with
@@ -1041,14 +1042,21 @@ loadmodule server
# possible values, look at the SSL SETTINGS section above.
#set ssl-verify-server 0

# What is your network?
# 0 = EFnet
# 1 = IRCnet
# 2 = Undernet
# 3 = DALnet
# 4 = +e/+I/max-modes 20 Hybrid
# 5 = Others
set net-type 0
## What is your network?
## If your network is not specifically listed here, please see eggdrop.conf
## for more information on what the best selection is.
## Options are:
## EFnet
## IRCnet
## Undernet
## DALnet
## freenode
## QuakeNet
## Rizon
## Other (This is a good, sane default option to use if your network/ircd is
## not listed here. Additional configuration options for this setting
## can be found further down in the IRC MODULE section)
set net-type "EFnet"

# Set the nick the bot uses on IRC, and on the botnet unless you specify a
# separate botnet-nick, here.
@@ -1105,7 +1113,6 @@ set msg-rate 2
# primary nickname is already in use.
set keep-nick 1


# This setting makes the bot squelch the error message when rejecting a DCC
# CHAT, SEND or message command. Normally, Eggdrop notifies the user that the
# command has been rejected because they don't have access. Note that sometimes
@@ -1170,8 +1177,8 @@ set double-server 1
set double-help 1

# This optimizes the kick queue. It also traces nick changes and parts in
# the channel and changes the kick queue accordingly. There are three
# different options for this setting:
# the channel and changes the kick queue accordingly.
# Options are:
# 0 = Turn it off.
# 1 = Optimize the kick queue by summarizing kicks.
# 2 = Trace nick changes and parts on the channel and change the queue
@@ -1185,13 +1192,13 @@ set optimize-kicks 1
# command, or set this to 0 for unlimited.
set stack-limit 4

### SERVER MODULE - OTHER NETWORKS (net-type 5) ###
### SERVER MODULE - OTHER NETWORKS (net-type "Other") ###

# This settings defines how umode +r is understood by Eggdrop. Some networks
# use +r to indicate a restricted connection. If this is your case, and you
# want your bot to leave restricted servers and jump to the next server on its
# list, then set it to 1.
#set check-mode-r 1
# list, then set it to 1. The default setting is 0.
#set check-mode-r 0

# This setting allows you to specify the maximum nick-length supported by your
# network. The default setting is 9. The maximum supported length by Eggdrop
@@ -1206,13 +1213,13 @@ set stack-limit 4
# is required for this module to function.
loadmodule ctcp

# Set here how the ctcp module should answer ctcps. There are 3 possible
# operating modes:
# 0: Normal behavior is used.
# 1: The bot ignores all ctcps, except for CHAT and PING requests
# by users with the +o flag.
# 2: Normal behavior is used, however the bot will not answer more
# than X ctcps in Y seconds (defined by 'set flood-ctcp').
# Set here how the ctcp module should answer ctcps.
# Options are:
# 0 = Normal behavior is used.
# 1 = The bot ignores all ctcps, except for CHAT and PING requests
# by users with the +o flag.
# 2 = Normal behavior is used, however the bot will not answer more
# than X ctcps in Y seconds (defined by 'set flood-ctcp').
set ctcp-mode 0

# There are also several variables to help make your bot less noticeable.
@@ -1317,18 +1324,18 @@ set opchars "@"
# longer than wait-info).
set no-chanrec-info 0

### IRC MODULE - IRCnet SPECIFIC FEATURES (net-type 1) ###
### IRC MODULE - IRCnet SPECIFIC FEATURES (net-type "IRCnet") ###

# Attention: Use these settings *only* if you set 'net-type' to 1!
# Attention: Use these settings *only* if you set 'net-type' to "IRCnet"!

# At the moment, the current IRCnet IRCd version (2.10) doesn't support the
# mixing of b, o and v modes with e and I modes. This might be changed in the
# future, so use 1 at the moment for this setting.
set prevent-mixing 1

### IRC MODULE - OTHER NETWORKS (net-type 5) ###
### IRC MODULE - OTHER NETWORKS (net-type "Other") ###

# Attention: Use these settings *only* if you set 'net-type' to 5!
# Attention: Use these settings *only* if you set net-type to "Other"!

# If your network supports more users per kick command then 1, you can
# change this behavior here. Set this to the number of users to kick at
@@ -1593,15 +1600,16 @@ loadmodule uptime
# Set the ident method you wish to use. Each of these methods requires
# some form of external configuration in order to function. See
# doc/settings/mod.ident for additional information.
# 0: oidentd
# Your bot will overwrite $HOME/.oidentd.conf right before opening the
# socket to the IRC server with the global reply.
# NOTE: requires the oidentd service to be running on the host machine
# 1: Builtin
# Your bot will automatically turn its builtin identd on and off when
# needed so it shouldn't conflict with other identds that do the same.
# NOTE: Eggdrop must be granted permissions on the host system to bind
# to port 113.
# Options are:
# 0 = oidentd
# Your bot will overwrite $HOME/.oidentd.conf right before opening the
# socket to the IRC server with the global reply.
# NOTE: requires the oidentd service to be running on the host machine
# 1 = Builtin
# Your bot will automatically turn its builtin identd on and off when
# needed so it shouldn't conflict with other identds that do the same.
# NOTE: Eggdrop must be granted permissions on the host system to bind
# to port 113.
#set ident-method 0

# Set the ident port to use for ident-method 1.
@@ -1642,6 +1650,14 @@ loadhelp userinfo.help

if {[info exists net-type]} {
switch -- ${net-type} {
"EFnet" {
# EFnet
source scripts/quotepong.tcl
}
"Undernet" {
# Undernet
source scripts/quotepass.tcl
}
"0" {
# EFnet
source scripts/quotepong.tcl
@@ -37,3 +37,4 @@ proc quotepass_bind {type} {
bind raw - NOTICE quotepass_notice
}

putlog "Loaded quotepass.tcl"
@@ -286,3 +286,4 @@ proc quotepong_bind {type} {
bind raw - 998 quotepong_servermsg
}

putlog "Loaded quotepong.tcl"
@@ -37,7 +37,6 @@ static p_tcl_bind_list H_nick, H_mode, H_kick, H_join, H_need;
static Function *global = NULL, *channels_funcs = NULL, *server_funcs = NULL;

static int ctcp_mode;
static int net_type;
static int strict_host;
static int wait_split = 300; /* Time to wait for user to return from net-split. */
static int max_bans = 20; /* Modified by net-type 1-4 */
@@ -933,7 +932,6 @@ static tcl_ints myints[] = {
{"max-exempts", &max_exempts, 0},
{"max-invites", &max_invites, 0},
{"max-modes", &max_modes, 0},
{"net-type", &net_type, 0},
{"strict-host", &strict_host, 0}, /* arthur2 */
{"ctcp-mode", &ctcp_mode, 0}, /* arthur2 */
{"keep-nick", &keepnick, 0}, /* guppy */
@@ -1016,10 +1014,16 @@ static void irc_report(int idx, int details)
}
}

/* Many networks either support max_bans/invite/exempts/ *or*
* they support max_modes. If they support max_modes, set each of
* other sub-max settings equal to max_modes
*/
static void do_nettype()
{
switch (net_type) {
case 0: /* EFnet */
switch (net_type_int) {
case NETT_EFNET:
case NETT_HYBRID_EFNET:
case NETT_FREENODE:
kick_method = 1;
modesperline = 4;
use_354 = 0;
@@ -1032,7 +1036,7 @@ static void do_nettype()
rfc_compliant = 1;
include_lk = 0;
break;
case 1: /* IRCnet */
case NETT_IRCNET:
kick_method = 4;
modesperline = 3;
use_354 = 0;
@@ -1045,42 +1049,55 @@ static void do_nettype()
rfc_compliant = 1;
include_lk = 1;
break;
case 2: /* UnderNet */
case NETT_UNDERNET:
kick_method = 1;
modesperline = 6;
use_354 = 1;
use_exempts = 0;
use_invites = 0;
max_bans = 45;
max_exempts = 45;
max_invites = 45;
max_modes = 45;
max_bans = 100;
max_exempts = 0;
max_invites = 0;
max_modes = 100;
rfc_compliant = 1;
include_lk = 1;
break;
case 3: /* DALnet */
kick_method = 1;
case NETT_DALNET:
kick_method = 4;
modesperline = 6;
use_354 = 0;
use_exempts = 0;
use_invites = 0;
max_bans = 100;
use_exempts = 1;
use_invites = 1;
max_bans = 200;
max_exempts = 100;
max_invites = 100;
max_modes = 100;
max_modes = 400;
rfc_compliant = 0;
include_lk = 1;
break;
case 4: /* Hybrid-6+ */
case NETT_QUAKENET:
kick_method = 1;
modesperline = 6;
use_354 = 1;
use_exempts = 0;
use_invites = 0;
max_bans = 45;
max_exempts = 0;
max_invites = 0;
max_modes = 45;
rfc_compliant = 1;
include_lk = 1;
break;
case NETT_RIZON:
kick_method = 1;
modesperline = 4;
use_354 = 0;
use_exempts = 1;
use_invites = 1;
max_bans = 20;
max_exempts = 20;
max_invites = 20;
max_modes = 20;
max_bans = 250;
max_exempts = 250;
max_invites = 250;
max_modes = 250;
rfc_compliant = 1;
include_lk = 0;
break;
@@ -1207,9 +1224,9 @@ char *irc_start(Function *global_funcs)
module_undepend(MODULE_NAME);
return "This module requires Eggdrop 1.8.0 or later.";
}
if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 0))) {
if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 5))) {
module_undepend(MODULE_NAME);
return "This module requires server module 1.0 or later.";
return "This module requires server module 1.5 or later.";
}
if (!(channels_funcs = module_depend(MODULE_NAME, "channels", 1, 1))) {
module_undepend(MODULE_NAME);

0 comments on commit 050c4a8

Please sign in to comment.
You can’t perform that action at this time.