Package lineage2.gameserver.utils

Examples of lineage2.gameserver.utils.SqlBatch


    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final NpcTemplate template = NpcHolder.getInstance().getTemplate(18602);
        if (template != null)
        {
          final NpcInstance a = template.getNewInstance();
          a.setCurrentHpMp(a.getMaxHp(), a.getMaxMp());
          a.spawnMe(actor.getLoc());
        }
      }
    }, 10000L);
View Full Code Here


      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
    final Location pos = Location.findPointToStay(x, y, z, 50, 100, player.getGeoIndex());
    if (price > 0)
    {
      player.reduceAdena(price, true);
    }
    player.teleToLocation(pos);
View Full Code Here

      player.sendPacket(SystemMessage2.removeItems(item, count));
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final Location pos = Location.findPointToStay(x, y, z, 20, 70, player.getGeoIndex());
    player.teleToLocation(pos);
  }
View Full Code Here

      return;
    }
    final String var = player.getVar("DCBackCoords");
    if ((var == null) || var.isEmpty())
    {
      player.teleToLocation(new Location(43768, -48232, -800), 0);
      return;
    }
    player.teleToLocation(Location.parseLoc(var), 0);
    player.unsetVar("DCBackCoords");
  }
View Full Code Here

    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
    {
      if (player != null)
      {
        player.teleToLocation(new Location(207559, 86429, -1000));
      }
    }
    return true;
  }
View Full Code Here

    try
    {
      con = DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      int order = 0;
      SqlBatch b = new SqlBatch("INSERT IGNORE INTO `character_effects_save` (`object_id`,`skill_id`,`skill_level`,`effect_count`,`effect_cur_time`,`duration`,`order`,`id`) VALUES");
      StringBuilder sb;
      for (Effect effect : effects)
      {
        if ((effect != null) && effect.isInUse() && !effect.getSkill().isToggle() && (effect.getEffectType() != EffectType.HealOverTime) && (effect.getEffectType() != EffectType.CombatPointHealOverTime) && (effect.getEffectType() != EffectType.Mentoring))
        {
          if (effect.isSaveable())
          {
            sb = new StringBuilder("(");
            sb.append(objectId).append(',');
            sb.append(effect.getSkill().getId()).append(',');
            sb.append(effect.getSkill().getLevel()).append(',');
            sb.append(effect.getCount()).append(',');
            sb.append(effect.getTime()).append(',');
            sb.append(effect.getPeriod()).append(',');
            sb.append(order).append(',');
            sb.append(id).append(')');
            b.write(sb.toString());
          }
          while (((effect = effect.getNext()) != null) && effect.isSaveable())
          {
            sb = new StringBuilder("(");
            sb.append(objectId).append(',');
            sb.append(effect.getSkill().getId()).append(',');
            sb.append(effect.getSkill().getLevel()).append(',');
            sb.append(effect.getCount()).append(',');
            sb.append(effect.getTime()).append(',');
            sb.append(effect.getPeriod()).append(',');
            sb.append(order).append(',');
            sb.append(id).append(')');
            b.write(sb.toString());
          }
          order++;
        }
      }
      if (!b.isEmpty())
      {
        statement.executeUpdate(b.close());
      }
    }
    catch (final Exception e)
    {
      _log.error("Could not store active effects data!", e);
View Full Code Here

      statement.execute();
      if (player.getSharedGroupReuses().isEmpty())
      {
        return;
      }
      SqlBatch b = new SqlBatch(INSERT_SQL_QUERY);
      synchronized (player.getSharedGroupReuses())
      {
        for (IntObjectMap.Entry<TimeStamp> entry : player.getSharedGroupReuses())
        {
          int group = entry.getKey();
          TimeStamp timeStamp = entry.getValue();
          if (timeStamp.hasNotPassed())
          {
            StringBuilder sb = new StringBuilder("(");
            sb.append(player.getObjectId()).append(',');
            sb.append(group).append(',');
            sb.append(timeStamp.getId()).append(',');
            sb.append(timeStamp.getEndTime()).append(',');
            sb.append(timeStamp.getReuseBasic()).append(')');
            b.write(sb.toString());
          }
        }
      }
      if (!b.isEmpty())
      {
        statement.executeUpdate(b.close());
      }
    }
    catch (final Exception e)
    {
      _log.error("CharacterGroupReuseDAO.insert(L2Player):", e);
View Full Code Here

    StringBuilder sb;
    try
    {
      con = DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      SqlBatch b = new SqlBatch("INSERT INTO `raidboss_points` (owner_id, boss_id, points) VALUES");
      for (Map.Entry<Integer, Map<Integer, Integer>> pointEntry : _points.entrySet())
      {
        Map<Integer, Integer> tmpPoint = pointEntry.getValue();
        if ((tmpPoint == null) || tmpPoint.isEmpty())
        {
          continue;
        }
        for (Map.Entry<Integer, Integer> pointListEntry : tmpPoint.entrySet())
        {
          if (KEY_RANK.equals(pointListEntry.getKey()) || KEY_TOTAL_POINTS.equals(pointListEntry.getKey()) || (pointListEntry.getValue() == null) || (pointListEntry.getValue() == 0))
          {
            continue;
          }
          sb = new StringBuilder("(");
          sb.append(pointEntry.getKey()).append(',');
          sb.append(pointListEntry.getKey()).append(',');
          sb.append(pointListEntry.getValue()).append(')');
          b.write(sb.toString());
        }
      }
      if (!b.isEmpty())
      {
        statement.executeUpdate(b.close());
      }
    }
    catch (SQLException e)
    {
      _log.warn("RaidBossSpawnManager: Couldnt update raidboss_points table");
View Full Code Here

      statement.executeUpdate("DELETE FROM character_skills_save WHERE char_obj_id = " + getObjectId() + " AND class_index=" + getActiveClassId() + " AND `end_time` < " + System.currentTimeMillis());
      if (_skillReuses.isEmpty())
      {
        return;
      }
      SqlBatch b = new SqlBatch("REPLACE INTO `character_skills_save` (`char_obj_id`,`skill_id`,`skill_level`,`class_index`,`end_time`,`reuse_delay_org`) VALUES");
      synchronized (_skillReuses)
      {
        StringBuilder sb;
        for (TimeStamp timeStamp : _skillReuses.values())
        {
          if (timeStamp.hasNotPassed())
          {
            sb = new StringBuilder("(");
            sb.append(getObjectId()).append(',');
            sb.append(timeStamp.getId()).append(',');
            sb.append(timeStamp.getLevel()).append(',');
            sb.append(getActiveClassId()).append(',');
            sb.append(timeStamp.getEndTime()).append(',');
            sb.append(timeStamp.getReuseBasic()).append(')');
            b.write(sb.toString());
          }
        }
      }
      if (!b.isEmpty())
      {
        statement.executeUpdate(b.close());
      }
    }
    catch (final Exception e)
    {
      _log.warn("Could not store disable skills data: " + e);
View Full Code Here

      statement.executeUpdate("DELETE FROM character_blocklist WHERE obj_Id=" + getObjectId());
      if (_blockList.isEmpty())
      {
        return;
      }
      SqlBatch b = new SqlBatch("INSERT IGNORE INTO `character_blocklist` (`obj_Id`,`target_Id`) VALUES");
      synchronized (_blockList)
      {
        StringBuilder sb;
        for (Entry<Integer, String> e : _blockList.entrySet())
        {
          sb = new StringBuilder("(");
          sb.append(getObjectId()).append(',');
          sb.append(e.getKey()).append(')');
          b.write(sb.toString());
        }
      }
      if (!b.isEmpty())
      {
        statement.executeUpdate(b.close());
      }
    }
    catch (Exception e)
    {
      _log.warn("Can't store player blocklist " + e);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.utils.SqlBatch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.