Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. /*
  2. * Class PlayerOption3
  3. *
  4. * Version 1.0
  5. *
  6. * Friday, August 22, 2008
  7. *
  8. * Created by Palidino76
  9. */
  10.  
  11. package net.com.codeusa.net.packethandler;
  12.  
  13. import net.com.codeusa.*;
  14. import net.com.codeusa.model.Player;
  15. import net.com.codeusa.util.Misc;
  16.  
  17. public class PlayerOption3 implements Packet {
  18. /**
  19. * Handles the third player option.
  20. * @param p The Player which the frame should be handled for.
  21. * @param packetId The packet id this belongs to.
  22. * @param packetSize The amount of bytes being recieved for this packet.
  23. */
  24. public void handlePacket(Player p, int packetId, int packetSize) {
  25. if (p == null || p.stream == null) {
  26. return;
  27. }
  28. p.duelFriend = p.stream.readUnsignedWordBigEndianA();
  29. Player player = Server.engine.players[p.duelFriend];
  30. if (p == null || player == null) {
  31. p.duelFriend = 0;
  32. return;
  33. }
  34. if (p.inDuelArena()) {
  35. p.getActionSender().sendMessage(p, "Sending duel request..");
  36. player.getActionSender().sendMessage(player, p.username + ":duelfriend:");
  37. player.duelFriend = p.playerId;
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement