CharacterRestore.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 net.sf.l2j.gameserver.clientpackets;
  16. import net.sf.l2j.gameserver.serverpackets.CharSelectionInfo;
  17. /**
  18. * This class ...
  19. *
  20. * @version $Revision: 1.4.2.1.2.2 $ $Date: 2005/03/27 15:29:29 $
  21. */
  22. public final class CharacterRestore extends L2GameClientPacket
  23. {
  24. private static final String _C__62_CHARACTERRESTORE = "[C] 62 CharacterRestore";
  25. //private static Logger _log = Logger.getLogger(CharacterRestore.class.getName());
  26. // cd
  27. private int _charSlot;
  28. @Override
  29. protected void readImpl()
  30. {
  31. _charSlot = readD();
  32. }
  33. @Override
  34. protected void runImpl()
  35. {
  36. try
  37. {
  38. getClient().markRestoredChar(_charSlot);
  39. } catch (Exception e){}
  40. CharSelectionInfo cl = new CharSelectionInfo(getClient().getAccountName(), getClient().getSessionId().playOkID1, 0);
  41. sendPacket(cl);
  42. getClient().setCharSelection(cl.getCharInfo());
  43. }
  44. /* (non-Javadoc)
  45. * @see net.sf.l2j.gameserver.clientpackets.ClientBasePacket#getType()
  46. */
  47. @Override
  48. public String getType()
  49. {
  50. return _C__62_CHARACTERRESTORE;
  51. }
  52. }