Implement server ping method.

This commit is contained in:
md_5
2013-01-23 16:49:05 +11:00
parent f22a999fd7
commit 8021f58451
6 changed files with 61 additions and 21 deletions

View File

@@ -25,9 +25,9 @@ public class ServerPing
/**
* Current amount of players on the server.
*/
private final String currentPlayers;
private final int currentPlayers;
/**
* Max amount of players the server will allow.
*/
private final String maxPlayers;
private final int maxPlayers;
}

View File

@@ -1,30 +1,27 @@
package net.md_5.bungee.api.event;
import java.net.InetSocketAddress;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.plugin.Event;
/**
* Called when the proxy is pinged with packet 0xFE from the server list.
*/
@Data
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class ProxyPingEvent extends Event
{
/**
* The address of the user pinging.
* The connection asking for a ping response.
*/
private final InetSocketAddress remoteAddress;
/**
* The data corresponding to the server which received this ping.
*/
private final ListenerInfo server;
private final PendingConnection connection;
/**
* The data to respond with.
*/