Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 61dd21f317 | |||
| 0f3a020591 | |||
| c4e67076f8 | |||
| 0f79971ea6 |
@@ -65,6 +65,7 @@ Bearbeiten Sie die `plugins/GlobalChat/welcome.yml` (Optional).
|
|||||||
|
|
||||||
| Befehl | Beschreibung | Berechtigung |
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|--------|--------------|--------------|
|
|--------|--------------|--------------|
|
||||||
|
| `/clearchat, cc` | Löscht den Chatverlauf | `globalchat.clear` |
|
||||||
| `/togglechat` | Schaltet den globalen Chat für den Spieler ein/aus (wichtig für Lands/Quests). | Spieler |
|
| `/togglechat` | Schaltet den globalen Chat für den Spieler ein/aus (wichtig für Lands/Quests). | Spieler |
|
||||||
| `/support <Nachricht>` | Sendet eine Anfrage an das gesamte Team. | Spieler |
|
| `/support <Nachricht>` | Sendet eine Anfrage an das gesamte Team. | Spieler |
|
||||||
| `/reply <Nachricht>` | Antwortet auf eine Support-Anfrage. | Spieler |
|
| `/reply <Nachricht>` | Antwortet auf eine Support-Anfrage. | Spieler |
|
||||||
@@ -79,6 +80,7 @@ Bearbeiten Sie die `plugins/GlobalChat/welcome.yml` (Optional).
|
|||||||
| `globalchat.reload` | OP | Erlaubt das Neuladen der Konfiguration. |
|
| `globalchat.reload` | OP | Erlaubt das Neuladen der Konfiguration. |
|
||||||
| `globalchat.mute` | OP | Erlaubt das Schalten des globalen Mutes. |
|
| `globalchat.mute` | OP | Erlaubt das Schalten des globalen Mutes. |
|
||||||
| `globalchat.bypass` | OP | Erlaubt das Schreiben trotz globalem Mute. |
|
| `globalchat.bypass` | OP | Erlaubt das Schreiben trotz globalem Mute. |
|
||||||
|
| `globalchat.clear` | OP | Löscht den Chatverlauf. |
|
||||||
|
|
||||||
## ℹ️ Technical Info (Secure Chat Fix)
|
## ℹ️ Technical Info (Secure Chat Fix)
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -8,7 +8,7 @@
|
|||||||
<!-- WICHTIG: Dies sind deine Projektdaten für 'globalchat' -->
|
<!-- WICHTIG: Dies sind deine Projektdaten für 'globalchat' -->
|
||||||
<groupId>de.viper</groupId>
|
<groupId>de.viper</groupId>
|
||||||
<artifactId>globalchat</artifactId>
|
<artifactId>globalchat</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>GlobalChat</name>
|
<name>GlobalChat</name>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import java.util.regex.Pattern;
|
|||||||
public class GlobalChat extends Plugin implements Listener {
|
public class GlobalChat extends Plugin implements Listener {
|
||||||
|
|
||||||
private static final String CHANNEL_CONTROL = "global:control";
|
private static final String CHANNEL_CONTROL = "global:control";
|
||||||
private static final String CHANNEL_CHAT = "global:chat"; // Kanal für Chat-Relay
|
private static final String CHANNEL_CHAT = "global:chat"; // Kanal für Chat-Relay (legacy)
|
||||||
|
|
||||||
private List<String> badWords = new ArrayList<>();
|
private List<String> badWords = new ArrayList<>();
|
||||||
private File logFolder;
|
private File logFolder;
|
||||||
@@ -122,7 +122,7 @@ public class GlobalChat extends Plugin implements Listener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// Plugin channels registrieren
|
// Plugin channels registrieren (legacy, werden nicht mehr für Chat-Relay genutzt)
|
||||||
try {
|
try {
|
||||||
getProxy().registerChannel(CHANNEL_CONTROL);
|
getProxy().registerChannel(CHANNEL_CONTROL);
|
||||||
getProxy().registerChannel(CHANNEL_CHAT);
|
getProxy().registerChannel(CHANNEL_CHAT);
|
||||||
@@ -138,7 +138,7 @@ public class GlobalChat extends Plugin implements Listener {
|
|||||||
if (!configFile.exists()) {
|
if (!configFile.exists()) {
|
||||||
getLogger().info("bungee.yml nicht gefunden. Erstelle Standard...");
|
getLogger().info("bungee.yml nicht gefunden. Erstelle Standard...");
|
||||||
try (InputStream in = getResourceAsStream("bungee.yml")) {
|
try (InputStream in = getResourceAsStream("bungee.yml")) {
|
||||||
Files.copy(in, configFile.toPath());
|
if (in != null) Files.copy(in, configFile.toPath());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -270,14 +270,10 @@ public class GlobalChat extends Plugin implements Listener {
|
|||||||
// Global Broadcast Helper
|
// Global Broadcast Helper
|
||||||
// ===========================
|
// ===========================
|
||||||
private void broadcastGlobal(TextComponent component) {
|
private void broadcastGlobal(TextComponent component) {
|
||||||
String jsonMessage = ComponentSerializer.toString(component);
|
// KORREKTUR: Sende als System/Plugin-Nachricht an alle verbundenen Spieler.
|
||||||
for (ServerInfo server : getProxy().getServers().values()) {
|
// Damit bleibt die Anzeige identisch, aber es werden keine unsignierten Player-Chat-Pakete erzeugt.
|
||||||
if (server.getPlayers().isEmpty()) continue;
|
for (ProxiedPlayer p : getProxy().getPlayers()) {
|
||||||
try {
|
p.sendMessage(component);
|
||||||
server.sendData(CHANNEL_CHAT, jsonMessage.getBytes(StandardCharsets.UTF_8));
|
|
||||||
} catch (Exception ex) {
|
|
||||||
getLogger().warning("Konnte Nachricht nicht an " + server.getName() + " senden.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,7 +348,7 @@ public class GlobalChat extends Plugin implements Listener {
|
|||||||
|
|
||||||
String chatOut = out.toString();
|
String chatOut = out.toString();
|
||||||
|
|
||||||
// NEU: Nachricht erstellen und an alle Server senden (via Helper)
|
// NEU: Nachricht erstellen und an alle Spieler senden (als Systemnachricht)
|
||||||
TextComponent chatComponent = new TextComponent(chatOut);
|
TextComponent chatComponent = new TextComponent(chatOut);
|
||||||
broadcastGlobal(chatComponent);
|
broadcastGlobal(chatComponent);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: GlobalChatSpigot
|
name: GlobalChatSpigot
|
||||||
main: de.viper.globalchat.GlobalChatSpigot
|
main: de.viper.globalchat.GlobalChatSpigot
|
||||||
version: 1.4
|
version: 1.5
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
description: Spigot helper for GlobalChat Bungee (sends coords, handles teleport requests)
|
description: Spigot helper for GlobalChat Bungee (sends coords, handles teleport requests)
|
||||||
authors: [M_Viper]
|
authors: [M_Viper]
|
||||||
|
|||||||
Reference in New Issue
Block a user