cleanup server code

This commit is contained in:
betasteward 2015-06-01 21:42:18 -04:00
parent 20a25ffdab
commit 71c7bc38e1
9 changed files with 12 additions and 79 deletions

View file

@ -346,10 +346,11 @@ public class Session {
pingTime.poll();
}
long sum = 0;
for (Long time :pingTime) {
for (Long time : pingTime) {
sum += time;
}
pingInfo = lastPing + " (Av: " + (milliSeconds > 0 ? milliSeconds + "ms":"<1ms")+")";
long avg = sum / pingTime.size();
pingInfo = lastPing + " (Av: " + (avg > 0 ? avg + "ms":"<1ms")+")";
}
public String getPingInfo() {