2
0

ExShowTrace.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 java.util.List;
  17. import com.l2jserver.gameserver.model.L2Object;
  18. import javolution.util.FastList;
  19. /**
  20. *
  21. * @author KenM
  22. */
  23. public final class ExShowTrace extends L2GameServerPacket
  24. {
  25. private final List<Trace> _traces = new FastList<Trace>();
  26. public void addTrace(int x, int y, int z, int time)
  27. {
  28. _traces.add(new Trace(x, y, z, time));
  29. }
  30. public void addTrace(L2Object obj, int time)
  31. {
  32. this.addTrace(obj.getX(), obj.getY(), obj.getZ(), time);
  33. }
  34. static final class Trace
  35. {
  36. public final int _x;
  37. public final int _y;
  38. public final int _z;
  39. public final int _time;
  40. public Trace(int x, int y, int z, int time)
  41. {
  42. _x = x;
  43. _y = y;
  44. _z = z;
  45. _time = time;
  46. }
  47. }
  48. /**
  49. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
  50. */
  51. @Override
  52. public String getType()
  53. {
  54. return "[S] FE:67 ExShowTrace";
  55. }
  56. /**
  57. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
  58. */
  59. @Override
  60. protected void writeImpl()
  61. {
  62. writeC(0xfe);
  63. writeH(0x67);
  64. writeH(_traces.size());
  65. for (Trace t : _traces)
  66. {
  67. writeD(t._x);
  68. writeD(t._y);
  69. writeD(t._z);
  70. writeH(t._time);
  71. }
  72. }
  73. }