220,232d219
< # zXgʂۂ(Q҃JEgEeʐ)
< # IP琔l̕ϊsȂH
< #   0 : ϊȂ
< #   1 : ϊ
< $usehostbin = 1;
< 
< # eʐt@C
< # gpȂƂ͂̕ϐɂ܂B
< $postlimitfilename = './bbs.lim';
< 
< # ̓eʐ(byte)
< $postlimitbyte = 64 * 1024;
< 
620c607
< 	my ( $myhost, @cntdata, $mbrcount, $cuser, $ctime, $cadd );
---
> 	my ( @hostbin, @ukey, @cntdata, $mbrcount, $cuser, $ctime, $cadd );
624a612,618
> 		@hostbin = split ( /\./, $ENV{'REMOTE_ADDR'} );
> 		for ( $i = 0 ; $i < 4 ; $i++ ) {
> 			$hostbin[$i] = vec ( pack ( 'C4', $hostbin[$i] ), 0, 8 );
> 		}
> 		$ukey[0] = $hostbin[0] + $hostbin[1] + $hostbin[2] + $hostbin[3];
> 		$ukey[1] = $hostbin[0] ^ $hostbin[1] & $hostbin[2] ^ $hostbin[3];
> 		$ukey[2] = $ukey[0] * $ukey[1];
626,627d619
< 		$myhost = $usehostbin ? &hostbin() : $ENV{'REMOTE_ADDR'};
< 		
639,640c631,632
< 				if ( $cuser eq $myhost ) {
< 					$cntdata[$i] = "$myhost,$nowtime\n";
---
> 				if ( $cuser eq $ukey[2] ) {
> 					$cntdata[$i] = "$ukey[2],$nowtime\n";
651c643
< 				push ( @cntdata, "$myhost,$nowtime\n" );
---
> 				push ( @cntdata, "$ukey[2],$nowtime\n" );
655c647
< 			push ( @cntdata, "$myhost,$nowtime\n" );
---
> 			push ( @cntdata, "$ukey[2],$nowtime\n" );
674,695d665
< #  IPAhX𐔒lɕϊ
< ###############################################################################
< 
< sub hostbin {
< 	
< 	my (@hostbin, @ukey);
< 	
< 	@hostbin = split ( /\./, $ENV{'REMOTE_ADDR'} );
< 	
< 	for (my $i = 0 ; $i < 4 ; $i++ ) {
< #		$hostbin[$i] = vec ( pack ( 'C4', $hostbin[$i] ), 0, 8 );
< 		$hostbin[$i] = $hostbin[$i] & 0xFF;
< 	}
< 	$ukey[0] = $hostbin[0] + $hostbin[1] + $hostbin[2] + $hostbin[3];
< 	$ukey[1] = $hostbin[0] ^ $hostbin[1] & $hostbin[2] ^ $hostbin[3];
< 	$ukey[2] = $ukey[0] * $ukey[1];
< 	
< 	return $ukey[2];
< }
< 
< 
< ###############################################################################
965,972d934
< 	
< 	# eʐ
< 	if ( $postlimitfilename ne '') {
< 		my $postbyte = length ($FORM{'u'}) + length ($FORM{'i'}) + length ($FORM{'t'}) + length ($FORM{'v'});
< 		if ( &postlimit ($postbyte) ) {
< 			&prterror ( '̓eʂEl𒴂܂' );
< 		}
< 	}
1107,1169d1068
< 
< 
< ###############################################################################
< #  eʐ
< ###############################################################################
< 
< sub postlimit {
< 	
< 	my ($myhost, $today, $lastvisit, $flag, $isover, @lines);
< 	my $postbyte = shift;
< 	
< 	$myhost = $usehostbin ? &hostbin() : $ENV{'REMOTE_ADDR'};
< 	
< 	# ̓t
< 	my ($sec, $min, $hour, $mday, $month, $year) = localtime ($nowtime);
< 	$today = sprintf ("%d%02d%02d", $year+1900, $month+1, $mday);
< 	
< 	@lines = ();
< 	
< 	if ( open (LIM, "+< $postlimitfilename") ) {
< 		eval{ flock (LIM, 2) };
< 		seek (LIM, 0, 0);
< 		
< 		chomp ($lastvisit = <LIM>);
< 		
< 		# tXVꂽAf[^͓ǂݍ܂Ȃ
< 		unless ($lastvisit and $lastvisit < $today) {
< 			while (<LIM>) {
< 			my ($ip, $byte) = split (/\,/, $_);
< 				
< 				# IPv瓊eʂ̍vl𑝂₷
< 				if (!$flag and $ip eq $myhost) {
< 					chomp ($byte);
< 					$postbyte += $byte;
< 					$_ = "$myhost,$postbyte\n";
< 					
< 					$flag = 1;
< 				}
< 				push (@lines, $_);
< 			}
< 		}
< 	} else {
< 		open (LIM, ">> $postlimitfilename" )
< 			or &prterror ( 'eʐt@C̓ǂݍ݂Ɏs܂' );
< 		eval { flock (LIM, 2) };
< 	}
< 	
< 	# YIPΒǉ
< 	unless ($flag) {
< 		push (@lines, "$myhost,$postbyte\n");
< 	}
< 	
< 	$isover = ($postbyte > $postlimitbyte);
< 	if (!$isover) {
< 		truncate (LIM, 0);
< 		seek (LIM, 0, 0);
< 		print LIM $today . "\n", @lines;
< 	}
< 	close (LIM);
< 	
< 	return ($isover);
< }
< 
