Thread: [PI] Wierd trade bug

Results 1 to 9 of 9
  1. #1 [PI] Wierd trade bug 
    Donator

    Join Date
    Feb 2013
    Posts
    1,670
    Thanks given
    477
    Thanks received
    244
    Rep Power
    29
    When I try to take an item out of trade, it doesn't work unless I have at least one of that item in my inventory.

    http://puu.sh/7eMj5.jpg
    That's me, trading a santa hat, can't take it out.

    http://puu.sh/7eMl1.jpg
    Now I can take them out

    http://puu.sh/7eMly.jpg
    Now I can't take them out.

    Any help is apprecaited.
    Or if you at least know what class it's in, please tell me.

    (Already tried to replace TradeAndDuel)
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Feb 2013
    Posts
    1,670
    Thanks given
    477
    Thanks received
    244
    Rep Power
    29
    Bump.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Shoutbox's Avatar
    Join Date
    Sep 2013
    Posts
    1,748
    Thanks given
    580
    Thanks received
    363
    Rep Power
    834
    Not being mean but that has to be a PI. On topic. I think you shouldnt use that base and also message me on Skype because I know another dupe/bug that might work on your server.
    S A D B O Y S

    私は自分自身を殺すために待つことができない
    Reply With Quote  
     

  4. #4  
    Donator

    Join Date
    Feb 2013
    Posts
    1,670
    Thanks given
    477
    Thanks received
    244
    Rep Power
    29
    Quote Originally Posted by Suicide View Post
    Not being mean but that has to be a PI. On topic. I think you shouldnt use that base and also message me on Skype because I know another dupe/bug that might work on your server.
    Yes it's a PI. I have putten hours of work into this server, so not switching base...
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2014
    Posts
    23
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Bump.
    EDIT: I fixed it, but I might have caused a dupe or something doing so... Can someone tell me what the point of this is in my fromTrade method?

    Code:
    public boolean fromTrade(int itemID, int fromSlot, int amount) {
    		Client o = (Client) Server.playerHandler.players[c.tradeWith];
    		if(o == null) {
    			return false;
    		}
    		try {
    			if (!c.inTrade || !c.canOffer) {
    				declineTrade();
    				return false;
    			}
    			/*if(!c.getItems().playerHasItem(itemID, amount))
    				return false;*/
    			c.tradeConfirmed = false;
    			o.tradeConfirmed = false;
    			if(!Item.itemStackable[itemID]) {
    				for(int a = 0; a < amount; a++) {
    					for (GameItem item : offeredItems) {
    						if(item.id == itemID) {	
    							if(!item.stackable) {	
    								offeredItems.remove(item);	
    								c.getItems().addItem(itemID, 1);	
    								o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);		
    							} else {
    								if(item.amount > amount) {
    									item.amount -= amount;
    									c.getItems().addItem(itemID, amount);
    									o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);								
    								} else {
    									amount = item.amount;
    									offeredItems.remove(item);
    									c.getItems().addItem(itemID, amount);
    									o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    								}
    							}
    							break;
    						}
    						o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    						c.tradeConfirmed = false;
    						o.tradeConfirmed = false;
    						c.getItems().resetItems(3322);
    						resetTItems(3415);
    						o.getTradeAndDuel().resetOTItems(3416);
    						c.getPA().sendFrame126("", 3431);
    						o.getPA().sendFrame126("", 3431);
    					}
    				}	
    			}
    			for (GameItem item : offeredItems) {
    				if(item.id == itemID) {
    					if(!item.stackable) {
    					} else  {
    						if(item.amount > amount) {
    							item.amount -= amount;
    							c.getItems().addItem(itemID, amount);
    							o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    						} else  {
    							amount = item.amount;
    							offeredItems.remove(item);
    							c.getItems().addItem(itemID, amount);
    							o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    						}
    					}
    					break;
    				}
    			}
    
    			o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    			c.tradeConfirmed = false;
    			o.tradeConfirmed = false;
    			c.getItems().resetItems(3322);
    			resetTItems(3415);
    			o.getTradeAndDuel().resetOTItems(3416);
    			c.getPA().sendFrame126("", 3431);
    			o.getPA().sendFrame126("", 3431);
    		} catch(Exception e){}
    		return true;
    	}
    All it does is checking if the player has the item, he's trying to take out in his inventory. What's the point of that?
    Reply With Quote  
     

  6. #6  
    Banned [PI] Wierd trade bug Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by Evito View Post
    Bump.
    EDIT: I fixed it, but I might have caused a dupe or something doing so... Can someone tell me what the point of this is in my fromTrade method?

    Code:
    public boolean fromTrade(int itemID, int fromSlot, int amount) {
    		Client o = (Client) Server.playerHandler.players[c.tradeWith];
    		if(o == null) {
    			return false;
    		}
    		try {
    			if (!c.inTrade || !c.canOffer) {
    				declineTrade();
    				return false;
    			}
    			/*if(!c.getItems().playerHasItem(itemID, amount))
    				return false;*/
    			c.tradeConfirmed = false;
    			o.tradeConfirmed = false;
    			if(!Item.itemStackable[itemID]) {
    				for(int a = 0; a < amount; a++) {
    					for (GameItem item : offeredItems) {
    						if(item.id == itemID) {	
    							if(!item.stackable) {	
    								offeredItems.remove(item);	
    								c.getItems().addItem(itemID, 1);	
    								o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);		
    							} else {
    								if(item.amount > amount) {
    									item.amount -= amount;
    									c.getItems().addItem(itemID, amount);
    									o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);								
    								} else {
    									amount = item.amount;
    									offeredItems.remove(item);
    									c.getItems().addItem(itemID, amount);
    									o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    								}
    							}
    							break;
    						}
    						o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    						c.tradeConfirmed = false;
    						o.tradeConfirmed = false;
    						c.getItems().resetItems(3322);
    						resetTItems(3415);
    						o.getTradeAndDuel().resetOTItems(3416);
    						c.getPA().sendFrame126("", 3431);
    						o.getPA().sendFrame126("", 3431);
    					}
    				}	
    			}
    			for (GameItem item : offeredItems) {
    				if(item.id == itemID) {
    					if(!item.stackable) {
    					} else  {
    						if(item.amount > amount) {
    							item.amount -= amount;
    							c.getItems().addItem(itemID, amount);
    							o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    						} else  {
    							amount = item.amount;
    							offeredItems.remove(item);
    							c.getItems().addItem(itemID, amount);
    							o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    						}
    					}
    					break;
    				}
    			}
    
    			o.getPA().sendFrame126("Trading with: " + c.playerName+" who has "+c.getItems().freeSlots()+" free slots" ,3417);	
    			c.tradeConfirmed = false;
    			o.tradeConfirmed = false;
    			c.getItems().resetItems(3322);
    			resetTItems(3415);
    			o.getTradeAndDuel().resetOTItems(3416);
    			c.getPA().sendFrame126("", 3431);
    			o.getPA().sendFrame126("", 3431);
    		} catch(Exception e){}
    		return true;
    	}
    All it does is checking if the player has the item, he's trying to take out in his inventory. What's the point of that?
    there is no point... it should be checking if the player has the item in the trade interface to protect from packet injection

    and then you guys wonder why your project insanity/delta server have so many dupes and problems... please just use a proper base
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Mar 2014
    Posts
    23
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by lare96 View Post
    there is no point... it should be checking if the player has the item in the trade interface to protect from packet injection

    and then you guys wonder why your project insanity/delta server have so many dupes and problems... please just use a proper base
    Thank you. I will make it check if the item is in the trade interface.
    Would this work or am I just being stupid?

    Code:
    if(!offeredItems.contains(itemID))
    				return false;
    Reply With Quote  
     

  8. #8  
    Banned [PI] Wierd trade bug Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by Evito View Post
    Thank you. I will make it check if the item is in the trade interface.
    Would this work or am I just being stupid?

    Code:
    if(!offeredItems.contains(itemID))
    				return false;
    you aren't stupid

    that looks like it would work
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Mar 2014
    Posts
    23
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by lare96 View Post
    you aren't stupid

    that looks like it would work
    Thank you.
    I spent hours on this PI, so not going to switch base now.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. PI new trade screen bug
    By woof woof bish in forum Help
    Replies: 4
    Last Post: 01-23-2012, 07:52 AM
  2. Replies: 6
    Last Post: 07-10-2011, 06:20 PM
  3. [Riot/PI]Simple Trade Bug Issue
    By Lmctruck30 in forum Snippets
    Replies: 6
    Last Post: 12-18-2010, 02:37 AM
  4. [PI] Wierd Bug?
    By Mrthunder23 in forum Help
    Replies: 3
    Last Post: 10-17-2010, 10:44 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •