ExCubeGameAddPlayer.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. *
  24. * @author mrTJO
  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. /**
  32. * Add Player To Minigame Waiting List
  33. *
  34. * @param player Player Instance
  35. * @param isRedTeam Is Player from Red Team?
  36. */
  37. public ExCubeGameAddPlayer(L2PcInstance player, boolean isRedTeam)
  38. {
  39. _player = player;
  40. _isRedTeam = isRedTeam;
  41. }
  42. /* (non-Javadoc)
  43. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  44. */
  45. @Override
  46. protected void writeImpl()
  47. {
  48. writeC(0xfe);
  49. writeH(0x97);
  50. writeD(0x01);
  51. writeD(0xffffffff);
  52. writeD(_isRedTeam ? 0x01 : 0x00);
  53. writeD(_player.getObjectId());
  54. writeS(_player.getName());
  55. }
  56. /* (non-Javadoc)
  57. * @see com.l2jserver.gameserver.BasePacket#getType()
  58. */
  59. @Override
  60. public String getType()
  61. {
  62. return _S__FE_97_01_EXCUBEGAMEADDPLAYER;
  63. }
  64. }