Exemplo n.º 1
0
 @Override
 public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
   Channel session = ctx.channel();
   if ((firewall.getClientType(session) != ClientType.MIS)
       && (firewall.blockedByPacks(ctx.channel(), 1))) {
     String remoteIp = sessionManager.getRemoteIp(session);
     long playerId = sessionManager.getPlayerId(session).longValue();
     LOGGER.error(
         String.format(
             "In blacklist: [ip: %s, playerId: %d]",
             new Object[] {remoteIp, Long.valueOf(playerId)}));
     sessionManager.closeSession(session);
     return;
   }
   ctx.fireChannelRead(msg);
 }