From c7f16247ca337779e9261189957efe27787ca7c9 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 28 May 2022 13:08:50 +0200 Subject: [PATCH] Fix TeamCommand tp no message --- src/de/steamwar/bungeecore/commands/TeamCommand.java | 7 ++++++- src/de/steamwar/messages/BungeeCore.properties | 1 + src/de/steamwar/messages/BungeeCore_de.properties | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index 2c58296..73bf19d 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -25,6 +25,7 @@ import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.inventory.SWListInv; import de.steamwar.bungeecore.sql.*; import de.steamwar.messages.ChatSender; +import io.netty.channel.ConnectTimeoutException; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; @@ -586,7 +587,11 @@ public class TeamCommand extends BasicCommand { ProxyServer.getInstance().getServers().put(info.getName(), info); return info; }); - player.connect(serverInfo); + player.connect(serverInfo, (success, error) -> { + if (error instanceof ConnectTimeoutException) { + Message.send("TEAM_TIMEOUT", player); + } + }); } private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 95a1d5e..5036164 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -478,6 +478,7 @@ TEAM_SERVER_SET=§7You changed the team server address§8! TEAM_SERVER_PORT_INVALID=§cInvalid port number. TEAM_SERVER_ADDRESS_INVALID=§cInvalid address. TEAM_NO_ADDRESS=§cNo team server address set. +TEAM_TIMEOUT=§cTeam server may be offline. TEAM_TP_NO_TEAM=§cUnknown team. #TpCommand diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 26d21bc..987fed1 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -457,6 +457,7 @@ TEAM_SERVER_SET=§7Du hast die Teamserveradresse geändert§8! TEAM_SERVER_PORT_INVALID=§cUnmögliche Portnummer. TEAM_SERVER_ADDRESS_INVALID=§cUngültige Adresse. TEAM_NO_ADDRESS=§cTeamserveradresse nicht gesetzt. +TEAM_TIMEOUT=§cTeamserver scheint offline zu sein. TEAM_TP_NO_TEAM=§cUnbekanntes Team. #TpCommand