A T2 error is thrown when the packet size that you send to the client isn't the same size that's read.
You need to make sure that you're sending the bytes correctly with the correct packet size (if it's hardcoded).
|
So I'm currently making a project in apollo which is a 377 revision, and I plan on learning from this project and then continuing on. So I'm currently making a ground item system, and that to spawn ground items a position event must be used which is packet 75. So every ground item is saved in an array and the problem is you can't keep calling packet 75 to position the ground item if you keep doing this you will create clone of that ground item. So I found out that packet 40 (packet 64 in 317) resets every object/item in an 8x8 region which means it deletes it and places it where it is at. So I setup the encoder just like the packet 75. And I don't know what I'm doing wrong, but when I teleport to the region with the items while calling packet 40 it just logs me off and I get T2 errors. Is there anything that I'm doing wrong with calling packet 40?
Spoiler for Packet 40:
A T2 error is thrown when the packet size that you send to the client isn't the same size that's read.
You need to make sure that you're sending the bytes correctly with the correct packet size (if it's hardcoded).
I'm pretty sure I did assign it correctly I got the correct bytes from a list in this forum. If that is not enough information this is how I setup the encoder
Code:GamePacketBuilder builder = new GamePacketBuilder(40); Position base = event.getBase(), pos = event.getPosition(); builder.put(DataType.BYTE, pos.getLocalY(base) & 0xFFFF); builder.put(DataType.BYTE, DataTransformation.NEGATE, pos.getLocalX(base));
Yes I already have that down. But I don't know how to correctly call it. Idk if you know what packet 40 does, but idk if i should call it before the region update process or after, and then call the ground item packet.
packet 40 377 deob read methods
Code:anInt990 = buffer.method542(anInt1236); anInt989 = buffer.method541(-34545);Code:public int method542(int i) { i = 77 / i; return 128 - array[position++] & 0xff; }Code:public int method541(int i) { if (i != -34545) { return anInt1436; } else { return -array[position++] & 0xff; } }
haven't tested myself but pretty sure the first byte you're encoding needs the following transformation:
Code:put(DataType.BYTE, DataOrder.BIG, DataTransformation.ADD, value);
Subtracted, not added
Then the next logical step would be sending it outside of player synchronization. You should actually send it on completion of region change btw. The client sends a packet when region change has completed. Keep in mind that you must validate the packet and ensure a region change had actually occurred
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |