AdminBBSManager.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.communitybbs.Manager;
  16. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  17. import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
  18. public class AdminBBSManager extends BaseBBSManager
  19. {
  20. /**
  21. * Gets the single instance of AdminBBSManager.
  22. * @return single instance of AdminBBSManager
  23. */
  24. public static AdminBBSManager getInstance()
  25. {
  26. return SingletonHolder._instance;
  27. }
  28. @Override
  29. public void parsecmd(String command, L2PcInstance activeChar)
  30. {
  31. if (!activeChar.isGM())
  32. {
  33. return;
  34. }
  35. if (command.startsWith("admin_bbs"))
  36. {
  37. separateAndSend("<html><body><br><br><center>This Page is only an exemple :)<br><br>command=" + command
  38. + "</center></body></html>", activeChar);
  39. }
  40. else
  41. {
  42. ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command
  43. + " is not implemented yet</center><br><br></body></html>", "101");
  44. activeChar.sendPacket(sb);
  45. activeChar.sendPacket(new ShowBoard(null, "102"));
  46. activeChar.sendPacket(new ShowBoard(null, "103"));
  47. }
  48. }
  49. @Override
  50. public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
  51. {
  52. if (!activeChar.isGM())
  53. {
  54. return;
  55. }
  56. }
  57. private static class SingletonHolder
  58. {
  59. protected static final AdminBBSManager _instance = new AdminBBSManager();
  60. }
  61. }