This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Strange double bans? Why is this happening?

Old posts that have not been replied to for several years.
Locked
U
Unknown1
Voice
Posts: 11
Joined: Fri Jun 11, 2004 5:40 pm

Strange double bans? Why is this happening?

Post by Unknown1 »

Here is a test script that does what I'm trying to fix...

What this does is allows Voices to do 5 min bans so the ops can monitor up and coming Ops... The kick is delayed 5 seconds because the kick seems to happen before the ban is set..

Code: Select all

bind pubm - "#fart !ban*" VoiceKickBan:pubm:trigger

proc VoiceKickBan:pubm:trigger {nick uhost hand chan arg} {
	if { [isop $nick $chan] || [ishalfop $nick $chan] || [isvoice $nick $chan] } {
		set name [string range $arg 5 end]
		if { [ onchan $name $chan ] } {
			if { [isop $name $chan] || [ishalfop $name $chan] || [isvoice $name $chan] } {
				return 0
			}
			newchanban $chan [getchanhost $name] VoiceBan "Voice Ban($nick)" 5 sticky
			utimer 5 "[VoiceKickBan:Kick $nick $chan $name]"
		}
	}
}

proc VoiceKickBan:Kick {tnick tchan tname} {
	puthelp "KICK $tchan $tname :Voice Ban($tnick)"
}
I know this isn't pretty code.. But when I run this and someone uses it.. It does this in the channel..
[15:16] <@John[io]> !ban Fresh9675511
[15:16] * BadX sets mode: +b *!~1033e432@4F431FF5F6A18B7D7DDC1E5A8319C3x
[15:17] * Fresh9675511 was kicked by BadX (Voice Ban(John[io]))
But when I look at the Bots internal list.. It shows this..
[15:23] <badx> ! [ 1] ~1033e432!*@4F431FF5F6A18B7D7DDC1E5A8319C3x (expires at 22:31) (sticky)
[15:23] <badx> VoiceBan: Voice Ban(John[io])
[15:23] <badx> Created 22:26
[15:23] <badx> * [ 2] *!~1033e432@4F431FF5F6A18B7D7DDC1E5A8319C3x (BadX!~BadX@DA5F351328F9237AD24DC0AD2BA4x) (active 00:11)
Why is it setting the incorrect ban within the channel?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

You've got newchanban setting a "sticky" ban .. ie. permanent!

Replace "sticky" at the end with "none" ie. newchanban $chan [getchanhost $name] VoiceBan "Voice Ban($nick)" 5 none

PS: TCL queries are posted in the TCL Forums not the Eggdrop Forum :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
U
Unknown1
Voice
Posts: 11
Joined: Fri Jun 11, 2004 5:40 pm

Post by Unknown1 »

Doooh! Can someone please move this thread to the right area? Sorry.. But this is a grey area as it could be a setting in the eggdrop's config file doing this.

OK.. (Although I haven't tested it yet..) If it's the sticky that is doing this, isn't that kinda strange behavior.. Why would a sticky have a different ban mask?.. Seems like a bug to me?

Hmm.. The thing is.. I have to have +dynamicbans and -enforcebans for my channels.. So.. Doing the newchanban without a sticky and kicking them will allow the user to come back in at least one more time and get kicked again as it will not set the ban within the channel until that user rejoins..

And having it doing two different bans is bad also.. I have a trigger set so that a OP can remove a bots internal ban.. But the ban that the Op sees in the channel is not the sticky one which would need removing..

The Op would be doing

!remban *!~1033e432@4F431FF5F6A18B7D7DDC1E5A8319C3x

instead of

!remban ~1033e432!*@4F431FF5F6A18B7D7DDC1E5A8319C3x
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

There is no bug!

Check the "set strict-host" setting in your config. I use 0 myself and have no problems. Stripping the leading ~ is a good idea.

Masking the nicks' host should solve the problem:

Code: Select all

maskhost <nick!user@host>
    Returns: masked hostmask for the string given ("n!u@1.2.3.4" -> "*!u@1.2.3.*",
      "n!u@lame.com" -> "*!u@lame.com", "n!u@a.b.edu" -> "*!u@*.b.edu")
Setting a "sticky" ban overrides the dynamicbans setting as it is a permanent ban.

**Edited**

Try this:

Code: Select all

set banmask [makehost [getchanhost $name $chan]]

##
# makehost
proc makehost {host} {
	return "*!*[lindex [split [maskhost $host] "!"] 1]"
}
Then you have:

Code: Select all

newchanban $chan $banmask $name VoiceBan "Voice Ban($nick)" 5 none
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked