Package com.l2jfrozen

Examples of com.l2jfrozen.L2Properties


    Util.printSection("CatsGuard");
    try
    {
      if (_SERVER_KEY == 0)
        return;
      L2Properties p = new L2Properties("./config/protected/catsguard.properties");
      ENABLED = Boolean.parseBoolean(p.getProperty("Enabled", "true")) && ENABLED;
      if (!ENABLED)
      {
        _log.info("CatsGuard: disabled");
      return;
      }
      LOG_OPTION = p.getProperty("LogOption", "NOSPS HACK");
      MAX_SESSIONS = Integer.parseInt(p.getProperty("MaxSessionsFromHWID", "-1"));
      MAX_PREMIUM_SESSIONS = Integer.parseInt(p.getProperty("MaxSessionsForPremium", "-1"));
      ANNOUNCE_HACK = Boolean.parseBoolean(p.getProperty("AnnounceHackAttempt", "true"));
      ON_HACK_ATTEMP = p.getProperty("OnHackAttempt", "kick");
      ALLOW_GM_FROM_BANNED_HWID = Boolean.parseBoolean(p.getProperty("AllowGMFromBannedHWID", "false")); _connections = new FastMap<String, Integer>().setShared(true);
    LOG_SESSIONS = Boolean.parseBoolean(p.getProperty("LogSessions", "false")); _bannedhwid = new FastList<String>();
      Connection con = L2DatabaseFactory.getInstance().getConnection(false);
      PreparedStatement stm = con.prepareStatement("select * from banned_hwid");
      try
      {
        ResultSet rs = stm.executeQuery();
View Full Code Here


 
  public static void load()
  {
    try
    {
      L2Properties p = new L2Properties(PP_CONFIG_FILE);
      ENGRAVER_ENABLED = Boolean.parseBoolean(p.getProperty("EngraveEnabled", "true"));
      ENGRAVE_PRICE = Integer.parseInt(p.getProperty("EngravePrice", "0"));
      ENGRAVE_PRICE_ITEM = Integer.parseInt(p.getProperty("EngravePriceItem", "57"));
      SPAWN_ENGRAVER = Boolean.parseBoolean(p.getProperty("EngraveSpawnNpc", "true"));
      ENGRAVE_ALLOW_DESTROY = Boolean.parseBoolean(p.getProperty("EngraveAllowDestroy", "false"));
      MAX_ENGRAVED_ITEMS_PER_CHAR = Integer.parseInt(p.getProperty("EngraveMaxItemsPerChar", "0"));
      String str = p.getProperty("EngraveNpcLocation", "").trim();
      if(str.length() > 0)
      {
        StringTokenizer st = new StringTokenizer(str, " ");
        if(st.hasMoreTokens())
        {
          ENGRAVER_X = Integer.parseInt(st.nextToken());
        }
        if(st.hasMoreTokens())
        {
          ENGRAVER_Y = Integer.parseInt(st.nextToken());
        }
        if(st.hasMoreTokens())
        {
          ENGRAVER_Z = Integer.parseInt(st.nextToken());
        }
      }
      str = p.getProperty("EngraveExcludeItems", "").trim();
      if(str.length() > 0)
      {
        StringTokenizer st = new StringTokenizer(str, ",");
        while(st.hasMoreTokens())
        {
          ENGRAVE_EXCLUDED_ITEMS.add(Integer.parseInt(st.nextToken().trim()));
        }
      }
      str = p.getProperty("EngraveAllowGrades", "all").toLowerCase();
      if(str.indexOf("none") != -1 || str.indexOf("all") != -1)
      {
        ENGRAVE_ALLOW_GRADE.add(L2Item.CRYSTAL_NONE);
      }

      if(str.indexOf("a") != -1 || str.indexOf("all") != -1)
      {
        ENGRAVE_ALLOW_GRADE.add(L2Item.CRYSTAL_A);
      }

      if(str.indexOf("b") != -1 || str.indexOf("all") != -1)
      {
        ENGRAVE_ALLOW_GRADE.add(L2Item.CRYSTAL_B);
      }

      if(str.indexOf("c") != -1 || str.indexOf("all") != -1)
      {
        ENGRAVE_ALLOW_GRADE.add(L2Item.CRYSTAL_C);
      }

      if(str.indexOf("d") != -1 || str.indexOf("all") != -1)
      {
        ENGRAVE_ALLOW_GRADE.add(L2Item.CRYSTAL_D);
      }

      if(str.indexOf("s") != -1 || str.indexOf("all") != -1)
      {
        ENGRAVE_ALLOW_GRADE.add(L2Item.CRYSTAL_S);
      }

      BUFFER_ENABLED = Boolean.parseBoolean(p.getProperty("BufferEnabled", "false"));
      StringTokenizer st = new StringTokenizer(p.getProperty("BufferExcludeOn", ""), " ");
      while(st.hasMoreTokens())
      {
        BUFFER_EXCLUDE_ON.add(st.nextToken());
      }
      BUFFER_COMMAND = p.getProperty("BufferCommand", "buffme");
      BUFFER_NPC = Integer.parseInt(p.getProperty("BufferNpcId", "50019"));
      BUFFER_PRICE = Integer.parseInt(p.getProperty("BufferPrice", "-1"));
      BUFFER_USEBBS = Boolean.parseBoolean(p.getProperty("BufferUseBBS", "false"));
      BUFFER_USECOMMAND = Boolean.parseBoolean(p.getProperty("BufferUseCommand", "false"));

      FIGHTER_SKILL_LIST = new FastMap<Integer, Integer>();
      MAGE_SKILL_LIST = new FastMap<Integer, Integer>();

      String[] fPropertySplit;
      fPropertySplit = p.getProperty("FighterSkillList", "").split(";");

      String[] mPropertySplit;
      mPropertySplit = p.getProperty("MageSkillList", "").split(";");

      for(String skill : fPropertySplit)
      {
        String[] skillSplit = skill.split(",");
        if(skillSplit.length != 2)
        {
          System.out.println("[FighterSkillList]: invalid config property -> FighterSkillList \"" + skill + "\"");
        }
        else
        {
          try
          {
            FIGHTER_SKILL_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
          }
          catch(NumberFormatException nfe)
          {
            if(Config.ENABLE_ALL_EXCEPTIONS)
              nfe.printStackTrace();
           
            if(!skill.equals(""))
            {
              System.out.println("[FighterSkillList]: invalid config property -> FighterSkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
            }
          }
        }
      }
     
      for(String skill : mPropertySplit)
      {
        String[] skillSplit = skill.split(",");
        if(skillSplit.length != 2)
        {
          System.out.println("[MageSkillList]: invalid config property -> MageSkillList \"" + skill + "\"");
        }
        else
        {
          try
          {
            MAGE_SKILL_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
          }
          catch(NumberFormatException nfe)
          {
            if(Config.ENABLE_ALL_EXCEPTIONS)
              nfe.printStackTrace();
           
            if(!skill.equals(""))
            {
              System.out.println("[MageSkillList]: invalid config property -> MageSkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
            }
          }
        }
      }
     
      GLOBALGK_NPC = Integer.parseInt(p.getProperty("GKNpcId", "7077"));
      GLOBALGK_ENABDLED = Boolean.parseBoolean(p.getProperty("GKEnabled", "false"));
      GLOBALGK_COMMAND = p.getProperty("GKCommand", "teleport");
      GLOBALGK_TIMEOUT = Integer.parseInt(p.getProperty("GKTimeout", "10"));
      if(GLOBALGK_TIMEOUT < 1)
      {
        GLOBALGK_TIMEOUT = 1;
      }
      GLOBALGK_PRICE = Integer.parseInt(p.getProperty("GKPrice", "-1"));
      GLOBALGK_USECOMMAND = Boolean.parseBoolean(p.getProperty("GKUseCommand", "false"));
      GLOBALGK_USEBBS = Boolean.parseBoolean(p.getProperty("GKUseBBS", "true"));
      GLOBALGK_EXCLUDE_ON = new FastList<String>();
      st = new StringTokenizer(p.getProperty("GKExcludeOn", ""), " ");
      while(st.hasMoreTokens())
      {
        GLOBALGK_EXCLUDE_ON.add(st.nextToken().toUpperCase());
      }

      GMSHOP_NPC = Integer.parseInt(p.getProperty("GMShopNpcId", "53"));
      GMSHOP_ENABLED = Boolean.parseBoolean(p.getProperty("GMShopEnabled","false"));
      GMSHOP_COMMAND = p.getProperty("GMShopCommand", "gmshop");
      GMSHOP_USEBBS = Boolean.parseBoolean(p.getProperty("GMShopUseBBS","false"));
      GMSHOP_USECOMMAND = Boolean.parseBoolean(p.getProperty("GMShopUseCommand","false"));
      GMSHOP_EXCLUDE_ON = new FastList<String>();
      st = new StringTokenizer(p.getProperty("GMShopExcludeOn", ""), " ");
      while(st.hasMoreTokens())
      {
        GMSHOP_EXCLUDE_ON.add(st.nextToken().toUpperCase());
      }
     
      XMLRPC_ENABLED = Boolean.parseBoolean(p.getProperty("XMLRPCEnabled", "true"));
      XMLRPC_HOST = p.getProperty("XMLRPCHost", "localhost");
      XMLRPC_PORT = Integer.parseInt(p.getProperty("XMLRPCPort", "7000"));

      L2TOPDEMON_ENABLED = Boolean.parseBoolean(p.getProperty("L2TopDeamonEnabled","false"));
      L2TOPDEMON_URL = p.getProperty("L2TopDeamonURL","");
      L2TOPDEMON_POLLINTERVAL = Integer.parseInt(p.getProperty("L2TopDeamonPollInterval","5"));
      L2TOPDEMON_PREFIX = p.getProperty("L2TopDeamonPrefix","");
      L2TOPDEMON_ITEM = Integer.parseInt(p.getProperty("L2TopDeamonRewardItem","0"));
      L2TOPDEMON_MESSAGE = L2Utils.loadMessage(p.getProperty("L2TopDeamonMessage",""));
      L2TOPDEMON_MIN = Integer.parseInt(p.getProperty("L2TopDeamonMin","1"));
      L2TOPDEMON_MAX = Integer.parseInt(p.getProperty("L2TopDeamonMax","1"));
      L2TOPDEMON_IGNOREFIRST = Boolean.parseBoolean(p.getProperty("L2TopDeamonDoNotRewardAtFirstTime","false"));
      if(ItemTable.getInstance().getTemplate(L2TOPDEMON_ITEM)==null) {
        L2TOPDEMON_ENABLED = false;
        System.err.println("Powerpak: Unknown item ("+L2TOPDEMON_ITEM+") as vote reward. Vote disabled");
      }

      WEBSERVER_ENABLED = Boolean.parseBoolean(p.getProperty("WebServerEnabled","true"));
      WEBSERVER_HOST = p.getProperty("WebServerHost","localhost");
      WEBSERVER_PORT = Integer.parseInt(p.getProperty("WebServerPort","8080"));
     
      AUTOVOTEREWARD_ENABLED = Boolean.parseBoolean(p.getProperty("VoteRewardSystem","true"));
      VOTES_FOR_REWARD = Integer.parseInt(p.getProperty("VotesRequiredForReward", "100"));
      VOTES_SYSYEM_INITIAL_DELAY = Integer.parseInt(p.getProperty("VotesSystemInitialDelay", "60000"));
      VOTES_SYSYEM_STEP_DELAY = Integer.parseInt(p.getProperty("VotesSystemStepDelay", "1800000"));
      VOTES_SITE_HOPZONE_URL = p.getProperty("VotesSiteHopZoneUrl", "");
      VOTES_SITE_TOPZONE_URL = p.getProperty("VotesSiteTopZoneUrl", "");
      SERVER_WEB_SITE = p.getProperty("ServerWebSite", "");
      VOTES_REWARDS = p.getProperty("VotesRewards", "");
      VOTES_REWARDS_LIST = new FastMap<Integer, Integer>();
     
      String[] splitted_VOTES_REWARDS = VOTES_REWARDS.split(";");
     
      for(String reward:splitted_VOTES_REWARDS){
       
        String[] item_count = reward.split(",");
       
        if(item_count.length != 2)
        {
          System.out.println("[VotesRewards]: invalid config property -> VotesRewards \"" + VOTES_REWARDS + "\"");
        }
        else
          VOTES_REWARDS_LIST.put(Integer.parseInt(item_count[0]), Integer.parseInt(item_count[1]));
       
      }
     
      ENABLE_SAY_SOCIAL_ACTIONS = Boolean.parseBoolean(p.getProperty("EnableSocialSayActions","false"));
   
      CHAR_REPAIR = Boolean.parseBoolean(p.getProperty("CharacterRepair", "False"));
     
    }
    catch(Exception e)
    {
      if(Config.ENABLE_ALL_EXCEPTIONS)
View Full Code Here

      PropertyHandlerMapping phm = new PropertyHandlerMapping();
      xmlServer.setHandlerMapping(phm);
      int numServices = 0;
      try
      {
        L2Properties p = new L2Properties("config/powerpak/xmlrpc.service");
        for(Object s : p.keySet())
        {
          String service = p.getProperty(s.toString());
          Class<?> clazz = Class.forName(service);
          if(clazz != null)
          {
            numServices++;
            phm.addHandler(s.toString(), clazz);
View Full Code Here

    if(PowerPakConfig.WEBSERVER_ENABLED)
      try
      {
        int handlers = 0;
        _server = HttpServer.create(new InetSocketAddress(InetAddress.getByName(PowerPakConfig.WEBSERVER_HOST), PowerPakConfig.WEBSERVER_PORT), 10);
        L2Properties p = new L2Properties("./config/powerpak/websevices.properties");
        for(Object s : p.keySet())
        {
          String contextHandlerName = p.getProperty(s.toString());
          try
          {
            Class<?> contextHandler = Class.forName(contextHandlerName);
            if(contextHandler != null && HttpHandler.class.isAssignableFrom(contextHandler))
            {
View Full Code Here

  public SMSOnline()
  {
    _rewards.clear();
    try
    {
      L2Properties p = new L2Properties("./config/powerpak/webservices/smsonline.properties");
      _RewardID = Integer.parseInt(p.getProperty("RewardID","4037"));
      _prefix = p.getProperty("Prefix","");
      _MsgOk = L2Utils.loadMessage(p.getProperty("SMSOk","%d CoL dobavleno dlya %s"));
      _MsgFail = L2Utils.loadMessage(p.getProperty("SMSFail","%s ne zaregistrirovan na servere"));
      _PlayerMessage = L2Utils.loadMessage(p.getProperty("MessageForPlayer",""));
      StringTokenizer st = new StringTokenizer(p.getProperty("AmountForNumbers",""),";");
      while(st.hasMoreTokens())
      {
        try
        {
          String  s =st.nextToken();
View Full Code Here

  protected static String _UserMessage;

  public PayStream() throws Exception
  {
    // Parse the config, which lies in the config / powerpak / webservices / paystream.properties
    L2Properties p = new L2Properties("./config/powerpak/webservices/paystream.properties");
    _KEY = p.getProperty("SecurityKey", "");
    _item = Integer.parseInt(p.getProperty("RewardItem", "0"));
    _MessageFail = L2Utils.loadMessage(p.getProperty("MessageFail", "Character %s does not exists"));
    _MessageOK = L2Utils.loadMessage(p.getProperty("MessageOK", "%d CoL added for %s"));
    _SMSPrefix = p.getProperty("SMSPrefix", "");
    _UserMessage = L2Utils.loadMessage(p.getProperty("MessageForUser", ""));
   
    if(ItemTable.getInstance().getTemplate(_item) == null)
      throw new Exception("Reward item (" + _item + ") does not exits");
   
    StringTokenizer st = new StringTokenizer(p.getProperty("AmountForNumbers", ""), ";");
    while(st.hasMoreTokens())
    {
      String token = st.nextToken();
      try
      {
View Full Code Here

TOP

Related Classes of com.l2jfrozen.L2Properties

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.