geforkt von SteamWar/BungeeCore
Merge remote-tracking branch 'origin/master'
Dieser Commit ist enthalten in:
Commit
3550b2c4fd
CommonCore
src/de/steamwar
@ -1 +1 @@
|
||||
Subproject commit d71896979ed397128306474da352cd56fc039a48
|
||||
Subproject commit 6cb3bc5ff5ee955ccdde281183991d0877e54169
|
@ -61,11 +61,7 @@ public class BungeeCore extends Plugin {
|
||||
public static boolean MAIN_SERVER;
|
||||
|
||||
public static String CHAT_PREFIX;
|
||||
public static String WORLD_FOLDER;
|
||||
public static String BAUWELT_PROTOTYP;
|
||||
public static String LOBBY_SERVER;
|
||||
public static String USERWORLDS15;
|
||||
public static String BAUWELT15;
|
||||
public static boolean EVENT_MODE;
|
||||
|
||||
private static BungeeCore instance;
|
||||
@ -168,7 +164,7 @@ public class BungeeCore extends Plugin {
|
||||
|
||||
if(!EVENT_MODE){
|
||||
new BauCommand();
|
||||
new WebregisterCommand();
|
||||
new WebpasswordCommand();
|
||||
new FightCommand();
|
||||
new ChallengeCommand();
|
||||
new HistoricCommand();
|
||||
@ -299,11 +295,7 @@ public class BungeeCore extends Plugin {
|
||||
}
|
||||
|
||||
CHAT_PREFIX = config.getString("prefix");
|
||||
WORLD_FOLDER = config.getString("worldfolder");
|
||||
BAUWELT_PROTOTYP = config.getString("bauweltprototyp");
|
||||
LOBBY_SERVER = config.getString("lobbyserver");
|
||||
USERWORLDS15 = config.getString("userworlds15");
|
||||
BAUWELT15 = config.getString("bauwelt15");
|
||||
EVENT_MODE = config.getBoolean("eventmode");
|
||||
Broadcaster.setBroadCastMsgs(config.getStringList("broadcasts").toArray(new String[1]));
|
||||
PollSystem.init(config.getString("poll.question"), config.getStringList("poll.answers"));
|
||||
|
@ -90,6 +90,7 @@ public class ErrorLogger extends Handler {
|
||||
contains.add("No client connected for pending server");
|
||||
contains.add("Error occurred processing connection for");
|
||||
contains.add("Server is online mode!");
|
||||
contains.add(" took ");
|
||||
ignoreContains = Collections.unmodifiableList(contains);
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,14 @@ public class ServerStarter {
|
||||
private static final Portrange BAU_PORTS = BungeeCore.MAIN_SERVER ? new Portrange(10100, 20000) : new Portrange(2100, 2200);
|
||||
private static final Portrange ARENA_PORTS = BungeeCore.MAIN_SERVER ? new Portrange(3000, 3100) : (BungeeCore.EVENT_MODE ? new Portrange(4000, 5000) : BAU_PORTS);
|
||||
|
||||
private static final String BACKBONE = System.getProperty("user.home") + "/";
|
||||
private static final String SERVER_PATH = BACKBONE + "server/";
|
||||
private static final String EVENT_PATH = BACKBONE + "event/";
|
||||
public static final String TEMP_WORLD_PATH = BACKBONE + "arenaserver/";
|
||||
public static final String TUTORIAL_PATH = BACKBONE + "tutorials/";
|
||||
public static final String WORLDS19_PATH = BACKBONE + "userworlds19/";
|
||||
private static final String SERVER_PATH = "/servers/";
|
||||
private static final String USER_HOME = System.getProperty("user.home") + "/";
|
||||
private static final String EVENT_PATH = USER_HOME + "event/";
|
||||
public static final String TEMP_WORLD_PATH = USER_HOME + "arenaserver/";
|
||||
public static final String TUTORIAL_PATH = USER_HOME + "tutorials/";
|
||||
public static final String WORLDS12_PATH = USER_HOME + "userworlds/";
|
||||
public static final String WORLDS15_PATH = USER_HOME + "userworlds15/";
|
||||
public static final String WORLDS19_PATH = USER_HOME + "userworlds19/";
|
||||
|
||||
private File directory = null;
|
||||
private String worldDir = null;
|
||||
@ -109,7 +111,7 @@ public class ServerStarter {
|
||||
|
||||
public ServerStarter build19(UUID owner) {
|
||||
directory = new File(SERVER_PATH, "Bau19");
|
||||
serverJar = "paper-1.19.1.jar";
|
||||
serverJar = "paper-1.19.2.jar";
|
||||
worldDir = WORLDS19_PATH;
|
||||
worldName = String.valueOf(SteamwarUser.get(owner).getId());
|
||||
buildWithWorld(owner, new File(directory, "Bauwelt").getPath());
|
||||
@ -118,19 +120,19 @@ public class ServerStarter {
|
||||
|
||||
public ServerStarter build15(UUID owner) {
|
||||
directory = new File(SERVER_PATH, "Bau15");
|
||||
worldDir = BungeeCore.USERWORLDS15;
|
||||
worldDir = WORLDS15_PATH;
|
||||
worldName = String.valueOf(SteamwarUser.get(owner).getId());
|
||||
buildWithWorld(owner, BungeeCore.BAUWELT15);
|
||||
buildWithWorld(owner, new File(directory, "Bauwelt").getPath());
|
||||
return this;
|
||||
}
|
||||
|
||||
public ServerStarter build12(UUID owner) {
|
||||
directory = new File(SERVER_PATH, "UserBau");
|
||||
directory = new File(SERVER_PATH, "Bau12");
|
||||
serverJar = "spigot-1.12.2.jar";
|
||||
xmx = "256M";
|
||||
worldDir = BungeeCore.WORLD_FOLDER;
|
||||
worldDir = WORLDS12_PATH;
|
||||
worldName = owner.toString();
|
||||
buildWithWorld(owner, BungeeCore.BAUWELT_PROTOTYP);
|
||||
buildWithWorld(owner, new File(directory, "Bauwelt").getPath());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -236,8 +236,8 @@ public class BauCommand extends BasicCommand {
|
||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
||||
versionSelector(p, args, 1,
|
||||
() -> deleteConfirmation(p, () -> deleteWorld(p, ServerStarter.WORLDS19_PATH + user.getId())),
|
||||
() -> deleteConfirmation(p, () -> deleteWorld(p, BungeeCore.USERWORLDS15 + user.getId())),
|
||||
() -> deleteConfirmation(p, () -> deleteWorld(p, BungeeCore.WORLD_FOLDER + p.getUniqueId().toString())),
|
||||
() -> deleteConfirmation(p, () -> deleteWorld(p, ServerStarter.WORLDS15_PATH + user.getId())),
|
||||
() -> deleteConfirmation(p, () -> deleteWorld(p, ServerStarter.WORLDS12_PATH + p.getUniqueId().toString())),
|
||||
() -> HelpCommand.sendBauHelp(ChatSender.of(p)));
|
||||
}
|
||||
|
||||
|
@ -19,58 +19,45 @@
|
||||
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.Message;
|
||||
import de.steamwar.bungeecore.sql.SWException;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.messages.ChatSender;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class WebregisterCommand extends SWCommand {
|
||||
public class WebpasswordCommand extends SWCommand {
|
||||
|
||||
public WebregisterCommand() {
|
||||
super("webregister", null, "web", "webpw");
|
||||
public WebpasswordCommand() {
|
||||
super("webpassword", null, "webpw", "web");
|
||||
}
|
||||
|
||||
|
||||
@Register(description = "WEB_USAGE")
|
||||
public void genericCommand(ProxiedPlayer player, String email) {
|
||||
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), email);
|
||||
public void genericCommand(ProxiedPlayer player, String password) {
|
||||
if(password.length() < 8) {
|
||||
ChatSender.of(player).system("WEB_PASSWORD_LENGTH");
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), password);
|
||||
pb.redirectErrorStream(true);
|
||||
try {
|
||||
Process regProcess = pb.start();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(regProcess.getInputStream()));
|
||||
String errorLine;
|
||||
boolean error = false;
|
||||
while((errorLine = reader.readLine()) != null){
|
||||
switch(errorLine){
|
||||
case "username_exists":
|
||||
Message.send("WEB_ALREADY", player);
|
||||
break;
|
||||
case "email_exists":
|
||||
Message.send("WEB_ALREADY_EMAIL", player);
|
||||
// SWException.log("Bungee", "Duplicate E-Mail", player.getName() + " " + args[0]);
|
||||
break;
|
||||
case "invalid_email":
|
||||
Message.send("WEB_NOT_EMAIL", player);
|
||||
break;
|
||||
case "email_updated":
|
||||
Message.send("WEB_EMAIL_REFRESH", player);
|
||||
break;
|
||||
default:
|
||||
Message.send("WEB_INTERNAL_ERROR", player);
|
||||
SWException.log("Bungee", "Unknown Wordpress User Creation Error", errorLine);
|
||||
if((errorLine = reader.readLine()) != null) {
|
||||
if ("updated".equals(errorLine)) {
|
||||
ChatSender.of(player).system("WEB_UPDATED");
|
||||
return;
|
||||
} else {
|
||||
throw new SecurityException("Could not create webaccount " + errorLine);
|
||||
}
|
||||
error = true;
|
||||
}
|
||||
|
||||
if(error)
|
||||
return;
|
||||
|
||||
Message.send("WEB_EMAIL_SEND", player);
|
||||
ChatSender.of(player).system("WEB_CREATED");
|
||||
} catch (IOException e) {
|
||||
Message.send("WEB_INTERNAL_ERROR", player);
|
||||
throw new SecurityException("Could not create webaccount", e);
|
||||
}
|
||||
}
|
@ -105,6 +105,9 @@ public class ConnectionListener extends BasicListener {
|
||||
@EventHandler
|
||||
public void onServerKickEvent(ServerKickEvent ev)
|
||||
{
|
||||
if(!ev.getPlayer().isConnected())
|
||||
return;
|
||||
|
||||
ServerInfo kickedFrom;
|
||||
|
||||
if (ev.getPlayer().getServer() != null){
|
||||
|
@ -22,7 +22,7 @@ package de.steamwar.bungeecore.sql;
|
||||
import com.google.gson.JsonParser;
|
||||
import de.steamwar.bungeecore.BungeeCore;
|
||||
import de.steamwar.bungeecore.Message;
|
||||
import de.steamwar.bungeecore.commands.WebregisterCommand;
|
||||
import de.steamwar.bungeecore.commands.WebpasswordCommand;
|
||||
import de.steamwar.bungeecore.listeners.ConnectionListener;
|
||||
import de.steamwar.bungeecore.network.NetworkSender;
|
||||
import de.steamwar.messages.ChatSender;
|
||||
@ -121,7 +121,7 @@ public class SteamwarUser {
|
||||
String userName = connection.getName();
|
||||
if (!user.userName.equals(userName)) {
|
||||
updateName.update(userName, user.id);
|
||||
WebregisterCommand.changeUsername(user.userName, userName);
|
||||
WebpasswordCommand.changeUsername(user.userName, userName);
|
||||
user.userName = userName;
|
||||
}
|
||||
} else {
|
||||
|
@ -498,13 +498,10 @@ UNIGNORE_NOT_IGNORED=§cYou are not ignoring this player.
|
||||
UNIGNORE_UNIGNORED=§7You ignored §e{0}§8.
|
||||
|
||||
#WebregisterCommand
|
||||
WEB_USAGE=§8/§7webregister §8[§eE-Mail§8]
|
||||
WEB_ALREADY=§cYou already have a webaccount.
|
||||
WEB_ALREADY_EMAIL=§cYou already used this E-Mail address on another account...
|
||||
WEB_NOT_EMAIL=§c[E-Mail], not [free text]!
|
||||
WEB_EMAIL_REFRESH=§aYour E-Mail was updated.
|
||||
WEB_INTERNAL_ERROR=§cAn internal error occurred, please contact a developer.
|
||||
WEB_EMAIL_SEND=§aAn E-Mail to reset your password has been sent.
|
||||
WEB_USAGE=§8/§7webpassword §8[§epassword§8]
|
||||
WEB_UPDATED=§7Your password was updated.
|
||||
WEB_CREATED=§7Your webaccount was created.
|
||||
WEB_PASSWORD_LENGTH=§cYour password is shorter than 8 characters.
|
||||
|
||||
#ChatListener
|
||||
CHAT_LIXFEL_ACTION_BAR=§4§lTechnical problems?
|
||||
|
@ -477,13 +477,10 @@ UNIGNORE_NOT_IGNORED=§cDu ignorierst diesen Spieler nicht.
|
||||
UNIGNORE_UNIGNORED=§7Du empfängst nun wieder Nachrichten von §e{0}§8.
|
||||
|
||||
#WebregisterCommand
|
||||
WEB_USAGE=§8/§7webregister §8[§eE-Mail§8]
|
||||
WEB_ALREADY=§cDu hast bereits einen Webaccount.
|
||||
WEB_ALREADY_EMAIL=§cDie E-Mail hast du bereits für einen anderen Account verwendet...
|
||||
WEB_NOT_EMAIL=§c[E-Mail], nicht [Freitext]!
|
||||
WEB_EMAIL_REFRESH=§aDeine E-Mail-Adresse wurde aktualisiert.
|
||||
WEB_INTERNAL_ERROR=§cEin interner Fehler ist aufgetreten, bitte wende dich an einen Developer.
|
||||
WEB_EMAIL_SEND=§aEine E-Mail zum Setzen des Passworts wurde gesendet.
|
||||
WEB_USAGE=§8/§7webpassword §8[§ePasswort§8]
|
||||
WEB_UPDATED=§7Dein Passwort wurde aktualisiert.
|
||||
WEB_CREATED=§7Dein Webaccount wurde erstellt.
|
||||
WEB_PASSWORD_LENGTH=§cDein Passwort ist kürzer als 8 Zeichen.
|
||||
|
||||
#ChatListener
|
||||
CHAT_LIXFEL_ACTION_BAR=§4§lTechnische Probleme?
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren