/** {@inheritDoc} */
  @Override
  protected void writeImpl(AionConnection con, ByteBuffer buf) {
    Account account = con.getAccount();

    writeD(buf, ok ? 0x00 : 0x01);
    writeS(buf, account.getName());
  }
예제 #2
0
  /** {@inheritDoc} */
  @Override
  protected void writeImpl(AionConnection con, ByteBuffer buf) {
    boolean canRead = true;

    if (race != null) {
      canRead =
          chatType.isSysMsg()
              || CustomConfig.FACTIONS_SPEAKING_MODE == 1
              || player.getAccessLevel() > 0
              || (con.getActivePlayer() != null && con.getActivePlayer().getAccessLevel() > 0);
    }

    writeC(buf, chatType.toInteger()); // type

    /*
     * 0 : all 1 : elyos 2 : asmodians
     */
    writeC(buf, canRead ? 0 : race.getRaceId() + 1);
    writeD(buf, senderObjectId); // sender object id

    switch (chatType) {
      case NORMAL:
      case ANNOUNCEMENTS:
      case PERIOD_NOTICE:
      case PERIOD_ANNOUNCEMENTS:
      case SYSTEM_NOTICE:
        writeH(buf, 0x00); // unknown
        writeS(buf, message);
        break;
      case SHOUT:
        writeS(buf, senderName);
        writeS(buf, message);
        writeF(buf, x);
        writeF(buf, y);
        writeF(buf, z);
        break;
      case ALLIANCE:
      case GROUP:
      case GROUP_LEADER:
      case LEGION:
      case WHISPER:
        writeS(buf, senderName);
        writeS(buf, message);
        break;
    }
  }