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

Add support for player skins via SkinsDB #284

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

shrimpza
Copy link
Contributor

@shrimpza shrimpza commented Dec 16, 2022

Adds support for SkinsDB, allowing display of custom player skins on the map.

The implementation will serve skin textures directly from the skinsdb/textures directory, and assemble previews on the client. I believe this should support older (32x64) and newer texture (64x64) skin formats. Overlays are not supported (yet?!).

Also updated the popup when selecting a player, to show a preview of the player with their skin. Also added a small crown icon next to the name of players flagged as moderators in this popup.

image
image

@coveralls
Copy link

coveralls commented Dec 16, 2022

Pull Request Test Coverage Report for Build 3710908515

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 69.594%

Totals Coverage Status
Change from base Build 3688350837: 0.0%
Covered Lines: 1046
Relevant Lines: 1503

💛 - Coveralls

Default colors, see: [colors.txt](../server/static/colors.txt)
Default colors, see: [colors directory](../public/colors)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this refers to an old implementation, so I just updated this to the directory where colours are stored.

const marker = L.marker([player.pos.z, player.pos.x], {icon: this.getIcon(player)});

marker.bindPopup(this.createPopup(player));
marker.bindPopup(this.createPopup(player), {minWidth: 220});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the popup wider by default just because it looked a bit squashed with the player portrait included.


// no cached skin, we need to build the image
let img = new Image();
img.onload = function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The skins will load asyncronously, and then be added to the playerSkins map/cache, so after a subsequent update they'll rerender.

@@ -69,7 +69,6 @@ See: [Incremental rendering](doc/incrementalrendering.md)
## Planned Features

* Isometric view
* Skin support
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there are other skin mods or methods of support still required, I can add this back.

@BuckarooBanzay BuckarooBanzay added the enhancement New feature or request label Dec 16, 2022
@BuckarooBanzay
Copy link
Member

wow, this looks awesome 😲 🎉
Kudos for the skin-preview code and the path-traversal checks 👍
Time for me to fix the ci-issues and try to make a release i guess...

@BuckarooBanzay BuckarooBanzay merged commit 7e8dcdc into minetest-mapserver:master Dec 16, 2022
BuckarooBanzay referenced this pull request in TerraQuest-Studios/skinsdb-astro Nov 13, 2023
@shrimpza shrimpza deleted the skinsdb-support branch November 13, 2023 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants