untested LabyModToDiscord
Dieser Commit ist enthalten in:
Ursprung
1ad95dd80d
Commit
53d44cb628
1
pom.xml
1
pom.xml
@ -45,6 +45,7 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>bungeecore</finalName>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
@ -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;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren