diff --git a/checkin_notes b/checkin_notes index 679c05221c..d7ab5748d6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6002,3 +6002,9 @@ David 28 July 2008 html/ops/ repair_forums.php db_update.php + +Eric 28 July 2008 + - modified the credit multiplier calculation to make it more stable. + + tools/ + calculate_credit_multiplier diff --git a/tools/calculate_credit_multiplier b/tools/calculate_credit_multiplier index 031e77f601..9cd3a758da 100755 --- a/tools/calculate_credit_multiplier +++ b/tools/calculate_credit_multiplier @@ -88,7 +88,7 @@ for appid in $appids ; do last_value=`$MYSQL --execute="select multiplier from credit_multiplier where appid=$appid and (unix_timestamp(now())-time)=(select min(unix_timestamp(now())-time) from credit_multiplier where appid=$appid)"` last_time=`$MYSQL --execute="select unix_timestamp(now())-time from credit_multiplier where appid=$appid and (unix_timestamp(now())-time)=(select min(unix_timestamp(now())-time) from credit_multiplier where appid=$appid)"` - value=`$MYSQL --execute="select ($last_value*(($DECAY_TIME)-$last_time)+$ratio*$last_time)/($DECAY_TIME)"` + value=`$MYSQL --execute="select ($last_value*((($DECAY_TIME)-$last_time)+$ratio*$last_time))/($DECAY_TIME)"` $MYSQL --execute="insert into credit_multiplier values (0,$appid,unix_timestamp(now()),$value);" done