From 7df6363aa0247068205a09815721164813849b19 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sun, 7 Jan 2018 14:50:22 +0100 Subject: Rework private skins handling -add skin:is_applicable_for_player(playername) method - hide private skins in unified_inventory since not supported - check player assignment in skins.assign_player_skin() + inherited to skins.set_player_skin() --- API.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'API.md') diff --git a/API.md b/API.md index 0e6b293..ad0248b 100644 --- a/API.md +++ b/API.md @@ -72,7 +72,11 @@ The next metadata keys are usually filled - name - A name for the skin - author - The skin author - license - THe skin texture license - - assignment - is "player:playername" in case the skin is assigned to be privat for a player + - assignment - (obsolete) is "player:playername" in case the skin is assigned to be privat for a player + - playername - Player assignment for private skin ## skin:get_meta_string(key) Same as get_meta() but does return "" instead of nil if the meta key does not exists + +## skin:is_applicable_for_player(playername) +Check if a skin is applicable for the player "playername". Ususally the private skins could be applied to the player only -- cgit v1.2.3 From 429874698ea5176e15a3b5703ac734b5b123d842 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sun, 7 Jan 2018 19:09:52 +0100 Subject: Add skins.get_skinlist_with_meta(key, value) and small adjustments --- API.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'API.md') diff --git a/API.md b/API.md index ad0248b..f94213b 100644 --- a/API.md +++ b/API.md @@ -16,12 +16,14 @@ skins.update_player_skin(player) ``` ## skins.get_skinlist(assignment, select_unassigned) -Get a list of skin objects matching to the assignment. +Obsolete - use get_skinlist_for_player() or get_skinlist_with_meta() instead -Supported assignments: - - "player:"..playername - Skins directly assigned to a player +## skins.get_skinlist_for_player(playername) +Get all allowed skins for player. All public and all player's private skins. If playername not given only public skins returned -select_unassigned - Select all skins without assignment too (usually the "character_*" skins) +## skins.get_skinlist_with_meta(key, value) +Get all skins with metadata key is set to value. Example: +skins.get_skinlist_with_meta("playername", playername) - Get all private skins (w.o. public) for playername ## skins.new(key, object) @@ -73,10 +75,10 @@ The next metadata keys are usually filled - author - The skin author - license - THe skin texture license - assignment - (obsolete) is "player:playername" in case the skin is assigned to be privat for a player - - playername - Player assignment for private skin + - playername - Player assignment for private skin. Set false for skins not usable by all players (like NPC-Skins), true or nothing for all player skins ## skin:get_meta_string(key) Same as get_meta() but does return "" instead of nil if the meta key does not exists ## skin:is_applicable_for_player(playername) -Check if a skin is applicable for the player "playername". Ususally the private skins could be applied to the player only +Returns whether this skin is applicable for player "playername" or not, like private skins -- cgit v1.2.3 From 6a09746b903d63302d9dd339877bf450adb3a52c Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sun, 7 Jan 2018 20:30:27 +0100 Subject: Support for in_inventory_list attribute to hide usable skins in inventory API-documentation update --- API.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'API.md') diff --git a/API.md b/API.md index f94213b..193f824 100644 --- a/API.md +++ b/API.md @@ -70,12 +70,14 @@ Add a meta information to the skin object Note: the information is not stored, therefore should be filled each time during skins registration ## skin:get_meta(key) -The next metadata keys are usually filled +The next metadata keys are filled or/and used interally in skinsdb framework - name - A name for the skin - author - The skin author - license - THe skin texture license - assignment - (obsolete) is "player:playername" in case the skin is assigned to be privat for a player - playername - Player assignment for private skin. Set false for skins not usable by all players (like NPC-Skins), true or nothing for all player skins + - in_inventory_list - If set to false the skin is not visible in inventory skins selection but can be still applied to the player + - _sort_id - Thi skins lists are sorted by this field for output (internal key) ## skin:get_meta_string(key) Same as get_meta() but does return "" instead of nil if the meta key does not exists -- cgit v1.2.3