PC-958 Allow reporting of offline players
This commit is contained in:
parent
353cdb2413
commit
640a8d3516
@ -118,6 +118,7 @@ public class ReportManager
|
||||
*/
|
||||
public CompletableFuture<Report> createReport(int reporterId, int suspectId, ReportCategory category, String message)
|
||||
{
|
||||
// TODO only allow report if suspect actually did something
|
||||
return _reportRepository.getOngoingReport(suspectId, category)
|
||||
.thenCompose(reportIdOptional ->
|
||||
reportIdOptional.isPresent() ? _reportRepository
|
||||
|
@ -47,6 +47,7 @@ public class ReportCommand extends CommandBase<ReportPlugin>
|
||||
else
|
||||
{
|
||||
CoreClientManager clientManager = _commandCenter.GetClientManager();
|
||||
int reporterId = clientManager.getAccountId(reporter);
|
||||
String playerName = args[0];
|
||||
Player suspect = UtilPlayer.searchOnline(reporter, playerName, false);
|
||||
String reason = F.combine(args, 1, null, false);
|
||||
@ -60,18 +61,17 @@ public class ReportCommand extends CommandBase<ReportPlugin>
|
||||
}
|
||||
else
|
||||
{
|
||||
int reporterId = clientManager.getAccountId(reporter);
|
||||
CoreClient suspectClient = clientManager.Get(suspect);
|
||||
new ReportCategoryPage(Plugin, reporter, reporterId, suspectClient, reason).openInventory();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clientManager.loadClientByName(playerName, client ->
|
||||
clientManager.loadClientByName(playerName, suspectClient ->
|
||||
{
|
||||
if (client != null)
|
||||
if (suspectClient != null)
|
||||
{
|
||||
// TODO report category page
|
||||
new ReportCategoryPage(Plugin, reporter, reporterId, suspectClient, reason).openInventory();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user