Exemplo n.º 1
0
  /** {@inheritDoc} */
  @Override
  protected void runImpl() {

    Player activePlayer = getConnection().getActivePlayer();
    Friend target = activePlayer.getFriendList().getFriend(targetName);
    if (target == null) {
      log.warn(
          activePlayer.getName()
              + " tried to delete friend "
              + targetName
              + " who is not his friend");
      sendPacket(SM_SYSTEM_MESSAGE.BUDDYLIST_NOT_IN_LIST);
    } else {
      SocialService.deleteFriend(activePlayer, target.getOid());
    }
  }
Exemplo n.º 2
0
  /** {@inheritDoc} */
  @Override
  protected void runImpl() {
    Player activePlayer = getConnection().getActivePlayer();

    if (!note.equals(activePlayer.getCommonData().getNote())) {

      activePlayer.getCommonData().setNote(note);

      for (Friend friend : activePlayer.getFriendList()) // For all my friends
      {

        if (friend.isOnline()) // If the player is online
        {
          friend
              .getPlayer()
              .getClientConnection()
              .sendPacket(new SM_FRIEND_LIST()); // Send him a new friend list packet
        }
      }
    }
  }
 /** {@inheritDoc} */
 @Override
 protected void writeImpl(AionConnection con) {
   PacketLoggerService.getInstance().logPacketSM(this.getPacketName());
   Friend f = con.getActivePlayer().getFriendList().getFriend(friendObjId);
   if (f == null) {
     log.debug(
         "Attempted to update friend list status of "
             + friendObjId
             + " for "
             + con.getActivePlayer().getName()
             + " - object ID not found on friend list");
   } else {
     writeS(f.getName());
     writeD(f.getLevel());
     writeD(f.getPlayerClass().getClassId());
     writeC(f.isOnline() ? 1 : 0); // Online status - No idea why this and f.getStatus are used
     writeD(f.getMapId());
     writeD(f.getLastOnlineTime()); // Date friend was last online as a Unix timestamp.
     writeS(f.getNote());
     writeC(f.getStatus().getId());
   }
 }