Make reports no longer show reports with offline reportees#78
Make reports no longer show reports with offline reportees#78HuManKeat wants to merge 5 commits intoStratusNetwork:masterfrom HuManKeat:reports-rework
Conversation
| @@ -184,7 +189,7 @@ public void reports(final CommandContext args, final CommandSender sender) throw | |||
| audience.sendMessage(new HeaderComponent(title)); | |||
| for(Report report : reportResult.documents()) { | |||
| if(report.reported() != null) { | |||
There was a problem hiding this comment.
You should check if the player is offline here instead of in ReportFormatter. That would avoid calling audience.sendmessage() for a bunch of empty collections.
|
You seem to have removed the code that makes the o flag actually do anything. Also you should probably make it so when you use the a flag it shows players that are online on other servers not just the current one |
| @@ -1,12 +1,14 @@ | |||
| package tc.oc.commons.bukkit.report; | |||
There was a problem hiding this comment.
Your changes in reportformatter don’t seem to do anything. They can probably just be discarded.
| for(Report report : reportResult.documents()) { | ||
| if(report.reported() != null) { | ||
| audience.sendMessages(reportFormatter.format(report, crossServer, true)); | ||
| if(report.reported() != null && onlinePlayers.find(report.reported()).isOnline()) { |
There was a problem hiding this comment.
report.reported() != null && (showOffline || onlinePlayers.find(report.reported()).isOnline())
There was a problem hiding this comment.
You need to figure out how to get this to work with the a flag
No description provided.