Exemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 protected void writeImpl(AionConnection con, ByteBuffer buf) {
   switch (action) {
     case 1:
       if (GSConfig.SERVER_VERSION.startsWith("2.1")) {
         writeC(buf, action);
         writeD(buf, questId);
         writeC(buf, status);
         writeC(buf, 0x0);
         writeD(buf, step);
         writeH(buf, 0);
         break;
       }
     case 2:
       writeC(buf, action);
       writeD(buf, questId);
       writeC(buf, status);
       writeC(buf, 0x0);
       writeD(buf, step);
       writeH(buf, 0x0);
       break;
     case 3:
       writeC(buf, action);
       writeD(buf, questId);
       writeC(buf, status);
       if (GSConfig.SERVER_VERSION.startsWith("2.0")) writeC(buf, 0x0);
       writeC(buf, step);
       if (GSConfig.SERVER_VERSION.startsWith("2.0")) writeD(buf, 0x0);
       break;
     case 4:
       writeC(buf, action);
       writeD(buf, questId);
       writeD(buf, timer);
       writeC(buf, 0x01);
       writeH(buf, 0x0);
       writeC(buf, 0x01);
       break;
     case 5:
       writeC(buf, action);
       writeD(buf, questId);
       writeD(buf, sharerId);
       writeD(buf, 0);
       break;
     case 6:
       writeC(buf, action);
       writeD(buf, questId);
       writeC(buf, status);
       writeC(buf, step);
       writeH(buf, 0x0);
   }
 }
Exemplo n.º 2
0
  private void writeImplTitleList(ByteBuffer buf) {
    Player player = titleList.getOwner();
    TitleService.removeExpiredTitles(player);

    if (GSConfig.SERVER_VERSION.startsWith("2.")) writeH(buf, 0); // unk
    else writeC(buf, 0); // unk

    writeH(buf, titleList.size());

    for (final Title title : titleList.getTitles()) {
      writeD(buf, title.getTitleId());
      writeD(buf, (int) title.getTitleTimeLeft());
    }

    if (player.getCommonData().getTitleId() > 0) {
      if (titleList.canAddTitle(player.getCommonData().getTitleId())) {
        player.getCommonData().setTitleId(0);
        PacketSendUtility.sendMessage(player, "The usage time of title has expired.");
      }
    }
  }