Jump to content
  • 0

Question

Posted

hello guys i tried knowing what is causing captcha not working but i have no clue here in config.java

	//Captcha
	public static boolean CAPTCHA_ALLOW;
	public static long CAPTCHA_ANSWER_SECONDS;
	public static long CAPTCHA_JAIL_SECONDS;
	public static long CAPTCHA_TIME_BETWEEN_TESTED_SECONDS;
	public static long CAPTCHA_TIME_BETWEEN_REPORTS_SECONDS;
	public static int CAPTCHA_MIN_LEVEL;
	public static int CAPTCHA_COUNT;
	public static String[] CAPTCHA_PUNISHMENT;
	public static boolean EVENT_RANDOM_TASK;
	public static long EVENT_RANDOM_TIME;
==========================================
//Captcha
		CAPTCHA_ALLOW = otherSettings.getProperty("AllowCaptcha", true);
		CAPTCHA_ANSWER_SECONDS = otherSettings.getProperty("CaptchaAnswerTime", 15L);
		CAPTCHA_JAIL_SECONDS = otherSettings.getProperty("CaptchaJailTime", 1800L);
		CAPTCHA_TIME_BETWEEN_TESTED_SECONDS = otherSettings.getProperty("CaptchaDelayBetweenCaptchas", 1800L);
		CAPTCHA_TIME_BETWEEN_REPORTS_SECONDS = otherSettings.getProperty("CaptchaReportDelay", 7200);
		CAPTCHA_MIN_LEVEL = otherSettings.getProperty("CaptchaMinLevel", 40);
	    CAPTCHA_COUNT = otherSettings.getProperty("CaptchaCount", 2);
	    CAPTCHA_PUNISHMENT = otherSettings.getProperty("CaptchaPunishment", new String[] { "JAIL:90", "JAIL:350", "JAIL:900", "BAN:-100" });
==========================================
captcha.java :
package l2f.gameserver.handler.voicecommands.impl.BotReport;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import l2f.gameserver.Config;
import l2f.commons.util.Rnd;
import l2f.gameserver.data.htm.HtmCache;
import l2f.gameserver.model.Player;
import l2f.gameserver.network.serverpackets.NpcHtmlMessage;
import l2f.gameserver.network.serverpackets.PledgeCrest;
import l2f.gameserver.vote.DDSConverter;
/**
 * Class that handles Generating and Sending Captcha Image to the Player
 */
public class Captcha
{
        private static final char[] CAPTCHA_TEXT_POSSIBILITIES = {'A','B','C','D','E','F','G','H','K','L','M','P','R','S','T','U','W','X','Y','Z'};
        private static final int CAPTCHA_WORD_LENGTH = 5;
        private static final int CAPTCHA_MIN_ID = 1900000000;
        private static final int CAPTCHA_MAX_ID = 2000000000;
        /**
         * Generation new Captcha ID
         * Generation random Captcha Text
         * Generating BufferedImage
         * Sending BufferedImage as PledgeCrest to the Target
         * Sending HTML Window with Captcha to the player
         * @param target that will receive image and html Window
         * @return Captcha Text that player will try to write on Text Box
         */
        public static String sendCaptcha(Player target)
        {
                int captchaId = generateRandomCaptchaId();
                char[] captchaText = generateCaptchaText();
                BufferedImage image = generateCaptcha(captchaText);
                PledgeCrest packet = new PledgeCrest(captchaId, DDSConverter.convertToDDS(image).array());
                target.sendPacket(packet);
                sendCaptchaWindow(target, captchaId);
                return String.valueOf(captchaText);
        }
        /**
         * Getting data/html-en/captcha.htm HTML
         * Replacing %captchaId% and %time%
         * Sending it as HTML window
         * @param target Player that will receive html
         * @param captchaId ID of the image to replace
         */
        private static void sendCaptchaWindow(Player target, int captchaId)
        {
                String text = HtmCache.getInstance().getNotNull("captcha.htm", target);
                text = text.replace("%captchaId%", String.valueOf(captchaId));
                text = text.replace("%time%", String.valueOf(Config.CAPTCHA_ANSWER_SECONDS));
                NpcHtmlMessage msg = new NpcHtmlMessage(0);
                msg.setHtml(text);
                target.sendPacket(msg);
        }
        private static char[] generateCaptchaText()
        {
                char[] text = new char[5];
                for (int i = 0; i < CAPTCHA_WORD_LENGTH; i++)
                        text[i] = CAPTCHA_TEXT_POSSIBILITIES[Rnd.get(CAPTCHA_TEXT_POSSIBILITIES.length)];
                return text;
        }
        private static int generateRandomCaptchaId()
        {
                return Rnd.get(CAPTCHA_MIN_ID, CAPTCHA_MAX_ID);
        }
        private static BufferedImage generateCaptcha(char[] text)
        {
                Color textColor = new Color(38, 213, 30);
                Color circleColor = new Color(73, 100, 151);
                Font textFont = new Font("comic sans ms", Font.BOLD, 24);
                int charsToPrint = 5;
                int width = 256;
                int height = 64;
                int circlesToDraw = 8;
                float horizMargin = 20.0f;
                double rotationRange = 0.7; // this is radians
                BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
                Graphics2D g = (Graphics2D) bufferedImage.getGraphics();
                //Draw an oval
                g.setColor(new Color(30,31,31));
                g.fillRect(0, 0, width, height);
                g.setColor(circleColor);
                for ( int i = 0; i < circlesToDraw; i++ ) {
                        int circleRadius = (int) (Math.random() * height / 2.0);
                        int circleX = (int) (Math.random() * width - circleRadius);
                        int circleY = (int) (Math.random() * height - circleRadius);
                        g.drawOval(circleX, circleY, circleRadius * 2, circleRadius * 2);
                }
                g.setColor(textColor);
                g.setFont(textFont);
                FontMetrics fontMetrics = g.getFontMetrics();
                int maxAdvance = fontMetrics.getMaxAdvance();
                int fontHeight = fontMetrics.getHeight();
                float spaceForLetters = -horizMargin * 2.0F + width;
                float spacePerChar = spaceForLetters / (charsToPrint - 1.0f);
                for ( int i = 0; i < charsToPrint; i++ )
                {
                        char characterToShow = text[i];
                        // this is a separate canvas used for the character so that
                        // we can rotate it independently
                        int charWidth = fontMetrics.charWidth(characterToShow);
                        int charDim = Math.max(maxAdvance, fontHeight);
                        int halfCharDim = charDim / 2;
                        BufferedImage charImage = new BufferedImage(charDim, charDim, BufferedImage.TYPE_INT_ARGB);
                        Graphics2D charGraphics = charImage.createGraphics();
                        charGraphics.translate(halfCharDim, halfCharDim);
                        double angle = (Math.random() - 0.5) * rotationRange;
                        charGraphics.transform(AffineTransform.getRotateInstance(angle));
                        charGraphics.translate(-halfCharDim,-halfCharDim);
                        charGraphics.setColor(textColor);
                        charGraphics.setFont(textFont);
                        int charX = (int) (0.5 * charDim - 0.5 * charWidth);
                        charGraphics.drawString(String.valueOf(characterToShow), charX, (charDim - fontMetrics.getAscent()) / 2 + fontMetrics.getAscent());
                        float x = horizMargin + spacePerChar * i - charDim / 2.0f;
                        int y = (height - charDim) / 2;
                        g.drawImage(charImage, (int) x, y, charDim, charDim, null, null);
                        charGraphics.dispose();
                }
                g.dispose();
                return bufferedImage;
        }
}

im enable it via the other.ini too but it just won't work inside the game no page will appear nothing even i tried with l2mythras - l2 ava - l2age all of the sources have the same problem captcha won't work at all enabling it from config.java - captcha.java - other.ini  even when i check the server id and it just won't show up anyone will know how to make it work or will advice me using another captcha system it will be easy to adabt in this source because it aint easy in this kind pack of files to adabt thank's to all 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

    • Interface sources for P447 (7s update) for Classic/Essence   NWindow + InterfaceClassic + L2Editor + L2ClientDat Mobius + XDat Editor   Download
    • Hey there, welcome to the community – no worries about being new, we all started exactly where you are. Let me break this down based on what you’re trying to achieve with your Interlude‑Classic idea.   What you’re describing is actually a pretty popular concept: basically Interlude gameplay and balance, but with Classic‑style UI and a cleaner overall user experience. A “hybrid client”, not a full chronicle change.   Projects that have done something similar or are worth studying:   Lucera 2 – You’re right about this one. They use a custom client that blends Interlude gameplay with a more modern/Classic‑like interface. Their UI work (inventory, skill bar, lobby, etc.) is a good reference point.   L2J Mobius – Not exactly your target, but it’s very flexible and has a lot of examples of customizations and adaptations between chronicles.   Smaller custom projects – There are (or were) a few hybrid attempts using Interlude server files with heavily modified clients, but most are private or closed‑source, so you mainly get ideas, not ready‑to-use files.   Where the real challenge is (the client side):   What you want is possible, but the heavy lifting is on the client, not the server. The main pain points usually are:   Making sure interface files are compatible between chronicles (UI textures, layouts, systemmsg, etc.).   L2Font and localization edits: titles, chat, system messages – a small mistake here can break visuals or cause weird text issues.   Character selection / lobby screens: if you take them from another chronicle, you have to adapt them carefully so they don’t conflict with Interlude data.   Inventory, status bars and shortcuts: they must still work with Interlude’s item/skill structure and packet format, or you’ll get visual desyncs and client errors.   About multi‑protocol:   You’re correct that multi‑protocol is often used by projects that want to support different client versions or custom blends. In your case, it can help “talk” properly with a customized client while keeping an Interlude base server. It doesn’t magically fix everything, but it gives you more flexibility on how client and server exchange data.   Quick chronicle breakdown (relevant for your idea):   2.0–2.6: Early, simpler mechanics, good base for old‑school vibes.   2.7: More skills and better balance, often used as a base for custom projects.   2.9.5: A “bridge” between old and new, very common choice for hybrid or heavily modded setups.   3.0+: Adds Kamael and systems you said you don’t want, so you’d mainly use it as a reference, not as a direct base.   My honest recommendation:   Start from a solid Interlude base (files you understand and can actually maintain). Interlude still has the most support, tools and community knowledge.   Focus first on UI/interface modifications instead of trying to change core mechanics. Use Lucera‑style clients and similar projects as visual/technical reference.   Consider a multi‑protocol setup only after you’re comfortable with a normal Interlude client; otherwise you’ll just stack complexity.   Join active L2J / client‑mod Discords and forums. There are specific channels for interface, system edits and client reverse‑engineering where people share tips and tools.   What I would avoid at the beginning:   No intentar mezclar tres o cuatro chronicles a la vez; con uno bien entendido + UI custom ya tienes más que suficiente trabajo.   No subestimar la parte de cliente; muchas veces es más complicada y más frágil que el lado del servidor.   No saltarte el testeo en entorno local; los híbridos rompen cosas pequeñas (tooltips raros, skills que crashean el cliente, UI bugueada) si no pruebas bien.   Resources worth checking:   L2J forums and old MaxCheaters threads about faction/hybrid servers and client mods.   GitHub repos with client tools and interface mods (even si no son exactamente tu chronicle, te sirven como ejemplo).   Discord communities focused on L2 client development; ahí es donde se mueve hoy la parte “seria” del modding.   The good news: what you want is achievable, just not “plug & play”. It will require patience, testing and a bit of learning on both server and client sides. If you share exactly which files/pack you’re planning to use and what you want your UI to look like, people here (me included) can give you more concrete, step‑by‑step advice.
    • I’m done with Lineage 2. Not because I “grew up”, not because I “don’t have time for games” anymore, but because this game has slowly turned into everything it was supposed to be against.   Let’s be honest: most people are not playing Lineage 2 anymore. They are running 5–10 boxes, macros and scripts, setting up their characters and going to watch Netflix. The core loop isn’t PvP, clan wars or raids – it’s AFK grinding and praying your gear upgrades don’t fail.   The game used to be about outplaying your enemy with positioning, timing and coordination. Now it’s about:   Who has more boxes logged in.   Who is willing to swipe the credit card harder.   Who abuses the most broken script, cheat or exploit before it gets “patched”.   And let’s talk about pay‑to‑win. You can pretend it’s “supporting the server” all you want, but when someone can buy power that takes others months (or is literally impossible) to reach, that’s not support, that’s buying victories. When top players are just walking credit cards with epics, donations and event gear, you don’t have competition, you have a spending contest.   The community? It’s just as bad. Most “friends” are temporary party members until they find a better CP, clan or donation package. Drama, backstabbing, ninja looting, clan leaders selling clan resources, spies in Discord – it’s more like a cheap political simulator than an MMO. People talk about “honor” and “fair play”, then log their 10th box, run radar and target through walls.   And private servers… So many promises: “long‑term project”, “no corruption”, “no over‑enchant items”, “balanced gameplay”. Then after a few weeks you see:   Admin friends with full gear “testing”.   Hidden donations or “special offers” for “supporters”.   GMs closing their eyes to obvious abuse because it’s their buddies or biggest donors. Every wipe and every “fresh start” is just another cycle of the same lie, and we all pretend “this time will be different”.   The saddest part? Most of us know all this and still keep coming back because Lineage 2 has an insane core – the world, the classes, the adrenaline of real PvP, the politics, the sieges. But that core is buried under layers of greed, abuse, bots, scripts, egos and fake promises.   So here is the brutal truth: Lineage 2 is not a hardcore competitive MMORPG anymore. It’s a casino disguised as nostalgia, kept alive by whales, box armies and people too addicted or too hopeful to finally let go.   If you’re still playing, ask yourself honestly: Are you having fun, or are you just grinding, coping and praying that “next server” will finally be the one that isn’t corrupt, pay‑to‑win or dead in three months?   For me, I’m out. Flame me, defend the game, call me salty – I don’t care. But deep down, most of you know I’m not lying.
  • 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..