SteamWar/BungeeCore
Archiviert
13
2

Fix TeamCommand tp no message
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-05-28 13:29:18 +02:00
Ursprung f45ed11a59
Commit 300a2ef502
4 geänderte Dateien mit 13 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -88,6 +88,7 @@ public class ErrorLogger extends Handler {
contains.add("read timed out"); contains.add("read timed out");
contains.add("Connection reset by peer"); contains.add("Connection reset by peer");
contains.add("No client connected for pending server"); contains.add("No client connected for pending server");
contains.add("Error occurred processing connection for");
ignoreContains = Collections.unmodifiableList(contains); ignoreContains = Collections.unmodifiableList(contains);
} }
} }

Datei anzeigen

@ -26,6 +26,8 @@ import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.sql.*; import de.steamwar.bungeecore.sql.*;
import de.steamwar.messages.ChatSender; import de.steamwar.messages.ChatSender;
import io.netty.channel.ConnectTimeoutException; import io.netty.channel.ConnectTimeoutException;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.UserConnection;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
@ -35,6 +37,7 @@ import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ServerConnectEvent;
import java.net.*; import java.net.*;
import java.time.Instant; import java.time.Instant;
@ -587,18 +590,13 @@ public class TeamCommand extends BasicCommand {
ProxyServer.getInstance().getServers().put(info.getName(), info); ProxyServer.getInstance().getServers().put(info.getName(), info);
return info; return info;
}); });
try { ((UserConnection) player).connect(serverInfo, (success, error) -> {
player.connect(serverInfo, (success, error) -> { if (error instanceof ConnectTimeoutException) {
if (error != null) { Message.send("TEAM_TIMEOUT", player);
error.printStackTrace(); } else if (error != null) {
} Message.send("TEAM_UNKNOWN", player);
if (error instanceof ConnectTimeoutException) { }
Message.send("TEAM_TIMEOUT", player); }, false, ServerConnectEvent.Reason.PLUGIN, BungeeCord.getInstance().getConfig().getServerConnectTimeout(), false);
}
});
} catch (Exception e) {
e.printStackTrace();
}
} }
private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){

Datei anzeigen

@ -479,6 +479,7 @@ TEAM_SERVER_PORT_INVALID=§cInvalid port number.
TEAM_SERVER_ADDRESS_INVALID=§cInvalid address. TEAM_SERVER_ADDRESS_INVALID=§cInvalid address.
TEAM_NO_ADDRESS=§cNo team server address set. TEAM_NO_ADDRESS=§cNo team server address set.
TEAM_TIMEOUT=§cTeam server may be offline. TEAM_TIMEOUT=§cTeam server may be offline.
TEAM_UNKNOWN=§cAn unexpected error occurred while connecting to the team server.
TEAM_TP_NO_TEAM=§cUnknown team. TEAM_TP_NO_TEAM=§cUnknown team.
#TpCommand #TpCommand

Datei anzeigen

@ -458,6 +458,7 @@ TEAM_SERVER_PORT_INVALID=§cUnmögliche Portnummer.
TEAM_SERVER_ADDRESS_INVALID=§cUngültige Adresse. TEAM_SERVER_ADDRESS_INVALID=§cUngültige Adresse.
TEAM_NO_ADDRESS=§cTeamserveradresse nicht gesetzt. TEAM_NO_ADDRESS=§cTeamserveradresse nicht gesetzt.
TEAM_TIMEOUT=§cTeamserver scheint offline zu sein. TEAM_TIMEOUT=§cTeamserver scheint offline zu sein.
TEAM_UNKNOWN=§cEin unwerwarteter Fehler ist aufgetreten beim verbinden zum Teamserver.
TEAM_TP_NO_TEAM=§cUnbekanntes Team. TEAM_TP_NO_TEAM=§cUnbekanntes Team.
#TpCommand #TpCommand