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