RequestBypassToServer from everywhere ?

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Lee
Posts: 102
Joined: Wed Sep 02, 2009 11:10 pm

RequestBypassToServer from everywhere ?

Post by Lee »

Hello there.
I am trying to make the bypass work from everywhere, creating something like this :

RequestBypassToServer.java

Code: Select all

            else if (_command.startsWith("newbie"))            {                String sub = _command.substring(7);                Core.onBypass(sub, activeChar);            }
thats how i registred the bypass

Core.onBypass

Code: Select all

    public static synchronized void onBypass(String command, L2PcInstance pi)    {        if (pi == null)            return;                if (command.startsWith("start"))        {            doCheck(pi);            htmFile += "start";            htmFile += ".htm";            String htmContent = HtmCache.getInstance().getHtm(htmFile);            if (htmContent != null)            {                NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(pi.getObjectId());                npcHtmlMessage.setHtml(htmContent);                npcHtmlMessage.replace("%name%", String.valueOf(pi.getName()));                pi.sendPacket(npcHtmlMessage);            }                    }                if (command.startsWith("class_gladi"))        {            doCheck(pi);            giveImperial(pi);            pi.addItem("newbieSystem", 6580, 1, pi, true); // Duals S Grade            htmFile += "gladi";            htmFile += ".htm";            String htmContent = HtmCache.getInstance().getHtm(htmFile);            if (htmContent != null)            {                NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(pi.getObjectId());                npcHtmlMessage.setHtml(htmContent);                npcHtmlMessage.replace("%name%", String.valueOf(pi.getName()));                pi.sendPacket(npcHtmlMessage);            }        }                 else if (command.startsWith("finish"))        {            doCheck(pi);            htmFile += "finish";            htmFile += ".htm";            String htmContent = HtmCache.getInstance().getHtm(htmFile);            if (htmContent != null)            {                pi.sendMessage("executing htm");                NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(pi.getObjectId());                npcHtmlMessage.setHtml(htmContent);                npcHtmlMessage.replace("%name%", String.valueOf(pi.getName()));                pi.sendPacket(npcHtmlMessage);                pi.sendMessage("executed htm for finish");            }                    pi.addAdena("newbie system", 400000000, pi, true);             //if (!pi.isGM())                //isdone = true;        }        else if (command.startsWith("telefinish"))        {            doCheck(pi);            pi.teleToLocation(1, 1, 1); // teleport to giran ?            pi.getStat().setLevel(80);        }    }
The problem is that when I click it, nothing happends. HTML's are showing only the first time I click them, then they stop and send only the condition check message (so its executing the command). The idea is to go from bypass to bypass, like

Welcome blablab

Next (bypass -h newbie_next)

newbie_next

To do blablalba you must blablalba so begin

Begin (bypass -h newbie_begin)

How can I do this ?
User avatar
tukune
Posts: 533
Joined: Sun Mar 29, 2009 2:35 pm
Location: Japan

Re: RequestBypassToServer from everywhere ?

Post by tukune »

:idea:

Code: Select all

  public static synchronized void onBypass(String command, L2PcInstance pi)  {+    System.out.println("Core#onBypass: command=<" + command + ">"); //debug+    System.out.println("Core#onBypass: pi=" + (pi == null ? "NULL" : pi.getName())); //debug      if (pi == null)          return;         if (command.startsWith("start"))
Lee
Posts: 102
Joined: Wed Sep 02, 2009 11:10 pm

Re: RequestBypassToServer from everywhere ?

Post by Lee »

anyone ?
Post Reply