Skip to content
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

common: don't cleanup icons on unregister #115

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

cbs228
Copy link
Contributor

@cbs228 cbs228 commented Sep 16, 2023

In previous versions, icons files were removed from the web directory when they were unregistered via
IconRegistry.unregister(). Icons are unregistered when plugins are shut down or removed.

When an external web server is in use, map tiles remain available to clients after the game server has stopped—but registered icons do not. The removed icons result in ugly "broken link" images on clients.

Since icons are generally quite small, and are in most cases seldomly swapped out, leaving unused icon files is probably not a big deal. Skip the removal of images/icon/registered and all icon files. Old icon files are overwritten as necessary with new ones.

Closes #114

In previous versions, icons files were removed from the web
directory when they were unregistered via
`IconRegistry.unregister()`. Icons are unregistered when plugins
are shut down or removed.

When an external web server is in use, map tiles remain available
to clients after the game server has stopped—but registered icons
do not. The removed icons result in ugly "broken link" images on
clients.

Instead of removing icon files immediately when they are
unregistered, defer the removal until squaremap's next startup.
Old icon files will be overwritten with new ones if necessary.

See also:

<jpenilla#114>
@jpenilla jpenilla changed the title common: don't cleanup icons common: don't cleanup icons on unregister Sep 17, 2023
Copy link
Owner

@jpenilla jpenilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jpenilla jpenilla merged commit 7173d23 into jpenilla:master Sep 17, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registered icon removal causes 404 errors on external web servers
2 participants