Archived
0

fix State reaction

This commit is contained in:
2018-04-09 00:49:27 +03:00
parent ad742a6ae8
commit e8337ed0ea

View File

@@ -44,13 +44,15 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
channel.attr(State.ATTR_STATE).set(packet.getNextState()); channel.attr(State.ATTR_STATE).set(packet.getNextState());
} }
Config config = Main.appContext.getBean("config", Config.class); //FIXME if (packet.getNextState().equals(State.STATUS)) {
StatusResponse pkt = new StatusResponse(); Config config = Main.appContext.getBean("config", Config.class); //FIXME
pkt.setDescription(config.getDescriptionServer()); StatusResponse pkt = new StatusResponse();
pkt.setMaxOnline(config.getMaxPlayers()); pkt.setDescription(config.getDescriptionServer());
pkt.setFaviconBase64(config.getFaviconBase64()); pkt.setMaxOnline(config.getMaxPlayers());
pkt.setFaviconBase64(config.getFaviconBase64());
channel.writeAndFlush(pkt); channel.writeAndFlush(pkt);
}
} }
public void onPingPacket(Channel channel, PingPacket packet) { public void onPingPacket(Channel channel, PingPacket packet) {