Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/CommunityBoard.java b/aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/CommunityBoard.java
- index d5b2c6b..dc49a3b 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/CommunityBoard.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/communitybbs/CommunityBoard.java
- @@ -22,6 +22,7 @@
- import net.sf.l2j.gameserver.communitybbs.model.Forum;
- import net.sf.l2j.gameserver.communitybbs.model.Post;
- import net.sf.l2j.gameserver.communitybbs.model.Topic;
- +import net.sf.l2j.gameserver.data.xml.MultisellData;
- import net.sf.l2j.gameserver.enums.bbs.ForumAccess;
- import net.sf.l2j.gameserver.enums.bbs.ForumType;
- import net.sf.l2j.gameserver.model.actor.Player;
- @@ -119,6 +120,10 @@
- TopicBBSManager.getInstance().parseCmd(command, player);
- else if (command.startsWith("_bbsposts"))
- PostBBSManager.getInstance().parseCmd(command, player);
- + else if (command.startsWith("_bbsmultisell;"))
- + {
- + MultisellData.getInstance().separateAndSendCb(command.substring(14).trim(), player, false);
- + }
- else
- BaseBBSManager.separateAndSend("<html><body><br><br><center>The command: " + command + " isn't implemented.</center></body></html>", player);
- }
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java
- index 23e4364..b20ccca 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java
- @@ -77,50 +77,85 @@
- }
- /**
- - * Send the correct multisell content to a {@link Player}.<br>
- - * <br>
- - * {@link ListContainer} template is first retrieved, based on its name, then {@link Npc} npcId check is done for security reason. Then the content is sent into {@link PreparedListContainer}, notably to check Player inventory. Finally a {@link MultiSellList} packet is sent to the Player. That
- - * new, prepared list is kept in memory on Player instance, mostly for memory reason.
- - * @param listName : The ListContainer list name.
- - * @param player : The Player to check.
- - * @param npc : The Npc to check (notably used for npcId check).
- - * @param inventoryOnly : if true we check inventory content.
- - */
- - public void separateAndSend(String listName, Player player, Npc npc, boolean inventoryOnly)
- - {
- - final ListContainer template = _entries.get(listName.hashCode());
- - if (template == null)
- - return;
- -
- - if ((npc != null && !template.isNpcAllowed(npc.getNpcId())) || (npc == null && template.isNpcOnly()))
- - return;
- -
- - final PreparedListContainer list = new PreparedListContainer(template, inventoryOnly, player, npc);
- -
- - int index = 0;
- - do
- - {
- - // send list at least once even if size = 0
- - player.sendPacket(new MultiSellList(list, index));
- - index += PAGE_SIZE;
- - }
- - while (index < list.getEntries().size());
- -
- - player.setMultiSell(list);
- - }
- -
- - public ListContainer getList(String listName)
- - {
- - return _entries.get(listName.hashCode());
- - }
- -
- - public static MultisellData getInstance()
- - {
- - return SingletonHolder.INSTANCE;
- - }
- -
- - private static class SingletonHolder
- - {
- - protected static final MultisellData INSTANCE = new MultisellData();
- - }
- + * Send the correct multisell content to a {@link Player}.<br>
- + * <br>
- + * {@link ListContainer} template is first retrieved, based on its name, then {@link Npc} npcId check is done for security reason. Then the content is sent into {@link PreparedListContainer}, notably to check Player inventory. Finally a {@link MultiSellList} packet is sent to the Player. That
- + * new, prepared list is kept in memory on Player instance, mostly for memory reason.
- + * @param listName : The ListContainer list name.
- + * @param player : The Player to check.
- + * @param npc : The Npc to check (notably used for npcId check).
- + * @param inventoryOnly : if true we check inventory content.
- + */
- + public void separateAndSend(String listName, Player player, Npc npc, boolean inventoryOnly)
- + {
- + final ListContainer template = _entries.get(listName.hashCode());
- + if (template == null)
- + {
- + return;
- + }
- +
- + if ((npc != null && !template.isNpcAllowed(npc.getNpcId())) || (npc == null && template.isNpcOnly()))
- + {
- + return;
- + }
- +
- + final PreparedListContainer list = new PreparedListContainer(template, inventoryOnly, player, npc);
- +
- + int index = 0;
- + do
- + {
- + // send list at least once even if size = 0
- + player.sendPacket(new MultiSellList(list, index));
- + index += PAGE_SIZE;
- + }
- + while (index < list.getEntries().size());
- +
- + player.setMultiSell(list);
- + }
- +
- + /**
- + * Send the correct multisell content to a {@link Player}.<br>
- + * <br>
- + * {@link ListContainer} template is first retrieved, based on its name, no {@link Npc} checks are done. Then the content is sent into {@link PreparedListContainer}, notably to check Player inventory. Finally a {@link MultiSellList} packet is sent to the Player. That new, prepared list is kept
- + * in memory on Player instance, mostly for memory reason.
- + * @param listName : The ListContainer list name.
- + * @param player : The Player to check.
- + * @param inventoryOnly : if true we check inventory content.
- + */
- + public void separateAndSendCb(String listName, Player player, boolean inventoryOnly)
- + {
- + final ListContainer template = _entries.get(listName.hashCode());
- + if (template == null)
- + {
- + return;
- + }
- +
- + final PreparedListContainer list = new PreparedListContainer(template, inventoryOnly, player, null);
- +
- + int index = 0;
- + do
- + {
- + // send list at least once even if size = 0
- + player.sendPacket(new MultiSellList(list, index));
- + index += PAGE_SIZE;
- + }
- + while (index < list.getEntries().size());
- +
- + player.setMultiSell(list);
- + }
- +
- + public ListContainer getList(String listName)
- + {
- + return _entries.get(listName.hashCode());
- + }
- +
- + public static MultisellData getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final MultisellData INSTANCE = new MultisellData();
- + }
- }
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement