mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-08 19:57:28 +08:00
[mai2] add log and adjust divMaxLength default value in annotations.
This commit is contained in:
@@ -85,7 +85,7 @@ public class ApiMaimai2PlayerDataController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("config/userPhoto/divMaxLength")
|
@GetMapping("config/userPhoto/divMaxLength")
|
||||||
public long getConfigUserPhotoDivMaxLength(@Value("${game.maimai2.userPhoto.divMaxLength:16}") long divMaxLength) {
|
public long getConfigUserPhotoDivMaxLength(@Value("${game.maimai2.userPhoto.divMaxLength:32}") long divMaxLength) {
|
||||||
return divMaxLength;
|
return divMaxLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class UploadUserPortraitHandler implements BaseHandler {
|
|||||||
public UploadUserPortraitHandler(BasicMapper mapper,
|
public UploadUserPortraitHandler(BasicMapper mapper,
|
||||||
@Value("${game.maimai2.userPhoto.enable:true}") boolean enable,
|
@Value("${game.maimai2.userPhoto.enable:true}") boolean enable,
|
||||||
@Value("${game.maimai2.userPhoto.picSavePath:data/userPhoto}") String picSavePath,
|
@Value("${game.maimai2.userPhoto.picSavePath:data/userPhoto}") String picSavePath,
|
||||||
@Value("${game.maimai2.userPhoto.divMaxLength:16}") long divMaxLength) {
|
@Value("${game.maimai2.userPhoto.divMaxLength:32}") long divMaxLength) {
|
||||||
this.mapper = mapper;
|
this.mapper = mapper;
|
||||||
this.picSavePath = picSavePath;
|
this.picSavePath = picSavePath;
|
||||||
this.enable = enable;
|
this.enable = enable;
|
||||||
@@ -63,8 +63,10 @@ public class UploadUserPortraitHandler implements BaseHandler {
|
|||||||
int divLength = userPhoto.getDivLength();
|
int divLength = userPhoto.getDivLength();
|
||||||
String divData = userPhoto.getDivData();
|
String divData = userPhoto.getDivData();
|
||||||
|
|
||||||
if (divLength > divMaxLength)
|
if (divLength > divMaxLength) {
|
||||||
|
logger.warn(String.format("stop user %d uploading photo data because divLength(%d) > divMaxLength(%d)", userId, divLength, divMaxLength));
|
||||||
return "{\"returnCode\":-1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserPortraitApi\"}";
|
return "{\"returnCode\":-1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserPortraitApi\"}";
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var tmp_filename = Paths.get(picSavePath, userId + "-up.tmp");
|
var tmp_filename = Paths.get(picSavePath, userId + "-up.tmp");
|
||||||
|
|||||||
Reference in New Issue
Block a user