Hello all school maths experts, here's how the ingame activity measured:
We look at each clan member's activity. If they played 5+ games over a month, we mark them as active. Otherwise, inactive.
Then we look what's the percentage of active members among all clan members. If it's 50% or more (or there's 25+ active members), clan receives max points for ingame activity. Otherwise, we multiply that percentage by 0.9.
Total number of games played by all clan members
does not matter. A 50-member clan can have 10k games played within a month total and still be marked as inactive if it was just 4 members playing non-stop.
php code:
$memberActivity['activepercentage'] = ceil($memberActivity['active'] / $memberActivity['total'] * 100);
if ($memberActivity['activepercentage'] >= 50 || $memberActivity['active'] >= 25) {
$memberActivity['status'] = "active";
$memberActivity['points'] = 45;
} else {
$memberActivity['status'] = "warn";
$memberActivity['points'] = ceil($memberActivity['activepercentage'] * 0.9);
}
if ($memberActivity['points'] < 20) {
$memberActivity['status'] = "inactive";
}