Jump to content

Recommended Posts

Posted

nop, theres an unclosed connecton in my code. go to ColorNameManager.loadValues and at the botton of the method add

try{ if(con != null) con.close(); } catch(Exception e){ if(Config.DEBUG) e.printStackTrace(); }

 

where exactly i must add this? cause i am a little stupid in java

Posted

where exactly i must add this? cause i am a little stupid in java

 

go to ColorNameManager.java

find the method called public static void loadValues()

at the end of the method (before the last " } " ), add the

code i posted

Posted

symbol  : variable Config
location: class com.l2jserver.gameserver.model.actor.appearance.ColorNameManager
try{ if(con != null) con.close(); } catch(Exception e){ if(Config.DEBUG) e.printStackTrace(); }
		                                           ^

 

this is the error i see now when i try to add the code that you told me in the end of the method

  • 2 months later...
Posted

System.out.println("ColorNameManager: Loaded " + _pvpColor.size() + " colors for pvp kills!");

System.out.println("ColorNameManager: Loaded " + _pkColor.size() + " colors for pk kills!");

 

try

   {

if(con != null) con.close();

}

catch(Exception e)

   {  

}

}

 

This is my code after this fix but still i have unclosed connection when i relog a char with pvp/pk color.Can u help me BB ?

 

Ah forgot to ask u say in ur last post "public static void loadValues()" but in the script is "public void loadValues()" is that a problem?

  • 2 weeks later...
Posted

I try to use it but as i see from posts i have some of the problems.1st how can i remove primary key and second pls write the fix us a code here pls cause i dodn't understans what you try to tell :/ (i don't understand verygood english so i'm a little stupid :P)

  • 4 weeks later...
Posted

B1ggBoss Here you can put the diff with the changes already made?

 

(Puedes postear aqui el diff con los cambios ya echos?

B1ggBoss eres un monstruo y perdon por eres XDDD. Gracias un autentico genio!)

Posted

look for com.l2jserver.gameserver.model.actor.appearance.ColorNameManager.java

 

and replace it for:

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.actor.appearance;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Set;

import com.l2jserver.L2DatabaseFactory;

import javolution.util.FastMap;

/**
* @author BiggBoss
*/
public class ColorNameManager
{
   private static FastMap<Integer, String> _pvpColor = new FastMap<Integer, String>();
   private static FastMap<Integer, String> _pkColor = new FastMap<Integer, String>();
   
   private ColorNameManager()
   {
   }
   
   public static ColorNameManager getInstance()
   {
      return SingletonHolder._cne;
   }
   
   /**
    * Will load all pvp count with their respective color at server start up
    * Also will set up the higher pvp/pk count rank for future purposes
    */
   public void loadValues()
   {
      Connection con = null;
      try
      {
         _pvpColor.put(0, "FFFFFF");
         _pkColor.put(0, "FFFFFF");
         con = L2DatabaseFactory.getInstance().getConnection();
         PreparedStatement pvpStatement = con.prepareStatement("SELECT * FROM pvp_color_nick WHERE type = ?");
         pvpStatement.setString(1, "pvp");
         
         ResultSet pvpRset = pvpStatement.executeQuery();
         while(pvpRset.next())
         {
            _pvpColor.put(pvpRset.getInt("pvppk_count"), pvpRset.getString("color"));
         }
         pvpRset.close();
         pvpStatement.close();
         
         PreparedStatement pkStatement = con.prepareStatement("SELECT * FROM pvp_color_nick WHERE type = ?");
         pkStatement.setString(1, "pk");
         
         ResultSet pkRset = pkStatement.executeQuery();
         while(pkRset.next())
         {
            _pkColor.put(pkRset.getInt("pvppk_count"), pkRset.getString("color"));
         }
         pkRset.close();
         pkStatement.close();
      }
      catch(SQLException sqle)
      {
         sqle.printStackTrace();
      }
      finally
      {
         try
         {
            if(con != null)
               con.close();
         }
         catch(Exception e)
         {
            e.printStackTrace();
         }
      }
      System.out.println("ColorNameManager: Loaded " + _pvpColor.size() + " colors for pvp kills!");
      System.out.println("ColorNameManager: Loaded " + _pkColor.size() + " colors for pk kills!");
   }
   
   /**
    * Returns a string-representative with the color of the rank
    * @param kills
    * @param forPvp
    * @return a String containing the Hexadecimal color
    */
   public String getColor(int kills, boolean forPvp)
   {
      String color = "";
      if(forPvp)
         color = _pvpColor.get(getValueBefore(kills, _pvpColor.keySet()));
      else
         color = _pkColor.get(getValueBefore(kills, _pkColor.keySet()));
      
      return color;
   }
   
   /**
    * Will return the value just before the given value contained
    * in the provided Set of integers
    * @param value
    * @param set
    * @return the value just before the provided one
    */
   private static int getValueBefore(int value, Set<Integer> set)
   {
      int counter = 0;
      for(int i : set)
      {
         if(i > counter && value > i)
            counter = i;
      }
      return counter;
   }
         
   static class SingletonHolder
   {
      static ColorNameManager _cne = new ColorNameManager();
   }
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • 🚀 Telonyx Contest Platform Telegram Native Giveaway & Contest System for Modern Communities 💎 White-Label • Self-Hosted • Telegram Mini App • Monetization Ready 🧠 Product Overview Telonyx Contest Platform is a production-ready Telegram Mini App system designed for running modern contests, giveaways and engagement campaigns directly inside Telegram. It replaces outdated bot-based mechanics with a fully interactive application experience — no commands, no chat spam, no external websites. Users interact with a clean, fast and mobile-first interface inside Telegram. ⚡ Core Experience Participants can: • 🚀 instantly join contests inside Telegram Mini App • 🎁 view prizes and participation rules • 📊 track real-time contest status • ✅ verify task completion automatically • 🏆 receive winner results and notifications • 💰 participate in free or paid campaigns Everything is fully native to Telegram. 🧩 Key Platform Capabilities 🎯 Contest Engine • advanced contest creation system • multiple winners and reward tiers • scheduled launches and auto-finish logic • contest duplication and templates • real-time participant tracking • flexible rule configuration 📱 Mini App Interface • modern Telegram Mini App UX • mobile-first optimized layout • fast loading and smooth transitions • participant counter & live status • prize showcase system • one-click participation flow 🔎 Task Verification System Automated validation of participation rules: • Telegram channel subscriptions • sponsor channel requirements • multi-channel verification logic • YouTube subscription checks • TikTok task validation ❌ Zero manual moderation required 🛡 Anti-Fraud & Security Layer • duplicate entry prevention • bot detection system • CAPTCHA integration • rule enforcement engine • participation integrity checks 🏆 Automated Winner Selection • fully automated draw system • transparent winner selection logic • instant result publishing • winner notification system • historical archive of all contests 💎 Telegram Stars Monetization • optional paid participation via Telegram Stars • native Telegram checkout integration • flexible entry pricing per campaign • direct monetization of engagement traffic 🌍 Multi-Language Architecture Built with localization in mind. Supported out of the box: • 🇬🇧 English • 🇷🇺 Russian • 🇺🇦 Ukrainian • 🇹🇷 Turkish • 🇪🇸 Spanish • 🇵🇹 Portuguese • ➕ extensible language system for custom localization All UI layers, notifications and admin panel can be fully translated per deployment. 🎯 Ideal Use Cases 🎮 Gaming Projects / Lineage II Servers • pre-launch hype campaigns • donation reward giveaways • VIP / premium account distribution • promo code campaigns • server opening events 🎥 Streamers & Creators • subscriber engagement campaigns • live stream giveaways • audience growth funnels • partnership promotions 🌐 Communities & Brands • automated engagement systems • viral marketing campaigns • audience retention mechanics 🏗 Architecture & Deployment • Telegram Mini App frontend • FastAPI backend architecture • PostgreSQL database layer • Redis caching system • Docker-based deployment • WebSocket real-time updates • REST API integration layer 📦 Self-hosted deployment — full control over infrastructure and data 🎨 White-Label & Customization Each installation can be fully customized: • complete UI/UX rebranding • project-specific visual identity • custom engagement mechanics • referral & viral systems • loyalty & progression systems • seasonal campaign modules • custom API integrations   💡 Why This Platform Traditional contest bots are limited, noisy and inefficient. Telonyx Contest Platform is a modern engagement layer for Telegram ecosystems — combining UX, automation and monetization in one system. ✔ Higher participation rate ✔ Lower friction ✔ Direct revenue via Telegram Stars ✔ Full control via self-hosted deployment 💼 Commercial Model • Single License (Self-Hosted Deployment) • White-Label Branding Rights • Optional Custom Development • Installation & Setup Service 📩 Contact For demo access, licensing details or custom implementation: @se1dhe @telonyx_dev  
    • https://discord.gg/acvqx9rbhy Added intelligent agent that reads scripts and config and provides infos to players regarding gameplay Like where to farm/max enchants etc etc   Added auto translate to En/ES/BR htmls without api
    • The core strength of Novproxy Perfectly unlock overseas AI large models: 100% pure residential IP, perfectly bypassing various strict risk controls such as ChatGPT, Claude, Midjourney, etc. This is an essential tool for parents to train AI on weekends and during work! Available in 195+ countries/regions worldwide: covering an extremely wide range. Whether it's setting up accounts for cross-border e-commerce, conducting overseas web crawling, or conducting network gray-scale tests, it can all be handled easily. Ultra-fast concurrency: Real residential network, stable and non-blocking, high-concurrency business can also run at full capacity.
    • Thanks for your comment. That's what I'm working on, but it takes a lot of planning and getting it to work. I hope I can pull it off. Right now, I'm working on the Party feature, and I'm also working on AI conversations focused solely on Lineage, meaning the AI will only talk about the game. We'll see how it goes. The idea is to develop the system so thoroughly that there are sieges and the Phantom Players are undetectable, making them seem as realistic as possible. I'm sorry, but I don't see it as a useful modification. I'm also doing modifications on request, so if you're interested, you can send me a PM.
    • Trader Feedback  0  0  0 Total Rating 0%  Status:Offline  Group:Members  Posts:29  Reputation:  Member No:245618  Days Won:0  Joined:04/06/2026    Gender:Not Telling    Country: Author Posted April 29 TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..