ExMultiPartyCommandChannelInfo.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.L2CommandChannel;
  17. import com.l2jserver.gameserver.model.L2Party;
  18. /**
  19. *
  20. * @author chris_00
  21. * ch sdd d[sdd]
  22. */
  23. public class ExMultiPartyCommandChannelInfo extends L2GameServerPacket
  24. {
  25. private static final String _S__FE_31_EXMULTIPARTYCOMMANDCHANNELINFO = "[S] FE:31 ExMultiPartyCommandChannelInfo";
  26. private L2CommandChannel _channel;
  27. public ExMultiPartyCommandChannelInfo(L2CommandChannel channel)
  28. {
  29. this._channel = channel;
  30. }
  31. /**
  32. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
  33. */
  34. @Override
  35. public String getType()
  36. {
  37. return _S__FE_31_EXMULTIPARTYCOMMANDCHANNELINFO;
  38. }
  39. /**
  40. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
  41. */
  42. @Override
  43. protected void writeImpl()
  44. {
  45. if (_channel == null)
  46. return;
  47. // L2PcInstance player = this.getClient().getActiveChar();
  48. writeC(0xfe);
  49. writeH(0x31);
  50. writeS(_channel.getChannelLeader().getName()); // Channelowner
  51. writeD(0); // Channelloot 0 or 1
  52. writeD(_channel.getMemberCount());
  53. writeD(_channel.getPartys().size());
  54. for(L2Party p : _channel.getPartys())
  55. {
  56. writeS(p.getLeader().getName()); // Leadername
  57. writeD(p.getPartyLeaderOID()); // Leaders ObjId
  58. writeD(p.getMemberCount()); // Membercount
  59. }
  60. }
  61. }