mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-23 07:50:18 +01:00
Merge branch 'master' into contentdb
This commit is contained in:
commit
59f0dcaf3f
2
API.md
2
API.md
@ -91,7 +91,7 @@ The next metadata keys are filled or/and used interally in skinsdb framework
|
|||||||
- name - A name for the skin
|
- name - A name for the skin
|
||||||
- author - The skin author
|
- author - The skin author
|
||||||
- license - THe skin texture license
|
- license - THe skin texture license
|
||||||
- assignment - (obsolete) 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 private 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
|
- 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
|
- 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)
|
- _sort_id - Thi skins lists are sorted by this field for output (internal key)
|
||||||
|
11
README.md
11
README.md
@ -20,15 +20,16 @@ This Minetest mod offers changeable player skins with a graphical interface for
|
|||||||
|
|
||||||
## Installing skins
|
## Installing skins
|
||||||
|
|
||||||
### Download from the [database](http://minetest.fensta.bplaced.net/)
|
### Download from the [database](https://skinsdb.terraqueststudios.net/)
|
||||||
|
|
||||||
#### Ingame Downloader
|
#### Ingame Downloader
|
||||||
|
|
||||||
1) Get Minetest 5.1.0-dev-cb00632 or newer
|
1) Get Minetest 5.1.0-dev-cb00632 or newer
|
||||||
2) Start your world
|
2) In the settings menu show advanced options, find the "Developer Options" tab and add "skinsdb" to "Trusted mods" (secure.trusted_mods in minetest.conf)
|
||||||
3) Run `/skinsdb_download_skins <skindb start page> <amount of pages>`
|
3) Start your world
|
||||||
4) Wait for the Minetest server to shut down
|
4) Run `/skinsdb_download_skins <skindb start page> <amount of pages>`
|
||||||
5) Start the server again
|
5) Wait for the Minetest server to shut down
|
||||||
|
6) Start the server again
|
||||||
|
|
||||||
You might want to run `minetest` in a Terminal/Console window to check the log output instantly.
|
You might want to run `minetest` in a Terminal/Console window to check the log output instantly.
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
minetest.register_chatcommand("skinsdb", {
|
minetest.register_chatcommand("skinsdb", {
|
||||||
params = "[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]",
|
params = S("[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]"),
|
||||||
description = S("Show, list or set player's skin"),
|
description = S("Show, list or set player's skin"),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
6
init.lua
6
init.lua
@ -8,6 +8,12 @@ skins = {}
|
|||||||
skins.modpath = minetest.get_modpath(minetest.get_current_modname())
|
skins.modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||||
skins.default = "character"
|
skins.default = "character"
|
||||||
|
|
||||||
|
-- see skindsdb/textures/readme.txt to avoid playername with underscore problem
|
||||||
|
skins.fsep = minetest.settings:get("skinsdb_fsep") or "_"
|
||||||
|
if skins.fsep == "_" then
|
||||||
|
minetest.log("warning", "skinsdb filename seperator is set to " .. skins.fsep .. ", see skindsdb/textures/readme.txt to avoid problems with playernames containing underscore")
|
||||||
|
end
|
||||||
|
|
||||||
dofile(skins.modpath.."/skin_meta_api.lua")
|
dofile(skins.modpath.."/skin_meta_api.lua")
|
||||||
dofile(skins.modpath.."/api.lua")
|
dofile(skins.modpath.."/api.lua")
|
||||||
dofile(skins.modpath.."/skinlist.lua")
|
dofile(skins.modpath.."/skinlist.lua")
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
# Translation by Xanthin
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
|
|
||||||
Raw texture=Rohtextur
|
|
||||||
Name=Name
|
|
||||||
Author=Autor
|
|
||||||
Change=Wechseln
|
|
||||||
Page=Seite
|
|
||||||
License=Lizenz
|
|
||||||
Description=Beschreibung
|
|
||||||
Show, list or set player's skin=Anzeigen oder setzen der Spieler-Skins
|
Show, list or set player's skin=Anzeigen oder setzen der Spieler-Skins
|
||||||
Player not found=Spieler nicht da
|
Player not found=Spieler nicht da
|
||||||
unknown command=unbekannter Befehl
|
unknown command=unbekannter Befehl
|
||||||
see /help skinsdb for supported parameters=Lese /help für erlaubte Parameter
|
see /help skinsdb for supported parameters=Lese /help für erlaubte Parameter
|
||||||
skin set to=Skin ist jetzt
|
skin set to=Skin ist jetzt
|
||||||
invalid skin=unbekannter Skin
|
invalid skin=unbekannter Skin
|
||||||
unknown parameter=unbekannter Parameter
|
|
||||||
Skins=Aussehen
|
|
||||||
Requires skin key=Benötigt Skin-Name
|
Requires skin key=Benötigt Skin-Name
|
||||||
|
unknown parameter=unbekannter Parameter
|
||||||
|
Raw texture=Rohtextur
|
||||||
|
Page=Seite
|
||||||
|
Name=Name
|
||||||
|
Author=Autor
|
||||||
|
License=Lizenz
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=
|
||||||
|
Change=Wechseln
|
||||||
|
Skins=Aussehen
|
||||||
|
19
locale/skinsdb.eo.tr
Normal file
19
locale/skinsdb.eo.tr
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# textdomain: skinsdb
|
||||||
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=[set] <haŭtonomo> | show [<haŭtonomo>] | list | list private | list public | [ui]
|
||||||
|
Show, list or set player's skin=Montri haŭtojn («show»), listigi haŭtojn («list»), aŭ agordi onian haŭton («set»)
|
||||||
|
Player not found=Ludanto ne trovita
|
||||||
|
unknown command=nekonata ordono
|
||||||
|
see /help skinsdb for supported parameters=rulu «/help skinsdb» por vidi subtenatajn parametrojn
|
||||||
|
skin set to=haŭto agordita al
|
||||||
|
invalid skin=nevalida haŭto
|
||||||
|
Requires skin key=Postulas haŭtonomon
|
||||||
|
unknown parameter=nekonata parametro
|
||||||
|
Raw texture=Kruda bildo
|
||||||
|
Page=Paĝo
|
||||||
|
Name=Nomo
|
||||||
|
Author=Aŭtoro
|
||||||
|
License=Permesilo
|
||||||
|
<skindb start page> <amount of pages>=<komenca paĝo> <paĝokvanto>
|
||||||
|
Downloads the specified range of skins and shuts down the server=Elŝutinte haŭtojn el skindb inter la donitaj paĝoj, restartigas la servilon
|
||||||
|
Change=Ŝanĝi
|
||||||
|
Skins=Haŭtoj
|
@ -1,18 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
Raw texture=Texture
|
|
||||||
Name=Nom
|
|
||||||
Author=Auteur
|
|
||||||
Change=Changer
|
|
||||||
Page=Page
|
|
||||||
License=Licence
|
|
||||||
Description=Description
|
|
||||||
Show, list or set player's skin=Afficher, lister ou définir le skin du joueur
|
Show, list or set player's skin=Afficher, lister ou définir le skin du joueur
|
||||||
Player not found=Joueur non trouvé
|
Player not found=Joueur non trouvé
|
||||||
unknown command=commande inconnue
|
unknown command=commande inconnue
|
||||||
see /help skinsdb for supported parameters=voir /help skinsdb pour les paramètres supportés
|
see /help skinsdb for supported parameters=voir /help skinsdb pour les paramètres supportés
|
||||||
skin set to=skin définie sur
|
skin set to=skin définie sur
|
||||||
invalid skin=skin peau invalide
|
invalid skin=skin peau invalide
|
||||||
|
Requires skin key=
|
||||||
unknown parameter=paramètre inconnu
|
unknown parameter=paramètre inconnu
|
||||||
unknown skin=skin inconnue
|
Raw texture=Texture
|
||||||
|
Page=Page
|
||||||
|
Name=Nom
|
||||||
|
Author=Auteur
|
||||||
|
License=Licence
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=
|
||||||
|
Change=Changer
|
||||||
|
Skins=
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
# Malay translation by muhdnurhidayat
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
|
|
||||||
Raw texture=Tekstur mentah
|
|
||||||
Name=Nama
|
|
||||||
Author=Pencipta
|
|
||||||
Change=Ubah
|
|
||||||
Page=Halaman
|
|
||||||
License=Lesen
|
|
||||||
Description=Keterangan
|
|
||||||
Show, list or set player's skin=Tunjukkan, senaraikan atau tetapkan kulit pemain
|
Show, list or set player's skin=Tunjukkan, senaraikan atau tetapkan kulit pemain
|
||||||
Player not found=Pemain tidak dijumpai
|
Player not found=Pemain tidak dijumpai
|
||||||
unknown command=perintah tidak diketahui
|
unknown command=perintah tidak diketahui
|
||||||
see /help skinsdb for supported parameters=lihat /help skinsdb untuk parameter yang disokong
|
see /help skinsdb for supported parameters=lihat /help skinsdb untuk parameter yang disokong
|
||||||
skin set to=kulit ditetapkan kepada
|
skin set to=kulit ditetapkan kepada
|
||||||
invalid skin=kulit tidak sah
|
invalid skin=kulit tidak sah
|
||||||
|
Requires skin key=
|
||||||
unknown parameter=parameter tidak diketahui
|
unknown parameter=parameter tidak diketahui
|
||||||
unknown skin=kulit tidak diketahui
|
Raw texture=Tekstur mentah
|
||||||
|
Page=Halaman
|
||||||
|
Name=Nama
|
||||||
|
Author=Pencipta
|
||||||
|
License=Lesen
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=
|
||||||
|
Change=Ubah
|
||||||
|
Skins=
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
Raw texture=Textura crua
|
|
||||||
Name=Nome
|
|
||||||
Author=Autor
|
|
||||||
Change=Mudar
|
|
||||||
Page=Página
|
|
||||||
License=Licença
|
|
||||||
Description=Descrição
|
|
||||||
Show, list or set player's skin=Mostrar, listar ou definir a skin do jogador
|
Show, list or set player's skin=Mostrar, listar ou definir a skin do jogador
|
||||||
Player not found=Jogador não encontrado
|
Player not found=Jogador não encontrado
|
||||||
unknown command=Comando desconhecido
|
unknown command=Comando desconhecido
|
||||||
see /help skinsdb for supported parameters= consulte /help skinsdb para obter os parâmetros suportados
|
see /help skinsdb for supported parameters= consulte /help skinsdb para obter os parâmetros suportados
|
||||||
skin set to=Aparência definida para
|
skin set to=Aparência definida para
|
||||||
invalid skin=Aparência inválida
|
invalid skin=Aparência inválida
|
||||||
unknown parameter=parâmetro desconhecido
|
|
||||||
unknown skin=Aparência desconhecida
|
|
||||||
Downloads thespecified range of skins and shuts down the server= Baixa o intervalo especificado de capas e desliga o servidor
|
|
||||||
Skins=Aparência
|
|
||||||
Requires skin key=Requer chave de aparência
|
Requires skin key=Requer chave de aparência
|
||||||
|
unknown parameter=parâmetro desconhecido
|
||||||
|
Raw texture=Textura crua
|
||||||
|
Page=Página
|
||||||
|
Name=Nome
|
||||||
|
Author=Autor
|
||||||
|
License=Licença
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=Baixa o intervalo especificado de capas e desliga o servidor
|
||||||
|
Change=Mudar
|
||||||
|
Skins=Aparência
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
# Translation by Baytuch
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
|
|
||||||
Raw texture=Текстура
|
|
||||||
Name=Имя
|
|
||||||
Author=Автор
|
|
||||||
Change=Изменить
|
|
||||||
Page=Страница
|
|
||||||
License=Лицензия
|
|
||||||
Description=Описание
|
|
||||||
Show, list or set player's skin=Показать скин, список скинов, установить скин игрока
|
Show, list or set player's skin=Показать скин, список скинов, установить скин игрока
|
||||||
Player not found=Игрок не найден
|
Player not found=Игрок не найден
|
||||||
unknown command=неизвестная команда
|
unknown command=неизвестная команда
|
||||||
see /help skinsdb for supported parameters=смотрите /help skinsdb для просмотра параметров
|
see /help skinsdb for supported parameters=смотрите /help skinsdb для просмотра параметров
|
||||||
skin set to=установлено скин
|
skin set to=установлено скин
|
||||||
invalid skin=некорректный скин
|
invalid skin=некорректный скин
|
||||||
unknown parameter=неопределенный параметр
|
|
||||||
unknown skin=неопределенный скин
|
|
||||||
Downloads the specified range of skins and shuts down the server=Загрузить массив скинов и остановить сервер
|
|
||||||
Skins=Скины
|
|
||||||
Requires skin key=Зависимый идентификатор скина
|
Requires skin key=Зависимый идентификатор скина
|
||||||
|
unknown parameter=неопределенный параметр
|
||||||
|
Raw texture=Текстура
|
||||||
|
Page=Страница
|
||||||
|
Name=Имя
|
||||||
|
Author=Автор
|
||||||
|
License=Лицензия
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=Загрузить массив скинов и остановить сервер
|
||||||
|
Change=Изменить
|
||||||
|
Skins=Скины
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
# Translation by Baytuch
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
|
|
||||||
Raw texture=Текстура
|
|
||||||
Name=Ім'я
|
|
||||||
Author=Автор
|
|
||||||
Change=Змінити
|
|
||||||
Page=Сторінка
|
|
||||||
License=Ліцензія
|
|
||||||
Description=Опис
|
|
||||||
Show, list or set player's skin=Показати скін, список скінів, встановити скін гравця
|
Show, list or set player's skin=Показати скін, список скінів, встановити скін гравця
|
||||||
Player not found=Гравець не знайдений
|
Player not found=Гравець не знайдений
|
||||||
unknown command=невідома команда
|
unknown command=невідома команда
|
||||||
see /help skinsdb for supported parameters=дивіться /help skinsdb для перегляду параметрів
|
see /help skinsdb for supported parameters=дивіться /help skinsdb для перегляду параметрів
|
||||||
skin set to=встановлено скін
|
skin set to=встановлено скін
|
||||||
invalid skin=некоректний скін
|
invalid skin=некоректний скін
|
||||||
unknown parameter=невизначений параметр
|
|
||||||
unknown skin=невизначений скін
|
|
||||||
Downloads the specified range of skins and shuts down the server=Завантажити масив скінів та зупинити сервер
|
|
||||||
Skins=Скіни
|
|
||||||
Requires skin key=Залежний ідентифікатор скіна
|
Requires skin key=Залежний ідентифікатор скіна
|
||||||
|
unknown parameter=невизначений параметр
|
||||||
|
Raw texture=Текстура
|
||||||
|
Page=Сторінка
|
||||||
|
Name=Ім'я
|
||||||
|
Author=Автор
|
||||||
|
License=Ліцензія
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=Завантажити масив скінів та зупинити сервер
|
||||||
|
Change=Змінити
|
||||||
|
Skins=Скіни
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
#Translation by IFRFSX(BingFengFSX)
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
|
|
||||||
Raw texture=自然状态的纹理
|
|
||||||
Name=名称
|
|
||||||
Author=作者
|
|
||||||
Change=更换
|
|
||||||
Page=页面
|
|
||||||
License=许可证
|
|
||||||
Description=说明
|
|
||||||
Show, list or set player's skin=显示,列出或者设置玩家的皮肤
|
Show, list or set player's skin=显示,列出或者设置玩家的皮肤
|
||||||
Player not found=玩家未找到
|
Player not found=玩家未找到
|
||||||
unknown command=未知命令
|
unknown command=未知命令
|
||||||
see /help skinsdb for supported parameters=有关skinsdb支持的参数,参见 /help
|
see /help skinsdb for supported parameters=有关skinsdb支持的参数,参见 /help
|
||||||
skin set to=皮肤设置为
|
skin set to=皮肤设置为
|
||||||
invalid skin=无效皮肤
|
invalid skin=无效皮肤
|
||||||
|
Requires skin key=
|
||||||
unknown parameter=未知参数
|
unknown parameter=未知参数
|
||||||
unknown skin=未知皮肤
|
Raw texture=自然状态的纹理
|
||||||
|
Page=页面
|
||||||
|
Name=名称
|
||||||
|
Author=作者
|
||||||
|
License=许可证
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
Downloads the specified range of skins and shuts down the server=下载指定范围的皮肤并关闭服务器
|
Downloads the specified range of skins and shuts down the server=下载指定范围的皮肤并关闭服务器
|
||||||
|
Change=更换
|
||||||
Skins=皮肤
|
Skins=皮肤
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
#Translation by IFRFSX(BingFengFSX)
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
Raw texture=自然狀態的紋理
|
Show, list or set player's skin=顯示,列出或者設定玩家的皮膚
|
||||||
Name=名稱
|
|
||||||
Author=作者
|
|
||||||
Change=更換
|
|
||||||
Page=頁面
|
|
||||||
License=許可證
|
|
||||||
Description=說明
|
|
||||||
Show,list or set player's skin=顯示,列出或者設定玩家的皮膚
|
|
||||||
Player not found=玩家未找到
|
Player not found=玩家未找到
|
||||||
unknown command=未知命令
|
unknown command=未知命令
|
||||||
see /help skinsdb for supported parameters=有關skinsdb支持的參數,參見/help
|
see /help skinsdb for supported parameters=有關skinsdb支持的參數,參見/help
|
||||||
skin set to=皮膚設定為
|
skin set to=皮膚設定為
|
||||||
invalid skin=無效皮膚
|
invalid skin=無效皮膚
|
||||||
|
Requires skin key=
|
||||||
unknown parameter=未知參數
|
unknown parameter=未知參數
|
||||||
unknown skin=未知皮膚
|
Raw texture=自然狀態的紋理
|
||||||
|
Page=頁面
|
||||||
|
Name=名稱
|
||||||
|
Author=作者
|
||||||
|
License=許可證
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
Downloads the specified range of skins and shuts down the server=下載指定範圍的皮膚並關閉服務器
|
Downloads the specified range of skins and shuts down the server=下載指定範圍的皮膚並關閉服務器
|
||||||
|
Change=更換
|
||||||
Skins=皮膚
|
Skins=皮膚
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
# textdomain: skinsdb
|
# textdomain: skinsdb
|
||||||
|
[set] <skin key> | show [<skin key>] | list | list private | list public | [ui]=
|
||||||
Raw texture=
|
|
||||||
Name=
|
|
||||||
Author=
|
|
||||||
Change=
|
|
||||||
Page=
|
|
||||||
License=
|
|
||||||
Description=
|
|
||||||
Show, list or set player's skin=
|
Show, list or set player's skin=
|
||||||
Player not found=
|
Player not found=
|
||||||
unknown command=
|
unknown command=
|
||||||
see /help skinsdb for supported parameters=
|
see /help skinsdb for supported parameters=
|
||||||
skin set to=
|
skin set to=
|
||||||
invalid skin=
|
invalid skin=
|
||||||
unknown parameter=
|
|
||||||
unknown skin=
|
|
||||||
Downloads the specified range of skins and shuts down the server=
|
|
||||||
Skins=
|
|
||||||
Requires skin key=
|
Requires skin key=
|
||||||
|
unknown parameter=
|
||||||
|
Raw texture=
|
||||||
|
Page=
|
||||||
|
Name=
|
||||||
|
Author=
|
||||||
|
License=
|
||||||
|
<skindb start page> <amount of pages>=
|
||||||
|
Downloads the specified range of skins and shuts down the server=
|
||||||
|
Change=
|
||||||
|
Skins=
|
||||||
|
3
settingtypes.txt
Normal file
3
settingtypes.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# texture filename seperator, default "_"
|
||||||
|
# see skindsdb/textures/readme.txt to avoid playername with underscore problem
|
||||||
|
skinsdb_fsep (texture filename seperator) enum _ _,.
|
@ -2,7 +2,7 @@ local skins_dir_list = minetest.get_dir_list(skins.modpath.."/textures")
|
|||||||
|
|
||||||
for _, fn in pairs(skins_dir_list) do
|
for _, fn in pairs(skins_dir_list) do
|
||||||
local name, sort_id, is_preview, playername
|
local name, sort_id, is_preview, playername
|
||||||
local nameparts = string.gsub(fn, "[.]", "_"):split("_")
|
local nameparts = string.gsub(fn, "[.]", skins.fsep):split(skins.fsep)
|
||||||
|
|
||||||
-- check allowed prefix and file extension
|
-- check allowed prefix and file extension
|
||||||
if (nameparts[1] == 'player' or nameparts[1] == 'character') and
|
if (nameparts[1] == 'player' or nameparts[1] == 'character') and
|
||||||
|
@ -20,7 +20,7 @@ if not ie or not http then
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_chatcommand("skinsdb_download_skins", {
|
minetest.register_chatcommand("skinsdb_download_skins", {
|
||||||
params = "<skindb start page> <amount of pages>",
|
params = S("<skindb start page> <amount of pages>"),
|
||||||
description = S("Downloads the specified range of skins and shuts down the server"),
|
description = S("Downloads the specified range of skins and shuts down the server"),
|
||||||
privs = {server=true},
|
privs = {server=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
@ -47,9 +47,8 @@ if #internal.errors > 0 then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- http://minetest.fensta.bplaced.net/api/apidoku.md
|
-- http://minetest.fensta.bplaced.net/api/apidoku.md
|
||||||
local root_url = "http://minetest.fensta.bplaced.net"
|
local root_url = "http://skinsdb.terraqueststudios.net"
|
||||||
local page_url = root_url .. "/api/v2/get.json.php?getlist&page=%i&outformat=base64" -- [1] = Page#
|
local page_url = root_url .. "/api/v1/content?client=mod&page=%i" -- [1] = Page#
|
||||||
local preview_url = root_url .. "/skins/1/%i.png" -- [1] = ID
|
|
||||||
|
|
||||||
local mod_path = skins.modpath
|
local mod_path = skins.modpath
|
||||||
local meta_path = mod_path .. "/meta/"
|
local meta_path = mod_path .. "/meta/"
|
||||||
@ -88,7 +87,7 @@ local function safe_single_skin(skin)
|
|||||||
skin.license
|
skin.license
|
||||||
}
|
}
|
||||||
|
|
||||||
local name = "character_" .. skin.id
|
local name = "character" .. skins.fsep .. skin.id
|
||||||
|
|
||||||
-- core.safe_file_write does not work here
|
-- core.safe_file_write does not work here
|
||||||
unsafe_file_write(
|
unsafe_file_write(
|
||||||
@ -100,9 +99,6 @@ local function safe_single_skin(skin)
|
|||||||
skins_path .. name .. ".png",
|
skins_path .. name .. ".png",
|
||||||
core.decode_base64(skin.img)
|
core.decode_base64(skin.img)
|
||||||
)
|
)
|
||||||
fetch_url(preview_url:format(skin.id), function(preview)
|
|
||||||
unsafe_file_write(skins_path .. name .. "_preview.png", preview)
|
|
||||||
end)
|
|
||||||
core.log("action", ("%s: Completed skin %s"):format(_ID_, name))
|
core.log("action", ("%s: Completed skin %s"):format(_ID_, name))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
In this folder the skin files could be placed according the following file naming convention.
|
In this folder the skin files could be placed according the following file naming convention.
|
||||||
|
|
||||||
|
skinsdb uses an underscore as default seperator for filename splitting which can cause problems with playernames containing "_",
|
||||||
|
see https://github.com/minetest-mods/skinsdb/issues/54.
|
||||||
|
The config setting skinsdb_fsep (texture filename seperator) was added as a workaround which also offers "."(dot) as seperator,
|
||||||
|
dot is the only character which is allowed in textures but not in playernames.
|
||||||
|
To keep compatibility with older versions underscore is the default value.
|
||||||
|
|
||||||
|
fresh install:
|
||||||
|
you should change the seperator to "." to avoid that problem.
|
||||||
|
existing install:
|
||||||
|
- change the filenames according to the naming convention with dot as seperator instead of underscore
|
||||||
|
- change the texture filename seperator in settings or add "skinsdb_fsep = ." to your minetest.conf before starting your server
|
||||||
|
|
||||||
Public skin available for all users:
|
Public skin available for all users:
|
||||||
character_[number-or-name].png
|
character_[number-or-name].png
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import sys, requests, base64
|
import sys, requests, base64
|
||||||
|
|
||||||
download_preview = ( len (sys.argv) > 1 and sys.argv[1] == "with_preview" )
|
# filename seperator to use, either default "-" or ".". see skinsdb/textures/readme.txt
|
||||||
|
#fsep = "_"
|
||||||
|
fsep = "."
|
||||||
|
|
||||||
|
|
||||||
print("Downloading skins from minetest.fensta.bplaced.net ...")
|
|
||||||
|
print("Downloading skins from skinsdb.terraqueststudio.net ...")
|
||||||
# Requesting all skins and their raw texture using the API
|
# Requesting all skins and their raw texture using the API
|
||||||
r = requests.get('http://minetest.fensta.bplaced.net/api/v2/get.json.php?getlist&page=1&per_page=999999999')
|
r = requests.get('http://skinsdb.terraqueststudios.net/api/v1/content?client=script&page=1&per_page=10000')
|
||||||
|
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
sys.exit("Request failed!")
|
sys.exit("Request failed!")
|
||||||
@ -13,10 +16,7 @@ if r.status_code != 200:
|
|||||||
data = r.json()
|
data = r.json()
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
if download_preview:
|
print("Writing skins")
|
||||||
print("Writing to file and downloading previews ...")
|
|
||||||
else:
|
|
||||||
print("Writing skins")
|
|
||||||
|
|
||||||
|
|
||||||
for json in data["skins"]:
|
for json in data["skins"]:
|
||||||
@ -24,7 +24,7 @@ for json in data["skins"]:
|
|||||||
|
|
||||||
# Texture file
|
# Texture file
|
||||||
raw_data = base64.b64decode(json["img"])
|
raw_data = base64.b64decode(json["img"])
|
||||||
file = open("../textures/character_" + id + ".png", "wb")
|
file = open("../textures/character" + fsep + id + ".png", "wb")
|
||||||
file.write(bytearray(raw_data))
|
file.write(bytearray(raw_data))
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
@ -38,17 +38,5 @@ for json in data["skins"]:
|
|||||||
print("Added #%s Name: %s Author: %s License: %s" % (id, name, author, license))
|
print("Added #%s Name: %s Author: %s License: %s" % (id, name, author, license))
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
if download_preview:
|
|
||||||
# Downloading the preview of the skin
|
|
||||||
r2 = requests.get('http://minetest.fensta.bplaced.net/skins/1/' + id + ".png")
|
|
||||||
if r2.status_code == 200:
|
|
||||||
# Preview file
|
|
||||||
preview = r2.content
|
|
||||||
file = open("../textures/character_" + id + "_preview.png", "wb")
|
|
||||||
file.write(bytearray(preview))
|
|
||||||
file.close()
|
|
||||||
else:
|
|
||||||
print("Failed to download skin preview #" + id)
|
|
||||||
|
|
||||||
|
|
||||||
print("Fetched " + str(count) + " skins!")
|
print("Fetched " + str(count) + " skins!")
|
||||||
|
Loading…
Reference in New Issue
Block a user