mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-12 03:37:27 +08:00
[diva] Ignore pvId -1 request
This commit is contained in:
@@ -3,7 +3,6 @@ package icu.samnyan.aqua.sega.diva.handler.ingame;
|
|||||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerProfileRepository;
|
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerProfileRepository;
|
||||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvCustomizeRepository;
|
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvCustomizeRepository;
|
||||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvRecordRepository;
|
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvRecordRepository;
|
||||||
import icu.samnyan.aqua.sega.diva.exception.ProfileNotFoundException;
|
|
||||||
import icu.samnyan.aqua.sega.diva.handler.BaseHandler;
|
import icu.samnyan.aqua.sega.diva.handler.BaseHandler;
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.Difficulty;
|
import icu.samnyan.aqua.sega.diva.model.common.Difficulty;
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.Edition;
|
import icu.samnyan.aqua.sega.diva.model.common.Edition;
|
||||||
@@ -20,6 +19,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
@@ -42,7 +42,7 @@ public class GetPvPdHandler extends BaseHandler {
|
|||||||
|
|
||||||
public String handle(GetPvPdRequest request) {
|
public String handle(GetPvPdRequest request) {
|
||||||
|
|
||||||
PlayerProfile profile = profileRepository.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
Optional<PlayerProfile> profileO = profileRepository.findByPdId(request.getPd_id());
|
||||||
StringBuilder pd = new StringBuilder();
|
StringBuilder pd = new StringBuilder();
|
||||||
|
|
||||||
for (int pvId :
|
for (int pvId :
|
||||||
@@ -50,6 +50,10 @@ public class GetPvPdHandler extends BaseHandler {
|
|||||||
if (pvId == -1) {
|
if (pvId == -1) {
|
||||||
pd.append("***").append(",");
|
pd.append("***").append(",");
|
||||||
} else {
|
} else {
|
||||||
|
if (profileO.isEmpty()) {
|
||||||
|
pd.append("***").append(",");
|
||||||
|
} else {
|
||||||
|
var profile = profileO.get();
|
||||||
int diff = request.getDifficulty();
|
int diff = request.getDifficulty();
|
||||||
Difficulty difficulty = Difficulty.fromValue(diff);
|
Difficulty difficulty = Difficulty.fromValue(diff);
|
||||||
|
|
||||||
@@ -81,6 +85,7 @@ public class GetPvPdHandler extends BaseHandler {
|
|||||||
pd.append(URIEncoder.encode(str)).append(",");
|
pd.append(URIEncoder.encode(str)).append(",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pd.deleteCharAt(pd.length() - 1);
|
pd.deleteCharAt(pd.length() - 1);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user