Fix bank packet exploit + fishing guild banking (#300)

This commit is contained in:
Daniel Ginovker
2019-12-17 15:11:59 -05:00
committed by GitHub
parent 0653db8ad1
commit 223c3194a8
8 changed files with 12 additions and 1 deletions
@@ -32,7 +32,7 @@ public class BotHandler {
public static void playerShop(Player player){
// Must be in the correct zones
if (!player.inPlayerShopArea() && !player.inBankArea()) {
if (!player.inPlayerShopArea()) {
player.getPacketSender().sendMessage("You need to be in a bank zone or trade area for this.");
return;
}
@@ -2093,6 +2093,11 @@ public class ItemAssistant {
public void fromBank(int itemID, int fromSlot, int amount) {
boolean cantWithdrawCuzMaxStack = false;
if (c.lastMainFrameInterface != MainFrameIDs.BANK)
{
c.getPacketSender().sendMessage("Your bank isn't open!");
return;
}
if (amount > 0) {
if (c.bankItems[fromSlot] > 0) {
if (c.getItemAssistant().playerHasItem(itemID))
@@ -1757,6 +1757,7 @@ public abstract class Player {
isInArea(2530,4725,2550,4705) || //Phasmatys
isInArea(2834, 10215, 2841, 10204) || // Keldagrim
isInArea(2379, 4453, 2386, 4462) || // Zanaris
isInArea(2582, 3423, 2591, 3417) || //Fishing Guild
false;
}
@@ -344,6 +344,11 @@ public class ShopAssistant {
player.getPacketSender().sendMessage("Selling items as an admin has been disabled.");
return false;
}
if (!player.inPlayerShopArea()) //Packet abuse!
{
player.getPacketSender().sendMessage("You're not in a shopping area! Enter one to sell items & manage your store.");
return false;
}
if(!player.isShopping) {
return false;
}