Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigsy1 authored Jul 31, 2023
1 parent f1451c6 commit 8621562
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 46 deletions.
21 changes: 20 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
mIRCd[0.09hf14(Rev.2)][2021-2023] - 30/07/2023
mIRCd[0.09hf15(Rev.2)][2021-2023] - 01/08/2023
--------------------------------------------------
1. You can now specify DEFAULT_OPERMODES in mIRCd.ini to be set by a user whenever they succesfully /OPER by adding
DEFAULT_OPERMODES=modestring to [Mechanics] in mIRCd.ini. (Defaults to hardcoded +gsw.)
2. Although this is not a bug (but was changed by UnderNet), you can now hide the /SILENCE list from other users (excluding IRC operators)
by adding HIDE_SILENCE_LIST=TRUE or HIDE_SILENCE_LIST=FALSE to [Mechanics] in mIRCd.ini. (Defaults to FALSE.)
3. The same applies to /ACCEPT list, but by adding HIDE_ACCEPT_LIST=TRUE or HIDE_ACCEPT_LIST=FALSE to [Mechanics] in mIRCd.ini. (Defaults to FALSE.)

If you wish to hide both of them at the same time, you can simply abridge this to HIDE_CLIENT_LISTS=TRUE or HIDE_CLIENT_LISTS=FALSE
to [Mechanics] in mIRCd.ini. (Defaults to FALSE).
4. WALLCHOPS, WALLHOPS and WALLVOICES now count towards time last active. (Assuming a message was successfully sent.)
5. You can now specify if you want those on localhost/LAN to have immunity from restrictions upon connection (see order in notes for hf14)
by adding LOCAL_IMMUNITY=TRUE or LOCAL_IMMUNITY=FALSE to [Mechanics] in mIRCd.ini. (Defaults to FALSE.)
6. Fixed a bug *with* local immunity. (Used the wrong boolean operator.)
7. localhost (127.0.0.1) isn't subjected to DENY_EXTERNAL_CONNECTIONS=TRUE if LOCAL_IMMUNITY=FALSE, but LAN will be since you
might be wanting to restrict LAN users from connecting.
8. Other cosmetic/minor change(s).


mIRCd[0.09hf14(Rev.2)][2021-2023] - 30/07/2023
--------------------------------------------------
1. Can now allow opers to join (G|K)-lined channels by adding OPER_BYPASS_BADCHAN=TRUE or OPER_BYPASS_BADCHAN=FALSE to
[Features] in mIRCd.ini. Defaults to FALSE.
Expand Down
54 changes: 38 additions & 16 deletions mIRCd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,31 @@ ACCESS_IDENT_SERVER=TRUE
; Try to perform an ident lookup of connecting users.

AWAYLEN=250
; Maximum length of an away message.
; Maximum length of an /AWAY message.

CACHE_WHOWAS=TRUE
; Cache entries of users who have disconnected for use in /WHOWAS.

CLEAR_WHOWAS_CACHE=3600
; Clear entries older than 3600s (1h). Will default to 86400s (1d) if not set.
; Clear entries older than 3600s (1h). Will default to a hardcoded 86400s (1d) if not set.

DEFAULT_CHANMODES=nt
; Modes set on a channel upon creation. (Hardcoded default is also nt.)

DEFAULT_OPER_SNOMASK=17157
; Default server notice mask if +s is set during /OPER. This needs to be a number between 1 and 65535. (Default is 17157.)
; Default server notice mask if +s is set during /OPER. This needs to be a number between 1 and 65535. (Hardcoded default is 17157.)

DEFAULT_OPERMODES=gsw
; Modes "set by" (read as: forced upon) the user when the successfully /OPER. (Hardcoded default is also gsw.)

DEFAULT_SNOMASK=1
; Default server notice mask if users +s. (I recommended leaving this alone.)
; Default server notice mask if a user sets usermode +s. (I recommended leaving this alone.)

DEFAULT_USERMODES=x
; Modes "set by" (read as: forced) the user upon connection to the IRCd.
; Modes "set by" (read as: forced upon) the user upon connection to the IRCd.

DENY_EXTERNAL_CONNECTIONS=FALSE
; Deny anybody other than localhost (127.0.0.1) from being able to connect. (Note: LAN (192.168.*) is classified as being external.)

DENY_CHANNEL_CREATION=FALSE
; Prevent new channels from being created except by IRC operators.
Expand All @@ -44,11 +53,23 @@ EXCESS_FLOOD=TRUE
FLOOD_LIMIT=8192
; Flood limit in bytes. (I recommend leaving this alone.)

HIDE_ACCEPT_LIST=FALSE
; Hide the /ACCEPT list from other users. (Excluding IRC operators.)

HIDE_CLIENT_LISTS=TRUE
; Hide both the /ACCEPT list and /SILENCE list from other users. (Excluding IRC operators.)

HIDE_SILENCE_LIST=FALSE
; Hide the /SILENCE list from other users. (Excluding IRC operators.)

KEYLEN=23
; Maximum key length when setting +k. 23 is the limit.
; Maximum key length when setting +k. (23 is the hardcoded limit.)

KICKLEN=250
; Maximum length of a kick message.
; Maximum length of a /KICK message.

LOCAL_IMMUNITY=TRUE
; Allow those on localhost and LAN to bypass certain restrictions upon connection. (Note: See the order in hf14 patch notes.)

LOOKUP_DELAY=7
; How long to wait on DNS/ident checks before giving up.
Expand All @@ -60,10 +81,10 @@ MAXBANS=15
; Maximum amount of bans allowed in a channel.

MAXCHANNELS=15
; Maximum amount of channels you can join.
; Maximum amount of channels a user can join.

MAXCHANNELLEN=200
; Maximum length of a channel name. (Note: # is included in the length.)
; Maximum length of a channel name. (Note: Technically (LENGTH - 1) as # is included as part of the length.)

MAXCLONES=3
; Maximum amount of users allowed from the same ip address.
Expand All @@ -78,13 +99,14 @@ MAXTARGETS=3
; Limited to NOTICE and PRIVMSG. (Overrides TARGMAX_NOTICE and TARGMAX_PRIVMSG if specified. You can delete this item.)

MODESPL=6
; How many mode changes appear on one line before sending. E.g. +cimsyNKTS will send +cimsyN, then +KTS separately.
; How many /MODE changes appear on one line before sending. E.g. +cimsyNKTS will send +cimsyN, then +KTS separately.
; This only applies to channel modes, not user modes.

NICK_CHANGE_THROTTLE=15
; How long a user must wait before being able to change their nick each time. (15 seconds.)

NOOP_PERSIST=1
; Prevent users from being opped on joining persistant channels if there are no other users. Works with OPLESS_CHANS.
; Prevent users from being opped after joining persistant channels if there are no other users. Works with OPLESS_CHANS.
; 0 - Disabled; 1 - Everybody; 2 - Just Non-opers.

OPER_CMDS=HASH,LINKS,MAP
Expand All @@ -111,13 +133,13 @@ REGISTRATION_TIMEOUT_DURATION=235
RESTART_PASSWORD=0c2bf3e5869dbaeb3d2b4e8697a879040230264f5293590ae8989fe88cb8a893071c73d4d4ee39c4186838440df5136d900f9b55208f7144556f6314cd6b5d48

TOPICLEN=250
; Knock and Quit messages fall under this as well.
; /KNOCK and /QUIT messages fall under this as well.

SALT=changeme
; Salt used for passwords and other features.

WALLOPS_BAD_JOINS=TRUE
; Send a server wallops (+g) whenever a user tries to join a G-lined/K-lined channel.
; Send a server wallops (+g) whenever a user tries to /JOIN a G-lined/K-lined channel of their own volition.


[Features]
Expand All @@ -134,7 +156,7 @@ CONNECTED_LIST_THROTTLE=30
; Prevent /LIST from being performed until the user has been connected to the IRCd for at least 30 seconds. (Exluding IRC operators.)

DENY_SECRET=TRUE
; Vehemently deny the existence of secret channels. (E.g. Trying to /kick when not on them returns "No such channel.")
; Vehemently deny the existence of secret channels. (E.g. Trying to /KICK when not on them returns "No such channel.")

HALFOP=TRUE
; Enable halfop (+h <nick> -> %<nick>) support.
Expand All @@ -143,10 +165,10 @@ HIDE_HOSTS_FREELY=TRUE
; Setting +x will obfuscate the users host to other users. (Excluding IRC operators.)

OPER_BYPASS_BADCHAN=FALSE
; Allow IRC operators to join channel(s) that have been G-lined or K-lined.
; Allow IRC operators to join channel(s) that have been G-lined/K-lined.

OPER_OVERRIDE=TRUE
; Enable user mode +X for IRC operators. (Opers can walk through +i, etc.; /kick when not on the channel, etc.)
; Enable user mode +X for IRC operators. (Opers can walk through +i, etc.; /KICK when not on the channel, etc.)

PERSISTANT_CHANNELS=TRUE
; Enable channel mode +P. (Channels persist even after the last user has left.)
Expand Down
5 changes: 3 additions & 2 deletions mIRCd.mrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; mIRCd v0.09hf14 (Revision 2) - an IRCd scripted entirely in mSL - by Jigsy (https://github.com/Jigsy1/mIRCd)
; mIRCd v0.09hf15 (Revision 2) - an IRCd scripted entirely in mSL - by Jigsy (https://github.com/Jigsy1/mIRCd)
; "You were so preoccupied with whether or not you could, you didn't stop to think if you should." -Dr. Ian Malcolm (Jurrasic Park)
;
; Note: It is recommended running these scripts in a separate instance of mIRC - or in a Virtual Machine/under WINE.
Expand Down Expand Up @@ -374,6 +374,7 @@ alias mIRCd.start {
if ($mIRCd(SLINE_SUPPORT).temp == $null) { hadd -m $mIRCd.temp SLINE_SUPPORT $iif($bool_fmt($mIRCd(SLINE_SUPPORT)) == $true,1,0) }
if ($mIRCd(WHOIS_PARANOIA).temp == $null) { hadd -m $mIRCd.temp WHOIS_PARANOIA $iif($bool_fmt($mIRCd(WHOIS_PARANOIA)) == $true,1,0) }
if ($mIRCd(DEFAULT_CHANMODES).temp == $null) { hadd -m $mIRCd.temp DEFAULT_CHANMODES $iif($mIRCd.makeDefaultModes($mIRCd(DEFAULT_CHANMODES)).chan != $null,$v1,$mIRCd.defaultChanModes) }
if ($mIRCd(DEFAULT_OPERMODES).temp == $null) { hadd -m $mIRCd.temp DEFAULT_OPERMODES $iif($mIRCd.makeDefaultModes($mIRCd(DEFAULT_OPERMODES)).oper != $null,$v1,$mIRCd.defaultOperModes) }
if ($mIRCd(DEFAULT_USERMODES).temp == $null) { hadd -m $mIRCd.temp DEFAULT_USERMODES $mIRCd.makeDefaultModes($mIRCd(DEFAULT_USERMODES)).nick }
if ($mIRCd(SALT).temp == $null) { hadd -m $mIRCd.temp SALT $mIRCd(SALT) }
if ($mIRCd(SERVER_NAME).temp == $null) { hadd -m $mIRCd.temp SERVER_NAME $mIRCd(SERVER_NAME) }
Expand Down Expand Up @@ -405,7 +406,7 @@ alias mIRCd.unloadScripts {
; `-> A quick and dirty loop.
if ($script($script) != $null) { .unload -rs $qt($script) }
}
alias mIRCd.version { return mIRCd[0.09hf14(Rev.2)][2021-2023] }
alias mIRCd.version { return mIRCd[0.09hf15(Rev.2)][2021-2023] }
alias mIRCd.window { return @mIRCd }
alias -l nextHour { return $+($asctime($calc($ctime + 3600),HH),:00) }
alias -l requiredVersion { return 7.66 }
Expand Down
17 changes: 12 additions & 5 deletions mIRCd_mask.mrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ alias mIRCd_command_accept {

if (($pos(-+,$left($3,1)) == $null) || ($3 == $null)) {
; ¦-> Show any accepts (for a user).
; `-> Please see the note under /mIRCd_command_silence.
var %this.sock = $1
if ($getSockname($3) != $null) { var %this.sock = $v1 }
if ($getSockname($3) != $null) {
var %this.sock = $v1
if (($bool_fmt($mIRCd(HIDE_CLIENT_LISTS)) == $true) || ($bool_fmt($mIRCd(HIDE_ACCEPT_LIST)) == $true)) {
if ($is_oper($1) == $false) { var %this.sock = $1 }
}
}
if ($hcount($mIRCd.accept(%this.sock)) == 0) {
mIRCd.sraw $1 $mIRCd.reply(162,$mIRCd.info($1,nick),$mIRCd.info(%this.sock,nick))
return
Expand Down Expand Up @@ -346,10 +350,13 @@ alias mIRCd_command_silence {

if (($pos(-+,$left($3,1)) == $null) || ($3 == $null)) {
; ¦-> Show any silences (for a user).
; ¦-> NOTE: Being able to see the silence(s) of other users when non-oper is not a bug on some ircu IRCds. (UnderNet did change this, though.)
; `-> However, I am torn if a non-user should be able to see them, or if I should make them self/oper only.
var %this.sock = $1
if ($getSockname($3) != $null) { var %this.sock = $v1 }
if ($getSockname($3) != $null) {
var %this.sock = $v1
if (($bool_fmt($mIRCd(HIDE_CLIENT_LISTS)) == $true) || ($bool_fmt($mIRCd(HIDE_SILENCE_LIST)) == $true)) {
if ($is_oper($1) == $false) { var %this.sock = $1 }
}
}
if ($hcount($mIRCd.silence(%this.sock)) == 0) {
mIRCd.sraw $1 $mIRCd.reply(272,$mIRCd.info($1,nick),$mIRCd.info(%this.sock,nick))
return
Expand Down
36 changes: 21 additions & 15 deletions mIRCd_modeHandle.mrc
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,25 @@ alias mIRCd_command_oper {
mIRCd.sraw $1 $mIRCd.reply(464,$mIRCd.info($1,nick))
return
}
var %this.modes = $+($iif($is_modeSet($1,g).nick == $false,g),o,$iif($is_modeSet($1,s).nick == $false,s))
mIRCd.updateUser $1 modes $+($mIRCd.info($1,modes),%this.modes)
if (s isincs %this.modes) {
var %this.snoMask = $iif($mIRCd(DEFAULT_OPER_SNOMASK) isnum 1-65535,$v1,17157), %this.snoFlag = 1
mIRCd.updateUser $1 snoMask %this.snoMask
mIRCd.sraw $1 $mIRCd.reply(008,$mIRCd.info($1,nick),%this.snoMask,$base(%this.snoMask,10,16))
; `-> This should cover connections, DIE, GLINE, HACK(4), KILL, QUIT and RESTART.
}
mIRCd.raw $1 $+(:,$mIRCd.fulladdr($1)) MODE $mIRCd.info($1,nick) $+(:+,%this.modes)
var %this.initial = $mIRCd.info($1,modes)
; `-> For the new code.
mIRCd.updateUser $1 modes $+($mIRCd.info($1,modes),o)
mIRCd.raw $1 $+(:,$mIRCd.fulladdr($1)) MODE $mIRCd.info($1,nick) :+o
mIRCd.sraw $1 $mIRCd.reply(381,$mIRCd.info($1,nick))
; `-> Send +o separately because the next bit is entirely optional. (Plus we need o to be part of modes to push certain modes with mIRCd_command_mode.)
hadd -m $mIRCd.opersOnline $1 $ctime
; `-> This is a very hacky way of fiddling with the LUSERS numbers.
if (($is_modeSet($1,s).nick == $true) && (%this.snoFlag != 1)) {
if ($mIRCd.info($1,snoMask) != $null) { mIRCd.sraw $1 $mIRCd.reply(008,$mIRCd.info($1,nick),$v1,$base($v1,10,16)) }
if ($mIRCd(DEFAULT_OPERMODES).temp != +) { mIRCd_command_mode $1 MODE $mIRCd.info($1,nick) $+(:,$mIRCd(DEFAULT_OPERMODES).temp) }
if ($is_modeSet($1,s).nick == $true) {
if (s !isincs %this.initial) {
var %this.snoMask = $iif($mIRCd(DEFAULT_OPER_SNOMASK) isnum 1-65535,$v1,17157)
mIRCd.updateUser $1 snoMask %this.snoMask
mIRCd.sraw $1 $mIRCd.reply(008,$mIRCd.info($1,nick),%this.snoMask,$base(%this.snoMask,10,16))
; `-> This should cover connections, DIE, GLINE, HACK(4), KILL, QUIT and RESTART.
}
else {
if ($mIRCd.info($1,snoMask) != $null) { mIRCd.sraw $1 $mIRCd.reply(008,$mIRCd.info($1,nick),$v1,$base($v1,10,16)) (no change) }
}
}
mIRCd.serverWallops $mIRCd.info($1,nick) $parenthesis($gettok($mIRCd.fulladdr($1),2-,33)) is now an IRC operator (+o) using account: $hfind($mIRCd.opers,$hget($mIRCd.opers,$3),1,W).data
}
Expand Down Expand Up @@ -302,6 +307,7 @@ alias mIRCd.chanModesSupport { return $+(b,$comma,k,$comma,gjl,$iif($mIRCd(BANDW
; `-> RPL_ISUPPORT. If you remove a mode from chanModes, just remember to _CAREFULLY_ remove it from here, too.
alias -l mIRCd.defaultChanModes { return nt }
; `-> These are the fallback modes for the function right at the bottom of the script. (No need for the + here, we'll deal with that.)
alias -l mIRCd.defaultOperModes { return gsw }
; ,-> Buckle up, kids!
alias -l mIRCd.parseMode {
; /mIRCd.parseMode [<args>]
Expand Down Expand Up @@ -941,7 +947,7 @@ alias mIRCd.hiddenCheck {
if (%this.d == 1) { return CHECK_LOWERCASE_D }
}
alias mIRCd.makeDefaultModes {
; $mIRCd.makeDefaultModes(<input>)[.chan|user]
; $mIRCd.makeDefaultModes(<input>)[.chan|oper|(nick|user)]

if ($prop == chan) {
if ($1 == $null) { return $+(+,$mIRCd.defaultChanModes) }
Expand Down Expand Up @@ -969,9 +975,9 @@ alias mIRCd.makeDefaultModes {
return $+(+,$iif($removecs($+($sorttokcs(%this.lower,32,a),$sorttok(%this.upper,32,a)), $chr(32)) != $null,$v1,$mIRCd.defaultChanModes))
; `-> Default back to +nt if there isn't anything.
}
; ,-> User.
if ($1 == $null) { return + }
var %this.loop = 0, %these.polars = cS, %this.polar = c S,S c, %this.forbidden = hkoX
; ,-> Oper/User.
if ($1 == $null) { return $+(+,$iif($prop == oper,$mIRCd.defaultOperModes)) }
var %this.loop = 0, %these.polars = cS, %this.polar = c S,S c, %this.forbidden = $iif($prop == oper,ho,hkoX)
; ¦-> I don't mind the other modes being allowed (+g/+W) but I will _NOT_ allow +h, +k, +o or +X.
; `-> +h requires a S:line for a host (E.g. Jigsy!Jigsy@Towa.Herschel.is.mai.wai.fu), but +k, +o and +X are just asking for trouble.
while (%this.loop < $len($1)) {
Expand Down
2 changes: 2 additions & 0 deletions mIRCd_msgHandle.mrc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ alias mIRCd.parseWall {
if (($2 == WALLHOPS) && ($is_op(%this.id,%this.sock) == $false) && ($is_hop(%this.id,%this.sock) == $false)) { continue }
if (($2 == WALLCHOPS) && ($is_op(%this.id,%this.sock) == $false)) { continue }
mIRCd.raw %this.sock $+(:,$mIRCd.fulladdr($1)) NOTICE $+(@,$3) %this.string
if (%this.activeFlag != 1) { var %this.activeFlag = 1 }
}
if (%this.activeFlag == 1) { mIRCd.updateChan %this.id lastActive $ctime }
}
alias mIRCd.serverWallops {
; /mIRCd.serverWallops <text>
Expand Down
17 changes: 11 additions & 6 deletions mIRCd_userHandle.mrc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ alias mIRCd_command_pass {
}
var %this.current = $iif($mIRCd.info($1,nick) != $null,$v1,*)
if ($3 == $null) {
; `-> Just $3 being null. Apparently : itself is okay as a password.
; `-> Just $3 being null. Apparently : itself is okay as a password. (Empty password perhaps?)
mIRCd.sraw $1 $mIRCd.reply(461,%this.current,$2)
return
}
Expand Down Expand Up @@ -190,9 +190,11 @@ alias mIRCd_command_pong {
return
}
; `-> K-line takes priority (because it's local), but there's no specific order to Z-line or G-line. (03/02/2023: Now with local Z-lines, Z-line takes priority over G-line.)
if ((127.* iswm $sock($1).ip) && (192.168.* iswm $sock($1).ip)) {
mIRCd.welcome $1
return
if ((127.* iswm $sock($1).ip) || (192.168.* iswm $sock($1).ip)) {
if ($bool_fmt($mIRCd(LOCAL_IMMUNITY)) == $true) {
mIRCd.welcome $1
return
}
}
; `-> Allow localhost and LAN to override the rest of the code. (Though now that I think about it, do they need to be subjected to network bans?)
if ($mIRCd(CONNECTION_PASS) != $null) {
Expand All @@ -208,8 +210,11 @@ alias mIRCd_command_pong {
}
}
if ($bool_fmt($mIRCd(DENY_EXTERNAL_CONNECTIONS)) == $true) {
$+(.timermIRCd.deny,$1) -o 1 0 mIRCd.errorUser $1 $mIRCd.noMore(No external connections.)
return
if (127.* !iswm $sock($1).ip) {
; `-> This one doesn't need to apply to localhost. (We might want to restrict LAN, though.)
$+(.timermIRCd.deny,$1) -o 1 0 mIRCd.errorUser $1 $mIRCd.noMore(No external connections.)
return
}
}
if ($mIRCd(MAXCLONES) isnum 1-) {
var %this.loop = 0, %this.count = 0
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mIRCd v0.09hf14 (Revision 2) - by Jigsy (https://github.com/Jigsy1/mIRCd)
mIRCd v0.09hf15 (Revision 2) - by Jigsy (https://github.com/Jigsy1/mIRCd)
---------------------------------------------------------------------------

Files included in this release:
Expand Down

0 comments on commit 8621562

Please sign in to comment.