Skip to content

Commit

Permalink
Fix an issue with StaffChat from console, properly detect wildcard in…
Browse files Browse the repository at this point in the history
… command logging
  • Loading branch information
jacoballen1 committed Apr 2, 2021
1 parent 1e3a22d commit 374ae01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CommonCommandListener implements CommandListener {
public void onCommandExecution(CommandEvent event) {
if (registry.getOrDefault(CatalystKeys.COMMAND_LOGGING_ENABLED)) {
List<String> commandList = registry.getOrDefault(CatalystKeys.COMMAND_LOGGING_FILTER);
if ((commandList.size() == 1 && commandList.get(0).equals("*"))
if (commandList.contains("*")
|| commandList.contains(event.getCommand())) {
logger.info(event.getSourceName() + " executed command : " + event.getCommand());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public class CommonStaffChatListener<
@Override
public void onStaffChatEvent(StaffChatEvent<TString, TPlayer> event) {
String message = event.getRawMessage();
TUser player = (TUser) event.getPlayer();
String userName = userService.getUserName(player);

if (event.getIsConsole()) {
String finalMessage = message;
Expand All @@ -77,6 +75,9 @@ public void onStaffChatEvent(StaffChatEvent<TString, TPlayer> event) {
return;
}

TUser player = (TUser) event.getPlayer();
String userName = userService.getUserName(player);

if (registry.getOrDefault(CatalystKeys.EMOJI_ENABLE)
&& permissionService.hasPermission(player,
registry.getOrDefault(CatalystKeys.EMOJI_PERMISSION))) {
Expand Down

0 comments on commit 374ae01

Please sign in to comment.