security update, more userfriendly
Signed-off-by: yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
70958fac9a
Commit
22e9ea71e1
@ -123,6 +123,15 @@ public class CheckCommand implements CommandExecutor {
|
||||
schematic.getSchemType() != SchematicType.warship &&
|
||||
schematic.getSchemType() != SchematicType.wargear &&
|
||||
schematic.getSchemType() != SchematicType.miniwargear) {
|
||||
|
||||
if(schematic.getSchemOwner() == WarkingUser.get(player.getUniqueId()).getId()) {
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nicht deine eigenen Schematics prüfen!");
|
||||
return false;
|
||||
}
|
||||
if(!player.getWorld().getName().equals(player.getUniqueId().toString())) {
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cZum Prüfen musst du dich auf deinem Bauserver befinden!");
|
||||
return false;
|
||||
}
|
||||
for(CheckSession checkSession : CheckSession.checkSessions) {
|
||||
if(checkSession.getSchematic().getSchemName().equals(schematic.getSchemName())
|
||||
&& checkSession.getSchematic().getSchemOwner() == schematic.getSchemOwner()) {
|
||||
|
@ -12,12 +12,12 @@ public class PlayerCommandPreProcessListener implements Listener {
|
||||
@EventHandler
|
||||
public void handlePlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if(!event.getMessage().contains("copy"))
|
||||
if(!event.getMessage().contains("copy") && !event.getMessage().contains("cut"))
|
||||
return;
|
||||
|
||||
if(CheckSession.doesPlayerCheck(player)) {
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst nichts kopieren während du eine Schematic prüfst!");
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cDieser Befehl ist beim Prüfen gesperrt!");
|
||||
//eventuell Admin Benachrichtigen
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import de.warking.hunjy.MySQL.SchematicType;
|
||||
import de.warking.hunjy.MySQL.WarkingUser;
|
||||
import de.warking.schematicsystem.SchematicSystem;
|
||||
import de.warking.schematicsystem.check.CheckUtils;
|
||||
import de.warking.schematicsystem.utils.CheckedSchematic;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -22,7 +23,7 @@ public class PlayerJoinListener implements Listener {
|
||||
File file = new File(SchematicSystem.SCHEM_DIR + player.getUniqueId() + "/");
|
||||
File[] files = file.listFiles();
|
||||
|
||||
if(files == null || files.length == 0) return;
|
||||
if(files != null && files.length > 0) {
|
||||
List<Schematic> schematics = Schematic.getSchemsAccessibleByUser(player.getUniqueId());
|
||||
List<String> schematicNames = new ArrayList<>();
|
||||
|
||||
@ -38,9 +39,21 @@ public class PlayerJoinListener implements Listener {
|
||||
new Schematic(fileName.substring(0, fileName.lastIndexOf('.')), player.getUniqueId(), "", SchematicType.normal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CheckUtils.allowedToCheck(player))
|
||||
player.sendMessage(CheckUtils.sendTeamMembersCSchematicsInfo());
|
||||
|
||||
WarkingUser warkingUser = WarkingUser.get(player.getUniqueId());
|
||||
List<Schematic> uncheckedSchematics = new ArrayList<>();
|
||||
|
||||
uncheckedSchematics.addAll(Schematic.getSchemsOfType(warkingUser.getId(), SchematicType.Cairship));
|
||||
uncheckedSchematics.addAll(Schematic.getSchemsOfType(warkingUser.getId(), SchematicType.Cwarship));
|
||||
uncheckedSchematics.addAll(Schematic.getSchemsOfType(warkingUser.getId(), SchematicType.Cwargear));
|
||||
uncheckedSchematics.addAll(Schematic.getSchemsOfType(warkingUser.getId(), SchematicType.Cminiwargear));
|
||||
|
||||
if(!uncheckedSchematics.isEmpty())
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§7Du hast noch §6" + uncheckedSchematics.size() + " §7ungeprüfte Schematic(s)!");
|
||||
}
|
||||
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren