| @@ 524-531 (lines=8) @@ | ||
| 521 | ||
| 522 | // decay a team's average credit |
|
| 523 | // |
|
| 524 | function team_decay_credit($team) { |
|
| 525 | $avg = $team->expavg_credit; |
|
| 526 | $avg_time = $team->expavg_time; |
|
| 527 | $now = time(0); |
|
| 528 | update_average($now, 0, 0, $avg, $avg_time); |
|
| 529 | $team->update("expavg_credit=$avg, expavg_time=$now"); |
|
| 530 | ||
| 531 | } |
|
| 532 | // if the team hasn't received new credit for ndays, |
|
| 533 | // decay its average and return true |
|
| 534 | // |
|
| @@ 624-630 (lines=7) @@ | ||
| 621 | ||
| 622 | // decay a host's average credit |
|
| 623 | // |
|
| 624 | function host_decay_credit($host) { |
|
| 625 | $avg = $host->expavg_credit; |
|
| 626 | $avg_time = $host->expavg_time; |
|
| 627 | $now = time(0); |
|
| 628 | update_average($now, 0, 0, $avg, $avg_time); |
|
| 629 | $host->update("expavg_credit=$avg, expavg_time=$now"); |
|
| 630 | } |
|
| 631 | ||
| 632 | // if the host hasn't received new credit for ndays, |
|
| 633 | // decay its average and return true |
|