ExEventMatchMessage.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /**
  17. * Format: (ch)cs
  18. * c: message type (0 - gm, 1 - finish, 2 - start, 3 - game over, 4 - 1, 5 - 2, 6 - 3, 7 - 4, 8 - 5)
  19. * s: message text (only when type is 0 - gm)
  20. *
  21. * @author janiii
  22. *
  23. */
  24. public class ExEventMatchMessage extends L2GameServerPacket
  25. {
  26. private static final String _S__FE_0F_EXEVENTMATCHMESSAGE = "[S] FE:0f ExEventMatchMessage";
  27. private int _type;
  28. private String _message;
  29. /**
  30. * Create an event match message.
  31. * @param type 0 - gm, 1 - finish, 2 - start, 3 - game over, 4 - 1, 5 - 2, 6 - 3, 7 - 4, 8 - 5
  32. * @param message message to show, only when type is 0 - gm
  33. */
  34. public ExEventMatchMessage(int type, String message)
  35. {
  36. _type = type;
  37. _message = message;
  38. }
  39. /* (non-Javadoc)
  40. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  41. */
  42. @Override
  43. protected void writeImpl()
  44. {
  45. writeC(0xfe);
  46. writeH(0x0f);
  47. writeC(_type);
  48. writeS(_message);
  49. }
  50. /* (non-Javadoc)
  51. * @see com.l2jserver.gameserver.BasePacket#getType()
  52. */
  53. @Override
  54. public String getType()
  55. {
  56. return _S__FE_0F_EXEVENTMATCHMESSAGE;
  57. }
  58. }