parent
cf27447f0d
commit
247bcbbcd1
|
@ -353,11 +353,16 @@ public class GlobalDataManaager {
|
|||
}
|
||||
|
||||
|
||||
private static int calWorldLevel() throws Exception {
|
||||
private static int calWorldLevel(){
|
||||
Query query = new Query();
|
||||
query.with(new Sort(Sort.Direction.DESC,"playerManager.level"));
|
||||
query.fields().include("playerManager.level");
|
||||
List<User> users = MongoUtil.getLjsdMongoTemplate().findAllByCondition(query, User.class);
|
||||
List<User> users = null;
|
||||
try {
|
||||
users = MongoUtil.getLjsdMongoTemplate().findAllByCondition(query, User.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
int size = (int)(users.size()*0.85);
|
||||
int level = 0;
|
||||
for(int i = 0 ; i <size;i++){
|
||||
|
|
Loading…
Reference in New Issue