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.

banlist

Old posts that have not been replied to for several years.
Locked
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

banlist

Post by EEggy »

Hi,

i'll appreciate if some can help me to fix the following codes, its expired the global bans and the channel bans, i wanted it to expire just "channel bans", not the global.

advance thanks

Code: Select all

proc exe_timersequence { } {
    set IGNITION 2
    timer $IGNITION bcheck
    timer $IGNITION ulcheck
}
exe_timersequence

proc bcheck {} {
    set CK_INTERBAL1 720
    set CK_INTERBAL2 360
    foreach j [timers] {
        if {[string compare [lindex $j 1] bcheck] == 0} {
            killtimer [lindex $j 2]
        }
    }
    blistcheck GLOBAL
    foreach channame [channels] {
	blistcheck $channame
    }
    backup
    save
    timer $CK_INTERBAL1 bcheck
    timer $CK_INTERBAL2 ulcheck
}


proc blistcheck {watchchannel} {
    set CGLOBAL GLOBAL
    if {[string compare $watchchannel $CGLOBAL] == 0 } {
	foreach bansentry [banlist] {
	    set watchchannel #test
	    delban $watchchannel $bansentry
	}
    } else {
	foreach bansentry [banlist $watchchannel] {
	    delban $watchchannel $bansentry
	}
    }   
}

proc delban {watchchannel bansentry} {
    set EXPIRE_LIMIT 150
    set NV_LIMIT  40
    set NV_LIMIT2 50
    set createdday [lindex $bansentry 3]
    set usedday [lindex $bansentry 4]
    set currnttime [unixtime]
    set daylength 86400
    set createdday [expr ($currnttime - $createdday)/$daylength]
    set bannedperson [lindex $bansentry 0]
    set bywho [lindex $bansentry 5]
    set breason [lindex $bansentry 1]
    if { $usedday == 0} {
	if { $createdday > $NV_LIMIT } {
	    if {[isban $bannedperson] == 0} {
		killchanban $watchchannel $bannedperson
		putlog "Okay Expired."
	    } else {
		killban $bannedperson
		putlog "Okay Expired."
	    }
	    
	}
    } else {
        set usedday [expr ($currnttime - $usedday)/$daylength]
        if {$usedday > $EXPIRE_LIMIT } {
	    if {[isban $bannedperson] == 0} {
		killchanban $watchchannel $bannedperson
		putlog "Okay Expired."
	    } else {
		killban $bannedperson
		putlog "Okay Expired."
	    }
	    
	} elseif { ($usedday == $createdday) &&  ($createdday > $NV_LIMIT2 ) } {	
	    
	    if {[isban $bannedperson] == 0} {
		killchanban $watchchannel $bannedperson
		putlog "Okay Expired."
	    } else {
		killban $bannedperson
		putlog "Okay Expired."
	    }
	    
	}
    }
}
EEggy
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Re: banlist

Post by strikelight »

EEggy wrote:Hi,

i'll appreciate if some can help me to fix the following codes, its expired the global bans and the channel bans, i wanted it to expire just "channel bans", not the global.

advance thanks
You will need to delete this piece of code from the blistcheck proc then:

Code: Select all

	foreach bansentry [banlist] {
	    set watchchannel #test
	    delban $watchchannel $bansentry
	}
and you can also remove all occurances of 'killban' as well.
Locked