Refactor Handling to use Tasks
3013
and 3019
Opcode Description
Sequentially parsing large packets can cause lag in the bot and client. Parsing many items or characters in the spawn packet 3019
for example causes noticeable lag on occasion.
Using tasks to parse them in separate threads should help.
3017
to show how many units have to be parsed, followed by 3019
with the information to be parsed should be maintained.
- Adding their handlers to a separate category that have to be multithreaded could keep all these packets in one space and prevent race conditions.
- A packet queue that frees the proxy loop from waiting for the handler to return from parsing.
Edited by opport