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,6 +44,7 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
channel.attr(State.ATTR_STATE).set(packet.getNextState());
}
if (packet.getNextState().equals(State.STATUS)) {
Config config = Main.appContext.getBean("config", Config.class); //FIXME
StatusResponse pkt = new StatusResponse();
pkt.setDescription(config.getDescriptionServer());
@@ -52,6 +53,7 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
channel.writeAndFlush(pkt);
}
}
public void onPingPacket(Channel channel, PingPacket packet) {
channel.writeAndFlush(packet);