forked from WorldStarHipHopX/playforia
-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Bundle maps into build artifacts #104
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pehala FIY |
pehala
reviewed
Sep 30, 2023
Changes since last review:
|
Verified these are the same by running ```sh diff -r assets/res/Shared/picture/ client/src/main/resources/picture/shared/ || echo "Differences found!" diff -r assets/res/Shared/sound client/src/main/resources/sound/shared/ || echo "Differences found!" diff -r assets/res/AGolf/picture/ client/src/main/resources/picture/agolf/ || echo "Differences found!" diff -r assets/res/AGolf/picture/ client/src/main/resources/picture/agolf/ || echo "Differences found!" diff -r assets/res/l10n/ client/src/main/resources/l10n/ || echo "Differences found!" diff assets/res/appletloader_playforia.gif client/src/main/resources/appletloader_playforia.gif || echo "Differences found!" diff -r assets/res/Editor/ editor/src/main/resources/ || echo "Differences found" ``` There was an actual difference in Agolf/picture/special.gif, where the assets directory contains some debug drawings on the picture but this is unused and can be removed. AGolf2.xml was also missing from the client resources so I've added it there. I'm not sure if it's actually used for anything at the momement but better safe than sorry.
This way, the jar and configuration can be stored in separate file hierarchies. This is useful when you have multiple track directories, e.g. a small one with a selection of tracks and a larger one. It's also useful for starting a server with ssh without having to pollute your server's home directory (`ssh user@host java -jar server.jar --tracks-dir=/my/path/tracks`)
With this change, the server no longer needs to be deployed alongside a tracks directory and the symlink to the tracks directory can also be removed, making the server work by default on Windows on IDEs. Tracks are now bundled into the jar file generated by `mvn package`, however the location where tracks are searched for can still be overridden with a CLI flag. This required changing the way FileSystemStatsManager and FileSystemTrackManager load tracks by making it possible to configure which kind of file system they should use as jar resources can only be read as files when using a custom FileSystem.
Look fine for me. If I receive no complaints until Monday this gets merged! |
pehala
approved these changes
Oct 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With this change, the server no longer needs to be deployed alongside a
tracks directory and the symlink to the tracks directory can also be
removed, making the server work without any changes on Windows.
Tracks are now bundled into the jar file generated by
mvn package
,however the location where tracks are searched for can still be
overridden with a CLI flag.
This required changing the way FileSystemStatsManager and
FileSystemTrackManager load tracks by making it possible to configure
which kind of file system they should use as jar resources can only be
read as files when using a bespoke FileSystem.
Also a bunch of duplicate unused assets have been removed. See individual commits for more details.
Testing
exec:java
task from IntelliJ, which successfully loaded maps from the resources pathjava -jar server/target/server-2.1.2.0-BETA.jar
), which successfully loaded bundled maps--tracks-dir
argument (java -jar server/target/server-2.1.2.0-BETA.jar --tracks-dir server/src/main/resources/tracks
), which successfully loaded maps from my filesystem