I'm trying to create search types, but I come across a problem in the substring when I create a switch I don't get all my search data.
Code base :
Old:
+@Override+public boolean useAdminCommand(String command,Player activeChar)+{+ final NpcHtmlMessage html =newNpcHtmlMessage(0);+ html.setFile("data/html/admin/search.htm");++if(command.equals("admin_search"))+ html.replace("%list%","<center><br><br><br>Set first an key word</center>");+elseif(command.startsWith("admin_search"))+{+StringTokenizer st =newStringTokenizer(command," ");+ st.nextToken();++int page =Integer.valueOf(st.nextToken());+if(st.hasMoreTokens())+{+StringBuilder sb =newStringBuilder(String.valueOf(page));+StringBuilderlist= getList(activeChar, page, command.substring(14+ sb.length()));+ html.replace("%list%",list== null ?"":list.toString());+}+else+ html.replace("%list%","<center><br><br><br>Set first an key word</center>");+}+ activeChar.sendPacket(html);+returntrue;+}+
New :
@Overridepublicvoid useAdminCommand(String command,Player player){
final StringTokenizer st =newStringTokenizer(command," ");
st.nextToken();
final NpcHtmlMessage html =newNpcHtmlMessage(0);
html.setFile("data/html/admin/search.htm");if(command.equals("admin_search"))
html.replace("%list%","<center><br><br><br>Set first an key word</center>");elseif(command.startsWith("admin_search")){if(!st.hasMoreTokens()){
player.sendMessage("Usage: //search <item>");return;}int page =Integer.valueOf(st.nextToken());switch(st.nextToken()){case"item":if(st.hasMoreTokens()){StringBuilder sb =newStringBuilder(String.valueOf(page));StringBuilderlist= getListItem(player, page, command.substring(14+ sb.length()));
html.replace("%list%",list== null ?"":list.toString());}else
html.replace("%list%","<center><br><br><br>Set first an key word</center>");break;}}
player.sendPacket(html);}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
As you may have noticed, normal members cannot edit their own threads.
I have extended normal members to edit their own content up to 1440 minutes (24 hours or 1 day) after they made their topic/post.
To access unlimited edits of your contents, you need to upgrade to Premium or Gold Member .
what about VIP members which is the only role who can't bump their topics? I've been experiencing this for over a year now. I've contacted both you and Celestine multiple times, but I haven't received any response explaining why this is happening.
Question
Williams
I'm trying to create search types, but I come across a problem in the substring when I create a switch I don't get all my search data.
Code base :
Old:
New :
Html :
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.