Advertisement
Nik

sendCBHtml

Nik
Sep 17th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.96 KB | None | 0 0
  1.     private final void sendCBHtml(L2PcInstance activeChar, String html)
  2.     {
  3.         if (activeChar == null)
  4.             return;
  5.        
  6.         if (html != null)
  7.         {
  8.             activeChar.clearBypass();
  9.             int len = html.length();
  10.             for (int i = 0; i < len; i++)
  11.             {
  12.                 int start = html.indexOf("\"bypass ", i);
  13.                 int finish = html.indexOf("\"", start + 1);
  14.                 if (start < 0 || finish < 0)
  15.                     break;
  16.                
  17.                 if (html.substring(start+8, start+10).equals("-h"))
  18.                     start += 11;
  19.                 else
  20.                     start += 8;
  21.                
  22.                 i = finish;
  23.                 int finish2 = html.indexOf("$", start);
  24.                 if (finish2 < finish && finish2 > 0)
  25.                     activeChar.addBypass2(html.substring(start, finish2).trim());
  26.                 else
  27.                     activeChar.addBypass(html.substring(start, finish).trim());
  28.             }
  29.         }
  30.        
  31.         activeChar.sendPacket(new ShowBoard(null, "101"));
  32.         activeChar.sendPacket(new ShowBoard(html, "101"));
  33.         activeChar.sendPacket(new ShowBoard(null, "102"));
  34.         activeChar.sendPacket(new ShowBoard(null, "103"));
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement