ShowBoard.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.network.serverpackets;
  16. import java.util.List;
  17. import com.l2jserver.util.StringUtil;
  18. public class ShowBoard extends L2GameServerPacket
  19. {
  20. private static final String _S__6E_SHOWBOARD = "[S] 7b ShowBoard";
  21. private StringBuilder _htmlCode;
  22. public ShowBoard(String htmlCode, String id)
  23. {
  24. _htmlCode = StringUtil.startAppend(500, id, "\u0008", htmlCode);
  25. }
  26. public ShowBoard(List<String> arg)
  27. {
  28. _htmlCode = StringUtil.startAppend(500, "1002\u0008");
  29. for (String str : arg)
  30. StringUtil.append(_htmlCode, str, " \u0008");
  31. }
  32. @Override
  33. protected final void writeImpl()
  34. {
  35. writeC(0x7b);
  36. writeC(0x01); //c4 1 to show community 00 to hide
  37. writeS("bypass _bbshome"); // top
  38. writeS("bypass _bbsgetfav"); // favorite
  39. writeS("bypass _bbsloc"); // region
  40. writeS("bypass _bbsclan"); // clan
  41. writeS("bypass _bbsmemo"); // memo
  42. writeS("bypass _bbsmail"); // mail
  43. writeS("bypass _bbsfriends"); // friends
  44. writeS("bypass bbs_add_fav"); // add fav.
  45. if (_htmlCode.length() < 8192)
  46. writeS(_htmlCode.toString());
  47. else
  48. writeS("<html><body>Html is too long!</body></html>");
  49. }
  50. /* (non-Javadoc)
  51. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  52. */
  53. @Override
  54. public String getType()
  55. {
  56. return _S__6E_SHOWBOARD;
  57. }
  58. }