Author: xor
Date: 2008-11-13 20:02:47 +0000 (Thu, 13 Nov 2008)
New Revision: 23541
Modified:
trunk/plugins/WoT/introduction/IntroductionClient.java
Log:
Get puzzles from *different* identities - makes no sense if the user solves
more than one puzzle from the same identity.
Modified: trunk/plugins/WoT/introduction/IntroductionClient.java
===================================================================
--- trunk/plugins/WoT/introduction/IntroductionClient.java 2008-11-13
19:59:26 UTC (rev 23540)
+++ trunk/plugins/WoT/introduction/IntroductionClient.java 2008-11-13
20:02:47 UTC (rev 23541)
@@ -149,12 +149,14 @@
q.descend("mSolution").constrain(null).identity(); /* FIXME:
toad said constrain(null) is maybe broken. If this is true: Alternative would
be: q.descend("mIdentity").constrain(OwnIdentity.class).not(); */
ObjectSet<IntroductionPuzzle> puzzles = q.execute();
ArrayList<IntroductionPuzzle> result = new
ArrayList<IntroductionPuzzle>(count);
+ HashSet<Identity> resultHasPuzzleFrom = new
HashSet<Identity>(count);
for(IntroductionPuzzle p : puzzles) {
try {
int score = p.getInserter().getScore(id,
db).getScore();
- if(score > MINIMUM_SCORE_FOR_PUZZLE_DISPLAY) {
+ if(score > MINIMUM_SCORE_FOR_PUZZLE_DISPLAY &&
!resultHasPuzzleFrom.contains(p.getInserter())) {
result.add(p);
+
resultHasPuzzleFrom.add(p.getInserter());
if(result.size() == count)
break;
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs