diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/ChatRequestHandler.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/ChatRequestHandler.java index 2beb867d2..5afdf46df 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/ChatRequestHandler.java +++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/ChatRequestHandler.java @@ -98,7 +98,12 @@ public class ChatRequestHandler extends LotroServerRequestHandler implements Uri //Escaping underscores so that URLs with lots of underscores (i.e. wiki links) aren't mangled // Besides, who uses _this_ instead of *this*? newMsg = newMsg.replace("_", "\\_"); - newMsg = _markdownRenderer.render(_markdownParser.parse(newMsg)); + + //Need to preserve any commands being made + if(!newMsg.startsWith("/")) { + newMsg = _markdownRenderer.render(_markdownParser.parse(newMsg)); + newMsg = newMsg.replaceAll("[\n \t]*
", "

"); + } chatRoom.sendMessage(resourceOwner.getName(), newMsg, admin); responseWriter.writeXmlResponse(null); diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java index 8cb8561bd..c56cdf40e 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java +++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java @@ -129,7 +129,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri String format = getFormParameterSafely(postDecoder, "format"); String deckName = getFormParameterSafely(postDecoder, "deckName"); String timer = getFormParameterSafely(postDecoder, "timer"); - String desc = getFormParameterSafely(postDecoder, "desc"); + String desc = getFormParameterSafely(postDecoder, "desc").trim(); String isPrivateVal = getFormParameterSafely(postDecoder, "isPrivate"); boolean isPrivate = (isPrivateVal != null ? Boolean.valueOf(isPrivateVal) : false); @@ -145,6 +145,19 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri responseWriter.writeXmlResponse(marshalException(new HallException("Absolutely no playing with yourself!! Private matches must be with someone else."))); return; } + + try { + var player = _playerDao.getPlayer(desc); + if(player == null) + { + responseWriter.writeXmlResponse(marshalException(new HallException("Cannot find player '" + desc + "'. Check your spelling and capitalization and ensure it is exact."))); + return; + } + } + catch(RuntimeException ex) { + responseWriter.writeXmlResponse(marshalException(new HallException("Cannot find player '" + desc + "'. Check your spelling and capitalization and ensure it is exact."))); + return; + } } @@ -160,12 +173,17 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri Player librarian = _playerDao.getPlayer("Librarian"); _hallServer.spoofNewTable(format, resourceOwner, librarian, deckName, timer, "(New Player) " + desc, isPrivate); responseWriter.writeXmlResponse(null); + return; } catch (HallException ex) { } - responseWriter.writeXmlResponse(marshalException(e)); + responseWriter.writeXmlResponse(marshalException(e)); } } + catch (Exception ex) + { + responseWriter.writeXmlResponse(marshalException(new HallException("Failed to create table. Please try again later."))); + } finally { postDecoder.destroy(); } diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css b/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css index 11edbecd6..def2d8885 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css +++ b/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css @@ -412,11 +412,11 @@ table.tables tr.privateForPlayer { margin-bottom: 5px; font-style: italic; } -.chatMessage blockquote br { +/*.chatMessage blockquote br { line-height: 0px; margin: 0px; content: ""; -} +}*/ .user-mention { background-color: #FFFF0044; @@ -576,8 +576,8 @@ table.tables tr.privateForPlayer { #ui-tabs-1, #ui-tabs-2, #ui-tabs-3, -#ui-tabs-4, -#ui-tabs-5 { +#ui-tabs-4 +/*#ui-tabs-5*/ { overflow-x: hidden; overflow-y: hidden; height: 100%; diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index 734d7a824..310f99e98 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -206,18 +206,25 @@ public class HallServer extends AbstractServer { new ChatCommandCallback() { @Override public void commandReceived(String from, String parameters, boolean admin) { - _hallChat.sendToUser("System", from, "List of available commands:"); - _hallChat.sendToUser("System", from, "/ignore username - Adds user 'username' to list of your ignores"); - _hallChat.sendToUser("System", from, "/unignore username - Removes user 'username' from list of your ignores"); - _hallChat.sendToUser("System", from, "/listIgnores - Lists all your ignored users"); - _hallChat.sendToUser("System", from, "/incognito - Makes you incognito (not visible in user list)"); - _hallChat.sendToUser("System", from, "/endIncognito - Turns your visibility 'on' again"); + //_hallChat.sendToUser("System", from, + String message = """ + List of available commands: + /ignore username - Adds user 'username' to list of your ignores + /unignore username - Removes user 'username' from list of your ignores + /listIgnores - Lists all your ignored users + /incognito - Makes you incognito (not visible in user list) + /endIncognito - Turns your visibility 'on' again"""; if (admin) { - _hallChat.sendToUser("System", from, "Admin only commands:"); - _hallChat.sendToUser("System", from, "/ban username - Bans user 'username' permanently"); - _hallChat.sendToUser("System", from, "/banIp ip - Bans specified ip permanently"); - _hallChat.sendToUser("System", from, "/banIpRange ip - Bans ips with the specified prefix, ie. 10.10.10."); + message += """ + + + Admin only commands: + /ban username - Bans user 'username' permanently + /banIp ip - Bans specified ip permanently + /banIpRange ip - Bans ips with the specified prefix, ie. 10.10.10."""; } + + _hallChat.sendToUser("System", from, message.replace("\n", "
")); } }); _hallChat.addChatCommandCallback("nocommand", @@ -375,9 +382,13 @@ public class HallServer extends AbstractServer { throw new HallException("There is no ongoing serie for that league"); if(isPrivate) { - throw new HallException("League games cannot be private"); + throw new HallException("League games cannot be invite-only"); } + //Don't want people getting around the anonymity for leagues. + if(description != null) + description = ""; + format = _formatLibrary.getFormat(leagueSerie.getFormat()); collectionType = leagueSerie.getCollectionType();