Glowstone-Legacy icon indicating copy to clipboard operation
Glowstone-Legacy copied to clipboard

ProtocolLib support??

Open SpaceManiac opened this issue 9 years ago • 10 comments

(Requested by basicer on IRC).

My past investigation tells me ProtocolLib appears to be heavily dependent on NMS packet structure representations, something which it is unreasonable to attempt to implement purely in Glowstone. Someone (me?) should get in touch with the author (aadnk) and see what they have to say about ProtocolLib/Glowstone compatibility, since it would ease transition for some plugins depending on ProtocolLib but not CB/NMS directly.

The fallback is, of course, asking people to compile against Glowstone and use Glowstone message classes (which really is simpler, if you're willing to risk version instability). Maybe also adding packet in/out events behind some sort of config setting, because performance.

Low-priority.

SpaceManiac avatar Sep 04 '14 04:09 SpaceManiac

Paging @aadnk

ZephireNZ avatar Sep 04 '14 05:09 ZephireNZ

Another ping for @aadnk maybe? :3

dequis avatar Oct 17 '14 16:10 dequis

Demmet @aadnk

gdude2002 avatar Oct 25 '14 18:10 gdude2002

Another page for @aadnk (this is getting pretty annoying)

Personally I feel as though if ProtocolLib and similar plugins wish to support Glowstone, they can. If they don't for whatever reason, they don't have to.

turt2live avatar Jan 15 '15 03:01 turt2live

https://github.com/aadnk/ProtocolLib/blob/master/Readme.md

It appears @dmulloy2 is the current maintainer of ProtocolLib now.

SuperSpyTX avatar Jan 20 '15 10:01 SuperSpyTX

It is mentionned it requires Spigot API ? Is it new ? EDIT: My bad, it might be because Bukkit API stopped support.

jimmikaelkael avatar Jan 20 '15 10:01 jimmikaelkael

Well, if they managed to get it working with Spigot-specific stuff, then they should be able to get it working with Glowstone-specific stuff, right?

It's kind of an important plugin to have working - I hope @dmulloy2 will be happy to port it..

gdude2002 avatar Jan 20 '15 10:01 gdude2002

Well, if they managed to get it working with Spigot-specific stuff, then they should be able to get it working with Glowstone-specific stuff, right?

@gdude2002 not entirely. A large part of the ProtocolLib API is heavily based on the field order/types in the PacketXY classes. As Spigot uses decompiled minecraft source code (just as CB did), there were only small changes in the packets themselves (and I'd imagine some changes to get the packet interceptor injected into the pipeline). But if ProtocolLib was updated to support Glowstone, it would cause the majority of plugins using ProtocolLib to be incompatible with either Glowstone or Spigot (or each plugin would have to support both implementations by itself), as the ordering and the types of the fields are different in Glowstone than they were in CB / are in Spigot. There are separate wrappers for each of the packets which would basically provide a way to access packets from the ProtocolLib API without depending on field order. However you'd have to update these wrappers to support both, Spigot and Glowstone, and these wrappers are unfortunately underused (maybe 1 out of 10 plugins use them). You'd also need to basically recode all the other wrappers ProtocolLib provides (see them here). Even thought that'd be possible, it'd be rather time consuming and you might face even more challenges.

So while it'd be theoretically possible for ProtocolLib to support Glowstone and Spigot at the same time. I don't think it'd be worth the time. I do not actively follow Sponge atm but I'd guess that it is easier and faster to just wait for the Sponge API to be done and hope that it provides something that makes it not necessary to have ProtocolLib updated to Glowstone. Sorry for being that pessimistic, I'd be happy if someone shows me that I'm wrong :)

Johni0702 avatar Jan 20 '15 12:01 Johni0702

You're probably right, but well, with the way the Sponge project is going.. eh.. it would probably be faster to port this.

Still, not up to us! I would like a decent API that isn't bukkit-based, rather than hacky library porting, too.

gdude2002 avatar Jan 20 '15 13:01 gdude2002

Networking infrastructure doesn't generally belong on a server-side API anyways. What if we swap out Netty for raw sockets? Suddenly our networking infrastructure is vastly different and we can't maintain our "old" API calls. The server-side API would heavily rely on the implementation details, making it badly designed.

A third party resource (such as ProtocolLib) or an otherwise external resource to the common server-side API is more ideal because the use of it is an implied understanding that if things change, your code is likely broken.

turt2live avatar Jan 20 '15 13:01 turt2live