SteamWar/BungeeCore
Archiviert
13
2

Update some stuff #339

Zusammengeführt
Lixfel hat 9 Commits von FabricModStuff nach master 2022-04-09 20:58:27 +02:00 zusammengeführt
Nur Änderungen aus Commit 6b8d46d75a werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -51,8 +51,6 @@ public class Fabric extends BasicListener {
private static final Map<ProxiedPlayer, Integer> checkedPlayers = new HashMap<>();
private static final Map<ProxiedPlayer, Long> expectPluginMessage = new HashMap<>();
private static final Object OBJECT = new Object();
{
neededMods.add("java");
neededMods.add("minecraft");
@ -60,7 +58,7 @@ public class Fabric extends BasicListener {
neededMods.add("steamwarmodsender");
BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
synchronized (OBJECT) {
synchronized (expectPluginMessage) {
for (Map.Entry<ProxiedPlayer, Long> entry : expectPluginMessage.entrySet()) {
if (System.currentTimeMillis() - entry.getValue() > TimeUnit.SECONDS.toMillis(20)) {
banPlayer(SteamwarUser.get(entry.getKey()), entry.getKey());
@ -84,7 +82,7 @@ public class Fabric extends BasicListener {
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if (!checkedPlayers.containsKey(player)) {
synchronized (OBJECT) {
synchronized (expectPluginMessage) {
if (expectPluginMessage.containsKey(player)) {
banPlayer(user, player);
return;
@ -156,7 +154,7 @@ public class Fabric extends BasicListener {
@EventHandler
public void onServerSwitchEvent(ServerSwitchEvent e) {
if (e.getFrom() == null) return;
synchronized (OBJECT) {
synchronized (expectPluginMessage) {
expectPluginMessage.put(e.getPlayer(), System.currentTimeMillis());
}
}
@ -189,8 +187,8 @@ public class Fabric extends BasicListener {
}
public static void remove(ProxiedPlayer player) {
synchronized (OBJECT) {
checkedPlayers.remove(player);
checkedPlayers.remove(player);
synchronized (expectPluginMessage) {
expectPluginMessage.remove(player);
}
}