Commit 10c75681 authored by FDeppe's avatar FDeppe
Browse files

changed server code to consider vote values of break-requests instead of just counting them

parent b614bcec
...@@ -146,7 +146,7 @@ public class VoteController extends Controller { ...@@ -146,7 +146,7 @@ public class VoteController extends Controller {
case BREAK: case BREAK:
// consider only last 10min // consider only last 10min
if (v.date.after(tenMinutesAgo)) { if (v.date.after(tenMinutesAgo)) {
sBreakRequests.value++; sBreakRequests += v.value;
} }
break; break;
default: default:
...@@ -158,6 +158,9 @@ public class VoteController extends Controller { ...@@ -158,6 +158,9 @@ public class VoteController extends Controller {
break; break;
} }
} }
// prevent invalid counting due to flow of time and consideration-time-interval of votes
sBreakRequests = Math.max(0, sBreakRequests);
// generate statistics // generate statistics
sUsers.value = usersAll.size(); sUsers.value = usersAll.size();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment