geforkt von SteamWar/BungeeCore
Code Review Stuff
Dieser Commit ist enthalten in:
Ursprung
53249cec61
Commit
a2ce616dbb
@ -1 +1 @@
|
||||
Subproject commit e83ab4762d77567a01b0b71bdf12b65bf2aca3bd
|
||||
Subproject commit 9a3630b07cb870266669ba120985a2c0a8ebbf5c
|
@ -66,7 +66,7 @@ public class PunishmentCommand {
|
||||
return null;
|
||||
}
|
||||
|
||||
return SteamwarUser.getOrCreate(uuid, name, u -> {});
|
||||
return SteamwarUser.getOrCreate(uuid, name, u -> {}, (o, n) -> {});
|
||||
}
|
||||
|
||||
private static UUID getUUIDofOfflinePlayer(String playerName) {
|
||||
|
@ -19,16 +19,13 @@
|
||||
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.BungeeCore;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.messages.ChatSender;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.Token;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class WebpasswordCommand extends SWCommand {
|
||||
|
||||
@ -51,4 +48,13 @@ public class WebpasswordCommand extends SWCommand {
|
||||
|
||||
ChatSender.of(player).system("WEB_UPDATED");
|
||||
}
|
||||
|
||||
public static void changeUsername(String oldUsername, String newUsername){
|
||||
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/changename.php", oldUsername, newUsername);
|
||||
try {
|
||||
pb.start();
|
||||
} catch (IOException e) {
|
||||
throw new SecurityException("Could not change username", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class BanListener extends BasicListener {
|
||||
event.registerIntent(BungeeCore.get());
|
||||
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
||||
PendingConnection connection = event.getConnection();
|
||||
SteamwarUser user = SteamwarUser.getOrCreate(connection.getUniqueId(), connection.getName(), ConnectionListener::newPlayer);
|
||||
SteamwarUser user = SteamwarUser.getOrCreate(connection.getUniqueId(), connection.getName(), ConnectionListener::newPlayer, WebpasswordCommand::changeUsername);
|
||||
if (user.isPunished(Punishment.PunishmentType.Ban)) {
|
||||
event.setCancelled(true);
|
||||
BannedUserIPs.banIP(user.getId(), connection.getAddress().getAddress().getHostAddress());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren