-
Notifications
You must be signed in to change notification settings - Fork 30
[#412] Add async packet listener without packet reordering #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| PacketContainer packetContainer = new PacketContainer(packetType, packet); | ||
| ChunkStruct struct = new ChunkStruct(packetContainer, this.player.getWorld()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont like that we still get world in async. Maybe you can use sync ProtocolLib listener just to map System.identityHashCode(packet.getHandle()) -> player.getWorld() and here try to get it from map, if null fallback to player.getWorld().
Also i think sync listener could be used for starting obfuscate proccess for chunk as soon as possible, so we have minimal packet delay(Mostly is starting getting neighboring chunks as soon as posible (i think it is main source for packet delay)). At least on modern versions if you try to get chunk async while being on main thread it firstly check if chunk is already loaded and if loaded then it completes future immediately so this behaviour can be used to reduce packet delay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly a good idea would like to implement this maybe at a later stage not sure yet, I have to think about a possible implementation a bit.
...cator-plugin/src/main/java/net/imprex/orebfuscator/injector/OrebfuscatorInjectorManager.java
Show resolved
Hide resolved
| } | ||
|
|
||
| public void uninject() { | ||
| if (!this.channel.eventLoop().inEventLoop()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is uninject really should be done in event loop always? On plugin disable i think it should not switch contexts.
I think nobody is reloading orebfuscator via PlugMan, but for developing purposes it can be done and there is a really low chance that on plugin reloading it may fail to inject because old handler is still present on pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it would hurt to remove the event-loop context switch so I will do that.
Description
Add a async packet listener/injector that doesn't reorder packets.
Related Issue
closes #412
Motivation and Context
How Has This Been Tested?
Types of Changes