mirror of https://github.com/hykilpikonna/AquaDX
[ongeki] Limit maximum activityList entries
parent
42563e3e72
commit
c9f80215ca
|
@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -40,6 +41,15 @@ public class GetUserActivityHandler implements BaseHandler {
|
|||
|
||||
List<UserActivity> activityList = userActivityRepository.findByUser_Card_ExtIdAndKindOrderBySortNumberDesc(userId,kind);
|
||||
|
||||
// Game crash workaround. Ported from minime @ Felix, commit 7efa1d7fd8d6b31cfba5f1755bf7bf3b9bc7aeb0
|
||||
if (kind == 1) {
|
||||
// PlayActivity: 15
|
||||
activityList = new ArrayList<>(activityList.subList(0, activityList.size() < 15 ? activityList.size() : 15));
|
||||
} else if (kind == 2) {
|
||||
// Music: 10
|
||||
activityList = new ArrayList<>(activityList.subList(0, activityList.size() < 10 ? activityList.size() : 10));
|
||||
}
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", activityList.size());
|
||||
|
|
Loading…
Reference in New Issue