Thread: Weird item swapping bug with new data

Results 1 to 4 of 4
  1. #1 Weird item swapping bug with new data 
    Banned

    Join Date
    Dec 2014
    Posts
    281
    Thanks given
    200
    Thanks received
    116
    Rep Power
    0
    I packed the latest data into my client and i'm encountering a strange bug, old items work just fine but when i move one item from one spot to another this happens:

    Attached image
    Anybody got an idea?
    Reply With Quote  
     

  2. #2  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    What base? And post your moveitem packet.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Dec 2014
    Posts
    281
    Thanks given
    200
    Thanks received
    116
    Rep Power
    0
    Quote Originally Posted by Arithium View Post
    What base? And post your moveitem packet.
    I believe it was abyssalps but i don't remember 100% started it like 8 or 9 months ago, and do you want the moveitems packet or the method in item assistant? I'll post both.

    Spoiler for Packet:

    Code:
    package com.net.packet.impl;
    
    import java.util.Objects;
    
    import com.Server;
    import com.net.packet.PacketType;
    import com.fallenos.model.content.multiplayer.MultiplayerSessionFinalizeType;
    import com.fallenos.model.content.multiplayer.MultiplayerSessionStage;
    import com.fallenos.model.content.multiplayer.MultiplayerSessionType;
    import com.fallenos.model.content.multiplayer.duel.DuelSession;
    import com.fallenos.model.player.Client;
    
    /**
     * Move Items
     **/
    public class MoveItems implements PacketType {
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		int interfaceId = c.getInStream().readUnsignedWordBigEndianA();
    		boolean insertMode = c.getInStream().readSignedByteC() == 1;
    		int from = c.getInStream().readUnsignedWordBigEndianA();
    		int to = c.getInStream().readUnsignedWordBigEndian();
    		if (Server.getMultiplayerSessionListener().inSession(c, MultiplayerSessionType.TRADE)) {
    			Server.getMultiplayerSessionListener().finish(c, MultiplayerSessionFinalizeType.WITHDRAW_ITEMS);
    			c.sendMessage("You cannot move items whilst trading.");
    			return;
    		}
    		DuelSession duelSession = (DuelSession) Server.getMultiplayerSessionListener().getMultiplayerSession(c,
    				MultiplayerSessionType.DUEL);
    		if (Objects.nonNull(duelSession) && duelSession.getStage().getStage() > MultiplayerSessionStage.REQUEST
    				&& duelSession.getStage().getStage() < MultiplayerSessionStage.FURTHER_INTERACTION) {
    			c.sendMessage("You cannot move items right now.");
    			return;
    		}
    		c.getItems().moveItems(from, to, interfaceId, insertMode);
    
    	}
    }


    Spoiler for Method:

    Code:
    public void moveItems(int from, int to, int moveWindow, boolean insertMode) {
    		if (moveWindow == 3214) {
    			int tempI;
    			int tempN;
    			tempI = c.playerItems[from];
    			tempN = c.playerItemsN[from];
    			System.out.println("Debug: "+c.playerItems[from]);
    			c.playerItems[from] = c.playerItems[to];
    			c.playerItemsN[from] = c.playerItemsN[to];
    			
    			c.playerItems[to] = tempI;
    			c.playerItemsN[to] = tempN;
    		}
    		if (moveWindow == 5382) {
    			if (!c.isBanking) {
    				c.getPA().removeAllWindows();
    				resetBank();
    				return;
    			}
    			if (c.getPA().viewingOtherBank) {
    				c.getPA().resetOtherBank();
    				return;
    			}
    			if (c.getBank().getBankSearch().isSearching()) {
    				c.getBank().getBankSearch().reset();
    				return;
    			}
    			if (to > 999) {
    				int tabId = to - 1000;
    				if (tabId < 0)
    					tabId = 0;
    				if (tabId == c.getBank().getCurrentBankTab().getTabId()) {
    					c.sendMessage("You cannot add an item from it's tab to the same tab.");
    					resetBank();
    					return;
    				}
    				if (from > c.getBank().getCurrentBankTab().size()) {
    					resetBank();
    					return;
    				}
    				BankItem item = c.getBank().getCurrentBankTab().getItem(from);
    				if (item == null) {
    					resetBank();
    					return;
    				}
    				c.getBank().getCurrentBankTab().remove(item);
    				c.getBank().getBankTab()[tabId].add(item);
    			} else {
    				if (from > c.getBank().getCurrentBankTab().size() - 1
    						|| to > c.getBank().getCurrentBankTab().size() - 1) {
    					resetBank();
    					return;
    				}
    				if (!insertMode) {
    					BankItem item = c.getBank().getCurrentBankTab().getItem(from);
    					c.getBank().getCurrentBankTab().setItem(from, c.getBank().getCurrentBankTab().getItem(to));
    					c.getBank().getCurrentBankTab().setItem(to, item);
    				} else {
    					int tempFrom = from;
    					for (int tempTo = to; tempFrom != tempTo;)
    						if (tempFrom > tempTo) {
    							swapBankItem(tempFrom, tempFrom - 1);
    							tempFrom--;
    						} else if (tempFrom < tempTo) {
    							swapBankItem(tempFrom, tempFrom + 1);
    							tempFrom++;
    						}
    				}
    			}
    		}
    		if (moveWindow == 5382) {
    			resetBank();
    		}
    		if (moveWindow == 5064) {
    			int tempI;
    			int tempN;
    			tempI = c.playerItems[from];
    			tempN = c.playerItemsN[from];
    			c.playerItems[from] = c.playerItems[to];
    			c.playerItemsN[from] = c.playerItemsN[to];
    			c.playerItems[to] = tempI;
    			c.playerItemsN[to] = tempN;
    			resetItems(3214);
    		}
    		c.movingItems = true;
    		resetTempItems();
    		if (moveWindow == 3214) {
    			resetItems(3214);
    		}
    
    	}


    I attempted to debug it but it makes no sense lol. When i check the item id that is being moved it says 21003/21004 (elder maul) when its already moved it somehow becomes 27000, i got no idea how or why it's happening because i debugged 1 method lol and it isn't set to 27000 anywhere there.

    And i don't think its an issue with moveitem since other items work fine just not the latest raid items.

    Oh shit i figured it out. my item limit was set to 20700 and the item id was higher lol. cant believe i didn't notice that. Thanks for offering to help though bro.
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Try checking the packet client sided and seeing what id is actually being sent.
    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. adding new items with new data
    By Divine in forum Help
    Replies: 1
    Last Post: 07-05-2016, 10:34 AM
  2. Fixing switch items look bugs! [742+ - NEW]
    By Motherboard in forum Snippets
    Replies: 36
    Last Post: 02-02-2014, 10:00 PM
  3. Need help with new Data
    By SkyDog in forum Help
    Replies: 4
    Last Post: 11-17-2013, 03:18 AM
  4. 2 Bugs with New HD Models!
    By Division in forum Help
    Replies: 40
    Last Post: 10-03-2010, 04:59 AM
  5. Replies: 3
    Last Post: 09-10-2007, 07:07 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •