diff --git a/pom.xml b/pom.xml index 03afb00..a3c934a 100644 --- a/pom.xml +++ b/pom.xml @@ -45,6 +45,7 @@ + bungeecore diff --git a/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java b/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java index 0594939..d43cc6d 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java +++ b/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java @@ -1,5 +1,6 @@ package de.steamwar.bungeecore.listeners.mods; +import com.google.gson.JsonObject; import com.google.gson.stream.JsonReader; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.listeners.BasicListener; @@ -32,6 +33,7 @@ public class LabyMod extends BasicListener { event.setCancelled(true); labyModUsers.add((ProxiedPlayer) sender); + updateGameInfo((ProxiedPlayer) sender); byte[] data = event.getData(); ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> runAsync(data, (ProxiedPlayer) sender)); @@ -63,6 +65,17 @@ public class LabyMod extends BasicListener { return new Pair<>(varInt.getValue()+varInt.getKey(), new String(Arrays.copyOfRange(array, startPos, startPos + varInt.getValue()), StandardCharsets.UTF_8)); } + private void updateGameInfo(ProxiedPlayer proxiedPlayer) { + JsonObject obj = new JsonObject(); + obj.addProperty("hasGame", true); + obj.addProperty("game_mode", "steamwar.de"); + obj.addProperty("game_startTime", 0); + obj.addProperty("game_endTime", 0); + String output = "{ \"hasGame\" : \"true\", \"game_mode\" : \"steamwar.de\", \"game_startTime\" : \"0\", \"game_endTime\" : \"0\" }"; + + proxiedPlayer.sendData("LMC", output.getBytes()); + } + private static class InfoPacket{ String version = null; Feature ccp = null;