Fixing decks with foil or tengwar cards crashing the render. Banned users now see a 401 instead of a 404

This commit is contained in:
Christian 'ketura' McCarty
2022-11-01 23:19:51 -05:00
parent 67fcb023cb
commit af20c3d922
2 changed files with 3 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ public class GempukkuHttpRequestHandler extends SimpleChannelInboundHandler<Full
try {
if (isBanned(requestInformation.remoteIp))
responseSender.writeError(404);
responseSender.writeError(401);
else
_uriRequestHandler.handleRequest(uri, httpRequest, _objects, responseSender, requestInformation.remoteIp);
} catch (HttpProcessingException exp) {

View File

@@ -398,7 +398,8 @@ public class DeckRequestHandler extends LotroServerRequestHandler implements Uri
private String generateCardTooltip(LotroCardBlueprint bp, String bpid) throws CardNotFoundException {
String[] parts = bpid.split("_");
String tlhhID = "LOTR" + String.format("%02d", Integer.parseInt(parts[0])) + String.format("%03d", Integer.parseInt(parts[1]));
String cardnum = parts[0].replace("*", "").replace("T", "");
String tlhhID = "LOTR" + String.format("%02d", Integer.parseInt(cardnum)) + String.format("%03d", Integer.parseInt(parts[1]));
String result = "<span class=\"tooltip\">" + GameUtils.getFullName(bp)
+ "<span><img class=\"ttimage\" src=\"https://i.lotrtcgpc.net/decipher/" + tlhhID + ".jpg\" ></span></span>";