BaseBBSManager.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2004-2015 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.communitybbs.Manager;
  20. import java.util.ArrayList;
  21. import java.util.List;
  22. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  23. import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
  24. public abstract class BaseBBSManager
  25. {
  26. public abstract void parsecmd(String command, L2PcInstance activeChar);
  27. public abstract void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar);
  28. /**
  29. * @param html
  30. * @param acha
  31. */
  32. protected void send1001(String html, L2PcInstance acha)
  33. {
  34. if (html.length() < 8192)
  35. {
  36. acha.sendPacket(new ShowBoard(html, "1001"));
  37. }
  38. }
  39. /**
  40. * @param acha
  41. */
  42. protected void send1002(L2PcInstance acha)
  43. {
  44. send1002(acha, " ", " ", "0");
  45. }
  46. /**
  47. * @param activeChar
  48. * @param string
  49. * @param string2
  50. * @param string3
  51. */
  52. protected void send1002(L2PcInstance activeChar, String string, String string2, String string3)
  53. {
  54. List<String> _arg = new ArrayList<>();
  55. _arg.add("0");
  56. _arg.add("0");
  57. _arg.add("0");
  58. _arg.add("0");
  59. _arg.add("0");
  60. _arg.add("0");
  61. _arg.add(activeChar.getName());
  62. _arg.add(Integer.toString(activeChar.getObjectId()));
  63. _arg.add(activeChar.getAccountName());
  64. _arg.add("9");
  65. _arg.add(string2); // subject?
  66. _arg.add(string2); // subject?
  67. _arg.add(string); // text
  68. _arg.add(string3); // date?
  69. _arg.add(string3); // date?
  70. _arg.add("0");
  71. _arg.add("0");
  72. activeChar.sendPacket(new ShowBoard(_arg));
  73. }
  74. }