Thread: Farming objects not changing, configs, varbits?

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24
  1. #11  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

  2. #12  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

  3. #13  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    In your object definitions there's a var which is the varbit connected to that object. Ofcourse this is different each revision
    Reply With Quote  
     

  4. #14  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Joris View Post
    In your object definitions there's a var which is the varbit connected to that object. Ofcourse this is different each revision
    I found this method:
    Code:
    public ObjectDef method580() {
    		int i = -1;
    		if (anInt774 != -1) {
    			VarBit varBit = VarBit.cache[anInt774];
    			int j = varBit.anInt648;
    			int k = varBit.anInt649;
    			int l = varBit.anInt650;
    			int i1 = Client.anIntArray1232[l - k];
    			i = clientInstance.variousSettings[j] >> k & i1;
    		} else if (anInt749 != -1)
    			i = clientInstance.variousSettings[anInt749];
    		if (i < 0 || i >= childrenIDs.length || childrenIDs[i] == -1)
    			return null;
    		else
    			return forID(childrenIDs[i]);
    	}
    and it is used here:
    Code:
    if (objectDef.childrenIDs != null)
                        objectDef = objectDef.method580();
    So does that mean that childrenIDs is the varbit?
    Attached image
    Reply With Quote  
     

  5. #15  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    Quote Originally Posted by RememberM3 View Post
    I found this method:
    Code:
    public ObjectDef method580() {
    		int i = -1;
    		if (anInt774 != -1) {
    			VarBit varBit = VarBit.cache[anInt774];
    			int j = varBit.anInt648;
    			int k = varBit.anInt649;
    			int l = varBit.anInt650;
    			int i1 = Client.anIntArray1232[l - k];
    			i = clientInstance.variousSettings[j] >> k & i1;
    		} else if (anInt749 != -1)
    			i = clientInstance.variousSettings[anInt749];
    		if (i < 0 || i >= childrenIDs.length || childrenIDs[i] == -1)
    			return null;
    		else
    			return forID(childrenIDs[i]);
    	}
    and it is used here:
    Code:
    if (objectDef.childrenIDs != null)
                        objectDef = objectDef.method580();
    So does that mean that childrenIDs is the varbit?
    Yes it does look like that's it.
    Reply With Quote  
     

  6. #16  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Joris View Post
    Yes it does look like that's it.
    Alright, I'll try to print that.
    By the way, do you know why this is happening and has this to do with varbits?
    Attached image
    Attached image
    Reply With Quote  
     

  7. #17  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    Quote Originally Posted by RememberM3 View Post
    Alright, I'll try to print that.
    By the way, do you know why this is happening and has this to do with varbits?
    Attached image
    The examine is handled server sided by default. Your server looks quite custom (in terms of cache & client) so I can't tell for sure. Do you know where your object definitions are loaded server sided?
    Reply With Quote  
     

  8. #18  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Joris View Post
    The examine is handled server sided by default. Your server looks quite custom (in terms of cache & client) so I can't tell for sure. Do you know where your object definitions are loaded server sided?
    The server is a clean 317 server and I think the object definitions are loaded in the ObjectDef.java
    Code:
    package server.world.clip.region;
    
    public final class ObjectDef {
    
    	public static ObjectDef getObjectDef(int i) {
    		for (int j = 0; j < 20; j++)
    			if (cache[j].type == i)
    				return cache[j];
    
    		cacheIndex = (cacheIndex + 1) % 20;
    		ObjectDef class46 = cache[cacheIndex];
    		class46.type = i;
    		class46.setDefaults();
    		byte[] buffer = archive.get(i);
    		if (buffer != null && buffer.length > 0)
    			class46.readValues(new ByteStreamExt(buffer));
    		return class46;
    	}
    
    	private void setDefaults() {
    		anIntArray773 = null;
    		anIntArray776 = null;
    		name = null;
    		description = null;
    		modifiedModelColors = null;
    		originalModelColors = null;
    		xLength = 1;
    		yLength = 1;
    		aBoolean767 = true;
    		aBoolean757 = true;
    		hasActions = false;
    		aBoolean762 = false;
    		aBoolean764 = false;
    		anInt781 = -1;
    		anInt775 = 16;
    		actions = null;
    		anInt746 = -1;
    		anInt758 = -1;
    		isSolid = true;
    		anInt768 = 0;
    		aBoolean736 = false;
    		anInt774 = -1;
    		anInt749 = -1;
    		childrenIDs = null;
    	}
    
    	public static void loadConfig() {
    		archive = new MemoryArchive(new ByteStream(getBuffer("loc.dat")),
    				new ByteStream(getBuffer("loc.idx")));
    		cache = new ObjectDef[20];
    		for (int k = 0; k < 20; k++)
    			cache[k] = new ObjectDef();
    		System.out.println("[ObjectDef] Configuration has been loaded...");
    	}
    
    	public static byte[] getBuffer(String s) {
    		try {
    			java.io.File f = new java.io.File("./Data/world/object/" + s);
    			if (!f.exists())
    				return null;
    			byte[] buffer = new byte[(int) f.length()];
    			java.io.DataInputStream dis = new java.io.DataInputStream(
    					new java.io.FileInputStream(f));
    			dis.readFully(buffer);
    			dis.close();
    			return buffer;
    		} catch (Exception e) {
    		}
    		return null;
    	}
    
    	private void readValues(ByteStreamExt stream) {
    		int flag = -1;
    		do {
    			int type = stream.readUnsignedByte();
    			if (type == 0)
    				break;
    			if (type == 1) {
    				int len = stream.readUnsignedByte();
    				if (len > 0) {
    					if (anIntArray773 == null || lowMem) {
    						anIntArray776 = new int[len];
    						anIntArray773 = new int[len];
    						for (int k1 = 0; k1 < len; k1++) {
    							anIntArray773[k1] = stream.readUnsignedWord();
    							anIntArray776[k1] = stream.readUnsignedByte();
    						}
    					} else {
    						stream.currentOffset += len * 3;
    					}
    				}
    			} else if (type == 2) {
    				name = stream.readNewString();
    			} else if (type == 5) {
    				int len = stream.readUnsignedByte();
    				if (len > 0) {
    					if (anIntArray773 == null || lowMem) {
    						anIntArray776 = null;
    						anIntArray773 = new int[len];
    						for (int l1 = 0; l1 < len; l1++)
    							anIntArray773[l1] = stream.readUnsignedWord();
    					} else {
    						stream.currentOffset += len * 2;
    					}
    				}
    			} else if (type == 14)
    				xLength = stream.readUnsignedByte();
    			else if (type == 15)
    				yLength = stream.readUnsignedByte();
    			else if (type == 17)
    				aBoolean767 = false;
    			else if (type == 18)
    				aBoolean757 = false;
    			else if (type == 19)
    				hasActions = (stream.readUnsignedByte() == 1);
    			else if (type == 21)
    				aBoolean762 = true;
    			else if (type == 22) {
    			} else if (type == 23)
    				aBoolean764 = true;
    			else if (type == 24) {
    				anInt781 = stream.readUnsignedWord();
    				if (anInt781 == 65535)
    					anInt781 = -1;
    			} else if (type == 27)
    				continue;
    			else if (type == 28)
    				anInt775 = stream.readUnsignedByte();
    			else if (type == 29)
    				stream.readSignedByte();
    			else if (type == 39)
    				stream.readSignedByte();
    			else if (type >= 30 && type < 39) {
    				if (actions == null)
    					actions = new String[5];
    				actions[type - 30] = stream.readNewString();
    				hasActions = true;
    				if (actions[type - 30].equalsIgnoreCase("hidden"))
    					actions[type - 30] = null;
    			} else if (type == 40) {
    				int i1 = stream.readUnsignedByte();
    				modifiedModelColors = new int[i1];
    				originalModelColors = new int[i1];
    				for (int i2 = 0; i2 < i1; i2++) {
    					modifiedModelColors[i2] = stream.readUnsignedWord();
    					originalModelColors[i2] = stream.readUnsignedWord();
    				}
    
    			} else if (type == 41) {
    				int l = stream.readUnsignedByte();
    				stream.skip(l * 4);
    			} else if (type == 42) {
    				int l = stream.readUnsignedByte();
    				stream.skip(l);
    			} else if (type == 60)
    				anInt746 = stream.readUnsignedWord();
    			else if (type == 62) {
    			} else if (type == 64)
    				isSolid = false;
    			else if (type == 65)
    				stream.readUnsignedWord();
    			else if (type == 66)
    				stream.readUnsignedWord();
    			else if (type == 67)
    				stream.readUnsignedWord();
    			else if (type == 68)
    				anInt758 = stream.readUnsignedWord();
    			else if (type == 69)
    				anInt768 = stream.readUnsignedByte();
    			else if (type == 70)
    				stream.readSignedWord();
    			else if (type == 71)
    				stream.readSignedWord();
    			else if (type == 72)
    				stream.readSignedWord();
    			else if (type == 73)
    				aBoolean736 = true;
    			else if (type == 74) {
    			} else if (type == 75)
    				stream.readUnsignedByte();
    			else if (type == 77 || type == 92) {
    				anInt774 = stream.readUnsignedWord();
    				if (anInt774 == 65535)
    					anInt774 = -1;
    				anInt749 = stream.readUnsignedWord();
    				if (anInt749 == 65535)
    					anInt749 = -1;
    				int endChild = -1;
    				if (type == 92) {
    					endChild = stream.readUnsignedWord();
    					if (endChild == 65535)
    						endChild = -1;
    				}
    				int j1 = stream.readUnsignedByte();
    				childrenIDs = new int[j1 + 2];
    				for (int j2 = 0; j2 <= j1; j2++) {
    					childrenIDs[j2] = stream.readUnsignedWord();
    					if (childrenIDs[j2] == 65535)
    						childrenIDs[j2] = -1;
    				}
    				childrenIDs[j1 + 1] = endChild;
    			} else if (type == 78)
    				stream.skip(3);
    			else if (type == 79) {
    				stream.skip(5);
    				int l = stream.readUnsignedByte();
    				stream.skip(l * 2);
    			} else if (type == 81)
    				stream.skip(1);
    			else if (type == 82 || type == 88 || type == 89 || type == 90
    					|| type == 91 || type == 94 || type == 95 || type == 96
    					|| type == 97)
    				continue;
    			else if (type == 93)
    				stream.skip(2);
    			else if (type == 249) {
    				int l = stream.readUnsignedByte();
    				for (int ii = 0; ii < l; ii++) {
    					boolean b = (stream.readUnsignedByte() == 1);
    					stream.skip(3);
    					if (b)
    						stream.readNewString();
    					else
    						stream.skip(4);
    				}
    			} else
    				System.out.println("Unknown config: " + type);
    		} while (true);
    		if (flag == -1) {
    			hasActions = anIntArray773 != null
    					&& (anIntArray776 == null || anIntArray776[0] == 10);
    			if (actions != null)
    				hasActions = true;
    		}
    	}
    
    	private ObjectDef() {
    		type = -1;
    	}
    
    	public boolean hasActions() {
    		return hasActions;
    	}
    
    	public boolean hasName() {
    		return name != null && name.length() > 1;
    	}
    
    	public boolean solid() {
    		return isSolid;
    	}
    
    	public int xLength() {
    		return xLength;
    	}
    
    	public int yLength() {
    		return yLength;
    	}
    
    	public boolean aBoolean767() {
    		return aBoolean767;
    	}
    
    	public boolean aBoolean736;
    	public String name;
    	public int xLength;
    	public int anInt746;
    	private int[] originalModelColors;
    	public int anInt749;
    	public static boolean lowMem;
    	public int type;
    	public boolean aBoolean757;
    	public int anInt758;
    	public int childrenIDs[];
    	public int yLength;
    	public boolean aBoolean762;
    	public boolean aBoolean764;
    	public boolean aBoolean767;
    	public int anInt768;
    	private static int cacheIndex;
    	private int[] anIntArray773;
    	public int anInt774;
    	public int anInt775;
    	private int[] anIntArray776;
    	public byte description[];
    	public boolean hasActions;
    	public boolean isSolid;
    	public int anInt781;
    	private static ObjectDef[] cache;
    	private int[] modifiedModelColors;
    	public String actions[];
    	private static MemoryArchive archive;
    
    }
    Do I have to dump the loc.idx and loc.dat from the cache and then put them in the server data?
    Attached image
    Reply With Quote  
     

  9. #19  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    Quote Originally Posted by RememberM3 View Post
    The server is a clean 317 server and I think the object definitions are loaded in the ObjectDef.java

    Do I have to dump the loc.idx and loc.dat from the cache and then put them in the server data?
    Code:
    anInt774 = stream.readUnsignedWord();
    				if (anInt774 == 65535)
    					anInt774 = -1;
    				anInt749 = stream.readUnsignedWord();
    				if (anInt749 == 65535)
    					anInt749 = -1;
    anInt774 = varbit
    anInt749 = regular var
    Reply With Quote  
     

  10. #20  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Joris View Post
    Code:
    anInt774 = stream.readUnsignedWord();
    				if (anInt774 == 65535)
    					anInt774 = -1;
    				anInt749 = stream.readUnsignedWord();
    				if (anInt749 == 65535)
    					anInt749 = -1;
    anInt774 = varbit
    anInt749 = regular var
    Okay, so I need to set these and print the client ones?
    Attached image
    Reply With Quote  
     

Page 2 of 3 FirstFirst 123 LastLast

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. Npcs and objects not change when i edit
    By Cosmic Rune in forum Help
    Replies: 2
    Last Post: 07-04-2015, 11:46 PM
  2. Changing cords of an object not moving>?
    By StayPutMan in forum Help
    Replies: 2
    Last Post: 06-17-2013, 03:40 PM
  3. Object not working right help
    By mightymalakai33 in forum Help
    Replies: 0
    Last Post: 02-19-2009, 02:54 PM
  4. [508] Objects Not working?
    By Bulby Strife in forum Help
    Replies: 0
    Last Post: 11-25-2008, 08:08 PM
  5. Object not showing?
    By Bruno in forum Help
    Replies: 20
    Last Post: 10-26-2008, 07:36 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
  •