PlayerSkins

PlayerSkins 3.0.6

Fixed NRE when getting players SR balance
  • Like
Reactions: KBow
Make sure you download ImageLibrary v2.0.22 to prevent load orders running at the same time!

Added config option to choose whether to load workshop items - "Skin List - Import workshop skin list"
Broke skin load orders down into groups of 500, that way if your server crashes when downloading you won't have to restart from the beggining
Fixed NRE when trying to remove newly invalid skins from players selected skin data
Remove items from the menu if they don't have a icon stored
You will need ImageLibrary v2.0.21 for this update!

This will delete your old config so back up before updating!

Reworked config
Another pass of general cleanup
Removed skin list loading from ImageLibrary - Skin list now downloads from a premade JSON from the internet. This is a 2 part solution;
1) The chance clients will try and load an invalid skin (which stalls skin loading until the player restarts the game) is now greatly reduced because the skin list is updated once per day. This is not a guaranteed solution as the underlying problem needs to be resolved by FacePunch
2) Linux users who experience the Exception: ISteamUGC _ptr is null! issue should have no problem downloading this skin list
  • Like
Reactions: Vustra.
You will need ImageLibrary v2.0.21 for this update!

This will delete your old config so back up before updating!

Reworked config
Another pass of general cleanup
Removed skin list loading from ImageLibrary - Skin list now downloads from a premade JSON from the internet. This is a 2 part solution;
1) The chance clients will try and load an invalid skin (which stalls skin loading until the player restarts the game) is now greatly reduced because the skin list is updated once per day. This is not a guaranteed solution as the underlying problem needs to be resolved by FacePunch
2) Linux users who experience the Exception: ISteamUGC _ptr is null! issue should have no problem downloading this skin list
  • Like
Reactions: Vustra.
This update requires ImageLibrary v2.0.20
Added console command to add custom skins
First pass of tidy up
Economics integration fix
Changed Economics Hooks to match update.

If you haven't updated Economics please do so before installing this version.

If you have any issues let me know.
PLEASE DOWNLOAD THE NEWEST IMAGELIBRARY SO THE NEW CONFIG OPTION WILL WORK!

Fixed Token Purchase window freezing on screen.

Added Config option: RequireWebImages. Setting this to true will force ImageLibrary to return the URL of the image instead of the PNG. This is a lower quality image and MIGHT slow the RAM consumption. The only other suggestion for RAM usage is to type gc.unload in console periodically to clear ram usage. This has been very helpful on a server group I work with; so perhaps it will help you all as well.

Added a Show Skins button to each Permission entry (admin view). Pressing this will filter the selected skins for that item. If you switch items this permission will still be shown until you deselect the permission. This should help admins determine what permissions have what skins.. :)

f4deb77d34300e3272b7ea80a78cc054.png

8b1a232d790713cfbcc6fa3d55562417.jpg
Fix for duplicate skins show if you have multiple permissions for the same skin (Bug shown in my Permission Overview Video - Posted in Overview).

I also fixed if a player owns a skin but no longer has permission it was showing for them in "Owned Only" View. Now if they own it but don't have permission it is hidden in regular view and "Owned Only" View.

Let me know if anyone finds any other bugs, I hope you enjoy the new flexibility of the permission system! It was a pain in the ass to implement :)
  • Like
Reactions: VinylFresh
***MAJOR CHANGE***
THIS UPDATE REQUIRES A NEW DATA FILE AND CONFIG FILE.

I recommend you save your old Config and Data Files just in case you must revert to the prior version. I have done a ton of testing but I don't always catch everything!

PlayerSkins.vip (bypasses cost of skin) is now changed to PlayerSkins.free

I have revamped the Ban System to act as a Permission system instead. In doing so I moved the Banned Item and Skin Permissions to the Data file instead of keeping it in the config file. I recommend you make no manual changes to the Data file.

Ban Item still works the same. So you can ban an entire item from showing in the menu for all players.

Instead of Banning Skins you now will assign permissions to determine who can and cannot see it. Therefore, if you want to just hid skins from all players use a permission no one has!

Skin Permissions:
Now in the config file is a List of strings called 'permissions'. Any string you put into this list will be available as a permission within the game. On load of PlayerSkins all strings in this list will register as a permission. Therefore, if you put "test" as a permission on load it would register PlayerSkins.test.

Config shown in image below:
"permissions": [
"vip1",
"vip2",
"vip3",
"test1",
"test2",
"test3",
"test4",
"test5",
"test6",
"test7",
"test8",
"test9",
"test10"
],

Each of these permissions will automatically show as a permission option when you click a skin within admin mode. Each permission will provide (4) options: Assign, Deny, Assign All, Deny All.

Before I explain the permission options understand that if a skin has no permissions assigned to it then it is visible to everyone. If a skin has at-least one permission assigned then the player will need to have that permission or any other valid permission for that skin to see or use it! A skin can have as many or as few permissions as you want.

Assign: Allows Players with that permission to see that skin.
Deny: Removes that permission from the skin.
Assign All: Allows Players with that permission to see all skins within that item!
Deny All: Removes that permission from all skins within that item!

The follow views are only available in Admin Mode:
9f80c251e84c55e43b792b5848e720cf.jpg

664a280cc55c73e519ea97d38a0e1169.jpg
  • Like
Reactions: VinylFresh