Show no Chat Reports (Next to chat and Server List for NoChatReportsMod)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
4cfb7830f9
Commit
a028db5462
@ -24,6 +24,7 @@ import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
|
|||||||
import de.steamwar.bungeecore.commands.*;
|
import de.steamwar.bungeecore.commands.*;
|
||||||
import de.steamwar.bungeecore.listeners.*;
|
import de.steamwar.bungeecore.listeners.*;
|
||||||
import de.steamwar.bungeecore.listeners.mods.*;
|
import de.steamwar.bungeecore.listeners.mods.*;
|
||||||
|
import de.steamwar.bungeecore.listeners.ping.PingListener;
|
||||||
import de.steamwar.bungeecore.network.BungeeNetworkHandler;
|
import de.steamwar.bungeecore.network.BungeeNetworkHandler;
|
||||||
import de.steamwar.bungeecore.network.NetworkReceiver;
|
import de.steamwar.bungeecore.network.NetworkReceiver;
|
||||||
import de.steamwar.bungeecore.sql.*;
|
import de.steamwar.bungeecore.sql.*;
|
||||||
@ -77,6 +78,7 @@ public class BungeeCore extends Plugin {
|
|||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
getProxy().registerChannel("sw:bridge");
|
getProxy().registerChannel("sw:bridge");
|
||||||
getProxy().registerChannel("fabricmodsender:mods");
|
getProxy().registerChannel("fabricmodsender:mods");
|
||||||
|
getProxy().registerChannel("nochatreports:sync");
|
||||||
|
|
||||||
setInstance(this);
|
setInstance(this);
|
||||||
MAIN_SERVER = ProxyServer.getInstance().getConfig().getListeners().stream().anyMatch(info -> ((InetSocketAddress) info.getSocketAddress()).getPort() == 25565);
|
MAIN_SERVER = ProxyServer.getInstance().getConfig().getListeners().stream().anyMatch(info -> ((InetSocketAddress) info.getSocketAddress()).getPort() == 25565);
|
||||||
@ -110,6 +112,7 @@ public class BungeeCore extends Plugin {
|
|||||||
new BrandListener();
|
new BrandListener();
|
||||||
new Fabric();
|
new Fabric();
|
||||||
new SubserverProtocolFixer();
|
new SubserverProtocolFixer();
|
||||||
|
new PingListener();
|
||||||
|
|
||||||
local = new Node.LocalNode();
|
local = new Node.LocalNode();
|
||||||
//new Node.RemoteNode("lx");
|
//new Node.RemoteNode("lx");
|
||||||
|
@ -55,11 +55,6 @@ public class Forge extends BasicListener {
|
|||||||
initialHandlerCh.setAccessible(true);
|
initialHandlerCh.setAccessible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onServerPing(ProxyPingEvent event) {
|
|
||||||
event.setResponse(new FMLPing(event.getResponse(), event.getConnection().getVersion()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onServerConnected(LoginEvent event) {
|
public static void onServerConnected(LoginEvent event) {
|
||||||
if(event.getConnection().getVersion() < 341) { //1.13+
|
if(event.getConnection().getVersion() < 341) { //1.13+
|
||||||
event.completeIntent(BungeeCore.get());
|
event.completeIntent(BungeeCore.get());
|
||||||
|
13
src/de/steamwar/bungeecore/listeners/ping/PingListener.java
Normale Datei
13
src/de/steamwar/bungeecore/listeners/ping/PingListener.java
Normale Datei
@ -0,0 +1,13 @@
|
|||||||
|
package de.steamwar.bungeecore.listeners.ping;
|
||||||
|
|
||||||
|
import de.steamwar.bungeecore.listeners.BasicListener;
|
||||||
|
import net.md_5.bungee.api.event.ProxyPingEvent;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
|
public class PingListener extends BasicListener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPing(ProxyPingEvent event) {
|
||||||
|
event.setResponse(new SteamWarServerPing(event.getResponse(), event.getConnection().getVersion()));
|
||||||
|
}
|
||||||
|
}
|
@ -1,32 +1,17 @@
|
|||||||
/*
|
package de.steamwar.bungeecore.listeners.ping;
|
||||||
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.listeners.mods;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.ServerPing;
|
import net.md_5.bungee.api.ServerPing;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class FMLPing extends ServerPing {
|
public class SteamWarServerPing extends ServerPing {
|
||||||
|
|
||||||
|
private final boolean preventsChatReports = true;
|
||||||
private final ForgeData forgeData;
|
private final ForgeData forgeData;
|
||||||
|
|
||||||
public FMLPing(ServerPing existing, int version) {
|
public SteamWarServerPing(ServerPing existing, int version) {
|
||||||
super(existing.getVersion(), existing.getPlayers(), existing.getDescriptionComponent(), existing.getFaviconObject());
|
super(existing.getVersion(), existing.getPlayers(), existing.getDescriptionComponent(), existing.getFaviconObject());
|
||||||
forgeData = new ForgeData(version);
|
forgeData = new ForgeData(version);
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren