ExOlympiadUserInfo.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  17. import com.l2jserver.gameserver.model.olympiad.Participant;
  18. /**
  19. * This class ...
  20. *
  21. * @version $Revision: 1.4.2.1.2.3 $ $Date: 2005/03/27 15:29:57 $
  22. *
  23. * @author godson
  24. */
  25. public class ExOlympiadUserInfo extends L2GameServerPacket
  26. {
  27. // chcdSddddd
  28. private static final String _S__FE_29_OLYMPIADUSERINFO = "[S] FE:7A ExOlympiadUserInfo";
  29. private L2PcInstance _player;
  30. private Participant _par = null;
  31. public ExOlympiadUserInfo(L2PcInstance player)
  32. {
  33. _player = player;
  34. }
  35. public ExOlympiadUserInfo(Participant par)
  36. {
  37. _par = par;
  38. _player = par.player;
  39. }
  40. @Override
  41. protected final void writeImpl()
  42. {
  43. writeC(0xfe);
  44. writeH(0x7a);
  45. if (_player != null)
  46. {
  47. writeC(_player.getOlympiadSide());
  48. writeD(_player.getObjectId());
  49. writeS(_player.getName());
  50. writeD(_player.getClassId().getId());
  51. writeD((int)_player.getCurrentHp());
  52. writeD(_player.getMaxVisibleHp());
  53. writeD((int)_player.getCurrentCp());
  54. writeD(_player.getMaxCp());
  55. }
  56. else
  57. {
  58. writeC(_par.side);
  59. writeD(_par.objectId);
  60. writeS(_par.name);
  61. writeD(_par.baseClass);
  62. writeD(0);
  63. writeD(100);
  64. writeD(0);
  65. writeD(100);
  66. }
  67. }
  68. /* (non-Javadoc)
  69. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  70. */
  71. @Override
  72. public String getType()
  73. {
  74. return _S__FE_29_OLYMPIADUSERINFO;
  75. }
  76. }