ExCubeGameAddPlayer.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  18. * Format: (chd) dddS
  19. * d: always -1
  20. * d: player team
  21. * d: player object id
  22. * S: player name
  23. * @author mrTJO
  24. *
  25. */
  26. public class ExCubeGameAddPlayer extends L2GameServerPacket
  27. {
  28. private static final String _S__FE_97_01_EXCUBEGAMEADDPLAYER = "[S] FE:97:01 ExCubeGameAddPlayer";
  29. L2PcInstance _player;
  30. boolean _isRedTeam;
  31. public ExCubeGameAddPlayer(L2PcInstance player, boolean isRedTeam)
  32. {
  33. _player = player;
  34. _isRedTeam = isRedTeam;
  35. }
  36. /* (non-Javadoc)
  37. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  38. */
  39. @Override
  40. protected void writeImpl()
  41. {
  42. writeC(0xfe);
  43. writeH(0x97);
  44. writeD(0x01);
  45. writeD(0xffffffff);
  46. writeD(_isRedTeam ? 0x01 : 0x00);
  47. writeD(_player.getObjectId());
  48. writeS(_player.getName());
  49. }
  50. /* (non-Javadoc)
  51. * @see com.l2jserver.gameserver.BasePacket#getType()
  52. */
  53. @Override
  54. public String getType()
  55. {
  56. return _S__FE_97_01_EXCUBEGAMEADDPLAYER;
  57. }
  58. }