[aimedb] Pass existing aimeId for duplicated register request

pull/1/head
Dom Eori 2021-12-26 11:16:25 +09:00
parent 0d98fe8818
commit 0c65740607
1 changed files with 8 additions and 2 deletions

View File

@ -53,9 +53,15 @@ public class RegisterHandler implements BaseHandler {
resultMap.put("status", 1);
resultMap.put("aimeId", card.getExtId().longValue());
} else {
/* Ongeki workaround: if the card is already registered, it will just return existing aimeId associated with luid.
I have strong feeling that we should investigate about register code (13) instead of this hack,
but it seems enough for mitigate "ongeki bright" error popup during login process. */
logger.warn("Duplicated Aime Card Register detected, access code: {}", requestMap.get("luid"));
resultMap.put("status", 0);
resultMap.put("aimeId", 0L);
Card card = cardService.getCardByAccessCode((String) requestMap.get("luid")).get();
resultMap.put("status", 1);
resultMap.put("aimeId", card.getExtId().longValue());
}
logger.info("Response: " + logMapper.write(resultMap));