@Override protected Auth_Rsp newInstance(byte[] protoBytes) { try { return Auth_Rsp.parseFrom(protoBytes); } catch (InvalidProtocolBufferException e) { Log.d("AuthRspHandler", "AuthRspHandler", e); } return null; }
@Override protected void processCmd(IoSession session, Auth_Rsp t) { if (t.getSucess()) { session.setAttribute("auth", true); changeSessionId(session, t.getSessionId()); @SuppressWarnings("unchecked") PacketCollector<Auth_Rsp> pc = CallbackStore.instance().getPacketCollector(t.getId()); if (pc != null) { pc.onCollect(t); } doRegister(t); log.info("============================================================"); log.info("认证成功Session:{} 所在IP为:{}", t.getSessionId(), t.getIp()); } else { log.info("============================================================"); log.info("认证失败,原因是:{} ", t.getReason()); } log.info("============================================================"); }