mirror of https://github.com/LOOHP/Limbo.git
Changed naming schem. Added message for Legacy Ping
This commit is contained in:
parent
c711f8cea6
commit
620327d64d
1
pom.xml
1
pom.xml
|
|
@ -49,6 +49,7 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
<finalName>${project.artifactId}-${project.version}-1.16.1</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ public class Console implements CommandSender {
|
||||||
out.println(message);
|
out.println(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
protected void run() {
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -172,10 +172,11 @@ public class ClientConnection extends Thread {
|
||||||
if (handShakeSize == 0xFE) {
|
if (handShakeSize == 0xFE) {
|
||||||
state = ClientState.LEGACY;
|
state = ClientState.LEGACY;
|
||||||
output.writeByte(255);
|
output.writeByte(255);
|
||||||
|
String str = client_socket.getInetAddress().getHostName() + ":" + client_socket.getPort();
|
||||||
|
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Legacy Status has pinged");
|
||||||
ServerProperties p = Limbo.getInstance().getServerProperties();
|
ServerProperties p = Limbo.getInstance().getServerProperties();
|
||||||
StatusPingEvent event = (StatusPingEvent) Limbo.getInstance().getEventsManager().callEvent(new StatusPingEvent(this, p.getVersionString(), p.getProtocol(), ComponentSerializer.parse(p.getMotdJson()), p.getMaxPlayers(), Limbo.getInstance().getPlayers().size(), p.getFavicon().orElse(null)));
|
StatusPingEvent event = (StatusPingEvent) Limbo.getInstance().getEventsManager().callEvent(new StatusPingEvent(this, p.getVersionString(), p.getProtocol(), ComponentSerializer.parse(p.getMotdJson()), p.getMaxPlayers(), Limbo.getInstance().getPlayers().size(), p.getFavicon().orElse(null)));
|
||||||
String response = Limbo.getInstance().buildLegacyPingResponse(event.getVersion(), event.getMotd(), event.getMaxPlayers(), event.getPlayersOnline());
|
String response = Limbo.getInstance().buildLegacyPingResponse(event.getVersion(), event.getMotd(), event.getMaxPlayers(), event.getPlayersOnline());
|
||||||
System.out.println(response);
|
|
||||||
byte[] bytes = response.getBytes(StandardCharsets.UTF_16BE);
|
byte[] bytes = response.getBytes(StandardCharsets.UTF_16BE);
|
||||||
output.writeShort(response.length());
|
output.writeShort(response.length());
|
||||||
output.write(bytes);
|
output.write(bytes);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue