Jump to content
  • 0

Hallo Guys Someone Can Help Me!


Question

Posted (edited)

Ok so, the problem is this, am creating a l2jfrozen project and i want to add a Special RB Manager, i find one with code for the core i put it but when i open the server then go to the manager i get this http://prntscr.com/anj5q5 & in GS Console i get this message: "Html is too long! this will crash the client!"

I Can't understand why is this, i check the code 40 times but i cant understand, hope you can help me guys  :S :/

If someone help me i will be to much happy!

Thanks in advance!

This is the code:

 

package com.l2jfrozen.gameserver.model.actor.instance;

import com.l2jfrozen.util.database.L2DatabaseFactory;
import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import java.util.HashMap;
import java.sql.*;

public class L2RBStatsInstance extends L2NpcInstance {

        public L2RBStatsInstance(int objectId, L2NpcTemplate template) {
            super(objectId, template);
            // TODO Auto-generated constructor stub
        }
        
        public void onAction(L2PcInstance player) {
            if (this != player.getTarget())
            {
                player.setTarget(this);
                player.sendPacket(new MyTargetSelected(getObjectId(), 0));
                player.sendPacket(new ValidateLocation(this));
            }
            else
            {
                player.sendPacket(new MyTargetSelected(getObjectId(), 0));
                player.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, this);
                
                if (!isInsideRadius(player, 150, false, false))
                    player.sendPacket(ActionFailed.STATIC_PACKET);
                else
                    showHtmlWindow(player);
            }
        }
        
        private void showHtmlWindow(L2PcInstance activeChar)
        {
            showChatWindow(activeChar);

            activeChar.sendPacket(ActionFailed.STATIC_PACKET);
        }
        

    public void showChatWindow(L2PcInstance player) {
            NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId());
            StringBuilder tb = new StringBuilder();
            PreparedStatement statement = null;
            ResultSet rset = null;
            HashMap<Integer,String> raidboss = new  HashMap<Integer,String>();
            
            raidboss.put(100885,"Beleth 50lv");
            raidboss.put(100020,"Istina 80lv");
            
            tb.append("<html><title>Raid Boss Status</title><body><center><br>");
            
            try (Connection con = L2DatabaseFactory.getInstance().getConnection())
            {
                statement = con.prepareStatement("SELECT boss_id, respawn_time FROM grandboss_data UNION SELECT boss_id, respawn_time FROM raidboss_spawnlist");

                rset = statement.executeQuery();
                tb.append("<table width=\"150\">");
                tb.append("<tr><td>Name</td>");
                tb.append("<td>Status</td></tr>");
                
                while (rset.next())
                 {
                    
                    tb.append("<tr><td>" + raidboss.get(rset.getInt("boss_id")) + "</td>");
                    if (rset.getLong("respawn_time") > 0)
                    tb.append("<td><font color=\"b09979\">"  + "Dead" + "</font></td></tr>");
                    else
                    tb.append("<td>" + "<font color=\"b09979\">Alive</font>" + "</td></tr>");
                    
                }
                tb.append("</table>");
                
                rset.close();
                statement.close();
            }
            catch (SQLException e)
            {
                e.printStackTrace();
            }
              
              tb.append("</center></body></html>");
              
              msg.setHtml(tb.toString());
              msg.replace("%objectId%", String.valueOf(this.getObjectId()));
              player.sendPacket(msg);
        }
    }    
      

Edited by antoskasas123

1 answer to this question

Recommended Posts

  • 0
Posted

The html this code produces is too long, that is why it shows you the error. If the html is too long, the client will crash. You can implement an results pagination to show the results.

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

    • Fresh off my private server for inspiration.
    • Custom High Five server L2insolence will open 2026-06-17 21:00 GMT+2 ! ! ! Web: http://www.l2insolence.eu/ Discord: https://discord.gg/duMjnj3y9A We have custom: 10 diferent looking custom armor sets. 8 weapon sets, 2 weapons sets are upgradable. 6 jewel sets. ----------------------------------- All custom tatto, masks, cloaks, agathions, belts, bracelest, talismans and more. Everi single item have own custom stats like: +p.atk% , +m.atk% , +p/m.def% and mutch more. All items in game have own stats. With custom looks. Glowing etc. ----------------------------------- Rates XP, SP: 25x Spoil and Drop: 10x Server Hard Farm ----------------------------------- Enchantment Safe enchant: +20099 Max enchant: +20099 All scrolls: 100% ----------------------------------- You can use scrolls or item enchant NPC to make +++ abd life beter. NPC Buffer There's an NPC buffer in all of our main towns. We have custom self buffs learned with npc with custom stats. Global Gatekeeper. GM Shop with normal items and custom ones, Event NPC, item upgrader NPC. Raid Bosses, every zone have its own boss and drops for rare mats, respawn every 10 seconds.. Olympiad The olympiad is ongoing every two weeks.
    • I agree that kernel-level protection offers much deeper visibility and control, especially when it comes to advanced bots and bypass techniques. That said, I'm not trying to claim that a usermode solution is impossible to bypass. My goal is simply to increase the cost and complexity of bypassing the protection while keeping deployment simple, stable, and compatible for server owners. A lot of Interlude server operators don't want to install kernel drivers or deal with the risks and maintenance that come with them. That's why I'm currently focusing on a layered approach: secure launcher architecture, HWID licensing, session validation, anti-debugging, injection detection, integrity checks, replay protection, and heartbeat monitoring. I'm not ruling out kernel support in the future. Right now, my priority is gathering real-world feedback, improving the product, and learning how people attempt to bypass different protection layers. I appreciate the feedback and the discussion.
    • not true, you can change any bot program name so the ones that are injecting aint a problem any more, you can aswell bypass everything in a dll so his way of thinking isnt bad at all
  • 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..