コード例 #1
0
 @Override
 public boolean inGroup(final Player base, final String group) {
   final long start = System.nanoTime();
   final boolean result = handler.inGroup(base, group);
   checkPermLag(start, String.format("Checking if %s is in group %s", base.getName(), group));
   return result;
 }
コード例 #2
0
 @Override
 public String getSuffix(final Player base) {
   final long start = System.nanoTime();
   String suffix = handler.getSuffix(base);
   if (suffix == null) {
     suffix = "";
   }
   checkPermLag(start, String.format("Getting suffix for %s", base.getName()));
   return suffix;
 }
コード例 #3
0
 @Override
 public String getGroup(final Player base) {
   final long start = System.nanoTime();
   String group = handler.getGroup(base);
   if (group == null) {
     group = defaultGroup;
   }
   checkPermLag(start, String.format("Getting group for %s", base.getName()));
   return group;
 }
コード例 #4
0
 @Override
 public List<String> getGroups(final Player base) {
   final long start = System.nanoTime();
   List<String> groups = handler.getGroups(base);
   if (groups == null || groups.isEmpty()) {
     groups = Collections.singletonList(defaultGroup);
   }
   checkPermLag(start, String.format("Getting groups for %s", base.getName()));
   return Collections.unmodifiableList(groups);
 }
コード例 #5
0
 private void checkPermLag(long start, String summary) {
   final long elapsed = System.nanoTime() - start;
   if (elapsed > ess.getSettings().getPermissionsLagWarning()) {
     ess.getLogger()
         .log(
             Level.WARNING,
             String.format(
                 "Permissions lag notice with (%s). Response took %fms. Summary: %s",
                 getName(), elapsed / 1000000.0, summary));
   }
 }