SteamWar/BungeeCore
Archiviert
13
2

Packet System + Bungee GUI #111

Manuell gemergt
YoyoNow hat 12 Commits von packet-system nach master 2020-09-26 09:21:46 +02:00 zusammengeführt
15 geänderte Dateien mit 262 neuen und 81 gelöschten Zeilen
Nur Änderungen aus Commit 70071893fa werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -127,8 +127,6 @@ public class BungeeCore extends Plugin {
new IgnoreCommand();
new UnIgnoreCommand();
new TestCommand();
new EventStarter();
new Broadcaster();
new SessionManager();
@ -217,28 +215,7 @@ public class BungeeCore extends Plugin {
ProxyServer.getInstance().stop("Could not save conig file");
return;
}
try {
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
}
catch (YAMLException e) {
e.printStackTrace();
CHAT_PREFIX = "§eSteam§8War» §r";
WORLD_FOLDER = "/home/minecraft/userworlds/";
BAUWELT_PROTOTYP = "/home/minecraft/backbone/server/UserBau/Bauwelt2";
LOBBY_SERVER = "Lobby";
USERWORLDS15 = "/home/minecraft/userworlds15/";
BAUWELT15 = "/home/minecraft/backbone/server/Bau15/Bauwelt";
Broadcaster.setBroadCastMsgs(new String[] {""});
Persistent.setChatPrefix(CHAT_PREFIX);
Persistent.setLobbyServer(LOBBY_SERVER);
SQL.connect(
"jdbc:mysql://127.0.0.1:3306/developer",
Password.getUsername(),
Password.getPassword()
);
return;
}
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
}catch(IOException e){
log("Could not save/load config.yml", e);
ProxyServer.getInstance().stop();

Datei anzeigen

@ -20,6 +20,8 @@
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.comms.packets.inventory.SWInventory;
import de.steamwar.bungeecore.comms.packets.inventory.SWItem;
import de.steamwar.bungeecore.sql.BauweltMember;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ProxyServer;
@ -226,32 +228,39 @@ public class BauCommand {
}
private static void delete(ProxiedPlayer p, String[] command){
if(bau15(p, command, 2)){
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt.");
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
subserver.stop();
break;
SWInventory inventory = new SWInventory(p, 9, "§eDelete Confirm");
Veraltet
Review

"Wirklich Welt löschen?" fände ich besser.

"Wirklich Welt löschen?" fände ich besser.
inventory.addItem(1, new SWItem(1, "§cDecline", 1), click -> {
Veraltet
Review

Noch sind wir nicht multilingual, und den Knopf "Abbrechen" bitte auf Position 9 packen, dass Abbrechen ganz rechts ist, und "Löschen" links ist.

Noch sind wir nicht multilingual, und den Knopf "Abbrechen" bitte auf Position 9 packen, dass Abbrechen ganz rechts ist, und "Löschen" links ist.
Veraltet
Review

Bitte Abbrechen auf Position 8 und Löschen auf Position 1 (Das eine möchtest du machen, das andere ist optional). Löschen sollte grün sein und abbrechen rot oder alternativ Löschen rot und Abbrechen hellgrau. (Weiß nicht die Farbcodes auswendig, ob die so passend sind.

Bitte Abbrechen auf Position 8 und Löschen auf Position 1 (Das eine möchtest du machen, das andere ist optional). Löschen sollte grün sein und abbrechen rot oder alternativ Löschen rot und Abbrechen hellgrau. (Weiß nicht die Farbcodes auswendig, ob die so passend sind.
inventory.close();
});
inventory.addItem(7, new SWItem(7, "§aAccept", 10), click -> {
if(bau15(p, command, 2)){
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt.");
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
subserver.stop();
break;
}
}
}
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
File directory = new File(BungeeCore.USERWORLDS15 + user.getId());
del(directory);
});
}else{
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt.");
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
subserver.stop();
break;
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
File directory = new File(BungeeCore.USERWORLDS15 + user.getId());
del(directory);
});
}else{
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt.");
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
subserver.stop();
break;
}
}
}
File directory = new File(BungeeCore.WORLD_FOLDER + p.getUniqueId().toString());
del(directory);
});
}
File directory = new File(BungeeCore.WORLD_FOLDER + p.getUniqueId().toString());
Veraltet
Review

Evtl. kann man hier den Code so refactoren, dass nur die Zeile hier 2* abgewandelt vorkommt und der Rest nur einmal ausgeführt wird. Dann haben wir weniger Codedopplung (ich weiß, ich habe den Code mit der Codedopplung so entwickelt, aber das sollte man ja nicht weiter fördern :).

Evtl. kann man hier den Code so refactoren, dass nur die Zeile hier 2* abgewandelt vorkommt und der Rest nur einmal ausgeführt wird. Dann haben wir weniger Codedopplung (ich weiß, ich habe den Code mit der Codedopplung so entwickelt, aber das sollte man ja nicht weiter fördern :).
del(directory);
});
}
});
inventory.open();
}
private static void testarena(ProxiedPlayer p, String[] command){

Datei anzeigen

@ -1,33 +0,0 @@
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.comms.packets.inventory.SWInventory;
import de.steamwar.bungeecore.comms.packets.inventory.SWItem;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class TestCommand extends BasicCommand {
public TestCommand() {
super("test", null);
}
@Override
public void execute(CommandSender commandSender, String[] strings) {
if(!(commandSender instanceof ProxiedPlayer))
return;
SWInventory inventory = new SWInventory((ProxiedPlayer) commandSender, 3*9, "Test Inventory");
SWItem item = new SWItem("DIRT1", 13, "§e§lTest Item");
item.setSkullOwner(commandSender.getName());
for (ProxiedPlayer player:
((ProxiedPlayer) commandSender).getServer().getInfo().getPlayers()) {
item.addLore("§6" + player.getDisplayName());
}
item.setEnchanted(true);
item.setCallback(click -> {
inventory.close();
commandSender.sendMessage("TEST!!! FJOnbds");
});
inventory.addItem(item);
inventory.open();
}
}

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms;
import com.google.common.io.ByteArrayDataOutput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms;
import com.google.common.io.ByteArrayDataInput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms;
import com.google.common.io.ByteArrayDataInput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.handlers;
import com.google.common.io.ByteArrayDataInput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets.inventory;
Veraltet
Review

Jetzt werden die Paketverschachtelungen aber langsam wirklich deep. Evtl. einfach im Paket de.steamwar.bungeecore.inventory?

Jetzt werden die Paketverschachtelungen aber langsam wirklich deep. Evtl. einfach im Paket de.steamwar.bungeecore.inventory?
public interface InvCallback {

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets.inventory;
import de.steamwar.bungeecore.comms.handlers.InventoryCallbackHandler;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets.inventory;
import com.google.gson.JsonArray;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets.inventory;
import de.steamwar.bungeecore.sql.Schematic;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.sql;
import java.sql.ResultSet;