Merge remote-tracking branch 'origin/arena_merging_2.0' into arena_merging_2.0
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Commit
cae6427c6a
@ -85,13 +85,9 @@ public class ErrorLogger extends Handler {
|
||||
|
||||
static {
|
||||
List<String> contains = new ArrayList<>();
|
||||
contains.add("ServerConnector");
|
||||
contains.add("InitialHandler");
|
||||
contains.add("UpstreamBridge");
|
||||
contains.add("DownstreamBridge");
|
||||
contains.add(" took ");
|
||||
contains.add("No client connected for pending server!");
|
||||
contains.add("Error authenticating ");
|
||||
contains.add("read timed out");
|
||||
contains.add("Connection reset by peer");
|
||||
ignoreContains = Collections.unmodifiableList(contains);
|
||||
}
|
||||
}
|
||||
|
@ -59,23 +59,27 @@ public class EventStarter implements Runnable {
|
||||
|
||||
EventFight next;
|
||||
while((next = nextFight(fights)) != null){
|
||||
if(!BungeeCore.EVENT_MODE && Event.get(next.getEventID()).spectateSystem())
|
||||
break; //Don't start EventServer if not the event bungee
|
||||
|
||||
Team blue = Team.get(next.getTeamBlue());
|
||||
Team red = Team.get(next.getTeamRed());
|
||||
ServerStarter starter = new ServerStarter().event(next);
|
||||
|
||||
ProxiedPlayer leiter = ProxyServer.getInstance().getPlayer(SteamwarUser.get(next.getKampfleiter()).getUuid());
|
||||
if(leiter != null)
|
||||
starter.send(leiter);
|
||||
//Don't start EventServer if not the event bungee
|
||||
if(BungeeCore.EVENT_MODE || !Event.get(next.getEventID()).spectateSystem()) {
|
||||
ServerStarter starter = new ServerStarter().event(next);
|
||||
|
||||
Subserver subserver = starter.start();
|
||||
ProxiedPlayer leiter = ProxyServer.getInstance().getPlayer(SteamwarUser.get(next.getKampfleiter()).getUuid());
|
||||
if(leiter != null)
|
||||
starter.send(leiter);
|
||||
|
||||
eventServer.put(blue.getTeamId(), subserver);
|
||||
eventServer.put(red.getTeamId(), subserver);
|
||||
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
|
||||
Subserver subserver = starter.start();
|
||||
|
||||
eventServer.put(blue.getTeamId(), subserver);
|
||||
eventServer.put(red.getTeamId(), subserver);
|
||||
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
|
||||
} else {
|
||||
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/spectate"), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.OnlineStatus;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction;
|
||||
import net.dv8tion.jda.api.utils.MemberCachePolicy;
|
||||
@ -93,9 +94,13 @@ public class SteamwarDiscordBot {
|
||||
EventManager.update();
|
||||
SchematicsManager.update();
|
||||
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
|
||||
activity();
|
||||
EventManager.update();
|
||||
SchematicsManager.update();
|
||||
try {
|
||||
activity();
|
||||
EventManager.update();
|
||||
SchematicsManager.update();
|
||||
} catch (ErrorResponseException e) {
|
||||
//ignored
|
||||
}
|
||||
}, 30, 30, TimeUnit.SECONDS);
|
||||
DiscordRolesMessage.sendMessage();
|
||||
DiscordRulesMessage.sendMessage();
|
||||
|
@ -36,6 +36,7 @@ import net.md_5.bungee.config.Configuration;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
@ -127,13 +128,18 @@ public class CheckCommand extends BasicCommand {
|
||||
|
||||
for (SchematicNode schematic : schematicList) {
|
||||
CheckSession current = currentSchems.get(schematic.getId());
|
||||
long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime();
|
||||
String color = waitedMillis > 14400000 ? (waitedMillis > 86400000 ? "§c" : "§e") : "§a";
|
||||
String waitTime = Timestamp.from(Instant.ofEpochMilli(waitedMillis)).toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("CHECK_LIST_WAIT", player, color)));
|
||||
if (current == null) {
|
||||
Message.sendPrefixless("CHECK_LIST_TO_CHECK", player,
|
||||
waitTime,
|
||||
Message.parse("CHECK_LIST_TO_CHECK_HOVER", player),
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check schematic " + schematic.getId()),
|
||||
schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName());
|
||||
} else {
|
||||
Message.sendPrefixless("CHECK_LIST_CHECKING", player,
|
||||
waitTime,
|
||||
Message.parse("CHECK_LIST_CHECKING_HOVER", player),
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + current.checker.getName()),
|
||||
schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName(), current.checker.getName());
|
||||
|
@ -174,7 +174,7 @@ public class ChatListener extends BasicListener {
|
||||
public static void discordChat(SteamwarUser user, String message){
|
||||
String name = "§r" + user.getUserName() + "§r";
|
||||
if (user.getUserGroup() != UserGroup.Member) {
|
||||
name = user.getUserGroup().getColorCode() + user.getUserGroup().name() + " " + user.getUserName() + "§r";
|
||||
name = user.getUserGroup().getColorCode() + user.getUserGroup().getChatPrefix() + " " + user.getUserName() + "§r";
|
||||
}
|
||||
String chatcolor = user.getUserGroup().getChatColorCode();
|
||||
|
||||
|
@ -26,13 +26,13 @@ public class Season {
|
||||
|
||||
public static int getSeason() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int yearIndex = calendar.get(Calendar.MONTH) / 3;
|
||||
int yearIndex = calendar.get(Calendar.MONTH) / 4;
|
||||
return (calendar.get(Calendar.YEAR) * 3 + yearIndex);
|
||||
}
|
||||
|
||||
public static String getSeasonStart() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
return calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) / 3 * 3 + 1) + "-1";
|
||||
return calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) / 4 * 3 + 1) + "-1";
|
||||
}
|
||||
|
||||
public static String convertSeasonToString(int season){
|
||||
|
@ -24,12 +24,12 @@ import java.util.stream.Collectors;
|
||||
|
||||
public enum UserGroup {
|
||||
|
||||
Admin("§4", "§e", "Admin", true, true, true, true),
|
||||
Developer("§3", "§f", "Dev", true, true, true, true),
|
||||
Moderator("§c", "§f", "Mod", true, true, true, true),
|
||||
Supporter("§9", "§f", "Sup", false, true, true, true),
|
||||
Builder("§2", "§f", "Arch", false, true, false, true),
|
||||
YouTuber("§5", "§f", "YT", false, false, false, true),
|
||||
Admin("§4", "§e", "Obererzieher", true, true, true, true),
|
||||
Developer("§3", "§f", "Seelsorger", true, true, true, true),
|
||||
Moderator("§c", "§f", "Schichtleiter", true, true, true, true),
|
||||
Supporter("§9", "§f", "Kindergärtner", false, true, true, true),
|
||||
Builder("§2", "§f", "Hausmeister", false, true, false, true),
|
||||
YouTuber("§5", "§f", "Reporter", false, false, false, true),
|
||||
Member("§7", "§7", "", false, false, false, false);
|
||||
|
||||
private final String colorCode;
|
||||
|
@ -245,9 +245,10 @@ CHECK_HELP_NEXT=§8/§7check next §8- §7Nächste Prüffrage§8/§7freigeben
|
||||
CHECK_HELP_DECLINE=§8/§7check decline §8[§eGrund§8] - §7Schematic ablehnen
|
||||
CHECK_HELP_CANCEL=§8/§7check cancel §8- §7Bricht den Prüfvorgang ab
|
||||
CHECK_LIST_HEADER=§e§lZu prüfen sind {0} Schematics
|
||||
CHECK_LIST_TO_CHECK=§8{0} §7{1} §e{2}
|
||||
CHECK_LIST_TO_CHECK={0} §8{1} §7{2} §e{3}
|
||||
CHECK_LIST_WAIT={0}d HH:mm
|
||||
CHECK_LIST_TO_CHECK_HOVER=§eSchematic prüfen
|
||||
CHECK_LIST_CHECKING=§8{0} §7{1} §e{2} §7wird geprüft von §e{3}
|
||||
CHECK_LIST_CHECKING={0} §8{1} §7{2} §e{3} §7wird geprüft von §e{4}
|
||||
CHECK_LIST_CHECKING_HOVER=§eZum Prüfer
|
||||
CHECK_SCHEMATIC_ALREADY_CHECKING=§cDu prüfst schon eine Schematic!
|
||||
CHECK_SCHEMATIC_OWN=§cDu kannst nicht deine eigenen Schematics prüfen.
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren