fix State reaction
This commit is contained in:
@@ -44,13 +44,15 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
|
||||
channel.attr(State.ATTR_STATE).set(packet.getNextState());
|
||||
}
|
||||
|
||||
Config config = Main.appContext.getBean("config", Config.class); //FIXME
|
||||
StatusResponse pkt = new StatusResponse();
|
||||
pkt.setDescription(config.getDescriptionServer());
|
||||
pkt.setMaxOnline(config.getMaxPlayers());
|
||||
pkt.setFaviconBase64(config.getFaviconBase64());
|
||||
if (packet.getNextState().equals(State.STATUS)) {
|
||||
Config config = Main.appContext.getBean("config", Config.class); //FIXME
|
||||
StatusResponse pkt = new StatusResponse();
|
||||
pkt.setDescription(config.getDescriptionServer());
|
||||
pkt.setMaxOnline(config.getMaxPlayers());
|
||||
pkt.setFaviconBase64(config.getFaviconBase64());
|
||||
|
||||
channel.writeAndFlush(pkt);
|
||||
channel.writeAndFlush(pkt);
|
||||
}
|
||||
}
|
||||
|
||||
public void onPingPacket(Channel channel, PingPacket packet) {
|
||||
|
||||
Reference in New Issue
Block a user