security update, bug fixes
Signed-off-by: yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
22e9ea71e1
Commit
abb2b52154
@ -6,6 +6,7 @@ import com.sk89q.worldedit.bukkit.BukkitWorld;
|
|||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import de.warking.hunjy.MySQL.Schematic;
|
import de.warking.hunjy.MySQL.Schematic;
|
||||||
import de.warking.hunjy.MySQL.SchematicType;
|
import de.warking.hunjy.MySQL.SchematicType;
|
||||||
|
import de.warking.hunjy.MySQL.UserGroup;
|
||||||
import de.warking.hunjy.MySQL.WarkingUser;
|
import de.warking.hunjy.MySQL.WarkingUser;
|
||||||
import de.warking.schematicsystem.SchematicSystem;
|
import de.warking.schematicsystem.SchematicSystem;
|
||||||
import de.warking.schematicsystem.check.CheckSession;
|
import de.warking.schematicsystem.check.CheckSession;
|
||||||
@ -19,6 +20,7 @@ import org.bukkit.entity.Player;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -80,6 +82,18 @@ public class CheckCommand implements CommandExecutor {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(args[0].equalsIgnoreCase("cancel")) {
|
||||||
|
if(CheckSession.doesPlayerCheck(player)) {
|
||||||
|
CheckSession checkSession = CheckSession.getCheckSession(player);
|
||||||
|
checkSession.removeSchematic();
|
||||||
|
checkSession.remove();
|
||||||
|
player.sendMessage(SchematicSystem.PREFIX + "§aDer Prüfvorgang wurde abgebrochen!");
|
||||||
|
return false;
|
||||||
|
} else
|
||||||
|
player.sendMessage(SchematicSystem.PREFIX + "§cDu prüfst momentan keine Schematic!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +146,19 @@ public class CheckCommand implements CommandExecutor {
|
|||||||
player.sendMessage(SchematicSystem.PREFIX + "§cZum Prüfen musst du dich auf deinem Bauserver befinden!");
|
player.sendMessage(SchematicSystem.PREFIX + "§cZum Prüfen musst du dich auf deinem Bauserver befinden!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Player> worldPlayers = player.getWorld().getPlayers();
|
||||||
|
for(Player players : worldPlayers) {
|
||||||
|
if(!players.getUniqueId().toString().equals(player.getWorld().getName())) {
|
||||||
|
WarkingUser warkingUsers = WarkingUser.get(players.getUniqueId());
|
||||||
|
if(!CheckUtils.allowedToCheck(players) &&
|
||||||
|
!warkingUsers.getUUID().toString().equals(WarkingUser.get(schematic.getSchemOwner()).getUUID().toString())) {
|
||||||
|
player.sendMessage(SchematicSystem.PREFIX + "§cZum Prüfen darf sich niemand außer dir, " +
|
||||||
|
"der Schematic Owner oder ein anderes zum Prüfen befähigtes Teammitglied auf deinem Bauserver befinden!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for(CheckSession checkSession : CheckSession.checkSessions) {
|
for(CheckSession checkSession : CheckSession.checkSessions) {
|
||||||
if(checkSession.getSchematic().getSchemName().equals(schematic.getSchemName())
|
if(checkSession.getSchematic().getSchemName().equals(schematic.getSchemName())
|
||||||
&& checkSession.getSchematic().getSchemOwner() == schematic.getSchemOwner()) {
|
&& checkSession.getSchematic().getSchemOwner() == schematic.getSchemOwner()) {
|
||||||
@ -215,6 +242,7 @@ public class CheckCommand implements CommandExecutor {
|
|||||||
player.sendMessage("§8/ckeck schematic <SchematicName> <Besitzer> - §6Zum Checken einer Schematic");
|
player.sendMessage("§8/ckeck schematic <SchematicName> <Besitzer> - §6Zum Checken einer Schematic");
|
||||||
player.sendMessage("§8/ckeck allow - §6Schematic freigeben");
|
player.sendMessage("§8/ckeck allow - §6Schematic freigeben");
|
||||||
player.sendMessage("§8/ckeck decline <Grund> - §6Schematic nicht freigeben");
|
player.sendMessage("§8/ckeck decline <Grund> - §6Schematic nicht freigeben");
|
||||||
|
player.sendMessage("§8/check cancel - §6Bricht das Prüfen ab");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,10 @@ import de.warking.hunjy.MySQL.Schematic;
|
|||||||
import de.warking.hunjy.MySQL.SchematicType;
|
import de.warking.hunjy.MySQL.SchematicType;
|
||||||
import de.warking.hunjy.MySQL.WarkingUser;
|
import de.warking.hunjy.MySQL.WarkingUser;
|
||||||
import de.warking.schematicsystem.SchematicSystem;
|
import de.warking.schematicsystem.SchematicSystem;
|
||||||
|
import de.warking.schematicsystem.check.CheckSession;
|
||||||
import de.warking.schematicsystem.check.CheckUtils;
|
import de.warking.schematicsystem.check.CheckUtils;
|
||||||
import de.warking.schematicsystem.utils.CheckedSchematic;
|
import de.warking.schematicsystem.utils.CheckedSchematic;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -20,6 +22,21 @@ public class PlayerJoinListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void handlePlayerJoin(PlayerJoinEvent event) {
|
public void handlePlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
CheckSession currentChecking = null;
|
||||||
|
for(Player players : player.getWorld().getPlayers()) {
|
||||||
|
if(CheckSession.doesPlayerCheck(players))
|
||||||
|
currentChecking = CheckSession.getCheckSession(players);
|
||||||
|
}
|
||||||
|
if(currentChecking != null) {
|
||||||
|
if(!CheckUtils.allowedToCheck(player) && !WarkingUser.get(
|
||||||
|
currentChecking.getSchematic().getSchemOwner()).getUUID().toString()
|
||||||
|
.equals(player.getUniqueId().toString())) {
|
||||||
|
player.sendMessage(SchematicSystem.PREFIX + "§cAuf diesem Server wird momentan eine Schematic geprüft!");
|
||||||
|
player.kickPlayer("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
File file = new File(SchematicSystem.SCHEM_DIR + player.getUniqueId() + "/");
|
File file = new File(SchematicSystem.SCHEM_DIR + player.getUniqueId() + "/");
|
||||||
File[] files = file.listFiles();
|
File[] files = file.listFiles();
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren