AdminBBSManager.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 + "</center></body></html>", activeChar);
  38. }
  39. else
  40. {
  41. ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101");
  42. activeChar.sendPacket(sb);
  43. activeChar.sendPacket(new ShowBoard(null, "102"));
  44. activeChar.sendPacket(new ShowBoard(null, "103"));
  45. }
  46. }
  47. @Override
  48. public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
  49. {
  50. if (!activeChar.isGM())
  51. {
  52. return;
  53. }
  54. }
  55. private static class SingletonHolder
  56. {
  57. protected static final AdminBBSManager _instance = new AdminBBSManager();
  58. }
  59. }