Velocity icon indicating copy to clipboard operation
Velocity copied to clipboard

Added initial framework for service API

Open Crypnotic opened this issue 5 years ago • 12 comments

This commit adds a barebones Service API to allow a discussion based solely on the framework itself before any service interfaces are created.

Resolves #231

Key notes:

  • Currently services can only be provided by 1 plugin at a time. Bukkit allows services to be registered with priority. This may be something we should look into, but for the time being 1:1 is what is implemented.
  • This is by no means aimed to be a finished product.
  • This is loosely based on what Bukkit has implemented currently such that any interface can be registered by any plugin.
  • Currently, services cannot be unregistered by either the proxy or any plugins
  • There is very little by way of querying the registered services

Crypnotic avatar Jan 19 '20 23:01 Crypnotic

I'm fond of the ability to create services, But I feel in order for this to be implemented we may need to be able to unregister the services. Along with that maybe some basic services like Permissions, User, and Eco. I can look into making a pr to implement these services if needed.

jacoballen1 avatar Jan 20 '20 04:01 jacoballen1

That's planned, but with that comes with trying to figure out where within the proxy we need to unregister which I was not ready to dive into. Since it's not crucial at this point, I PRed without

Crypnotic avatar Jan 20 '20 05:01 Crypnotic

with that comes with trying to figure out where within the proxy we need to unregister

Out of curiosity, why would the proxy need to be able to unregister a service? In its current form, the PR doesn't allow the proxy to register a service (only plugins can), so it would only be able to unregister services that were registered by plugins.

mdcfe avatar Jan 20 '20 13:01 mdcfe

with that comes with trying to figure out where within the proxy we need to unregister

Out of curiosity, why would the proxy need to be able to unregister a service? In its current form, the PR doesn't allow the proxy to register a service (only plugins can), so it would only be able to unregister services that were registered by plugins.

I'm not entirely sure that it would need to, but that discussion needs to be had. Which is why it was left out for now

Crypnotic avatar Jan 20 '20 17:01 Crypnotic

We also need to decide the best way to store a plugin -> services map since there's no way to get that information without stepping through the services map

Crypnotic avatar Jan 20 '20 17:01 Crypnotic

plugin -> services map since there's no way to get that information without stepping through the services map

Does it really matter? I don't really see there being any case where such a thing is going to be checked often or in any context where performance is super relevant?

electronicboy avatar Jan 21 '20 18:01 electronicboy

plugin -> services map since there's no way to get that information without stepping through the services map

Does it really matter? I don't really see there being any case where such a thing is going to be checked often or in any context where performance is super relevant?

I don't necessarily think it is a great idea, but I can see someone coming into discord in due time asking how to do so. Really just a toss up between exposing the service map so they can step through it themselves, implementing such a method, or linking plugin -> service

Crypnotic avatar Jan 22 '20 00:01 Crypnotic

Resolved the overrides. Not sure why the ProtocolVersion 1.15.2 updates are showing now, but will sort out later

Crypnotic avatar Jan 22 '20 13:01 Crypnotic

any progress on this?

MrIvanPlays avatar Jul 30 '20 07:07 MrIvanPlays

Plenty of signs this is still a WIP. What more updates could you want?

astei avatar Jul 30 '20 07:07 astei

Plenty of signs this is still a WIP. What more updates could you want?

I mean, haven't been updated for like 7 months now and i think it's a dead wip?

MrIvanPlays avatar Jul 30 '20 07:07 MrIvanPlays

Plenty of signs this is still a WIP. What more updates could you want?

I mean, haven't been updated for like 7 months now and i think it's a dead wip? I left this as WIP for input from anyone that wanted changes made before it was merged, but it appears it's fine in its current form. RTM after review.

Crypnotic avatar Jan 21 '21 12:01 Crypnotic