Thread: Weird client crashes

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Weird client crashes 
    Registered Member chucky009's Avatar
    Join Date
    Aug 2011
    Posts
    355
    Thanks given
    1
    Thanks received
    26
    Rep Power
    0
    Hello,

    I've got an question i am not really well known with client sided stuff ( nor do i know if it's source issue ) but everytime the client will crash randomly when i attack an npc for example: tormentted demons it'll just crash...
    When i am at nex and walk around it'll crash randomly too, is this a cache issue? Or is the client just shit?

    Code:
    Error: jq.jx() lg.jy() | Class230.method2343:266 IncomingPacket.decodeIncomingPacket:1011 Class432_Sub1_Sub4_Sub1.method5539:407 Class331.method3876:64 client.method3911:722 client.method3883:611 Class332.method3893:633 Class332.method3885:358 Class332.run:306 java.lang.Thread.run | java.lang.RuntimeException: 796 39 | 72,90,127 39,2591,5729 3,-108,31,-1,-64,75,2,7,96,0,0,0,0,-128,-1,8,0,0,1,5,0,8,1,7,-35,0,0,0,0,0,42,-89,42,-89,42,-89,42,-89,0,
    java.net.ConnectException: Connection timed out: connect
    	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    	at java.net.PlainSocketImpl.connect(Unknown Source)
    	at java.net.SocksSocketImpl.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at sun.net.NetworkClient.doConnect(Unknown Source)
    	at sun.net.www.http.HttpClient.openServer(Unknown Source)
    	at sun.net.www.http.HttpClient.openServer(Unknown Source)
    	at sun.net.www.http.HttpClient.<init>(Unknown Source)
    	at sun.net.www.http.HttpClient.New(Unknown Source)
    	at sun.net.www.http.HttpClient.New(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    	at java.net.URL.openStream(Unknown Source)
    	at Class207.method2195(Class207.java:160)
    	at Class432_Sub1_Sub4_Sub1.method5539(Class432_Sub1_Sub4_Sub1.java:420)
    	at Class331.method3876(Class331.java:64)
    	at client.method3911(client.java:722)
    	at client.method3883(client.java:611)
    	at Class332.method3893(Class332.java:633)
    	at Class332.method3885(Class332.java:358)
    	at Class332.run(Class332.java:306)
    	at java.lang.Thread.run(Unknown Source)
    That's the error that gets outputted ( connection timed out is just because the player crashed somehow)

    It seems like it might be a packet issue? but i am not 100% sure
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by chucky009 View Post
    Hello,

    I've got an question i am not really well known with client sided stuff ( nor do i know if it's source issue ) but everytime the client will crash randomly when i attack an npc for example: tormentted demons it'll just crash...
    When i am at nex and walk around it'll crash randomly too, is this a cache issue? Or is the client just shit?

    Code:
    Error: jq.jx() lg.jy() | Class230.method2343:266 IncomingPacket.decodeIncomingPacket:1011 Class432_Sub1_Sub4_Sub1.method5539:407 Class331.method3876:64 client.method3911:722 client.method3883:611 Class332.method3893:633 Class332.method3885:358 Class332.run:306 java.lang.Thread.run | java.lang.RuntimeException: 796 39 | 72,90,127 39,2591,5729 3,-108,31,-1,-64,75,2,7,96,0,0,0,0,-128,-1,8,0,0,1,5,0,8,1,7,-35,0,0,0,0,0,42,-89,42,-89,42,-89,42,-89,0,
    java.net.ConnectException: Connection timed out: connect
    	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    	at java.net.PlainSocketImpl.connect(Unknown Source)
    	at java.net.SocksSocketImpl.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at sun.net.NetworkClient.doConnect(Unknown Source)
    	at sun.net.www.http.HttpClient.openServer(Unknown Source)
    	at sun.net.www.http.HttpClient.openServer(Unknown Source)
    	at sun.net.www.http.HttpClient.<init>(Unknown Source)
    	at sun.net.www.http.HttpClient.New(Unknown Source)
    	at sun.net.www.http.HttpClient.New(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    	at java.net.URL.openStream(Unknown Source)
    	at Class207.method2195(Class207.java:160)
    	at Class432_Sub1_Sub4_Sub1.method5539(Class432_Sub1_Sub4_Sub1.java:420)
    	at Class331.method3876(Class331.java:64)
    	at client.method3911(client.java:722)
    	at client.method3883(client.java:611)
    	at Class332.method3893(Class332.java:633)
    	at Class332.method3885(Class332.java:358)
    	at Class332.run(Class332.java:306)
    	at java.lang.Thread.run(Unknown Source)
    That's the error that gets outputted ( connection timed out is just because the player crashed somehow)

    It seems like it might be a packet issue? but i am not 100% sure
    Which revision and post relevant code related to the top of the stacktrace:

    Code:
    Class230.method2343:266 IncomingPacket.decodeIncomingPacket:1011
    Project thread
    Reply With Quote  
     

  3. #3  
    Registered Member chucky009's Avatar
    Join Date
    Aug 2011
    Posts
    355
    Thanks given
    1
    Thanks received
    26
    Rep Power
    0
    Quote Originally Posted by clem585 View Post
    Which revision and post relevant code related to the top of the stacktrace:

    Code:
    Class230.method2343:266 IncomingPacket.decodeIncomingPacket:1011
    It's a 718 loading 742 ( if i'm correct ) been ages since i did something on rsps,
    This is all that it outputs in the console

    Code:
    Overlay: 1, Interface ID: 192, Window Hash = 35913914
    Overlay: 1, Interface ID: 271, Window Hash = 35913913
    Overlay: 1, Interface ID: 387, Window Hash = 35913912
    Overlay: 1, Interface ID: 679, Window Hash = 35913911
    Overlay: 1, Interface ID: 320, Window Hash = 35913909
    Overlay: 1, Interface ID: 590, Window Hash = 35913920
    Overlay: 1, Interface ID: 261, Window Hash = 35913919
    Overlay: 1, Interface ID: 884, Window Hash = 35913907
    Overlay: 1, Interface ID: 751, Window Hash = 35913784
    Overlay: 1, Interface ID: 752, Window Hash = 35913899
    Overlay: 1, Interface ID: 745, Window Hash = 35913771
    Overlay: 1, Interface ID: 754, Window Hash = 35913773
    Overlay: 1, Interface ID: 747, Window Hash = 35913895
    Overlay: 1, Interface ID: 748, Window Hash = 35913891
    Overlay: 1, Interface ID: 749, Window Hash = 35913892
    Overlay: 1, Interface ID: 750, Window Hash = 35913893
    Overlay: 1, Interface ID: 34, Window Hash = 35913922
    Overlay: 1, Interface ID: 187, Window Hash = 35913921
    Overlay: 1, Interface ID: 550, Window Hash = 35913916
    Overlay: 1, Interface ID: 1110, Window Hash = 35913918
    Overlay: 1, Interface ID: 182, Window Hash = 35913925
    Overlay: 1, Interface ID: 1109, Window Hash = 35913917
    Overlay: 1, Interface ID: 1338, Window Hash = 35913908
    Overlay: 1, Interface ID: 752, Window Hash = 35913899
    Overlay: 1, Interface ID: 137, Window Hash = 49283081
    Overlay: 1, Interface ID: 1139, Window Hash = 35913915
    Overlay: 1, Interface ID: 1213, Window Hash = 35913779
    Overlay: 1, Interface ID: 192, Window Hash = 48890017
    Overlay: 1, Interface ID: 271, Window Hash = 48890016
    Overlay: 1, Interface ID: 387, Window Hash = 48890015
    Overlay: 1, Interface ID: 679, Window Hash = 48890014
    Overlay: 1, Interface ID: 320, Window Hash = 48890012
    Overlay: 1, Interface ID: 590, Window Hash = 48890023
    Overlay: 1, Interface ID: 261, Window Hash = 48890022
    Overlay: 1, Interface ID: 884, Window Hash = 48890010
    Overlay: 1, Interface ID: 751, Window Hash = 48889920
    Overlay: 1, Interface ID: 752, Window Hash = 48889919
    Overlay: 1, Interface ID: 745, Window Hash = 48889913
    Overlay: 1, Interface ID: 754, Window Hash = 48889923
    Overlay: 1, Interface ID: 747, Window Hash = 48890097
    Overlay: 1, Interface ID: 748, Window Hash = 48890094
    Overlay: 1, Interface ID: 749, Window Hash = 48890095
    Overlay: 1, Interface ID: 750, Window Hash = 48890096
    Overlay: 1, Interface ID: 34, Window Hash = 48890025
    Overlay: 1, Interface ID: 187, Window Hash = 48890024
    Overlay: 1, Interface ID: 550, Window Hash = 48890019
    Overlay: 1, Interface ID: 1110, Window Hash = 48890021
    Overlay: 1, Interface ID: 182, Window Hash = 48890028
    Overlay: 1, Interface ID: 1109, Window Hash = 48890020
    Overlay: 1, Interface ID: 1338, Window Hash = 48889972
    Overlay: 1, Interface ID: 752, Window Hash = 48889919
    Overlay: 1, Interface ID: 137, Window Hash = 49283081
    Overlay: 1, Interface ID: 1139, Window Hash = 48890018
    Overlay: 1, Interface ID: 1213, Window Hash = 48889939
    Overlay: 1, Interface ID: 192, Window Hash = 48890017
    Overlay: 1, Interface ID: 271, Window Hash = 48890016
    Overlay: 1, Interface ID: 387, Window Hash = 48890015
    Overlay: 1, Interface ID: 679, Window Hash = 48890014
    Overlay: 1, Interface ID: 320, Window Hash = 48890012
    Overlay: 1, Interface ID: 590, Window Hash = 48890023
    Overlay: 1, Interface ID: 261, Window Hash = 48890022
    Overlay: 1, Interface ID: 884, Window Hash = 48890010
    Overlay: 1, Interface ID: 751, Window Hash = 48889920
    Overlay: 1, Interface ID: 752, Window Hash = 48889919
    Overlay: 1, Interface ID: 745, Window Hash = 48889913
    Overlay: 1, Interface ID: 754, Window Hash = 48889923
    Overlay: 1, Interface ID: 747, Window Hash = 48890097
    Overlay: 1, Interface ID: 748, Window Hash = 48890094
    Overlay: 1, Interface ID: 749, Window Hash = 48890095
    Overlay: 1, Interface ID: 750, Window Hash = 48890096
    Overlay: 1, Interface ID: 34, Window Hash = 48890025
    Overlay: 1, Interface ID: 187, Window Hash = 48890024
    Overlay: 1, Interface ID: 550, Window Hash = 48890019
    Overlay: 1, Interface ID: 1110, Window Hash = 48890021
    Overlay: 1, Interface ID: 182, Window Hash = 48890028
    Overlay: 1, Interface ID: 1109, Window Hash = 48890020
    Overlay: 1, Interface ID: 1338, Window Hash = 48889972
    Overlay: 1, Interface ID: 752, Window Hash = 48889919
    Overlay: 1, Interface ID: 137, Window Hash = 49283081
    Overlay: 1, Interface ID: 1139, Window Hash = 48890018
    Overlay: 1, Interface ID: 1213, Window Hash = 48889939
    Overlay: 1, Interface ID: 1188, Window Hash = 49283085
    Overlay: 1, Interface ID: 1188, Window Hash = 49283085
    Overlay: 1, Interface ID: 601, Window Hash = 48889925
    Overlay: 1, Interface ID: 1186, Window Hash = 49283085
    Overlay: 1, Interface ID: 1188, Window Hash = 49283085
    Overlay: 1, Interface ID: 601, Window Hash = 48889890
    Error: jq.jx() lg.jy() | Class230.method2343:266 IncomingPacket.decodeIncomingPacket:1011 Class432_Sub1_Sub4_Sub1.method5539:407 Class331.method3876:64 client.method3911:722 client.method3883:621 Class332.method3893:633 Class332.method3885:358 Class332.run:306 java.lang.Thread.run | java.lang.RuntimeException: 22 27 | 72,90,69 27,2933,5192 2,-113,-1,-32,35,-128,0,-128,-10,-9,0,0,0,30,16,0,-128,-127,68,0,68,0,68,0,68,0,0,
    java.net.ConnectException: Connection timed out: connect
    	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    	at java.net.PlainSocketImpl.connect(Unknown Source)
    	at java.net.SocksSocketImpl.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at sun.net.NetworkClient.doConnect(Unknown Source)
    	at sun.net.www.http.HttpClient.openServer(Unknown Source)
    	at sun.net.www.http.HttpClient.openServer(Unknown Source)
    	at sun.net.www.http.HttpClient.<init>(Unknown Source)
    	at sun.net.www.http.HttpClient.New(Unknown Source)
    	at sun.net.www.http.HttpClient.New(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    	at java.net.URL.openStream(Unknown Source)
    	at Class207.method2195(Class207.java:160)
    	at Class432_Sub1_Sub4_Sub1.method5539(Class432_Sub1_Sub4_Sub1.java:420)
    	at Class331.method3876(Class331.java:64)
    	at client.method3911(client.java:722)
    	at client.method3883(client.java:621)
    	at Class332.method3893(Class332.java:633)
    	at Class332.method3885(Class332.java:358)
    	at Class332.run(Class332.java:306)
    	at java.lang.Thread.run(Unknown Source)
    ^ that's client

    Code:
    [23:16:13] -> Preparing Auto-Backup...
    [23:16:13] -> Preparing Cache...
    [23:16:13] -> Preparing Player Data...
    [23:16:13] -> Preparing Mapdata...
    [23:16:14] -> Preparing NPC Data...
    [23:16:14] -> Preparing Item Data...
    [23:16:14] -> Preparing Music Hints...
    [23:16:14] -> Preparing Shops Handler...
    [23:16:14] -> Preparing Lobby...
    [23:16:14] -> Preparing Clans Manager...
    [23:16:14] -> Preparing In-Game Scripts...
    [23:16:14] -> Preparing Login Server Connection...
    [23:16:14] -> Preparing MySQL link...
    [23:16:14] -> Unable to connect with Grand Exchange database. MySQL is not enabled serverside.
    [23:16:14] -> Preparing Grand Exchange...
    [23:16:14] -> Preparing World Engine...
    [23:16:15] -> Preparing Region Builder...
    [23:16:15] -> Preparing Netty...
    [23:16:15] -> Preparing Lending Manager...
    [23:16:15] -> Server launched with port 43594 in 1916 MILLISECONDS.
    [WorldPacketsDecoder] Unhandled Packet : 97
    [ButtonHandler] InterfaceId 750, componentId 4, slotId 65535, slotId2 65535, PacketId: 4
    [WorldPacketsDecoder] Dialogue: 1188, 11, -1
    [WorldPacketsDecoder] Dialogue: 1188, 16, -1
    [ButtonHandler] InterfaceId 746, componentId 121, slotId 65535, slotId2 65535, PacketId: 4
    [WorldPacketsDecoder] Unhandled Packet : 66
    [WorldPacketsDecoder] Dialogue: 1186, 7, -1
    [WorldPacketsDecoder] Dialogue: 1188, 11, -1
    This is from the source.

    Code:
    	static final void method2343(boolean largeView, int i) {
    		try {
    			client.anInt9022 = 0;
    			client.anInt9019 = 0;
    			client.anInt8996 += -1017538359;
    			Class359.method4238((byte) 2);
    			Class468.method5862(largeView, 791376098);
    			Class2.decodeNpcMasks(1382868750);
    			boolean bool_22_ = false;
    			for (int i_23_ = 0; i_23_ < client.anInt9022 * 1143933639; i_23_++) {
    				int i_24_ = client.anIntArray9021[i_23_];
    				Class330_Sub35 class330_sub35 = ((Class330_Sub35) client.aClass497_9014.method6094((long) i_24_));
    				Class432_Sub1_Sub1_Sub1_Sub2 class432_sub1_sub1_sub1_sub2 = ((Class432_Sub1_Sub1_Sub1_Sub2) class330_sub35.anObject7733);
    				if (-395183177 * class432_sub1_sub1_sub1_sub2.anInt10069 != client.anInt8996 * 1570636153) {
    					if (Class484.aBoolean5782 && Class378.method4380(i_24_, -1137361974))
    						Class513.method6194((byte) -25);
    					if (class432_sub1_sub1_sub1_sub2.aClass551_10251.method6372((byte) 37))
    						Class324.method3202(class432_sub1_sub1_sub1_sub2, -1493180928);
    					class432_sub1_sub1_sub1_sub2.method5475(null, 1918950667);
    					class330_sub35.method3252(-816582589);
    					bool_22_ = true;
    				}
    			}
    			if (bool_22_) {
    				int i_25_ = -1183709625 * client.anInt9232;
    				client.anInt9232 = client.aClass497_9014.method6096(940963698) * 93438839;
    				int i_26_ = 0;
    				Iterator iterator = client.aClass497_9014.iterator();
    				while (iterator.hasNext()) {
    					Class330_Sub35 class330_sub35 = (Class330_Sub35) iterator.next();
    					client.aClass330_Sub35Array9015[i_26_++] = class330_sub35;
    				}
    				for (int i_27_ = -1183709625 * client.anInt9232; i_27_ < i_25_; i_27_++)
    					client.aClass330_Sub35Array9015[i_27_] = null;
    			}
    			if (-275392715 * ((Class1) client.aClass1_9025).anInt26 != (((Class1) client.aClass1_9025).aClass330_Sub46_Sub2_17.offset) * -824785231)
    				throw new RuntimeException(new StringBuilder().append((((Class1) client.aClass1_9025).aClass330_Sub46_Sub2_17.offset) * -824785231).append(" ").append(-275392715 * (((Class1) client.aClass1_9025).anInt26)).toString());
    			for (int i_28_ = 0; i_28_ < client.anInt9017 * -823688441; i_28_++) {
    				if (client.aClass497_9014.method6094((long) client.anIntArray9018[i_28_]) == null)
    					throw new RuntimeException(new StringBuilder().append(i_28_).append(" ").append(client.anInt9017 * -823688441).toString());
    			}
    			if (0 != (client.anInt9232 * -1183709625 - -823688441 * client.anInt9017))
    				throw new RuntimeException(new StringBuilder().append("").append(-1183709625 * client.anInt9232 - (client.anInt9017 * -823688441)).toString());
    			for (int i_29_ = 0; i_29_ < client.anInt9232 * -1183709625; i_29_++) {
    				if (-395183177 * ((Class432_Sub1_Sub1_Sub1) (client.aClass330_Sub35Array9015[i_29_].anObject7733)).anInt10069 != client.anInt8996 * 1570636153)
    					throw new RuntimeException(new StringBuilder().append("").append(((Class432_Sub1_Sub1_Sub1) (client.aClass330_Sub35Array9015[i_29_].anObject7733)).anInt10008 * -1654044763).toString());
    			}
    		} catch (RuntimeException runtimeexception) {
    			throw Class476.method5964(runtimeexception, new StringBuilder().append("jq.jx(").append(')').toString());
    		}
    	}
    And that's the method
    Reply With Quote  
     

  4. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Seems to be an issue with your NPC masks. Try disabling them one by one server-sided to see which one(s) are causing issues. You can find them in "LocalNPCUpdate.java". You need to comment out 2 different sections per mask to fully disable it:

    Code:
    // #1
    if (random_update_mask_condition)
        bitMask |= 0x????????;
    
    // #2
    if (random_update_mask_condition)
        encodeRandomMask(stream);
    It could also be an issue with the other parts of the packet, but I don't think it changed between 718 and 742 so it's probably the masks.
    Project thread
    Reply With Quote  
     

  5. #5  
    Registered Member chucky009's Avatar
    Join Date
    Aug 2011
    Posts
    355
    Thanks given
    1
    Thanks received
    26
    Rep Power
    0
    Quote Originally Posted by clem585 View Post
    Seems to be an issue with your NPC masks. Try disabling them one by one server-sided to see which one(s) are causing issues. You can find them in "LocalNPCUpdate.java". You need to comment out 2 different sections per mask to fully disable it:

    Code:
    // #1
    if (random_update_mask_condition)
        bitMask |= 0x????????;
    
    // #2
    if (random_update_mask_condition)
        encodeRandomMask(stream);
    It could also be an issue with the other parts of the packet, but I don't think it changed between 718 and 742 so it's probably the masks.

    Alright thanks i will try to debug!

    Quote Originally Posted by clem585 View Post
    Seems to be an issue with your NPC masks. Try disabling them one by one server-sided to see which one(s) are causing issues. You can find them in "LocalNPCUpdate.java". You need to comment out 2 different sections per mask to fully disable it:

    Code:
    // #1
    if (random_update_mask_condition)
        bitMask |= 0x????????;
    
    // #2
    if (random_update_mask_condition)
        encodeRandomMask(stream);
    It could also be an issue with the other parts of the packet, but I don't think it changed between 718 and 742 so it's probably the masks.
    tried what you said but it doesn't give me anything, i am testing the crash inside nex room though. Everytime she says "fill my soul with smoke and i run around it instantly crashed. I guess the issue could be within nex classes itself too?
    Reply With Quote  
     

  6. #6  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by chucky009 View Post
    Alright thanks i will try to debug!



    tried what you said but it doesn't give me anything, i am testing the crash inside nex room though. Everytime she says "fill my soul with smoke and i run around it instantly crashed. I guess the issue could be within nex classes itself too?
    Nope, I'm 100% sure this is the issue. For example, it could be because you're trying to set an invalid animation, but disabling the animation mask would prevent that issue. Did you try every single mask one by one?
    Project thread
    Reply With Quote  
     

  7. #7  
    Registered Member chucky009's Avatar
    Join Date
    Aug 2011
    Posts
    355
    Thanks given
    1
    Thanks received
    26
    Rep Power
    0
    Quote Originally Posted by clem585 View Post
    Nope, I'm 100% sure this is the issue. For example, it could be because you're trying to set an invalid animation, but disabling the animation mask would prevent that issue. Did you try every single mask one by one?
    I'll redo it again and mark em real quick, but i'm pretty sure i did one time the client upon logging in literally crashed instantly. But yes you are right it's inside localnpcupdate.java ( atleast when that problem started happening ) on reverting it worked like it was before.

    As i am working through them i'll just post the class maybe you might see the issue already

    Code:
    package com.rs.game.player;
    
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.List;
    
    import com.rs.DataConstant;
    import com.rs.game.Hit;
    import com.rs.game.World;
    import com.rs.game.npc.NPC;
    import com.rs.stream.OutputStream;
    import com.rs.utils.Utils;
    
    public final class LocalNPCUpdate {
    
        private Player player;
        private LinkedList<NPC> localNPCs;
    
        public LocalNPCUpdate(Player player) {
    	this.player = player;
    	localNPCs = new LinkedList<NPC>();
        }
    
        private void addInScreenNPCs(OutputStream stream,
    	    OutputStream updateBlockData, boolean largeSceneView) {
    	for (int regionId : player.getMapRegionsIds()) {
    	    List<Integer> indexes = World.getRegion(regionId).getNPCsIndexes();
    	    if (indexes == null)
    		continue;
    	    for (int npcIndex : indexes) {
    		if (localNPCs.size() == DataConstant.SV_LOCAL_NPCS_LIMIT)
    		    break;
    		NPC n = World.getNPCs().get(npcIndex);
    		if (n == null || n.hasFinished() || localNPCs.contains(n)
    			|| !n.withinDistance(player, largeSceneView ? 126 : 14)
    			|| n.isDead())
    		    continue;
    		stream.writeBits(15, n.getIndex());
    		boolean needUpdate = n.needMasksUpdate()
    			|| n.getLastFaceEntity() != -1;
    		int x = n.getX() - player.getX();
    		int y = n.getY() - player.getY();
    		if (largeSceneView) {
    		    if (x < 127)
    			x += 256;
    		    if (y < 127)
    			y += 256;
    		} else {
    		    if (x < 15)
    			x += 32;
    		    if (y < 15)
    			y += 32;
    		}
    		stream.writeBits(1, n.hasTeleported() ? 1 : 0);
    		stream.writeBits(3, (n.getDirection() >> 11) - 4);
    		stream.writeBits(2, n.getPlane());
    		stream.writeBits(largeSceneView ? 8 : 5, y);
    		stream.writeBits(15, n.getId());
    		stream.writeBits(1, needUpdate ? 1 : 0);
    		stream.writeBits(largeSceneView ? 8 : 5, x);
    		localNPCs.add(n);
    		if (needUpdate)
    		    appendUpdateBlock(n, updateBlockData, true);
    	    }
    	}
        }
    
        private void appendUpdateBlock(NPC n, OutputStream data, boolean added) {
    	int maskData = 0;
    	if (n.hasChangedCombatLevel()
    		|| (added && n.getCustomCombatLevel() >= 0)) {
    	    maskData |= 8388608;
    	}
    	if (n.getNextGraphics3() != null) {
    	    maskData |= 33554432;
    	}
    	if (n.getNextGraphics2() != null) {
    	    maskData |= 512;
    	}
    	if (n.getNextTransformation() != null) {
    	    maskData |= 128;
    	}
    	if (n.getNextForceMovement() != null) {
    	    maskData |= 32768;
    	}
    	if (!n.getNextHits().isEmpty()) {
    	    maskData |= 8;
    	}
    	if (n.getNextFaceWorldTile() != null && n.getNextRunDirection() == -1
    		&& n.getNextWalkDirection() == -1) {
    	    maskData |= 2;
    	}
    	if (n.getNextGraphics1() != null) {
    	    maskData |= 64;
    	}
    	if (n.getNextFaceEntity() != -2
    		|| (added && n.getLastFaceEntity() != -1)) {
    	    maskData |= 32;
    	}
    	if (n.getNextForceTalk() != null) {
    	    maskData |= 16;
    	}
    	if (n.getNextAnimation() != null) {
    	    maskData |= 1;
    	}
    	if (n.getNextGraphics4() != null) {
    	    maskData |= 16777216;
    	}
    
    	if (maskData > 0xff)
    	    maskData |= 0x2;
    	if (maskData > 0xffff)
    	    maskData |= 0x8000;
    	if (maskData > 0xffffff)
    	    maskData |= 0x10000;
    
    	data.writeByte(maskData);
    
    	if (maskData > 0xff)
    	    data.writeByte(maskData >> 8);
    	if (maskData > 0xffff)
    	    data.writeByte(maskData >> 16);
    	if (maskData > 0xffffff)
    	    data.writeByte(maskData >> 24);
    
    	if (n.hasChangedCombatLevel()
    		|| (added && n.getCustomCombatLevel() >= 0)) {
    	    applyChangeLevelMask(n, data);
    	}
    	if (n.getNextGraphics3() != null) {
    	    applyGraphicsMask3(n, data);
    	}
    	if (n.getNextGraphics2() != null) {
    	    applyGraphicsMask2(n, data);
    	}
    	if (n.getNextTransformation() != null) {
    	    applyTransformationMask(n, data);
    	}
    	if (n.getNextForceMovement() != null) {
    	    applyForceMovementMask(n, data);
    	}
    	if (!n.getNextHits().isEmpty()) {
    	    applyHitMask(n, data);
    	}
    	if (n.getNextFaceWorldTile() != null && n.getNextRunDirection() == -1
    		&& n.getNextWalkDirection() == -1) {
    	    applyFaceWorldTileMask(n, data);
    	}
    	if (n.getNextGraphics1() != null) {
    	    applyGraphicsMask1(n, data);
    	}
    	if (n.getNextFaceEntity() != -2
    		|| (added && n.getLastFaceEntity() != -1)) {
    	    applyFaceEntityMask(n, data);
    	}
    	if (n.getNextForceTalk() != null) {
    	    applyForceTalkMask(n, data);
    	}
    	if (n.getNextAnimation() != null) {
    	    applyAnimationMask(n, data);
    	}
    	if (n.getNextGraphics4() != null) {
    	    applyGraphicsMask4(n, data);
    	}
        }
    
        private void applyAnimationMask(NPC n, OutputStream data) {
    	for (int id : n.getNextAnimation().getIds())
    	    data.writeBigSmart(id);
    	data.writeByteC(n.getNextAnimation().getSpeed());
        }
    
        private void applyChangeLevelMask(NPC n, OutputStream data) {
    	data.writeShort(n.getCombatLevel());
        }
    
        private void applyFaceEntityMask(NPC n, OutputStream data) {
    	data.writeShort128(n.getNextFaceEntity() == -2 ? n.getLastFaceEntity()
    		: n.getNextFaceEntity());
        }
    
        private void applyFaceWorldTileMask(NPC n, OutputStream data) {
    	data.writeShort((n.getNextFaceWorldTile().getX() << 1) + 1);
    	data.writeShortLE((n.getNextFaceWorldTile().getY() << 1) + 1);
        }
    
        private void applyForceMovementMask(NPC n, OutputStream data) {
    	data.writeByteC(n.getNextForceMovement().getToFirstTile().getX()
    		- n.getX());
    	data.writeByte128(n.getNextForceMovement().getToFirstTile().getY()
    		- n.getY());
    	data.writeByteC(n.getNextForceMovement().getToSecondTile() == null ? 0
    		: n.getNextForceMovement().getToSecondTile().getX() - n.getX());
    	data.writeByte(n.getNextForceMovement().getToSecondTile() == null ? 0
    		: n.getNextForceMovement().getToSecondTile().getY() - n.getY());
    	data.writeShort((n.getNextForceMovement().getFirstTileTicketDelay() * 600) / 20);
    	data.writeShort(n.getNextForceMovement().getToSecondTile() == null ? 0
    		: ((n.getNextForceMovement().getSecondTileTicketDelay() * 600) / 20));
    	data.writeShort(n.getNextForceMovement().getDirection());
        }
    
        private void applyForceTalkMask(NPC n, OutputStream data) {
    	data.writeString(n.getNextForceTalk().getText());
        }
    
        private void applyGraphicsMask1(NPC n, OutputStream data) {
    	data.writeShort128(n.getNextGraphics1().getId());
    	data.writeIntLE(n.getNextGraphics1().getSettingsHash());
    	data.writeByteC(n.getNextGraphics1().getSettings2Hash());
        }
    
        private void applyGraphicsMask2(NPC n, OutputStream data) {
    	data.writeShort(n.getNextGraphics2().getId());
    	data.writeIntLE(n.getNextGraphics2().getSettingsHash());
    	data.write128Byte(n.getNextGraphics2().getSettings2Hash());
        }
    
        private void applyGraphicsMask3(NPC n, OutputStream data) {
    	data.writeShort(n.getNextGraphics3().getId());
    	data.writeIntV2(n.getNextGraphics3().getSettingsHash());
    	data.writeByteC(n.getNextGraphics3().getSettings2Hash());
        }
    
        private void applyGraphicsMask4(NPC n, OutputStream data) {
    	data.writeShortLE(n.getNextGraphics4().getId());
    	data.writeIntLE(n.getNextGraphics4().getSettingsHash());
    	data.write128Byte(n.getNextGraphics4().getSettings2Hash());
        }
    
        private void applyHitMask(NPC npc, OutputStream data) {
    	int offset = data.getOffset();
    	int count = npc.getNextHits().size();
    	data.writeByteC(count);
    	int hp = npc.getHitpoints();
    	int maxHp = npc.getMaxHitpoints();
    	if (hp > maxHp)
    	    hp = maxHp;
    	int hpBarPercentage = maxHp == 0 ? 0 : (hp * 255 / maxHp);
    	byte hitCount = 0;
    	if (count > 0) {
    	    for (Hit hit : npc.getNextHits()) {
    		if (hit != null) {
    		    hitCount = (byte) (hitCount + 1);
    		    boolean interactingWith = hit.interactingWith(player, npc);
    		    if (hit.missed() && !interactingWith) {
    			data.writeSmart(32766);
    			data.writeByteC(0);
    		    } else if (hit.getSoaking() != null) {
    			data.writeSmart(32767);
    			data.writeSmart(hit.getMark(player, npc));
    			data.writeSmart(hit.getDamage());
    			data.writeSmart(hit.getSoaking().getMark(player, npc));
    			data.writeSmart(hit.getSoaking().getDamage());
    		    } else {
    			data.writeSmart(hit.getMark(player, npc));
    			data.writeSmart(hit.getDamage());
    		    }
    		    data.writeSmart(0);
    		}
    	    }
    	}
    	byte someSize = 1;
    	data.writeByte(someSize);
    	if (someSize > 0) {
    	    byte type = 0;
    	    for (byte i = 0; i < someSize; i = (byte) (i + 1)) {
    		data.writeSmart(npc.getHpBarSize());
    		data.writeSmart(0);
    		if (type != 32767) {
    		    data.writeSmart(8); // 0x7fff
    		    data.writeByteC(hpBarPercentage);
    		    if (type > 0) {
    			data.writeByte128(hpBarPercentage);
    		    }
    		}
    	    }
    	}
    	int offset2 = data.getOffset();
    	data.setOffset(offset);
    	data.writeByteC(hitCount);
    	data.setOffset(offset2);
        }
    
            @suppressWarnings("unused")
        private void applyNameChangeMask(NPC npc, OutputStream data) {
    	data.writeString(npc.getName());
        }
    
            @suppressWarnings("unused")
        private void applySecondBarMask(NPC n, OutputStream data) {
    	data.writeShortLE128(n.getSecondBar().getEndHp());
    	data.writeByte(n.getSecondBar().getTimer());
    	data.write128Byte(n.getSecondBar().getStartHp());
        }
    
        private void applyTransformationMask(NPC n, OutputStream data) {
    	data.writeBigSmart(n.getNextTransformation().getToNPCId());
        }
    
        public OutputStream createPacketAndProcess() {
    	boolean largeSceneView = player.hasLargeSceneView();
    	OutputStream stream = new OutputStream();
    	OutputStream updateBlockData = new OutputStream();
    	stream.writePacketVarShort(player, largeSceneView ? 65 : 72);
    	processLocalNPCsInform(stream, updateBlockData, largeSceneView);
    	stream.writeBytes(updateBlockData.getBuffer(), 0,
    		updateBlockData.getOffset());
    	stream.endPacketVarShort();
    	return stream;
        }
    
        private void processInScreenNPCs(OutputStream stream,
    	    OutputStream updateBlockData, boolean largeSceneView) {
    	stream.writeBits(8, localNPCs.size());
    	for (Iterator<NPC> it = localNPCs.iterator(); it.hasNext();) {
    	    NPC n = it.next();
    	    if (n.hasFinished()
    		    || !n.withinDistance(player, largeSceneView ? 126 : 14)
    		    || n.hasTeleported()) {
    		stream.writeBits(1, 1);
    		stream.writeBits(2, 3);
    		it.remove();
    		continue;
    	    }
    	    boolean needUpdate = n.needMasksUpdate();
    	    boolean walkUpdate = n.getNextWalkDirection() != -1;
    	    stream.writeBits(1, (needUpdate || walkUpdate) ? 1 : 0);
    	    if (walkUpdate) {
    		stream.writeBits(2, n.getNextRunDirection() == -1 ? 1 : 2);
    		if (n.getNextRunDirection() != -1)
    		    stream.writeBits(1, 1);
    		stream.writeBits(3,
    			Utils.getNpcMoveDirection(n.getNextWalkDirection()));
    		if (n.getNextRunDirection() != -1)
    		    stream.writeBits(3,
    			    Utils.getNpcMoveDirection(n.getNextRunDirection()));
    		stream.writeBits(1, needUpdate ? 1 : 0);
    	    } else if (needUpdate)
    		stream.writeBits(2, 0);
    	    if (needUpdate)
    		appendUpdateBlock(n, updateBlockData, false);
    	}
        }
    
        private void processLocalNPCsInform(OutputStream stream,
    	    OutputStream updateBlockData, boolean largeSceneView) {
    	stream.initBitAccess();
    	processInScreenNPCs(stream, updateBlockData, largeSceneView);
    	addInScreenNPCs(stream, updateBlockData, largeSceneView);
    	if (updateBlockData.getOffset() > 0)
    	    stream.writeBits(15, 32767);
    	stream.finishBitAccess();
        }
    
        public void reset() {
    	localNPCs.clear();
        }
    
    }
    Code:
    	// if (n.getNextForceMovement() != null) {
    	// applyForceMovementMask(n, data);
    	// }

    Code:
    	// if (n.getNextForceMovement() != null) {
    	// maskData |= 32768;
    	// }
    When i disable these, nex fully works w/o crashes. But when i go to tormentted demons it'll crash still.
    Reply With Quote  
     

  8. #8  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by chucky009 View Post
    I'll redo it again and mark em real quick, but i'm pretty sure i did one time the client upon logging in literally crashed instantly. But yes you are right it's inside localnpcupdate.java ( atleast when that problem started happening ) on reverting it worked like it was before.

    As i am working through them i'll just post the class maybe you might see the issue already

    Code:
    package com.rs.game.player;
    
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.List;
    
    import com.rs.DataConstant;
    import com.rs.game.Hit;
    import com.rs.game.World;
    import com.rs.game.npc.NPC;
    import com.rs.stream.OutputStream;
    import com.rs.utils.Utils;
    
    public final class LocalNPCUpdate {
    
        private Player player;
        private LinkedList<NPC> localNPCs;
    
        public LocalNPCUpdate(Player player) {
    	this.player = player;
    	localNPCs = new LinkedList<NPC>();
        }
    
        private void addInScreenNPCs(OutputStream stream,
    	    OutputStream updateBlockData, boolean largeSceneView) {
    	for (int regionId : player.getMapRegionsIds()) {
    	    List<Integer> indexes = World.getRegion(regionId).getNPCsIndexes();
    	    if (indexes == null)
    		continue;
    	    for (int npcIndex : indexes) {
    		if (localNPCs.size() == DataConstant.SV_LOCAL_NPCS_LIMIT)
    		    break;
    		NPC n = World.getNPCs().get(npcIndex);
    		if (n == null || n.hasFinished() || localNPCs.contains(n)
    			|| !n.withinDistance(player, largeSceneView ? 126 : 14)
    			|| n.isDead())
    		    continue;
    		stream.writeBits(15, n.getIndex());
    		boolean needUpdate = n.needMasksUpdate()
    			|| n.getLastFaceEntity() != -1;
    		int x = n.getX() - player.getX();
    		int y = n.getY() - player.getY();
    		if (largeSceneView) {
    		    if (x < 127)
    			x += 256;
    		    if (y < 127)
    			y += 256;
    		} else {
    		    if (x < 15)
    			x += 32;
    		    if (y < 15)
    			y += 32;
    		}
    		stream.writeBits(1, n.hasTeleported() ? 1 : 0);
    		stream.writeBits(3, (n.getDirection() >> 11) - 4);
    		stream.writeBits(2, n.getPlane());
    		stream.writeBits(largeSceneView ? 8 : 5, y);
    		stream.writeBits(15, n.getId());
    		stream.writeBits(1, needUpdate ? 1 : 0);
    		stream.writeBits(largeSceneView ? 8 : 5, x);
    		localNPCs.add(n);
    		if (needUpdate)
    		    appendUpdateBlock(n, updateBlockData, true);
    	    }
    	}
        }
    
        private void appendUpdateBlock(NPC n, OutputStream data, boolean added) {
    	int maskData = 0;
    	if (n.hasChangedCombatLevel()
    		|| (added && n.getCustomCombatLevel() >= 0)) {
    	    maskData |= 8388608;
    	}
    	if (n.getNextGraphics3() != null) {
    	    maskData |= 33554432;
    	}
    	if (n.getNextGraphics2() != null) {
    	    maskData |= 512;
    	}
    	if (n.getNextTransformation() != null) {
    	    maskData |= 128;
    	}
    	if (n.getNextForceMovement() != null) {
    	    maskData |= 32768;
    	}
    	if (!n.getNextHits().isEmpty()) {
    	    maskData |= 8;
    	}
    	if (n.getNextFaceWorldTile() != null && n.getNextRunDirection() == -1
    		&& n.getNextWalkDirection() == -1) {
    	    maskData |= 2;
    	}
    	if (n.getNextGraphics1() != null) {
    	    maskData |= 64;
    	}
    	if (n.getNextFaceEntity() != -2
    		|| (added && n.getLastFaceEntity() != -1)) {
    	    maskData |= 32;
    	}
    	if (n.getNextForceTalk() != null) {
    	    maskData |= 16;
    	}
    	if (n.getNextAnimation() != null) {
    	    maskData |= 1;
    	}
    	if (n.getNextGraphics4() != null) {
    	    maskData |= 16777216;
    	}
    
    	if (maskData > 0xff)
    	    maskData |= 0x2;
    	if (maskData > 0xffff)
    	    maskData |= 0x8000;
    	if (maskData > 0xffffff)
    	    maskData |= 0x10000;
    
    	data.writeByte(maskData);
    
    	if (maskData > 0xff)
    	    data.writeByte(maskData >> 8);
    	if (maskData > 0xffff)
    	    data.writeByte(maskData >> 16);
    	if (maskData > 0xffffff)
    	    data.writeByte(maskData >> 24);
    
    	if (n.hasChangedCombatLevel()
    		|| (added && n.getCustomCombatLevel() >= 0)) {
    	    applyChangeLevelMask(n, data);
    	}
    	if (n.getNextGraphics3() != null) {
    	    applyGraphicsMask3(n, data);
    	}
    	if (n.getNextGraphics2() != null) {
    	    applyGraphicsMask2(n, data);
    	}
    	if (n.getNextTransformation() != null) {
    	    applyTransformationMask(n, data);
    	}
    	if (n.getNextForceMovement() != null) {
    	    applyForceMovementMask(n, data);
    	}
    	if (!n.getNextHits().isEmpty()) {
    	    applyHitMask(n, data);
    	}
    	if (n.getNextFaceWorldTile() != null && n.getNextRunDirection() == -1
    		&& n.getNextWalkDirection() == -1) {
    	    applyFaceWorldTileMask(n, data);
    	}
    	if (n.getNextGraphics1() != null) {
    	    applyGraphicsMask1(n, data);
    	}
    	if (n.getNextFaceEntity() != -2
    		|| (added && n.getLastFaceEntity() != -1)) {
    	    applyFaceEntityMask(n, data);
    	}
    	if (n.getNextForceTalk() != null) {
    	    applyForceTalkMask(n, data);
    	}
    	if (n.getNextAnimation() != null) {
    	    applyAnimationMask(n, data);
    	}
    	if (n.getNextGraphics4() != null) {
    	    applyGraphicsMask4(n, data);
    	}
        }
    
        private void applyAnimationMask(NPC n, OutputStream data) {
    	for (int id : n.getNextAnimation().getIds())
    	    data.writeBigSmart(id);
    	data.writeByteC(n.getNextAnimation().getSpeed());
        }
    
        private void applyChangeLevelMask(NPC n, OutputStream data) {
    	data.writeShort(n.getCombatLevel());
        }
    
        private void applyFaceEntityMask(NPC n, OutputStream data) {
    	data.writeShort128(n.getNextFaceEntity() == -2 ? n.getLastFaceEntity()
    		: n.getNextFaceEntity());
        }
    
        private void applyFaceWorldTileMask(NPC n, OutputStream data) {
    	data.writeShort((n.getNextFaceWorldTile().getX() << 1) + 1);
    	data.writeShortLE((n.getNextFaceWorldTile().getY() << 1) + 1);
        }
    
        private void applyForceMovementMask(NPC n, OutputStream data) {
    	data.writeByteC(n.getNextForceMovement().getToFirstTile().getX()
    		- n.getX());
    	data.writeByte128(n.getNextForceMovement().getToFirstTile().getY()
    		- n.getY());
    	data.writeByteC(n.getNextForceMovement().getToSecondTile() == null ? 0
    		: n.getNextForceMovement().getToSecondTile().getX() - n.getX());
    	data.writeByte(n.getNextForceMovement().getToSecondTile() == null ? 0
    		: n.getNextForceMovement().getToSecondTile().getY() - n.getY());
    	data.writeShort((n.getNextForceMovement().getFirstTileTicketDelay() * 600) / 20);
    	data.writeShort(n.getNextForceMovement().getToSecondTile() == null ? 0
    		: ((n.getNextForceMovement().getSecondTileTicketDelay() * 600) / 20));
    	data.writeShort(n.getNextForceMovement().getDirection());
        }
    
        private void applyForceTalkMask(NPC n, OutputStream data) {
    	data.writeString(n.getNextForceTalk().getText());
        }
    
        private void applyGraphicsMask1(NPC n, OutputStream data) {
    	data.writeShort128(n.getNextGraphics1().getId());
    	data.writeIntLE(n.getNextGraphics1().getSettingsHash());
    	data.writeByteC(n.getNextGraphics1().getSettings2Hash());
        }
    
        private void applyGraphicsMask2(NPC n, OutputStream data) {
    	data.writeShort(n.getNextGraphics2().getId());
    	data.writeIntLE(n.getNextGraphics2().getSettingsHash());
    	data.write128Byte(n.getNextGraphics2().getSettings2Hash());
        }
    
        private void applyGraphicsMask3(NPC n, OutputStream data) {
    	data.writeShort(n.getNextGraphics3().getId());
    	data.writeIntV2(n.getNextGraphics3().getSettingsHash());
    	data.writeByteC(n.getNextGraphics3().getSettings2Hash());
        }
    
        private void applyGraphicsMask4(NPC n, OutputStream data) {
    	data.writeShortLE(n.getNextGraphics4().getId());
    	data.writeIntLE(n.getNextGraphics4().getSettingsHash());
    	data.write128Byte(n.getNextGraphics4().getSettings2Hash());
        }
    
        private void applyHitMask(NPC npc, OutputStream data) {
    	int offset = data.getOffset();
    	int count = npc.getNextHits().size();
    	data.writeByteC(count);
    	int hp = npc.getHitpoints();
    	int maxHp = npc.getMaxHitpoints();
    	if (hp > maxHp)
    	    hp = maxHp;
    	int hpBarPercentage = maxHp == 0 ? 0 : (hp * 255 / maxHp);
    	byte hitCount = 0;
    	if (count > 0) {
    	    for (Hit hit : npc.getNextHits()) {
    		if (hit != null) {
    		    hitCount = (byte) (hitCount + 1);
    		    boolean interactingWith = hit.interactingWith(player, npc);
    		    if (hit.missed() && !interactingWith) {
    			data.writeSmart(32766);
    			data.writeByteC(0);
    		    } else if (hit.getSoaking() != null) {
    			data.writeSmart(32767);
    			data.writeSmart(hit.getMark(player, npc));
    			data.writeSmart(hit.getDamage());
    			data.writeSmart(hit.getSoaking().getMark(player, npc));
    			data.writeSmart(hit.getSoaking().getDamage());
    		    } else {
    			data.writeSmart(hit.getMark(player, npc));
    			data.writeSmart(hit.getDamage());
    		    }
    		    data.writeSmart(0);
    		}
    	    }
    	}
    	byte someSize = 1;
    	data.writeByte(someSize);
    	if (someSize > 0) {
    	    byte type = 0;
    	    for (byte i = 0; i < someSize; i = (byte) (i + 1)) {
    		data.writeSmart(npc.getHpBarSize());
    		data.writeSmart(0);
    		if (type != 32767) {
    		    data.writeSmart(8); // 0x7fff
    		    data.writeByteC(hpBarPercentage);
    		    if (type > 0) {
    			data.writeByte128(hpBarPercentage);
    		    }
    		}
    	    }
    	}
    	int offset2 = data.getOffset();
    	data.setOffset(offset);
    	data.writeByteC(hitCount);
    	data.setOffset(offset2);
        }
    
            @suppressWarnings("unused")
        private void applyNameChangeMask(NPC npc, OutputStream data) {
    	data.writeString(npc.getName());
        }
    
            @suppressWarnings("unused")
        private void applySecondBarMask(NPC n, OutputStream data) {
    	data.writeShortLE128(n.getSecondBar().getEndHp());
    	data.writeByte(n.getSecondBar().getTimer());
    	data.write128Byte(n.getSecondBar().getStartHp());
        }
    
        private void applyTransformationMask(NPC n, OutputStream data) {
    	data.writeBigSmart(n.getNextTransformation().getToNPCId());
        }
    
        public OutputStream createPacketAndProcess() {
    	boolean largeSceneView = player.hasLargeSceneView();
    	OutputStream stream = new OutputStream();
    	OutputStream updateBlockData = new OutputStream();
    	stream.writePacketVarShort(player, largeSceneView ? 65 : 72);
    	processLocalNPCsInform(stream, updateBlockData, largeSceneView);
    	stream.writeBytes(updateBlockData.getBuffer(), 0,
    		updateBlockData.getOffset());
    	stream.endPacketVarShort();
    	return stream;
        }
    
        private void processInScreenNPCs(OutputStream stream,
    	    OutputStream updateBlockData, boolean largeSceneView) {
    	stream.writeBits(8, localNPCs.size());
    	for (Iterator<NPC> it = localNPCs.iterator(); it.hasNext();) {
    	    NPC n = it.next();
    	    if (n.hasFinished()
    		    || !n.withinDistance(player, largeSceneView ? 126 : 14)
    		    || n.hasTeleported()) {
    		stream.writeBits(1, 1);
    		stream.writeBits(2, 3);
    		it.remove();
    		continue;
    	    }
    	    boolean needUpdate = n.needMasksUpdate();
    	    boolean walkUpdate = n.getNextWalkDirection() != -1;
    	    stream.writeBits(1, (needUpdate || walkUpdate) ? 1 : 0);
    	    if (walkUpdate) {
    		stream.writeBits(2, n.getNextRunDirection() == -1 ? 1 : 2);
    		if (n.getNextRunDirection() != -1)
    		    stream.writeBits(1, 1);
    		stream.writeBits(3,
    			Utils.getNpcMoveDirection(n.getNextWalkDirection()));
    		if (n.getNextRunDirection() != -1)
    		    stream.writeBits(3,
    			    Utils.getNpcMoveDirection(n.getNextRunDirection()));
    		stream.writeBits(1, needUpdate ? 1 : 0);
    	    } else if (needUpdate)
    		stream.writeBits(2, 0);
    	    if (needUpdate)
    		appendUpdateBlock(n, updateBlockData, false);
    	}
        }
    
        private void processLocalNPCsInform(OutputStream stream,
    	    OutputStream updateBlockData, boolean largeSceneView) {
    	stream.initBitAccess();
    	processInScreenNPCs(stream, updateBlockData, largeSceneView);
    	addInScreenNPCs(stream, updateBlockData, largeSceneView);
    	if (updateBlockData.getOffset() > 0)
    	    stream.writeBits(15, 32767);
    	stream.finishBitAccess();
        }
    
        public void reset() {
    	localNPCs.clear();
        }
    
    }
    Code:
    	// if (n.getNextForceMovement() != null) {
    	// applyForceMovementMask(n, data);
    	// }

    Code:
    	// if (n.getNextForceMovement() != null) {
    	// maskData |= 32768;
    	// }
    When i disable these, nex fully works w/o crashes. But when i go to tormentted demons it'll crash still.
    Is it the same error for TDs? You will need to debug and see if the mask structure is the same in the client to fix the force movement. Also make sure it's in the right position, you have to encode the force movement block at the right time (you can see the masks order in the client in decodeNPCMasks).
    Project thread
    Reply With Quote  
     

  9. #9  
    Registered Member chucky009's Avatar
    Join Date
    Aug 2011
    Posts
    355
    Thanks given
    1
    Thanks received
    26
    Rep Power
    0
    Quote Originally Posted by clem585 View Post
    Is it the same error for TDs? You will need to debug and see if the mask structure is the same in the client to fix the force movement. Also make sure it's in the right position, you have to encode the force movement block at the right time (you can see the masks order in the client in decodeNPCMasks).

    Alright thanks, i will check it up soon! Sorry have been busy with another project. I'll update if i maked some progress om this and yes TDS seemed to give the same error, i'll verify it. I am not really known with client sided stuff tbh, but could this be a Java version problem too? Since i havent had an issue before with my source only until i started again with rsps stuff. Thanks for the explanations though!
    Reply With Quote  
     

  10. #10  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by chucky009 View Post
    Alright thanks, i will check it up soon! Sorry have been busy with another project. I'll update if i maked some progress om this and yes TDS seemed to give the same error, i'll verify it. I am not really known with client sided stuff tbh, but could this be a Java version problem too? Since i havent had an issue before with my source only until i started again with rsps stuff. Thanks for the explanations though!
    Not a java version error, for sure.
    Project thread
    Reply With Quote  
     

Page 1 of 2 12 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. Replies: 0
    Last Post: 10-20-2013, 06:11 PM
  2. Client Crash
    By lootface in forum Help
    Replies: 6
    Last Post: 02-20-2009, 11:42 AM
  3. Client crash problem =[
    By b0rntokill1 in forum Help
    Replies: 0
    Last Post: 02-18-2009, 04:34 PM
  4. Replies: 1
    Last Post: 12-05-2008, 02:59 AM
  5. Replies: 0
    Last Post: 11-30-2008, 12:47 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
  •