SamB440 / ForcePack

Spigot/Velocity plugin to aid resource pack deployment and enforcement, among other utilities.
https://fortitude.islandearth.net/category/forcepack
GNU General Public License v3.0
42 stars 17 forks source link

Really live reloading #61

Open BigTows opened 4 months ago

BigTows commented 4 months ago

User case: We utilize S3 storage to store our resource pack. This pack is loaded from our CI/CD pipelines, ensuring that any changes on the servers (such as Velocity) are ignored.

What if? ForcePack automatically check headers of the http request, for example: HEAD https://eu.amazonaws.com/textures/test.zip Response Header is: Name Value
Date Sat, 02 Mar 2024 07:17:37 GMT
Last-Modified Sat, 02 Mar 2024 07:17:37 GMT

The plugin can dynamically check these parameters and manage the update hash accordingly. I'm not referring to the /vforcepack reload command, as it can lead to a subpar user experience. (The user forcibly receives the resourcepack)

Instead, the plugin updates the hash automatically, ensuring that the player receives the updated resource pack during the next loading process. This streamlined approach enhances user experience by eliminating the need for manual intervention.

BigTows commented 4 months ago

or support S3 api ;) But scheduled http request it's fine i guess.

SamB440 commented 4 months ago

I feel like just expanding the reload command is a better option than a scheduled task.

Some sites won't include those headers.

BigTows commented 4 months ago

I feel like just expanding the reload command is a better option than a scheduled task.

A HEAD request is lighter than a GET request.

Some sites won't include those headers.

  1. Configure the header for checking:
  2. In some cases, the plugin can send a GET request to verify, but it's not a good idea.