From 9e6bdc377fcbc8e4c795bd76d582197e8afb3530 Mon Sep 17 00:00:00 2001 From: BlockMen Date: Tue, 17 Sep 2013 13:13:29 +0200 Subject: [PATCH 001/198] Fix compiling issue of MSVC --- src/biome.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biome.cpp b/src/biome.cpp index 83d4e7a4c..7e3dcac77 100644 --- a/src/biome.cpp +++ b/src/biome.cpp @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "util/numeric.h" #include "main.h" - +#include "util/mathconstants.h" NoiseParams nparams_biome_def_heat = {50, 50, v3f(500.0, 500.0, 500.0), 5349, 3, 0.70}; From fb6a789991ba633a330bacaf0e915019a01b602f Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 21 Apr 2013 12:55:46 -0400 Subject: [PATCH 002/198] Re-fix hud_change stat argument retrieval Conflicts: src/script/lua_api/l_object.cpp --- src/script/lua_api/l_object.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 6a800f15d..c324ced1a 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -877,16 +877,18 @@ int ObjectRef::l_hud_change(lua_State *L) if (player == NULL) return 0; - u32 id = -1; - if (!lua_isnil(L, 2)) - id = lua_tonumber(L, 2); - - HudElementStat stat = (HudElementStat)getenumfield(L, 3, "stat", - es_HudElementStat, HUD_STAT_NUMBER); - + u32 id = !lua_isnil(L, 2) ? lua_tonumber(L, 2) : -1; if (id >= player->hud.size()) return 0; + HudElementStat stat = HUD_STAT_NUMBER; + if (!lua_isnil(L, 3)) { + int statint; + std::string statstr = lua_tostring(L, 3); + stat = string_to_enum(es_HudElementStat, statint, statstr) ? + (HudElementStat)statint : HUD_STAT_NUMBER; + } + void *value = NULL; HudElement *e = player->hud[id]; if (!e) From 4ea0e4f606aa4173cc0fffd00e95a30ca3c219c8 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 28 Sep 2013 15:05:55 +0200 Subject: [PATCH 003/198] Add curl, freetype and luaJIT to CMAKE_BUILD_INFO --- src/CMakeLists.txt | 2 ++ src/cmake_config.h.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 937dfab8f..8a5212dca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -187,8 +187,10 @@ find_path(LUA_INCLUDE_DIR luajit.h message (STATUS "LuaJIT library: ${LUA_LIBRARY}") message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}") +set(USE_LUAJIT 0) if(LUA_LIBRARY AND LUA_INCLUDE_DIR) message (STATUS "LuaJIT found.") + set(USE_LUAJIT 1) else(LUA_LIBRARY AND LUA_INCLUDE_DIR) message (STATUS "LuaJIT not found, using bundled Lua.") set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src") diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index 7aea27ccb..c83df8e47 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -18,7 +18,7 @@ #else #define CMAKE_BUILD_TYPE "Debug" #endif -#define CMAKE_BUILD_INFO "VER=@VERSION_STRING@ BUILD_TYPE="CMAKE_BUILD_TYPE" RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ USE_SOUND=@USE_SOUND@ STATIC_SHAREDIR=@SHAREDIR@" +#define CMAKE_BUILD_INFO "VER=@VERSION_STRING@ BUILD_TYPE="CMAKE_BUILD_TYPE" RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ USE_SOUND=@USE_SOUND@ USE_CURL=@USE_CURL@ USE_FREETYPE=@USE_FREETYPE@ USE_LUAJIT=@USE_LUAJIT@ STATIC_SHAREDIR=@SHAREDIR@" #endif From 372d638ec1ea97bf88e9d62ffeb03e73bc94ee1e Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Tue, 17 Sep 2013 15:28:21 -0400 Subject: [PATCH 004/198] Lower the default max_users from 100 to 15 --- minetest.conf.example | 2 +- src/defaultsettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index 8094100e5..e90d18b06 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -218,7 +218,7 @@ # Message of the Day #motd = Welcome to this awesome Minetest server! # Maximum number of players connected simultaneously -#max_users = 100 +#max_users = 15 # Set to true to disallow old clients from connecting #strict_protocol_version_checking = false # Set to true to enable creative mode (unlimited inventory) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 3fbdad4f2..c0d3df291 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -159,7 +159,7 @@ void set_default_settings(Settings *settings) // "map-dir" doesn't exist by default. settings->setDefault("default_game", "minetest"); settings->setDefault("motd", ""); - settings->setDefault("max_users", "100"); + settings->setDefault("max_users", "15"); settings->setDefault("strict_protocol_version_checking", "false"); settings->setDefault("creative_mode", "false"); settings->setDefault("enable_damage", "true"); From 8bc7ea61b901516d3e1cbde77df1830d14129259 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Wed, 25 Sep 2013 04:29:07 +0200 Subject: [PATCH 005/198] Show git hash in version string at top left corner of window --- .gitignore | 1 + CMakeLists.txt | 3 +++ cmake/Modules/GenerateVersion.cmake | 20 +++++++++++++++ src/CMakeLists.txt | 12 +++++++++ src/cmake_config.h.in | 2 +- src/cmake_config_githash.h.in | 10 ++++++++ src/config.h | 6 ----- src/game.cpp | 10 ++++---- src/guiEngine.cpp | 5 ++-- src/guiPauseMenu.cpp | 3 ++- src/main.cpp | 3 ++- src/script/lua_api/l_mainmenu.cpp | 3 ++- src/server.cpp | 9 ++++--- src/serverlist.cpp | 3 ++- src/version.cpp | 39 +++++++++++++++++++++++++++++ src/version.h | 30 ++++++++++++++++++++++ 16 files changed, 137 insertions(+), 22 deletions(-) create mode 100644 cmake/Modules/GenerateVersion.cmake create mode 100644 src/cmake_config_githash.h.in create mode 100644 src/version.cpp create mode 100644 src/version.h diff --git a/.gitignore b/.gitignore index db131c29f..2e1584b1d 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ CMakeFiles/* src/CMakeFiles/* src/Makefile src/cmake_config.h +src/cmake_config_githash.h src/cmake_install.cmake src/script/CMakeFiles/* src/script/common/CMakeFiles/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 2db4e4a76..f9fff75db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ set(VERSION_MINOR 4) set(VERSION_PATCH 7) if(VERSION_EXTRA) set(VERSION_PATCH ${VERSION_PATCH}-${VERSION_EXTRA}) +else() + # Comment the following line during release + set(VERSION_PATCH ${VERSION_PATCH}-dev) endif() set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") diff --git a/cmake/Modules/GenerateVersion.cmake b/cmake/Modules/GenerateVersion.cmake new file mode 100644 index 000000000..4a7f183da --- /dev/null +++ b/cmake/Modules/GenerateVersion.cmake @@ -0,0 +1,20 @@ +# Always run during 'make' + +if(VERSION_EXTRA) + set(VERSION_GITHASH "${VERSION_STRING}") +else(VERSION_EXTRA) + execute_process(COMMAND git describe --always --tag --dirty + WORKING_DIRECTORY "${GENERATE_VERSION_SOURCE_DIR}" + OUTPUT_VARIABLE VERSION_GITHASH OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + + if(VERSION_GITHASH) + message(STATUS "*** Detected git version ${VERSION_GITHASH} ***") + else() + set(VERSION_GITHASH "${VERSION_STRING}") + endif() +endif() + +configure_file( + ${GENERATE_VERSION_SOURCE_DIR}/cmake_config_githash.h.in + ${GENERATE_VERSION_BINARY_DIR}/cmake_config_githash.h) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8a5212dca..4d99f5acd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -225,11 +225,21 @@ configure_file( "${PROJECT_BINARY_DIR}/cmake_config.h" ) +# Add a target that always rebuilds cmake_config_githash.h +add_custom_target(GenerateVersion + COMMAND ${CMAKE_COMMAND} + -D "GENERATE_VERSION_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" + -D "GENERATE_VERSION_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}" + -D "VERSION_STRING=${VERSION_STRING}" + -P "${CMAKE_SOURCE_DIR}/cmake/Modules/GenerateVersion.cmake" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + add_subdirectory(jthread) add_subdirectory(script) add_subdirectory(util) set(common_SRCS + version.cpp rollback_interface.cpp rollback.cpp genericobject.cpp @@ -406,6 +416,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") if(BUILD_CLIENT) add_executable(${PROJECT_NAME} ${minetest_SRCS}) + add_dependencies(${PROJECT_NAME} GenerateVersion) target_link_libraries( ${PROJECT_NAME} ${ZLIB_LIBRARIES} @@ -444,6 +455,7 @@ endif(BUILD_CLIENT) if(BUILD_SERVER) add_executable(${PROJECT_NAME}server ${minetestserver_SRCS}) + add_dependencies(${PROJECT_NAME}server GenerateVersion) target_link_libraries( ${PROJECT_NAME}server ${ZLIB_LIBRARIES} diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index c83df8e47..7cc2fb99e 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -18,7 +18,7 @@ #else #define CMAKE_BUILD_TYPE "Debug" #endif -#define CMAKE_BUILD_INFO "VER=@VERSION_STRING@ BUILD_TYPE="CMAKE_BUILD_TYPE" RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ USE_SOUND=@USE_SOUND@ USE_CURL=@USE_CURL@ USE_FREETYPE=@USE_FREETYPE@ USE_LUAJIT=@USE_LUAJIT@ STATIC_SHAREDIR=@SHAREDIR@" +#define CMAKE_BUILD_INFO "BUILD_TYPE="CMAKE_BUILD_TYPE" RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ USE_SOUND=@USE_SOUND@ USE_CURL=@USE_CURL@ USE_FREETYPE=@USE_FREETYPE@ USE_LUAJIT=@USE_LUAJIT@ STATIC_SHAREDIR=@SHAREDIR@" #endif diff --git a/src/cmake_config_githash.h.in b/src/cmake_config_githash.h.in new file mode 100644 index 000000000..4d5fcd60f --- /dev/null +++ b/src/cmake_config_githash.h.in @@ -0,0 +1,10 @@ +// Filled in by the build system +// Separated from cmake_config.h to avoid excessive rebuilds on every commit + +#ifndef CMAKE_CONFIG_GITHASH_H +#define CMAKE_CONFIG_GITHASH_H + +#define CMAKE_VERSION_GITHASH "@VERSION_GITHASH@" + +#endif + diff --git a/src/config.h b/src/config.h index 3cb59e619..652c9008a 100644 --- a/src/config.h +++ b/src/config.h @@ -7,22 +7,18 @@ #define CONFIG_H #define PROJECT_NAME "Minetest" -#define VERSION_STRING "unknown" #define RUN_IN_PLACE 0 #define USE_GETTEXT 0 #define USE_SOUND 0 #define USE_CURL 0 #define USE_FREETYPE 0 #define STATIC_SHAREDIR "" -#define BUILD_INFO "non-cmake" #define USE_LEVELDB 0 #ifdef USE_CMAKE_CONFIG_H #include "cmake_config.h" #undef PROJECT_NAME #define PROJECT_NAME CMAKE_PROJECT_NAME - #undef VERSION_STRING - #define VERSION_STRING CMAKE_VERSION_STRING #undef RUN_IN_PLACE #define RUN_IN_PLACE CMAKE_RUN_IN_PLACE #undef USE_GETTEXT @@ -35,8 +31,6 @@ #define USE_FREETYPE CMAKE_USE_FREETYPE #undef STATIC_SHAREDIR #define STATIC_SHAREDIR CMAKE_STATIC_SHAREDIR - #undef BUILD_INFO - #define BUILD_INFO CMAKE_BUILD_INFO #undef USE_LEVELDB #define USE_LEVELDB CMAKE_USE_LEVELDB #endif diff --git a/src/game.cpp b/src/game.cpp index 851f5dd9d..71a578a65 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "tool.h" #include "guiChatConsole.h" #include "config.h" +#include "version.h" #include "clouds.h" #include "particles.h" #include "camera.h" @@ -2963,9 +2964,6 @@ void the_game( //TimeTaker guiupdatetimer("Gui updating"); - const char program_name_and_version[] = - "Minetest " VERSION_STRING; - if(show_debug) { static float drawtime_avg = 0; @@ -2979,7 +2977,7 @@ void the_game( std::ostringstream os(std::ios_base::binary); os<setText(narrow_to_wide(os.str()).c_str()); guitext->setVisible(true); } else diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index 547f393a4..ac19274c3 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "scripting_mainmenu.h" #include "config.h" +#include "version.h" #include "porting.h" #include "filesys.h" #include "main.h" @@ -157,7 +158,7 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev, //create topleft header core::rect rect(0, 0, 500, 40); rect += v2s32(4, 0); - std::string t = "Minetest " VERSION_STRING; + std::string t = std::string("Minetest ") + minetest_version_hash; m_irr_toplefttext = m_device->getGUIEnvironment()->addStaticText(narrow_to_wide(t).c_str(), @@ -553,7 +554,7 @@ bool GUIEngine::downloadFile(std::string url,std::string target) { /******************************************************************************/ void GUIEngine::setTopleftText(std::string append) { - std::string toset = "Minetest " VERSION_STRING; + std::string toset = std::string("Minetest ") + minetest_version_hash; if (append != "") { toset += " / "; diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index f5d323a9b..ba103b740 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include "porting.h" #include "config.h" +#include "version.h" #include "main.h" #include #include @@ -195,7 +196,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) std::ostringstream os; os<<"Minetest\n"; - os<addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259); diff --git a/src/main.cpp b/src/main.cpp index f34e24abc..10547b711 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,6 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "guiMessageMenu.h" #include "filesys.h" #include "config.h" +#include "version.h" #include "guiMainMenu.h" #include "game.h" #include "keycode.h" @@ -903,7 +904,7 @@ int main(int argc, char *argv[]) // Print startup message infostream<get("server_name"); server["description"] = g_settings->get("server_description"); - server["version"] = VERSION_STRING; + server["version"] = minetest_version_simple; server["url"] = g_settings->get("server_url"); server["creative"] = g_settings->get("creative_mode"); server["damage"] = g_settings->get("enable_damage"); diff --git a/src/version.cpp b/src/version.cpp new file mode 100644 index 000000000..e5de8a61e --- /dev/null +++ b/src/version.cpp @@ -0,0 +1,39 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "version.h" +#include "config.h" + +#ifdef USE_CMAKE_CONFIG_H + +#include "cmake_config_githash.h" + +const char *minetest_version_simple = CMAKE_VERSION_STRING; +const char *minetest_version_hash = CMAKE_VERSION_GITHASH; +const char *minetest_build_info = + "VER=" CMAKE_VERSION_GITHASH " " CMAKE_BUILD_INFO; + +#else + +const char *minetest_version_simple = "unknown"; +const char *minetest_version_hash = "unknown"; +const char *minetest_build_info = "non-cmake"; + +#endif + diff --git a/src/version.h b/src/version.h new file mode 100644 index 000000000..0143d91a4 --- /dev/null +++ b/src/version.h @@ -0,0 +1,30 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef VERSION_HEADER +#define VERSION_HEADER + +#include "config.h" + +extern const char *minetest_version_simple; +extern const char *minetest_version_hash; +extern const char *minetest_build_info; + +#endif + From f0edd88dff26f408db895046b9411248ff3d51dd Mon Sep 17 00:00:00 2001 From: Kahrl Date: Wed, 25 Sep 2013 04:38:46 +0200 Subject: [PATCH 006/198] Remove doc/gpl-2.0.txt, add doc/lgpl-2.1.txt --- doc/gpl-2.0.txt | 339 -------------------------------- doc/lgpl-2.1.txt | 502 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 502 insertions(+), 339 deletions(-) delete mode 100644 doc/gpl-2.0.txt create mode 100644 doc/lgpl-2.1.txt diff --git a/doc/gpl-2.0.txt b/doc/gpl-2.0.txt deleted file mode 100644 index d159169d1..000000000 --- a/doc/gpl-2.0.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/doc/lgpl-2.1.txt b/doc/lgpl-2.1.txt new file mode 100644 index 000000000..4362b4915 --- /dev/null +++ b/doc/lgpl-2.1.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! From 5dce44ec5e5f7231dba3cdbec3f1fdc683ce5a34 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Wed, 25 Sep 2013 04:47:44 +0200 Subject: [PATCH 007/198] Add --version option --- doc/minetest.6 | 3 +++ doc/minetestserver.6 | 3 +++ src/main.cpp | 14 ++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/doc/minetest.6 b/doc/minetest.6 index 80991289e..d94c12cb6 100644 --- a/doc/minetest.6 +++ b/doc/minetest.6 @@ -37,6 +37,9 @@ Disable main menu \-\-help Show allowed options .TP +\-\-version +Show version information +.TP \-\-logfile Set logfile path (debug.txt) .TP diff --git a/doc/minetestserver.6 b/doc/minetestserver.6 index 35c4a1fe6..1d4a5f838 100644 --- a/doc/minetestserver.6 +++ b/doc/minetestserver.6 @@ -31,6 +31,9 @@ Set gameid \-\-help Show allowed options .TP +\-\-version +Show version information +.TP \-\-logfile Set logfile path (debug.txt) .TP diff --git a/src/main.cpp b/src/main.cpp index 10547b711..455138d5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -772,6 +772,8 @@ int main(int argc, char *argv[]) std::map allowed_options; allowed_options.insert(std::make_pair("help", ValueSpec(VALUETYPE_FLAG, _("Show allowed options")))); + allowed_options.insert(std::make_pair("version", ValueSpec(VALUETYPE_FLAG, + _("Show version information")))); allowed_options.insert(std::make_pair("config", ValueSpec(VALUETYPE_STRING, _("Load configuration from specified file")))); allowed_options.insert(std::make_pair("port", ValueSpec(VALUETYPE_STRING, @@ -843,6 +845,18 @@ int main(int argc, char *argv[]) return cmd_args.getFlag("help") ? 0 : 1; } + + if(cmd_args.getFlag("version")) + { +#ifdef SERVER + dstream<<"minetestserver "< Date: Wed, 11 Sep 2013 16:32:05 +0200 Subject: [PATCH 008/198] Allow to manually specify param2 in minetest.item_place() and return success --- builtin/item.lua | 24 ++++++++++++------------ doc/lua_api.txt | 8 ++++++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/builtin/item.lua b/builtin/item.lua index 6a01f37f6..5f3c71770 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -179,11 +179,11 @@ function minetest.get_node_drops(nodename, toolname) return got_items end -function minetest.item_place_node(itemstack, placer, pointed_thing) +function minetest.item_place_node(itemstack, placer, pointed_thing, param2) local item = itemstack:peek_item() local def = itemstack:get_definition() if def.type ~= "node" or pointed_thing.type ~= "node" then - return itemstack + return itemstack, false end local under = pointed_thing.under @@ -194,7 +194,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) if not oldnode_under or not oldnode_above then minetest.log("info", placer:get_player_name() .. " tried to place" .. " node in unloaded position " .. minetest.pos_to_string(above)) - return itemstack + return itemstack, false end local olddef_under = ItemStack({name=oldnode_under.name}):get_definition() @@ -206,7 +206,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) minetest.log("info", placer:get_player_name() .. " tried to place" .. " node in invalid position " .. minetest.pos_to_string(above) .. ", replacing " .. oldnode_above.name) - return itemstack + return itemstack, false end -- Place above pointed node @@ -222,10 +222,10 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) .. def.name .. " at " .. minetest.pos_to_string(place_to)) local oldnode = minetest.get_node(place_to) - local newnode = {name = def.name, param1 = 0, param2 = 0} + local newnode = {name = def.name, param1 = 0, param2 = param2} -- Calculate direction for wall mounted stuff like torches and signs - if def.paramtype2 == 'wallmounted' then + if def.paramtype2 == 'wallmounted' and not param2 then local dir = { x = under.x - above.x, y = under.y - above.y, @@ -233,7 +233,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) } newnode.param2 = minetest.dir_to_wallmounted(dir) -- Calculate the direction for furnaces and chests and stuff - elseif def.paramtype2 == 'facedir' then + elseif def.paramtype2 == 'facedir' and not param2 then local placer_pos = placer:getpos() if placer_pos then local dir = { @@ -251,7 +251,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) not check_attached_node(place_to, newnode) then minetest.log("action", "attached node " .. def.name .. " can not be placed at " .. minetest.pos_to_string(place_to)) - return itemstack + return itemstack, false end -- Add node and update @@ -283,7 +283,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) if take_item then itemstack:take_item() end - return itemstack + return itemstack, true end function minetest.item_place_object(itemstack, placer, pointed_thing) @@ -295,19 +295,19 @@ function minetest.item_place_object(itemstack, placer, pointed_thing) return itemstack end -function minetest.item_place(itemstack, placer, pointed_thing) +function minetest.item_place(itemstack, placer, pointed_thing, param2) -- Call on_rightclick if the pointed node defines it if pointed_thing.type == "node" and placer and not placer:get_player_control().sneak then local n = minetest.get_node(pointed_thing.under) local nn = n.name if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then - return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer, itemstack) or itemstack + return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer, itemstack) or itemstack, false end end if itemstack:get_definition().type == "node" then - return minetest.item_place_node(itemstack, placer, pointed_thing) + return minetest.item_place_node(itemstack, placer, pointed_thing, param2) end return itemstack end diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 43c719a43..06230eaa7 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1361,14 +1361,18 @@ minetest.rollback_revert_actions_by(actor, seconds) -> bool, log messages Defaults for the on_* item definition functions: (These return the leftover itemstack) -minetest.item_place_node(itemstack, placer, pointed_thing) +minetest.item_place_node(itemstack, placer, pointed_thing, param2) ^ Place item as a node +^ param2 overrides facedir and wallmounted param2 +^ returns itemstack, success minetest.item_place_object(itemstack, placer, pointed_thing) ^ Place item as-is -minetest.item_place(itemstack, placer, pointed_thing) +minetest.item_place(itemstack, placer, pointed_thing, param2) ^ Use one of the above based on what the item is. ^ Calls on_rightclick of pointed_thing.under if defined instead ^ Note: is not called when wielded item overrides on_place +^ param2 overrides facedir and wallmounted param2 +^ returns itemstack, success minetest.item_drop(itemstack, dropper, pos) ^ Drop the item minetest.item_eat(hp_change, replace_with_item) From a9c0961e0c9c3b854aca34b6d582198be1cd2277 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 28 Sep 2013 22:47:09 +0200 Subject: [PATCH 009/198] Add set_name(), set_count(), set_wear() and set_metadata() to Lua ItemStack --- doc/lua_api.txt | 4 +++ src/script/lua_api/l_item.cpp | 63 +++++++++++++++++++++++++++++++++++ src/script/lua_api/l_item.h | 12 +++++++ 3 files changed, 79 insertions(+) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 06230eaa7..335f8af65 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1658,9 +1658,13 @@ ItemStack: A stack of items. methods: - is_empty(): return true if stack is empty - get_name(): returns item name (e.g. "default:stone") +- set_name(itemname) - get_count(): returns number of items on the stack +- set_count(count) - get_wear(): returns tool wear (0-65535), 0 for non-tools +- set_wear(wear) - get_metadata(): returns metadata (a string attached to an item stack) +- set_metadata(metadata) - clear(): removes all items from the stack, making it empty - replace(item): replace the contents of this stack (item can also be an itemstring or table) diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp index a43b2858f..512cd7398 100644 --- a/src/script/lua_api/l_item.cpp +++ b/src/script/lua_api/l_item.cpp @@ -57,6 +57,20 @@ int LuaItemStack::l_get_name(lua_State *L) return 1; } +// set_name(self, name) +int LuaItemStack::l_set_name(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + LuaItemStack *o = checkobject(L, 1); + ItemStack &item = o->m_stack; + item.name = luaL_checkstring(L, 2); + + if (item.name == "" || item.empty()) + item.clear(); + + return 1; +} + // get_count(self) -> number int LuaItemStack::l_get_count(lua_State *L) { @@ -67,6 +81,20 @@ int LuaItemStack::l_get_count(lua_State *L) return 1; } +// set_count(self, number) +int LuaItemStack::l_set_count(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + LuaItemStack *o = checkobject(L, 1); + ItemStack &item = o->m_stack; + item.count = luaL_checkinteger(L, 2); + + if (item.name == "" || item.empty()) + item.clear(); + + return 1; +} + // get_wear(self) -> number int LuaItemStack::l_get_wear(lua_State *L) { @@ -77,6 +105,20 @@ int LuaItemStack::l_get_wear(lua_State *L) return 1; } +// set_wear(self, number) +int LuaItemStack::l_set_wear(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + LuaItemStack *o = checkobject(L, 1); + ItemStack &item = o->m_stack; + item.wear = luaL_checkinteger(L, 2); + + if (item.wear > 65535) + item.clear(); + + return 1; +} + // get_metadata(self) -> string int LuaItemStack::l_get_metadata(lua_State *L) { @@ -87,6 +129,23 @@ int LuaItemStack::l_get_metadata(lua_State *L) return 1; } +// set_metadata(self, string) +int LuaItemStack::l_set_metadata(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + LuaItemStack *o = checkobject(L, 1); + ItemStack &item = o->m_stack; + + size_t len = 0; + const char *ptr = luaL_checklstring(L, 2, &len); + if (ptr) + item.metadata.assign(ptr, len); + else + item.metadata = ""; + + return 1; +} + // clear(self) -> true int LuaItemStack::l_clear(lua_State *L) { @@ -363,9 +422,13 @@ const char LuaItemStack::className[] = "ItemStack"; const luaL_reg LuaItemStack::methods[] = { luamethod(LuaItemStack, is_empty), luamethod(LuaItemStack, get_name), + luamethod(LuaItemStack, set_name), luamethod(LuaItemStack, get_count), + luamethod(LuaItemStack, set_count), luamethod(LuaItemStack, get_wear), + luamethod(LuaItemStack, set_wear), luamethod(LuaItemStack, get_metadata), + luamethod(LuaItemStack, set_metadata), luamethod(LuaItemStack, clear), luamethod(LuaItemStack, replace), luamethod(LuaItemStack, to_string), diff --git a/src/script/lua_api/l_item.h b/src/script/lua_api/l_item.h index 7c2e1b098..7f5a1130d 100644 --- a/src/script/lua_api/l_item.h +++ b/src/script/lua_api/l_item.h @@ -41,15 +41,27 @@ private: // get_name(self) -> string static int l_get_name(lua_State *L); + // set_name(self, name) + static int l_set_name(lua_State *L); + // get_count(self) -> number static int l_get_count(lua_State *L); + // set_count(self, number) + static int l_set_count(lua_State *L); + // get_wear(self) -> number static int l_get_wear(lua_State *L); + // set_wear(self, number) + static int l_set_wear(lua_State *L); + // get_metadata(self) -> string static int l_get_metadata(lua_State *L); + // set_metadata(self, string) + static int l_set_metadata(lua_State *L); + // clear(self) -> true static int l_clear(lua_State *L); From 2134316c8083274fb1c7645cbb1ceab745073e84 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 29 Sep 2013 16:05:09 +0200 Subject: [PATCH 010/198] Pass VERSION_EXTRA to GenerateVersion.cmake --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d99f5acd..7b9ca0eae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -231,6 +231,7 @@ add_custom_target(GenerateVersion -D "GENERATE_VERSION_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" -D "GENERATE_VERSION_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}" -D "VERSION_STRING=${VERSION_STRING}" + -D "VERSION_EXTRA=${VERSION_EXTRA}" -P "${CMAKE_SOURCE_DIR}/cmake/Modules/GenerateVersion.cmake" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") From 2170c9958a455c228459c795857ec1a890cd05c5 Mon Sep 17 00:00:00 2001 From: fairiestoy Date: Wed, 11 Sep 2013 16:59:48 +0200 Subject: [PATCH 011/198] Optimized minetest.get_connected_players() Instead of collecting all objects within a huge radius (which could be a big value), just register each player that connects and give back the current hold list. --- builtin/misc.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/builtin/misc.lua b/builtin/misc.lua index 82a0ba298..3d2c496e3 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -40,15 +40,22 @@ function minetest.check_player_privs(name, privs) return true, "" end +local player_list = {} + +minetest.register_on_joinplayer(function(player) + player_list[player:get_player_name()] = player +end) + +minetest.register_on_leaveplayer(function(player) + player_list[player:get_player_name()] = nil +end) + function minetest.get_connected_players() - -- This could be optimized a bit, but leave that for later - local list = {} - for _, obj in pairs(minetest.get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do - if obj:is_player() then - table.insert(list, obj) - end + local temp_table = {} + for index, value in pairs(player_list) do + table.insert(temp_table, value) end - return list + return temp_table end function minetest.hash_node_position(pos) From afb27329fc05076876c19e90f8c4343efa540207 Mon Sep 17 00:00:00 2001 From: "0gb.us" Date: Mon, 23 Sep 2013 23:15:38 -0700 Subject: [PATCH 012/198] Remove mapgen_air alias (#935) --- games/minimal/mods/default/mapgen.lua | 1 - src/content_abm.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/games/minimal/mods/default/mapgen.lua b/games/minimal/mods/default/mapgen.lua index 070f4b1c3..8ff259c59 100644 --- a/games/minimal/mods/default/mapgen.lua +++ b/games/minimal/mods/default/mapgen.lua @@ -4,7 +4,6 @@ -- Aliases for map generator outputs -- -minetest.register_alias("mapgen_air", "air") minetest.register_alias("mapgen_stone", "default:stone") minetest.register_alias("mapgen_tree", "default:tree") minetest.register_alias("mapgen_leaves", "default:leaves") diff --git a/src/content_abm.cpp b/src/content_abm.cpp index fa6a128eb..ada20a27c 100644 --- a/src/content_abm.cpp +++ b/src/content_abm.cpp @@ -209,7 +209,7 @@ class LiquidDropABM : public ActiveBlockModifier { { return contents; } virtual std::set getRequiredNeighbors() { std::set neighbors; - neighbors.insert("mapgen_air"); + neighbors.insert("air"); return neighbors; } virtual float getTriggerInterval() @@ -241,7 +241,7 @@ class LiquidFreeze : public ActiveBlockModifier { } virtual std::set getRequiredNeighbors() { std::set s; - s.insert("mapgen_air"); + s.insert("air"); s.insert("group:melts"); return s; } @@ -303,7 +303,7 @@ class LiquidMeltWeather : public ActiveBlockModifier { } virtual std::set getRequiredNeighbors() { std::set s; - s.insert("mapgen_air"); + s.insert("air"); s.insert("group:freezes"); return s; } From 5598f3c81b0d78237f9c8b44b022e3b7270ef426 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Mon, 7 Oct 2013 22:47:13 +0200 Subject: [PATCH 013/198] FIx wrong error message on invalid use of the formspec element image_button --- src/guiFormSpecMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 28cb6740e..25adf8ea7 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1144,7 +1144,7 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,std: core::rect rect = core::rect(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y); if(data->bp_set != 2) - errorstream<<"WARNING: invalid use of item_image_button without a size[] element"< Date: Tue, 8 Oct 2013 00:23:35 +0200 Subject: [PATCH 014/198] Add Czech language --- po/cs/minetest.po | 940 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 940 insertions(+) create mode 100644 po/cs/minetest.po diff --git a/po/cs/minetest.po b/po/cs/minetest.po new file mode 100644 index 000000000..f821542b6 --- /dev/null +++ b/po/cs/minetest.po @@ -0,0 +1,940 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: minetest\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: builtin/gamemgr.lua:23 +msgid "Game Name" +msgstr "" + +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +msgid "Create" +msgstr "" + +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 +#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +msgid "Cancel" +msgstr "" + +#: builtin/gamemgr.lua:118 +msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" +msgstr "" + +#: builtin/gamemgr.lua:216 +msgid "GAMES" +msgstr "" + +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +msgid "Games" +msgstr "" + +#: builtin/gamemgr.lua:233 +msgid "Mods:" +msgstr "" + +#: builtin/gamemgr.lua:234 +msgid "edit game" +msgstr "" + +#: builtin/gamemgr.lua:237 +msgid "new game" +msgstr "" + +#: builtin/gamemgr.lua:247 +msgid "EDIT GAME" +msgstr "" + +#: builtin/gamemgr.lua:267 +msgid "Remove selected mod" +msgstr "" + +#: builtin/gamemgr.lua:270 +msgid "<<-- Add mod" +msgstr "" + +#: builtin/mainmenu.lua:159 +msgid "Ok" +msgstr "" + +#: builtin/mainmenu.lua:297 +msgid "World name" +msgstr "" + +#: builtin/mainmenu.lua:298 +msgid "Mapgen" +msgstr "" + +#: builtin/mainmenu.lua:300 +msgid "Game" +msgstr "" + +#: builtin/mainmenu.lua:314 +msgid "Delete World \"$1\"?" +msgstr "" + +#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +msgid "Yes" +msgstr "" + +#: builtin/mainmenu.lua:316 +msgid "No" +msgstr "" + +#: builtin/mainmenu.lua:384 +msgid "A world named \"$1\" already exists" +msgstr "" + +#: builtin/mainmenu.lua:399 +msgid "No worldname given or no game selected" +msgstr "" + +#: builtin/mainmenu.lua:852 +msgid "Singleplayer" +msgstr "" + +#: builtin/mainmenu.lua:853 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:854 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:855 +msgid "Settings" +msgstr "" + +#: builtin/mainmenu.lua:856 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:863 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:865 +msgid "Credits" +msgstr "" + +#: builtin/mainmenu.lua:885 +msgid "CLIENT" +msgstr "" + +#: builtin/mainmenu.lua:886 +msgid "Favorites:" +msgstr "" + +#: builtin/mainmenu.lua:887 +msgid "Address/Port" +msgstr "" + +#: builtin/mainmenu.lua:888 +msgid "Name/Password" +msgstr "" + +#: builtin/mainmenu.lua:891 +msgid "Public Serverlist" +msgstr "" + +#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 +#: builtin/modmgr.lua:271 src/keycode.cpp:229 +msgid "Delete" +msgstr "" + +#: builtin/mainmenu.lua:900 +msgid "Connect" +msgstr "" + +#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +msgid "New" +msgstr "" + +#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +msgid "Configure" +msgstr "" + +#: builtin/mainmenu.lua:944 +msgid "Start Game" +msgstr "" + +#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +msgid "Select World:" +msgstr "" + +#: builtin/mainmenu.lua:946 +msgid "START SERVER" +msgstr "" + +#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +msgid "Creative Mode" +msgstr "" + +#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +msgid "Enable Damage" +msgstr "" + +#: builtin/mainmenu.lua:951 +msgid "Public" +msgstr "" + +#: builtin/mainmenu.lua:953 +msgid "Name" +msgstr "" + +#: builtin/mainmenu.lua:955 +msgid "Password" +msgstr "" + +#: builtin/mainmenu.lua:956 +msgid "Server Port" +msgstr "" + +#: builtin/mainmenu.lua:966 +msgid "SETTINGS" +msgstr "" + +#: builtin/mainmenu.lua:967 +msgid "Fancy trees" +msgstr "" + +#: builtin/mainmenu.lua:969 +msgid "Smooth Lighting" +msgstr "" + +#: builtin/mainmenu.lua:971 +msgid "3D Clouds" +msgstr "" + +#: builtin/mainmenu.lua:973 +msgid "Opaque Water" +msgstr "" + +#: builtin/mainmenu.lua:976 +msgid "Mip-Mapping" +msgstr "" + +#: builtin/mainmenu.lua:978 +msgid "Anisotropic Filtering" +msgstr "" + +#: builtin/mainmenu.lua:980 +msgid "Bi-Linear Filtering" +msgstr "" + +#: builtin/mainmenu.lua:982 +msgid "Tri-Linear Filtering" +msgstr "" + +#: builtin/mainmenu.lua:985 +msgid "Shaders" +msgstr "" + +#: builtin/mainmenu.lua:987 +msgid "Preload item visuals" +msgstr "" + +#: builtin/mainmenu.lua:989 +msgid "Enable Particles" +msgstr "" + +#: builtin/mainmenu.lua:991 +msgid "Finite Liquid" +msgstr "" + +#: builtin/mainmenu.lua:994 +msgid "Change keys" +msgstr "" + +#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +msgid "Play" +msgstr "" + +#: builtin/mainmenu.lua:1009 +msgid "SINGLE PLAYER" +msgstr "" + +#: builtin/mainmenu.lua:1022 +msgid "Select texture pack:" +msgstr "" + +#: builtin/mainmenu.lua:1023 +msgid "TEXTURE PACKS" +msgstr "" + +#: builtin/mainmenu.lua:1043 +msgid "No information available" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Core Developers" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Active Contributors" +msgstr "" + +#: builtin/mainmenu.lua:1092 +msgid "Previous Contributors" +msgstr "" + +#: builtin/modmgr.lua:236 +msgid "MODS" +msgstr "" + +#: builtin/modmgr.lua:237 +msgid "Installed Mods:" +msgstr "" + +#: builtin/modmgr.lua:243 builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: builtin/modmgr.lua:244 +msgid "Download" +msgstr "" + +#: builtin/modmgr.lua:256 +msgid "Rename" +msgstr "" + +#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 +msgid "Depends:" +msgstr "" + +#: builtin/modmgr.lua:282 +msgid "Rename Modpack:" +msgstr "" + +#: builtin/modmgr.lua:287 src/keycode.cpp:227 +msgid "Accept" +msgstr "" + +#: builtin/modmgr.lua:381 +msgid "World:" +msgstr "" + +#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +msgid "Hide Game" +msgstr "" + +#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +msgid "Hide mp content" +msgstr "" + +#: builtin/modmgr.lua:400 +msgid "Mod:" +msgstr "" + +#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +msgid "Save" +msgstr "" + +#: builtin/modmgr.lua:422 +msgid "Enable MP" +msgstr "" + +#: builtin/modmgr.lua:424 +msgid "Disable MP" +msgstr "" + +#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +msgid "enabled" +msgstr "" + +#: builtin/modmgr.lua:436 +msgid "Enable all" +msgstr "" + +#: builtin/modmgr.lua:551 +msgid "Select Mod File:" +msgstr "" + +#: builtin/modmgr.lua:590 +msgid "Install Mod: file: \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:591 +msgid "" +"\n" +"Install Mod: unsupported filetype \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:612 +msgid "Failed to install $1 to $2" +msgstr "" + +#: builtin/modmgr.lua:615 +msgid "Install Mod: unable to find suitable foldername for modpack $1" +msgstr "" + +#: builtin/modmgr.lua:635 +msgid "Install Mod: unable to find real modname for: $1" +msgstr "" + +#: builtin/modmgr.lua:824 +msgid "Modmgr: failed to delete \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:828 +msgid "Modmgr: invalid modpath \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:845 +msgid "Are you sure you want to delete \"$1\"?" +msgstr "" + +#: builtin/modmgr.lua:847 +msgid "No of course not!" +msgstr "" + +#: builtin/modstore.lua:183 +msgid "Page $1 of $2" +msgstr "" + +#: builtin/modstore.lua:243 +msgid "Rating" +msgstr "" + +#: builtin/modstore.lua:251 +msgid "re-Install" +msgstr "" + +#: src/client.cpp:2915 +msgid "Item textures..." +msgstr "" + +#: src/game.cpp:939 +msgid "Loading..." +msgstr "" + +#: src/game.cpp:999 +msgid "Creating server...." +msgstr "" + +#: src/game.cpp:1015 +msgid "Creating client..." +msgstr "" + +#: src/game.cpp:1024 +msgid "Resolving address..." +msgstr "" + +#: src/game.cpp:1121 +msgid "Connecting to server..." +msgstr "" + +#: src/game.cpp:1218 +msgid "Item definitions..." +msgstr "" + +#: src/game.cpp:1225 +msgid "Node definitions..." +msgstr "" + +#: src/game.cpp:1232 +msgid "Media..." +msgstr "" + +#: src/game.cpp:3405 +msgid "Shutting down stuff..." +msgstr "" + +#: src/game.cpp:3435 +msgid "" +"\n" +"Check debug.txt for details." +msgstr "" + +#: src/guiDeathScreen.cpp:96 +msgid "You died." +msgstr "" + +#: src/guiDeathScreen.cpp:104 +msgid "Respawn" +msgstr "" + +#: src/guiFormSpecMenu.cpp:1569 +msgid "Left click: Move all items, Right click: Move single item" +msgstr "" + +#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:140 +msgid "Proceed" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:121 +msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:161 +msgid "\"Use\" = climb down" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:176 +msgid "Double tap \"jump\" to toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:290 +msgid "Key already in use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:372 +msgid "press key" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:400 +msgid "Forward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:401 +msgid "Backward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +msgid "Left" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +msgid "Right" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:404 +msgid "Use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:405 +msgid "Jump" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:406 +msgid "Sneak" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:407 +msgid "Drop" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:408 +msgid "Inventory" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:409 +msgid "Chat" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:410 +msgid "Command" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:411 +msgid "Console" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:412 +msgid "Toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:413 +msgid "Toggle fast" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:414 +msgid "Toggle noclip" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:415 +msgid "Range select" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:416 +msgid "Print stacks" +msgstr "" + +#: src/guiPasswordChange.cpp:107 +msgid "Old Password" +msgstr "" + +#: src/guiPasswordChange.cpp:125 +msgid "New Password" +msgstr "" + +#: src/guiPasswordChange.cpp:142 +msgid "Confirm Password" +msgstr "" + +#: src/guiPasswordChange.cpp:160 +msgid "Change" +msgstr "" + +#: src/guiPasswordChange.cpp:169 +msgid "Passwords do not match!" +msgstr "" + +#: src/guiPauseMenu.cpp:122 +msgid "Continue" +msgstr "" + +#: src/guiPauseMenu.cpp:133 +msgid "Change Password" +msgstr "" + +#: src/guiPauseMenu.cpp:143 +msgid "Sound Volume" +msgstr "" + +#: src/guiPauseMenu.cpp:152 +msgid "Exit to Menu" +msgstr "" + +#: src/guiPauseMenu.cpp:161 +msgid "Exit to OS" +msgstr "" + +#: src/guiPauseMenu.cpp:170 +msgid "" +"Default Controls:\n" +"- WASD: move\n" +"- Space: jump/climb\n" +"- Shift: sneak/go down\n" +"- Q: drop item\n" +"- I: inventory\n" +"- Mouse: turn/look\n" +"- Mouse left: dig/punch\n" +"- Mouse right: place/use\n" +"- Mouse wheel: select item\n" +"- T: chat\n" +msgstr "" + +#: src/guiVolumeChange.cpp:108 +msgid "Sound Volume: " +msgstr "" + +#: src/guiVolumeChange.cpp:122 +msgid "Exit" +msgstr "" + +#: src/keycode.cpp:223 +msgid "Left Button" +msgstr "" + +#: src/keycode.cpp:223 +msgid "Middle Button" +msgstr "" + +#: src/keycode.cpp:223 +msgid "Right Button" +msgstr "" + +#: src/keycode.cpp:223 +msgid "X Button 1" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Back" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Clear" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Return" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Tab" +msgstr "" + +#: src/keycode.cpp:224 +msgid "X Button 2" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Capital" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Control" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Kana" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Menu" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Pause" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Shift" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Convert" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Escape" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Final" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Junja" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Kanji" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Nonconvert" +msgstr "" + +#: src/keycode.cpp:227 +msgid "End" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Home" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Mode Change" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Next" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Prior" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Space" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Down" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Execute" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Print" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Select" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Up" +msgstr "" + +#: src/keycode.cpp:229 +msgid "Help" +msgstr "" + +#: src/keycode.cpp:229 +msgid "Insert" +msgstr "" + +#: src/keycode.cpp:229 +msgid "Snapshot" +msgstr "" + +#: src/keycode.cpp:232 +msgid "Left Windows" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Apps" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Numpad 0" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Numpad 1" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Right Windows" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Sleep" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 2" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 3" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 4" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 5" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 6" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 7" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad *" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad +" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad -" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad /" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad 8" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad 9" +msgstr "" + +#: src/keycode.cpp:239 +msgid "Num Lock" +msgstr "" + +#: src/keycode.cpp:239 +msgid "Scroll Lock" +msgstr "" + +#: src/keycode.cpp:240 +msgid "Left Shift" +msgstr "" + +#: src/keycode.cpp:240 +msgid "Right Shift" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Left Control" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Left Menu" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Right Control" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Right Menu" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Comma" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Minus" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Period" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Plus" +msgstr "" + +#: src/keycode.cpp:247 +msgid "Attn" +msgstr "" + +#: src/keycode.cpp:247 +msgid "CrSel" +msgstr "" + +#: src/keycode.cpp:248 +msgid "Erase OEF" +msgstr "" + +#: src/keycode.cpp:248 +msgid "ExSel" +msgstr "" + +#: src/keycode.cpp:248 +msgid "OEM Clear" +msgstr "" + +#: src/keycode.cpp:248 +msgid "PA1" +msgstr "" + +#: src/keycode.cpp:248 +msgid "Zoom" +msgstr "" + +#: src/main.cpp:1411 +msgid "needs_fallback_font" +msgstr "" + +#: src/main.cpp:1486 +msgid "Main Menu" +msgstr "" + +#: src/main.cpp:1662 +msgid "No world selected and no address provided. Nothing to do." +msgstr "" + +#: src/main.cpp:1670 +msgid "Could not find or load game \"" +msgstr "" + +#: src/main.cpp:1684 +msgid "Invalid gamespec." +msgstr "" + +#: src/main.cpp:1729 +msgid "Connection error (timed out?)" +msgstr "" From b3ad0f1ed4f358d6ca2e0415e2c8b86c0d3fbfee Mon Sep 17 00:00:00 2001 From: Pilz Adam Date: Mon, 9 Sep 2013 18:31:01 +0200 Subject: [PATCH 015/198] Translated using Weblate (German) --- po/de/minetest.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index 21f24298d..dc2664444 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-09-06 21:24+0200\n" -"Last-Translator: Block Men \n" +"PO-Revision-Date: 2013-09-09 18:31+0200\n" +"Last-Translator: Pilz Adam \n" "Language-Team: Deutsch <>\n" "Language: de\n" "MIME-Version: 1.0\n" @@ -933,7 +933,7 @@ msgstr "Zoom" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "no" #: src/main.cpp:1486 msgid "Main Menu" From 14e562e92b3872495361ab9fae30b64b1b5c0b31 Mon Sep 17 00:00:00 2001 From: we prefer instagib metl3 Date: Mon, 9 Sep 2013 22:32:54 +0200 Subject: [PATCH 016/198] Translated using Weblate (French) --- po/fr/minetest.po | 153 +++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 84 deletions(-) diff --git a/po/fr/minetest.po b/po/fr/minetest.po index 340597ae7..4c14cad8e 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -8,20 +8,19 @@ msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-08-01 13:51+0100\n" -"Last-Translator: RyDroid \n" +"PO-Revision-Date: 2013-09-09 22:32+0200\n" +"Last-Translator: we prefer instagib metl3 \n" "Language-Team: Français <>\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Weblate 1.4-dev\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 -#, fuzzy msgid "Game Name" -msgstr "Jeu" +msgstr "Nom du jeu" #: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 msgid "Create" @@ -34,44 +33,43 @@ msgstr "Annuler" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Gamemgr : Impossible de copier le mod \"$1\" dans le jeu \"$2\"" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "JEUX" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 -#, fuzzy msgid "Games" -msgstr "Jeu" +msgstr "Jeux" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Mods :" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "" +msgstr "éditer le jeu" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "" +msgstr "nouveau jeu" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "" +msgstr "ÉDITER LE JEU" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Supprimer le mod sélectionné" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "" +msgstr "<<-- Ajouter un mod" #: builtin/mainmenu.lua:159 msgid "Ok" -msgstr "" +msgstr "Ok" #: builtin/mainmenu.lua:297 msgid "World name" @@ -79,16 +77,15 @@ msgstr "Nom du monde" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Génération de carte" #: builtin/mainmenu.lua:300 msgid "Game" msgstr "Jeu" #: builtin/mainmenu.lua:314 -#, fuzzy msgid "Delete World \"$1\"?" -msgstr "Supprimer ce monde" +msgstr "Supprimer le monde \"$1\" ?" #: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 msgid "Yes" @@ -99,13 +96,12 @@ msgid "No" msgstr "Non" #: builtin/mainmenu.lua:384 -#, fuzzy msgid "A world named \"$1\" already exists" -msgstr "Impossible de créer le monde : ce nom est déjà utilisé" +msgstr "Le monde \"$1\" existe déjà" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" -msgstr "" +msgstr "Nom du monde manquant ou aucun jeu sélectionné" #: builtin/mainmenu.lua:852 msgid "Singleplayer" @@ -113,11 +109,11 @@ msgstr "Solo" #: builtin/mainmenu.lua:853 msgid "Client" -msgstr "" +msgstr "Client" #: builtin/mainmenu.lua:854 msgid "Server" -msgstr "" +msgstr "Serveur" #: builtin/mainmenu.lua:855 msgid "Settings" @@ -125,11 +121,11 @@ msgstr "Réglages" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Packs de textures" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Mods" #: builtin/mainmenu.lua:865 msgid "Credits" @@ -137,7 +133,7 @@ msgstr "Crédits" #: builtin/mainmenu.lua:885 msgid "CLIENT" -msgstr "" +msgstr "CLIENT" #: builtin/mainmenu.lua:886 msgid "Favorites:" @@ -152,9 +148,8 @@ msgid "Name/Password" msgstr "Nom / MdP" #: builtin/mainmenu.lua:891 -#, fuzzy msgid "Public Serverlist" -msgstr "Liste de serveurs publics :" +msgstr "Liste de serveurs publics" #: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 #: builtin/modmgr.lua:271 src/keycode.cpp:229 @@ -174,9 +169,8 @@ msgid "Configure" msgstr "Configurer" #: builtin/mainmenu.lua:944 -#, fuzzy msgid "Start Game" -msgstr "Démarrer / Connecter" +msgstr "Démarrer" #: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 msgid "Select World:" @@ -184,7 +178,7 @@ msgstr "Sélectionner un monde :" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "DÉMARRER LE SERVEUR" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -200,20 +194,19 @@ msgstr "Public" #: builtin/mainmenu.lua:953 msgid "Name" -msgstr "" +msgstr "Nom" #: builtin/mainmenu.lua:955 -#, fuzzy msgid "Password" -msgstr "Ancien mot de passe" +msgstr "Mot de passe" #: builtin/mainmenu.lua:956 msgid "Server Port" -msgstr "" +msgstr "Port" #: builtin/mainmenu.lua:966 msgid "SETTINGS" -msgstr "" +msgstr "PARAMÈTRES" #: builtin/mainmenu.lua:967 msgid "Fancy trees" @@ -228,7 +221,6 @@ msgid "3D Clouds" msgstr "Nuages 3D" #: builtin/mainmenu.lua:973 -#, fuzzy msgid "Opaque Water" msgstr "Eau opaque" @@ -261,7 +253,6 @@ msgid "Enable Particles" msgstr "Activer les particules" #: builtin/mainmenu.lua:991 -#, fuzzy msgid "Finite Liquid" msgstr "Liquides limités" @@ -275,162 +266,157 @@ msgstr "Jouer" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "PARTIE SOLO" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Sélectionner un pack de textures :" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "PACKS DE TEXTURES" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "" +msgstr "Pas d'information disponible" #: builtin/mainmenu.lua:1071 msgid "Core Developers" -msgstr "" +msgstr "Développeurs principaux" #: builtin/mainmenu.lua:1082 msgid "Active Contributors" -msgstr "" +msgstr "Contributeurs actifs" #: builtin/mainmenu.lua:1092 msgid "Previous Contributors" -msgstr "" +msgstr "Anciens contributeurs" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MODS" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Mods installés :" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Installer" #: builtin/modmgr.lua:244 -#, fuzzy msgid "Download" -msgstr "Bas" +msgstr "Télécharger" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Renommer" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy msgid "Depends:" -msgstr "dépend de :" +msgstr "Dépend de :" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Renommer le pack de mods :" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" msgstr "Accepter" #: builtin/modmgr.lua:381 -#, fuzzy msgid "World:" msgstr "Sélectionner un monde :" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 -#, fuzzy msgid "Hide Game" -msgstr "Jeu" +msgstr "Cacher le jeu" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" -msgstr "" +msgstr "Cacher le contenu de packs de mods" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mod :" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Enregistrer" #: builtin/modmgr.lua:422 -#, fuzzy msgid "Enable MP" -msgstr "Tout activer" +msgstr "Activer le pack de mods" #: builtin/modmgr.lua:424 -#, fuzzy msgid "Disable MP" -msgstr "Tout désactiver" +msgstr "Désactiver le pack de mods" #: builtin/modmgr.lua:428 builtin/modmgr.lua:430 msgid "enabled" msgstr "activé" #: builtin/modmgr.lua:436 -#, fuzzy msgid "Enable all" msgstr "Tout activer" #: builtin/modmgr.lua:551 -#, fuzzy msgid "Select Mod File:" -msgstr "Sélectionner un monde :" +msgstr "Sélectionner un fichier de mod :" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Installer un mod : fichier : \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Installer un mod : type de fichier non supporté \"$1\"" #: builtin/modmgr.lua:612 -#, fuzzy msgid "Failed to install $1 to $2" -msgstr "Le monde n'a pas pu être initialisé" +msgstr "N'a pas pu installer $1 à $2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" +"Installer un mod : impossible de trouver un nom de dossier valide pour le " +"pack de mods $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "Installer un mod : impossible de trouver le vrai nom du mod pour : $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr : n'a pas pu supprimer \"$1\"" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr : chemin de mod invalide \"$1\"" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "Êtes-vous sûr de supprimer \"$1\" ?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "Non, bien sûr que non !" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Page $1 sur $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Note" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "ré-Installer" #: src/client.cpp:2915 msgid "Item textures..." @@ -457,17 +443,16 @@ msgid "Connecting to server..." msgstr "Connexion au serveur..." #: src/game.cpp:1218 -#, fuzzy msgid "Item definitions..." -msgstr "Textures d'objets..." +msgstr "Définitions d'objets..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Définitions des blocs..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Média..." #: src/game.cpp:3405 msgid "Shutting down stuff..." @@ -951,7 +936,7 @@ msgstr "Zoomer" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "needs_fallback_font" #: src/main.cpp:1486 msgid "Main Menu" From 25304b53a15cf340707a631af6d236d7726a1fdf Mon Sep 17 00:00:00 2001 From: Rutger NL Date: Wed, 11 Sep 2013 15:27:52 +0200 Subject: [PATCH 017/198] Translated using Weblate (Dutch) --- po/nl/minetest.po | 219 +++++++++++++++++++++++----------------------- 1 file changed, 108 insertions(+), 111 deletions(-) diff --git a/po/nl/minetest.po b/po/nl/minetest.po index ffe7f4c8f..209ddc343 100644 --- a/po/nl/minetest.po +++ b/po/nl/minetest.po @@ -8,18 +8,17 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-08-05 22:18+0200\n" -"Last-Translator: Sasikaa Lacikaa \n" +"PO-Revision-Date: 2013-09-11 15:27+0200\n" +"Last-Translator: Rutger NL \n" "Language-Team: \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Weblate 1.4-dev\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 -#, fuzzy msgid "Game Name" msgstr "Spel" @@ -34,44 +33,43 @@ msgstr "Annuleer" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Gamemgr: Kan mod \"$1\" niet naar spel \"$2\" kopiëren" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "SPELLEN" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 -#, fuzzy msgid "Games" -msgstr "Spel" +msgstr "Spellen" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Mods:" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "" +msgstr "spel aanpassen" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "" +msgstr "nieuw spel" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "" +msgstr "SPEL AANPASSEN" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Geselecteerde mod verwijderen" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "" +msgstr "<<-- Mod toevoegen" #: builtin/mainmenu.lua:159 msgid "Ok" -msgstr "" +msgstr "Ok" #: builtin/mainmenu.lua:297 msgid "World name" @@ -79,16 +77,15 @@ msgstr "Naam wereld" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Kaartgenerator" #: builtin/mainmenu.lua:300 msgid "Game" msgstr "Spel" #: builtin/mainmenu.lua:314 -#, fuzzy msgid "Delete World \"$1\"?" -msgstr "Verwijder wereld" +msgstr "Verwijder wereld \"$1\"?" #: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 msgid "Yes" @@ -99,13 +96,12 @@ msgid "No" msgstr "Nee" #: builtin/mainmenu.lua:384 -#, fuzzy msgid "A world named \"$1\" already exists" -msgstr "Kan geen nieuwe wereld aanmaken: De naam bestaat al" +msgstr "Wereld \"$1\" bestaat al" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" -msgstr "" +msgstr "Geen wereldnaam opgegeven of geen spel geselecteerd" #: builtin/mainmenu.lua:852 msgid "Singleplayer" @@ -113,11 +109,11 @@ msgstr "Singleplayer" #: builtin/mainmenu.lua:853 msgid "Client" -msgstr "" +msgstr "Client" #: builtin/mainmenu.lua:854 msgid "Server" -msgstr "" +msgstr "Server" #: builtin/mainmenu.lua:855 msgid "Settings" @@ -125,11 +121,11 @@ msgstr "Instellingen" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Textuurverzamelingen" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Mods" #: builtin/mainmenu.lua:865 msgid "Credits" @@ -137,11 +133,11 @@ msgstr "Credits" #: builtin/mainmenu.lua:885 msgid "CLIENT" -msgstr "" +msgstr "CLIENT" #: builtin/mainmenu.lua:886 msgid "Favorites:" -msgstr "Favourieten:" +msgstr "Favorieten:" #: builtin/mainmenu.lua:887 msgid "Address/Port" @@ -152,9 +148,8 @@ msgid "Name/Password" msgstr "Naam/Wachtwoord" #: builtin/mainmenu.lua:891 -#, fuzzy msgid "Public Serverlist" -msgstr "Publieke Server lijst:" +msgstr "Publieke Serverlijst" #: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 #: builtin/modmgr.lua:271 src/keycode.cpp:229 @@ -174,9 +169,8 @@ msgid "Configure" msgstr "Instellingen" #: builtin/mainmenu.lua:944 -#, fuzzy msgid "Start Game" -msgstr "Start het spel / Verbind" +msgstr "Start spel" #: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 msgid "Select World:" @@ -184,7 +178,7 @@ msgstr "Selecteer Wereld:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "START SERVER" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -200,20 +194,19 @@ msgstr "Publiek" #: builtin/mainmenu.lua:953 msgid "Name" -msgstr "" +msgstr "Naam" #: builtin/mainmenu.lua:955 -#, fuzzy msgid "Password" -msgstr "Huidig wachtwoord" +msgstr "Wachtwoord" #: builtin/mainmenu.lua:956 msgid "Server Port" -msgstr "" +msgstr "Serverpoort" #: builtin/mainmenu.lua:966 msgid "SETTINGS" -msgstr "" +msgstr "INSTELLINGEN" #: builtin/mainmenu.lua:967 msgid "Fancy trees" @@ -228,9 +221,8 @@ msgid "3D Clouds" msgstr "3D wolken" #: builtin/mainmenu.lua:973 -#, fuzzy msgid "Opaque Water" -msgstr "Doorzichtig water" +msgstr "Ondoorzichtig water" #: builtin/mainmenu.lua:976 msgid "Mip-Mapping" @@ -238,15 +230,15 @@ msgstr "Mip-Mapping" #: builtin/mainmenu.lua:978 msgid "Anisotropic Filtering" -msgstr "Bi-Linear Filtering" +msgstr "Anisotrope Filtering" #: builtin/mainmenu.lua:980 msgid "Bi-Linear Filtering" -msgstr "Bi-Linear Filtering" +msgstr "Bi-Lineaire Filtering" #: builtin/mainmenu.lua:982 msgid "Tri-Linear Filtering" -msgstr "Tri-Linear Filtering" +msgstr "Tri-Lineare Filtering" #: builtin/mainmenu.lua:985 msgid "Shaders" @@ -254,20 +246,19 @@ msgstr "Shaders" #: builtin/mainmenu.lua:987 msgid "Preload item visuals" -msgstr "Preload item visuals" +msgstr "Voorwerpen vooraf laden" #: builtin/mainmenu.lua:989 msgid "Enable Particles" -msgstr "Enable Particles" +msgstr "Deeltjes aanzetten" #: builtin/mainmenu.lua:991 -#, fuzzy msgid "Finite Liquid" -msgstr "Finite liquid" +msgstr "Eindige vloeistoffen" #: builtin/mainmenu.lua:994 msgid "Change keys" -msgstr "Sneltoetsen veranderen" +msgstr "Toetsen" #: builtin/mainmenu.lua:1007 src/keycode.cpp:248 msgid "Play" @@ -275,202 +266,195 @@ msgstr "Speel" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "ENKELE SPELER" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Selecteer textuurverzameling:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "TEXTUURVERZAMELINGEN" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "" +msgstr "Geen informatie aanwezig" #: builtin/mainmenu.lua:1071 msgid "Core Developers" -msgstr "" +msgstr "Hoofdontwikkelaars" #: builtin/mainmenu.lua:1082 msgid "Active Contributors" -msgstr "" +msgstr "Actieve bijdragers" #: builtin/mainmenu.lua:1092 msgid "Previous Contributors" -msgstr "" +msgstr "Vroegere bijdragers" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MODS" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Geïnstalleerde Mods:" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Installeren" #: builtin/modmgr.lua:244 -#, fuzzy msgid "Download" -msgstr "Omlaag" +msgstr "Downloaden" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Hernoemen" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy msgid "Depends:" -msgstr "heeft nodig:" +msgstr "Afhankelijkheden:" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Modverzameling hernoemen:" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" msgstr "Accepteren" #: builtin/modmgr.lua:381 -#, fuzzy msgid "World:" msgstr "Selecteer Wereld:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 -#, fuzzy msgid "Hide Game" -msgstr "Spel" +msgstr "Geen std" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" -msgstr "" +msgstr "Verberg mp mods" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mod:" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Bewaar" #: builtin/modmgr.lua:422 -#, fuzzy msgid "Enable MP" -msgstr "Allen inschakelen" +msgstr "MP inschakelen" #: builtin/modmgr.lua:424 -#, fuzzy msgid "Disable MP" -msgstr "Allen uitschakelen" +msgstr "MP uitschakelen" #: builtin/modmgr.lua:428 builtin/modmgr.lua:430 msgid "enabled" msgstr "ingeschakeld" #: builtin/modmgr.lua:436 -#, fuzzy msgid "Enable all" -msgstr "Allen inschakelen" +msgstr "Alles aan" #: builtin/modmgr.lua:551 -#, fuzzy msgid "Select Mod File:" -msgstr "Selecteer Wereld:" +msgstr "Selecteer Modbestand:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Mod installeren: bestand: \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Mod installeren: niet ondersteund bestandstype \"$1\"" #: builtin/modmgr.lua:612 -#, fuzzy msgid "Failed to install $1 to $2" -msgstr "Laden van wereld is mislukt" +msgstr "Installeren van $1 in $2 is mislukt" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" -msgstr "" +msgstr "Mod installeren: kan geen geschikte map vinden voor modverzameling $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "Mod installeren: kan geen echte modnaam vinden voor: $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr: kan \"$1\" niet verwijderen" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr: onjuist pad \"$1\"" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "Weet je zeker dat je \"$1\" wilt verwijderen?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "Natuurlijk niet!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Pagina $1 van $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Rang" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "opnieuw installeren" #: src/client.cpp:2915 msgid "Item textures..." -msgstr "Artikel texturen..." +msgstr "Voorwerp texturen…" #: src/game.cpp:939 msgid "Loading..." -msgstr "" +msgstr "Bezig met laden…" #: src/game.cpp:999 msgid "Creating server...." -msgstr "" +msgstr "Bezig server te maken…" #: src/game.cpp:1015 msgid "Creating client..." -msgstr "" +msgstr "Bezig client te maken…" #: src/game.cpp:1024 msgid "Resolving address..." -msgstr "" +msgstr "IP-adres opzoeken…" #: src/game.cpp:1121 msgid "Connecting to server..." -msgstr "" +msgstr "Bezig verbinding met de server te maken…" #: src/game.cpp:1218 msgid "Item definitions..." -msgstr "" +msgstr "Voorwerpdefinities…" #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Node definities…" #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Media…" #: src/game.cpp:3405 msgid "Shutting down stuff..." -msgstr "" +msgstr "Stopzetten…" #: src/game.cpp:3435 msgid "" @@ -478,7 +462,7 @@ msgid "" "Check debug.txt for details." msgstr "" "\n" -"Check debug.txt for details." +"Lees debug.txt voor details." #: src/guiDeathScreen.cpp:96 msgid "You died." @@ -486,7 +470,7 @@ msgstr "Je bent gestorven." #: src/guiDeathScreen.cpp:104 msgid "Respawn" -msgstr "Respawn" +msgstr "Herspawnen" #: src/guiFormSpecMenu.cpp:1569 msgid "Left click: Move all items, Right click: Move single item" @@ -496,19 +480,21 @@ msgstr "" #: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 #: src/guiTextInputMenu.cpp:140 msgid "Proceed" -msgstr "Volgende" +msgstr "Doorgaan" #: src/guiKeyChangeMenu.cpp:121 msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" -msgstr "Sneltoetsen." +msgstr "" +"Sneltoetsen. (Als dit menu stuk gaat, verwijder dan instellingen uit " +"minetest.conf)." #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" -msgstr "\"Use\" = Omlaag klimmen" +msgstr "\"Gebruiken\" = Omlaag klimmen" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" -msgstr "Dubbelklik op \"jump\" om te vliegen" +msgstr "2x \"springen\" om te vliegen" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" @@ -536,7 +522,7 @@ msgstr "Rechts" #: src/guiKeyChangeMenu.cpp:404 msgid "Use" -msgstr "Gebruikwn" +msgstr "Gebruiken" #: src/guiKeyChangeMenu.cpp:405 msgid "Jump" @@ -556,7 +542,7 @@ msgstr "Rugzak" #: src/guiKeyChangeMenu.cpp:409 msgid "Chat" -msgstr "Chat" +msgstr "Kletsen" #: src/guiKeyChangeMenu.cpp:410 msgid "Command" @@ -640,6 +626,17 @@ msgid "" "- Mouse wheel: select item\n" "- T: chat\n" msgstr "" +"Standaard toetsen:\n" +"- W,A,S,D: bewegen\n" +"- Spatie: spring/klim\n" +"- Shift: kruip/duik\n" +"- Q: weggooien\n" +"- I: rugzak\n" +"- Muis: draaien/kijken\n" +"- L.muisknop: graaf/sla\n" +"- R.muisknop: plaats/gebruik\n" +"- Muiswiel: selecteer\n" +"- T: chat\n" #: src/guiVolumeChange.cpp:108 msgid "Sound Volume: " @@ -647,7 +644,7 @@ msgstr "Volume: " #: src/guiVolumeChange.cpp:122 msgid "Exit" -msgstr "Exit" +msgstr "Terug" #: src/keycode.cpp:223 msgid "Left Button" @@ -675,7 +672,7 @@ msgstr "Wissen" #: src/keycode.cpp:224 msgid "Return" -msgstr "Return" +msgstr "Terug" #: src/keycode.cpp:224 msgid "Tab" @@ -939,7 +936,7 @@ msgstr "Zoom" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "needs_fallback_font" #: src/main.cpp:1486 msgid "Main Menu" @@ -959,7 +956,7 @@ msgstr "Onjuiste gamespec." #: src/main.cpp:1729 msgid "Connection error (timed out?)" -msgstr "Connection error (timed out?)" +msgstr "Fout bij verbinden (time out?)" #~ msgid "is required by:" #~ msgstr "is benodigd voor:" From d0ddcecbe5b5f7a34f85d3140a049980b16a6f48 Mon Sep 17 00:00:00 2001 From: Shen Zheyu Date: Sat, 14 Sep 2013 12:52:23 +0200 Subject: [PATCH 018/198] Translated using Weblate (Chinese (China)) --- po/zh_CN/minetest.po | 50 +++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/po/zh_CN/minetest.po b/po/zh_CN/minetest.po index d4676d4db..594888ca5 100644 --- a/po/zh_CN/minetest.po +++ b/po/zh_CN/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-09-07 16:20+0200\n" +"PO-Revision-Date: 2013-09-14 12:52+0200\n" "Last-Translator: Shen Zheyu \n" "Language-Team: LANGUAGE \n" "Language: zh_CN\n" @@ -77,7 +77,7 @@ msgstr "世界名称" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "地图生成器" #: builtin/mainmenu.lua:300 msgid "Game" @@ -169,7 +169,6 @@ msgid "Configure" msgstr "配置" #: builtin/mainmenu.lua:944 -#, fuzzy msgid "Start Game" msgstr "启动游戏" @@ -334,9 +333,8 @@ msgid "Hide Game" msgstr "隐藏游戏" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 -#, fuzzy msgid "Hide mp content" -msgstr "隐藏mp内容" +msgstr "隐藏MOD包内容" #: builtin/modmgr.lua:400 msgid "Mod:" @@ -347,79 +345,76 @@ msgid "Save" msgstr "保存" #: builtin/modmgr.lua:422 -#, fuzzy msgid "Enable MP" -msgstr "启用MP" +msgstr "启用MOD包" #: builtin/modmgr.lua:424 -#, fuzzy msgid "Disable MP" -msgstr "全部禁用" +msgstr "禁用MOD包" #: builtin/modmgr.lua:428 builtin/modmgr.lua:430 msgid "enabled" msgstr "启用" #: builtin/modmgr.lua:436 -#, fuzzy msgid "Enable all" msgstr "全部启用" #: builtin/modmgr.lua:551 -#, fuzzy msgid "Select Mod File:" -msgstr "选择世界:" +msgstr "选择MOD文件:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "安装MOD:文件:”$1“" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"安装MOD:不支持的文件类型“$1“" #: builtin/modmgr.lua:612 -#, fuzzy msgid "Failed to install $1 to $2" -msgstr "无法初始化世界" +msgstr "无法安装$1到$2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" -msgstr "" +msgstr "安装MOD:找不到MOD包$1的合适文件夹名" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "安装MOD:找不到$1的真正MOD名" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "MOD管理器:无法删除“$1“" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "MOD管理器:MOD“$1“路径非法" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "你确认要删除\"$1\"?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "当然不!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "第$1页,共$2页" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "评级" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "重新安装" #: src/client.cpp:2915 msgid "Item textures..." @@ -446,17 +441,16 @@ msgid "Connecting to server..." msgstr "正在连接服务器..." #: src/game.cpp:1218 -#, fuzzy msgid "Item definitions..." -msgstr "物品材质..." +msgstr "物品定义..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "方块定义..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "媒体..." #: src/game.cpp:3405 msgid "Shutting down stuff..." From 406bed1164b5f723fb09554ca13a047515a87de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederico=20Guimar=C3=A3es?= Date: Mon, 16 Sep 2013 17:22:30 +0200 Subject: [PATCH 019/198] Translated using Weblate (Portuguese (Brazil)) --- po/pt_BR/minetest.po | 185 ++++++++++++++++++++----------------------- 1 file changed, 87 insertions(+), 98 deletions(-) diff --git a/po/pt_BR/minetest.po b/po/pt_BR/minetest.po index cc614c323..46c3b6b5d 100644 --- a/po/pt_BR/minetest.po +++ b/po/pt_BR/minetest.po @@ -8,20 +8,19 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-05-15 18:58+0200\n" +"PO-Revision-Date: 2013-09-16 17:22+0200\n" "Last-Translator: Frederico Guimarães \n" "Language-Team: LANGUAGE \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Weblate 1.4-dev\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 -#, fuzzy msgid "Game Name" -msgstr "Jogo" +msgstr "Nome do jogo" #: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 msgid "Create" @@ -34,44 +33,43 @@ msgstr "Cancelar" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Gamemgr: Não foi possível copiar o mod \"$1\" para o jogo \"$2\"" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "JOGOS" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 -#, fuzzy msgid "Games" -msgstr "Jogo" +msgstr "Jogos" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Módulos:" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "" +msgstr "editar o jogo" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "" +msgstr "novo jogo" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "" +msgstr "EDITAR JOGO" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Remover o módulo selecionado" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "" +msgstr "<<-- Adicionar módulo" #: builtin/mainmenu.lua:159 msgid "Ok" -msgstr "" +msgstr "Ok" #: builtin/mainmenu.lua:297 msgid "World name" @@ -79,16 +77,15 @@ msgstr "Nome do mundo" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Mapgen" #: builtin/mainmenu.lua:300 msgid "Game" msgstr "Jogo" #: builtin/mainmenu.lua:314 -#, fuzzy msgid "Delete World \"$1\"?" -msgstr "Excluir o mundo" +msgstr "Excluir o mundo \"$1\"?" #: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 msgid "Yes" @@ -99,13 +96,14 @@ msgid "No" msgstr "Não" #: builtin/mainmenu.lua:384 -#, fuzzy msgid "A world named \"$1\" already exists" -msgstr "Não foi possivel criar o mundo: Já existe um mundo com esse nome" +msgstr "Já existe um mundo com o nome \"$1\"" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" msgstr "" +"Não foi fornecido nenhum nome para o mundo ou não foi selecionado nenhum " +"jogo" #: builtin/mainmenu.lua:852 msgid "Singleplayer" @@ -113,11 +111,11 @@ msgstr "Um jogador" #: builtin/mainmenu.lua:853 msgid "Client" -msgstr "" +msgstr "Cliente" #: builtin/mainmenu.lua:854 msgid "Server" -msgstr "" +msgstr "Servidor" #: builtin/mainmenu.lua:855 msgid "Settings" @@ -125,11 +123,11 @@ msgstr "Configurações" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Pacotes de texturas" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Módulos" #: builtin/mainmenu.lua:865 msgid "Credits" @@ -137,7 +135,7 @@ msgstr "Créditos" #: builtin/mainmenu.lua:885 msgid "CLIENT" -msgstr "" +msgstr "CLIENTE" #: builtin/mainmenu.lua:886 msgid "Favorites:" @@ -152,9 +150,8 @@ msgid "Name/Password" msgstr "Nome/Senha" #: builtin/mainmenu.lua:891 -#, fuzzy msgid "Public Serverlist" -msgstr "Lista de servidores públicos:" +msgstr "Servidores públicos" #: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 #: builtin/modmgr.lua:271 src/keycode.cpp:229 @@ -174,9 +171,8 @@ msgid "Configure" msgstr "Configurar" #: builtin/mainmenu.lua:944 -#, fuzzy msgid "Start Game" -msgstr "Iniciar o jogo/Conectar" +msgstr "Iniciar o jogo" #: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 msgid "Select World:" @@ -184,7 +180,7 @@ msgstr "Selecione um mundo:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "INICIAR SERVIDOR" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -200,24 +196,23 @@ msgstr "Público" #: builtin/mainmenu.lua:953 msgid "Name" -msgstr "" +msgstr "Nome" #: builtin/mainmenu.lua:955 -#, fuzzy msgid "Password" -msgstr "Senha antiga" +msgstr "Senha" #: builtin/mainmenu.lua:956 msgid "Server Port" -msgstr "" +msgstr "Porta do servidor" #: builtin/mainmenu.lua:966 msgid "SETTINGS" -msgstr "" +msgstr "CONFIGURAÇÕES" #: builtin/mainmenu.lua:967 msgid "Fancy trees" -msgstr "Árvores mais detalhadas" +msgstr "Árvores melhores" #: builtin/mainmenu.lua:969 msgid "Smooth Lighting" @@ -228,13 +223,12 @@ msgid "3D Clouds" msgstr "Nuvens 3D" #: builtin/mainmenu.lua:973 -#, fuzzy msgid "Opaque Water" msgstr "Água opaca" #: builtin/mainmenu.lua:976 msgid "Mip-Mapping" -msgstr "Mip-Mapping" +msgstr "Mipmapping" #: builtin/mainmenu.lua:978 msgid "Anisotropic Filtering" @@ -254,14 +248,13 @@ msgstr "Sombreadores" #: builtin/mainmenu.lua:987 msgid "Preload item visuals" -msgstr "Precarga dos elementos visuais" +msgstr "Precarga de elementos visuais" #: builtin/mainmenu.lua:989 msgid "Enable Particles" msgstr "Habilitar partículas" #: builtin/mainmenu.lua:991 -#, fuzzy msgid "Finite Liquid" msgstr "Líquido finito" @@ -275,162 +268,158 @@ msgstr "Jogar" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "UM JOGADOR" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Selecione o pacote de texturas:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "PACOTES DE TEXTURAS" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "" +msgstr "Nenhuma informação disponível" #: builtin/mainmenu.lua:1071 msgid "Core Developers" -msgstr "" +msgstr "Desenvolvedores principais" #: builtin/mainmenu.lua:1082 msgid "Active Contributors" -msgstr "" +msgstr "Colaboradores ativos" #: builtin/mainmenu.lua:1092 msgid "Previous Contributors" -msgstr "" +msgstr "Colaboradores anteriores" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MÓDULOS" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Módulos instalados:" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Instalar" #: builtin/modmgr.lua:244 -#, fuzzy msgid "Download" -msgstr "Abaixo" +msgstr "Baixar" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Renomear" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy msgid "Depends:" -msgstr "depende de:" +msgstr "Depende de:" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Renomear pacote de módulos:" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" msgstr "Aceitar" #: builtin/modmgr.lua:381 -#, fuzzy msgid "World:" -msgstr "Selecione um mundo:" +msgstr "Mundo:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 -#, fuzzy msgid "Hide Game" -msgstr "Jogo" +msgstr "Ocultar jogos" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" -msgstr "" +msgstr "Ocultar conteúdo PMs" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mod:" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Salvar" #: builtin/modmgr.lua:422 -#, fuzzy msgid "Enable MP" -msgstr "Habilitar tudo" +msgstr "Habilitar PMs" #: builtin/modmgr.lua:424 -#, fuzzy msgid "Disable MP" -msgstr "Desabilitar tudo" +msgstr "Desabilitar PMs" #: builtin/modmgr.lua:428 builtin/modmgr.lua:430 msgid "enabled" msgstr "habilitado" #: builtin/modmgr.lua:436 -#, fuzzy msgid "Enable all" -msgstr "Habilitar tudo" +msgstr "Habilitar todos" #: builtin/modmgr.lua:551 -#, fuzzy msgid "Select Mod File:" -msgstr "Selecione um mundo:" +msgstr "Selecione o arquivo do módulo:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Instalação de módulo: arquivo: \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Instalação de módulo: o tipo de arquivo \"$1\" não é suportado" #: builtin/modmgr.lua:612 -#, fuzzy msgid "Failed to install $1 to $2" -msgstr "Não foi possível iniciar o mundo" +msgstr "Não foi possível instalar $1 em $2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" +"Instalação de módulo: não foi possível encontrar o nome adequado da pasta " +"para o pacote de módulos $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" msgstr "" +"Instalação de módulo: não foi possível encontrar o nome real do módulo: $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr: não foi possível excluir \"$1\"" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr: caminho inválido do módulo \"$1\"" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "Tem certeza que deseja excluir \"$1\"?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "Claro que não!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Página $1 de $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Classificação" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "reinstalar" #: src/client.cpp:2915 msgid "Item textures..." @@ -457,17 +446,16 @@ msgid "Connecting to server..." msgstr "Conectando ao servidor..." #: src/game.cpp:1218 -#, fuzzy msgid "Item definitions..." -msgstr "Texturas dos itens..." +msgstr "Definições dos itens..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Definições dos nós..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Mídia..." #: src/game.cpp:3405 msgid "Shutting down stuff..." @@ -491,7 +479,7 @@ msgstr "Reviver" #: src/guiFormSpecMenu.cpp:1569 msgid "Left click: Move all items, Right click: Move single item" -msgstr "Botão esq.: Move todos os itens, Botão dir.: Move um item" +msgstr "Botão esquerdo: Move todos os itens. Botão direito: Move um item" #: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 #: src/guiTextInputMenu.cpp:140 @@ -501,15 +489,16 @@ msgstr "Continuar" #: src/guiKeyChangeMenu.cpp:121 msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" msgstr "" -"Teclas. (Se este menu estiver com problema, remova itens do minetest.conf)" +"Teclas (se este menu estiver com problema, remova itens do arquivo " +"minetest.conf)" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" -msgstr "\"Usar\" = desce" +msgstr "\"Usar\" = descer" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" -msgstr "Aperte duas vezes \"saltar\" para ativar o voo" +msgstr "\"Pular\" duas vezes ativa o voo" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" @@ -517,7 +506,7 @@ msgstr "Essa tecla já está em uso" #: src/guiKeyChangeMenu.cpp:372 msgid "press key" -msgstr "pressione uma tecla" +msgstr "press. uma tecla" #: src/guiKeyChangeMenu.cpp:400 msgid "Forward" @@ -541,7 +530,7 @@ msgstr "Usar" #: src/guiKeyChangeMenu.cpp:405 msgid "Jump" -msgstr "Saltar" +msgstr "Pular" #: src/guiKeyChangeMenu.cpp:406 msgid "Sneak" @@ -577,15 +566,15 @@ msgstr "Alternar corrida" #: src/guiKeyChangeMenu.cpp:414 msgid "Toggle noclip" -msgstr "Alternar mov.livre" +msgstr "Alternar noclip" #: src/guiKeyChangeMenu.cpp:415 msgid "Range select" -msgstr "Selecionar distância" +msgstr "Sel. distância" #: src/guiKeyChangeMenu.cpp:416 msgid "Print stacks" -msgstr "Imprimir pilha (log)" +msgstr "Impr. pilha (log)" #: src/guiPasswordChange.cpp:107 msgid "Old Password" @@ -648,9 +637,9 @@ msgstr "" "- Q: descartar o item\n" "- I: inventário\n" "- Mouse: virar/olhar\n" -"- Botão esq. do mouse: cavar/atingir\n" -"- Botão dir. do mouse: colocar/usar\n" -"- Roda do mouse: selecionar item\n" +"- Botão esquerdo: cavar/atingir\n" +"- Botão direito: colocar/usar\n" +"- Roda: selecionar item\n" "- T: bate-papo\n" #: src/guiVolumeChange.cpp:108 @@ -951,7 +940,7 @@ msgstr "Zoom" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "needs_fallback_font" #: src/main.cpp:1486 msgid "Main Menu" From 919ffd9d36fef33d30babb7badeb034c05aa3362 Mon Sep 17 00:00:00 2001 From: Rutger NL Date: Wed, 11 Sep 2013 16:25:17 +0200 Subject: [PATCH 020/198] Translated using Weblate (Dutch) --- po/nl/minetest.po | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/po/nl/minetest.po b/po/nl/minetest.po index 209ddc343..bc10d4a7c 100644 --- a/po/nl/minetest.po +++ b/po/nl/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-09-11 15:27+0200\n" +"PO-Revision-Date: 2013-09-11 16:25+0200\n" "Last-Translator: Rutger NL \n" "Language-Team: \n" "Language: nl\n" @@ -121,7 +121,7 @@ msgstr "Instellingen" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "Textuurverzamelingen" +msgstr "Texturen" #: builtin/mainmenu.lua:863 msgid "Mods" @@ -170,7 +170,7 @@ msgstr "Instellingen" #: builtin/mainmenu.lua:944 msgid "Start Game" -msgstr "Start spel" +msgstr "Start Server" #: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 msgid "Select World:" @@ -182,7 +182,7 @@ msgstr "START SERVER" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" -msgstr "Creative Modus" +msgstr "Creatieve Modus" #: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 msgid "Enable Damage" @@ -266,7 +266,7 @@ msgstr "Speel" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "ENKELE SPELER" +msgstr "SINGLEPLAYER" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" @@ -274,7 +274,7 @@ msgstr "Selecteer textuurverzameling:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "TEXTUURVERZAMELINGEN" +msgstr "TEXTUREN" #: builtin/mainmenu.lua:1043 msgid "No information available" @@ -326,7 +326,7 @@ msgstr "Accepteren" #: builtin/modmgr.lua:381 msgid "World:" -msgstr "Selecteer Wereld:" +msgstr "Wereld:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 msgid "Hide Game" @@ -418,43 +418,43 @@ msgstr "opnieuw installeren" #: src/client.cpp:2915 msgid "Item textures..." -msgstr "Voorwerp texturen…" +msgstr "Voorwerp texturen..." #: src/game.cpp:939 msgid "Loading..." -msgstr "Bezig met laden…" +msgstr "Bezig met laden..." #: src/game.cpp:999 msgid "Creating server...." -msgstr "Bezig server te maken…" +msgstr "Bezig server te maken..." #: src/game.cpp:1015 msgid "Creating client..." -msgstr "Bezig client te maken…" +msgstr "Bezig client te maken..." #: src/game.cpp:1024 msgid "Resolving address..." -msgstr "IP-adres opzoeken…" +msgstr "IP-adres opzoeken..." #: src/game.cpp:1121 msgid "Connecting to server..." -msgstr "Bezig verbinding met de server te maken…" +msgstr "Verbinding met de server maken..." #: src/game.cpp:1218 msgid "Item definitions..." -msgstr "Voorwerpdefinities…" +msgstr "Voorwerpdefinities..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "Node definities…" +msgstr "Node definities..." #: src/game.cpp:1232 msgid "Media..." -msgstr "Media…" +msgstr "Media..." #: src/game.cpp:3405 msgid "Shutting down stuff..." -msgstr "Stopzetten…" +msgstr "Stopzetten..." #: src/game.cpp:3435 msgid "" @@ -490,7 +490,7 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" -msgstr "\"Gebruiken\" = Omlaag klimmen" +msgstr "\"Gebruiken\" = Omlaag" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" @@ -542,7 +542,7 @@ msgstr "Rugzak" #: src/guiKeyChangeMenu.cpp:409 msgid "Chat" -msgstr "Kletsen" +msgstr "Chatten" #: src/guiKeyChangeMenu.cpp:410 msgid "Command" @@ -594,7 +594,7 @@ msgstr "Wachtwoorden zijn niet gelijk!" #: src/guiPauseMenu.cpp:122 msgid "Continue" -msgstr "Volgende" +msgstr "Verder spelen" #: src/guiPauseMenu.cpp:133 msgid "Change Password" @@ -606,7 +606,7 @@ msgstr "Volume" #: src/guiPauseMenu.cpp:152 msgid "Exit to Menu" -msgstr "Exit naar menu" +msgstr "Terug naar menu" #: src/guiPauseMenu.cpp:161 msgid "Exit to OS" @@ -792,7 +792,7 @@ msgstr "Linker Windowstoets" #: src/keycode.cpp:233 msgid "Apps" -msgstr "Apps" +msgstr "Menu" #: src/keycode.cpp:233 msgid "Numpad 0" @@ -908,7 +908,7 @@ msgstr "Plus" #: src/keycode.cpp:247 msgid "Attn" -msgstr "Attn" +msgstr "SAK" #: src/keycode.cpp:247 msgid "CrSel" @@ -916,7 +916,7 @@ msgstr "CrSel" #: src/keycode.cpp:248 msgid "Erase OEF" -msgstr "Erase OEF" +msgstr "Erase EOF" #: src/keycode.cpp:248 msgid "ExSel" From ee9f4f11a33ebb8eca9e3977b441dafb3804621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederico=20Guimar=C3=A3es?= Date: Tue, 17 Sep 2013 15:15:04 +0200 Subject: [PATCH 021/198] Translated using Weblate (Portuguese (Brazil)) --- po/pt_BR/minetest.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/po/pt_BR/minetest.po b/po/pt_BR/minetest.po index 46c3b6b5d..1aa8ff2e1 100644 --- a/po/pt_BR/minetest.po +++ b/po/pt_BR/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-09-16 17:22+0200\n" +"PO-Revision-Date: 2013-09-17 15:15+0200\n" "Last-Translator: Frederico Guimarães \n" "Language-Team: LANGUAGE \n" "Language: pt_BR\n" @@ -123,7 +123,7 @@ msgstr "Configurações" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "Pacotes de texturas" +msgstr "Texturas" #: builtin/mainmenu.lua:863 msgid "Mods" @@ -180,7 +180,7 @@ msgstr "Selecione um mundo:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "INICIAR SERVIDOR" +msgstr "SERVIDOR" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -276,7 +276,7 @@ msgstr "Selecione o pacote de texturas:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "PACOTES DE TEXTURAS" +msgstr "TEXTURAS" #: builtin/mainmenu.lua:1043 msgid "No information available" From f86cdf0960eb12341545f5b708a35fd026880f22 Mon Sep 17 00:00:00 2001 From: William Strealy Date: Sat, 14 Sep 2013 04:33:28 +0200 Subject: [PATCH 022/198] Translated using Weblate (Spanish) --- po/es/minetest.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/es/minetest.po b/po/es/minetest.po index 923f4bbf1..6f87c2f24 100644 --- a/po/es/minetest.po +++ b/po/es/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-08-26 01:55+0200\n" -"Last-Translator: Diego Martínez \n" +"PO-Revision-Date: 2013-09-14 04:33+0200\n" +"Last-Translator: William Strealy \n" "Language-Team: LANGUAGE \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -37,7 +37,7 @@ msgstr "" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "JUEGOS" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 msgid "Games" @@ -45,7 +45,7 @@ msgstr "Juegos" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Modificaciónes:" #: builtin/gamemgr.lua:234 msgid "edit game" @@ -53,7 +53,7 @@ msgstr "editar juego" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "Juego Nuevo" +msgstr "juego nuevo" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" From 19742d8d985dbb0a63a406c881617da7aed50151 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Tue, 8 Oct 2013 22:41:53 +0200 Subject: [PATCH 023/198] Add support for parameter 'visual_scale' for drawtypes 'signlike' and 'torchlike' like used for drawtype 'plantlike' --- doc/lua_api.txt | 4 ++++ src/content_mapblock.cpp | 30 ++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 335f8af65..f89f71273 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1999,6 +1999,10 @@ Node definition (register_node) drawtype = "normal", -- See "Node drawtypes" visual_scale = 1.0, + ^ Supported for drawtypes "plantlike", "signlike", "torchlike". + ^ For plantlike, the image will start at the bottom of the node; for the + ^ other drawtypes, the image will be centered on the node. + ^ Note that positioning for "torchlike" may still change. tiles = {tile definition 1, def2, def3, def4, def5, def6}, ^ Textures of node; +Y, -Y, +X, -X, +Z, -Z (old field name: tile_images) ^ List can be shortened to needed length diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 929682eaf..3cded5bdb 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -908,13 +908,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data, u16 l = getInteriorLight(n, 1, data); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); + float s = BS/2*f.visual_scale; // Wall at X+ of node video::S3DVertex vertices[4] = { - video::S3DVertex(-BS/2,-BS/2,0, 0,0,0, c, 0,1), - video::S3DVertex(BS/2,-BS/2,0, 0,0,0, c, 1,1), - video::S3DVertex(BS/2,BS/2,0, 0,0,0, c, 1,0), - video::S3DVertex(-BS/2,BS/2,0, 0,0,0, c, 0,0), + video::S3DVertex(-s,-s,0, 0,0,0, c, 0,1), + video::S3DVertex( s,-s,0, 0,0,0, c, 1,1), + video::S3DVertex( s, s,0, 0,0,0, c, 1,0), + video::S3DVertex(-s, s,0, 0,0,0, c, 0,0), }; for(s32 i=0; i<4; i++) @@ -949,13 +950,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data, video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); float d = (float)BS/16; + float s = BS/2*f.visual_scale; // Wall at X+ of node video::S3DVertex vertices[4] = { - video::S3DVertex(BS/2-d,BS/2,BS/2, 0,0,0, c, 0,0), - video::S3DVertex(BS/2-d,BS/2,-BS/2, 0,0,0, c, 1,0), - video::S3DVertex(BS/2-d,-BS/2,-BS/2, 0,0,0, c, 1,1), - video::S3DVertex(BS/2-d,-BS/2,BS/2, 0,0,0, c, 0,1), + video::S3DVertex(BS/2-d, s, s, 0,0,0, c, 0,0), + video::S3DVertex(BS/2-d, s, -s, 0,0,0, c, 1,0), + video::S3DVertex(BS/2-d, -s, -s, 0,0,0, c, 1,1), + video::S3DVertex(BS/2-d, -s, s, 0,0,0, c, 0,1), }; v3s16 dir = n.getWallMountedDir(nodedef); @@ -990,16 +992,16 @@ void mapblock_mesh_generate_special(MeshMakeData *data, u16 l = getInteriorLight(n, 1, data); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); + float s = BS/2*f.visual_scale; + for(u32 j=0; j<2; j++) { video::S3DVertex vertices[4] = { - video::S3DVertex(-BS/2*f.visual_scale,-BS/2,0, 0,0,0, c, 0,1), - video::S3DVertex( BS/2*f.visual_scale,-BS/2,0, 0,0,0, c, 1,1), - video::S3DVertex( BS/2*f.visual_scale, - -BS/2 + f.visual_scale*BS,0, 0,0,0, c, 1,0), - video::S3DVertex(-BS/2*f.visual_scale, - -BS/2 + f.visual_scale*BS,0, 0,0,0, c, 0,0), + video::S3DVertex(-s,-BS/2, 0, 0,0,0, c, 0,1), + video::S3DVertex( s,-BS/2, 0, 0,0,0, c, 1,1), + video::S3DVertex( s,-BS/2 + s*2,0, 0,0,0, c, 1,0), + video::S3DVertex(-s,-BS/2 + s*2,0, 0,0,0, c, 0,0), }; if(j == 0) From 4e5760a5416cbca6945b1b4484cbd96bea7b250c Mon Sep 17 00:00:00 2001 From: Novatux Date: Sun, 6 Oct 2013 12:15:14 +0200 Subject: [PATCH 024/198] Fix minetest.facedir_to_dir when param2 is 5 or 7. --- builtin/item.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/item.lua b/builtin/item.lua index 5f3c71770..f07566b8c 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -98,7 +98,7 @@ function minetest.facedir_to_dir(facedir) --indexed into by a table of correlating facedirs [({[0]=1, 2, 3, 4, - 5, 2, 6, 4, + 5, 4, 6, 2, 6, 2, 5, 4, 1, 5, 3, 6, 1, 6, 3, 5, From 34e0a0ca0fbb6826ea0c583295f79307b1a754c6 Mon Sep 17 00:00:00 2001 From: Novatux Date: Mon, 6 May 2013 18:53:15 +0200 Subject: [PATCH 025/198] Add tool callback --- builtin/item.lua | 19 ++++++++++++------- doc/lua_api.txt | 9 +++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/builtin/item.lua b/builtin/item.lua index f07566b8c..7f20d30c5 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -383,14 +383,19 @@ function minetest.node_dig(pos, node, digger) local wielded = digger:get_wielded_item() local drops = minetest.get_node_drops(node.name, wielded:get_name()) - - -- Wear out tool - if not minetest.setting_getbool("creative_mode") then - local tp = wielded:get_tool_capabilities() - local dp = minetest.get_dig_params(def.groups, tp) - wielded:add_wear(dp.wear) - digger:set_wielded_item(wielded) + + local wdef = wielded:get_definition() + local tp = wielded:get_tool_capabilities() + local dp = minetest.get_dig_params(def.groups, tp) + if wdef and wdef.after_use then + wielded = wdef.after_use(wielded, digger, node, dp) or wielded + else + -- Wear out tool + if not minetest.setting_getbool("creative_mode") then + wielded:add_wear(dp.wear) + end end + digger:set_wielded_item(wielded) -- Handle drops minetest.handle_node_drops(pos, drops, digger) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index f89f71273..cfea3b5c1 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1980,6 +1980,15 @@ Item definition (register_node, register_craftitem, register_tool) eg. itemstack:take_item(); return itemstack ^ Otherwise, the function is free to do what it wants. ^ The default functions handle regular use cases. + after_use = func(itemstack, user, node, digparams), + ^ default: nil + ^ If defined, should return an itemstack and will be called instead of + wearing out the tool. If returns nil, does nothing. + If after_use doesn't exist, it is the same as: + function(itemstack, user, node, digparams) + itemstack:add_wear(digparams.wear) + return itemstack + end } Tile definition: From b3591019ad7e9bdce2a0a20cbbf64a769c1717c2 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 17 Oct 2013 00:10:16 +0300 Subject: [PATCH 026/198] Fix object duplication bug (at least in the most reproducible UFO case) --- src/environment.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ src/staticobject.h | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/environment.cpp b/src/environment.cpp index 03b436890..dd160d1f7 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1805,6 +1805,47 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) // The block in which the object resides in v3s16 blockpos_o = getNodeBlockPos(floatToInt(objectpos, BS)); + // If object's static data is stored in a deactivated block and object + // is actually located in an active block, re-save to the block in + // which the object is actually located in. + if(!force_delete && + obj->m_static_exists && + !m_active_blocks.contains(obj->m_static_block) && + m_active_blocks.contains(blockpos_o)) + { + v3s16 old_static_block = obj->m_static_block; + + // Save to block where object is located + MapBlock *block = m_map->emergeBlock(blockpos_o, false); + if(!block){ + errorstream<<"ServerEnvironment::deactivateFarObjects(): " + <<"Could not save object id="<getStaticData(); + StaticObject s_obj(obj->getType(), objectpos, staticdata_new); + block->m_static_objects.insert(id, s_obj); + obj->m_static_block = blockpos_o; + block->raiseModified(MOD_STATE_WRITE_NEEDED, + "deactivateFarObjects: Static data moved in"); + + // Delete from block where object was located + block = m_map->emergeBlock(old_static_block, false); + if(!block){ + errorstream<<"ServerEnvironment::deactivateFarObjects(): " + <<"Could not delete object id="<m_static_objects.remove(id); + block->raiseModified(MOD_STATE_WRITE_NEEDED, + "deactivateFarObjects: Static data moved out"); + continue; + } + // If block is active, don't remove if(!force_delete && m_active_blocks.contains(blockpos_o)) continue; diff --git a/src/staticobject.h b/src/staticobject.h index 640747e96..575c15b18 100644 --- a/src/staticobject.h +++ b/src/staticobject.h @@ -54,7 +54,7 @@ class StaticObjectList public: /* Inserts an object to the container. - Id must be unique or 0. + Id must be unique (active) or 0 (stored). */ void insert(u16 id, StaticObject obj) { From 12504a18ec5b76df037482ea2cf435d8c320efbc Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Mon, 16 Sep 2013 16:13:39 -0400 Subject: [PATCH 027/198] Remove vector metatable setting This not only makes the vector functions faster, but also makes them more consistent with other functions. --- builtin/vector.lua | 72 +++++++++++++++++----------------------------- doc/lua_api.txt | 12 +------- 2 files changed, 28 insertions(+), 56 deletions(-) diff --git a/builtin/vector.lua b/builtin/vector.lua index 839f139ca..7faa2c17d 100644 --- a/builtin/vector.lua +++ b/builtin/vector.lua @@ -2,22 +2,12 @@ vector = {} function vector.new(a, b, c) - v = {x=0, y=0, z=0} if type(a) == "table" then - v = {x=a.x, y=a.y, z=a.z} + return {x=a.x, y=a.y, z=a.z} elseif a and b and c then - v = {x=a, y=b, z=c} + return {x=a, y=b, z=c} end - setmetatable(v, { - __add = vector.add, - __sub = vector.subtract, - __mul = vector.multiply, - __div = vector.divide, - __umn = function(v) return vector.multiply(v, -1) end, - __len = vector.length, - __eq = vector.equals, - }) - return v + return {x=0, y=0, z=0} end function vector.equals(a, b) @@ -85,57 +75,49 @@ end function vector.add(a, b) if type(b) == "table" then - return vector.new( - a.x + b.x, - a.y + b.y, - a.z + b.z) + return {x = a.x + b.x, + y = a.y + b.y, + z = a.z + b.z} else - return vector.new( - a.x + b, - a.y + b, - a.z + b) + return {x = a.x + b, + y = a.y + b, + z = a.z + b} end end function vector.subtract(a, b) if type(b) == "table" then - return vector.new( - a.x - b.x, - a.y - b.y, - a.z - b.z) + return {x = a.x - b.x, + y = a.y - b.y, + z = a.z - b.z} else - return vector.new( - a.x - b, - a.y - b, - a.z - b) + return {x = a.x - b, + y = a.y - b, + z = a.z - b} end end function vector.multiply(a, b) if type(b) == "table" then - return vector.new( - a.x * b.x, - a.y * b.y, - a.z * b.z) + return {x = a.x * b.x, + y = a.y * b.y, + z = a.z * b.z} else - return vector.new( - a.x * b, - a.y * b, - a.z * b) + return {x = a.x * b, + y = a.y * b, + z = a.z * b} end end function vector.divide(a, b) if type(b) == "table" then - return vector.new( - a.x / b.x, - a.y / b.y, - a.z / b.z) + return {x = a.x / b.x, + y = a.y / b.y, + z = a.z / b.z} else - return vector.new( - a.x / b, - a.y / b, - a.z / b) + return {x = a.x / b, + y = a.y / b, + z = a.z / b} end end diff --git a/doc/lua_api.txt b/doc/lua_api.txt index cfea3b5c1..5a0d5817f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1037,22 +1037,12 @@ vector.length(v) -> number vector.normalize(v) -> vector vector.round(v) -> vector vector.equal(v1, v2) -> bool +For the folowing x can be either a vector or a number. vector.add(v, x) -> vector - ^ x can be annother vector or a number vector.subtract(v, x) -> vector vector.multiply(v, x) -> vector vector.divide(v, x) -> vector -You can also use Lua operators on vectors. -For example: - v1 = vector.new() - v1 = v1 + 5 - v2 = vector.new(v1) - v1 = v1 * v2 - if v1 == v2 then - error("Math broke") - end - Helper functions ----------------- dump2(obj, name="_", dumped={}) From e232f7311f62e600189f1397fdd29a65ae186b1f Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 15 Sep 2013 22:47:39 -0400 Subject: [PATCH 028/198] Add sanity checks to vector functions --- builtin/vector.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/builtin/vector.lua b/builtin/vector.lua index 7faa2c17d..698309c4a 100644 --- a/builtin/vector.lua +++ b/builtin/vector.lua @@ -2,25 +2,30 @@ vector = {} function vector.new(a, b, c) + assert(a) if type(a) == "table" then return {x=a.x, y=a.y, z=a.z} - elseif a and b and c then + else + assert(b and c) return {x=a, y=b, z=c} end return {x=0, y=0, z=0} end function vector.equals(a, b) + assert(a and b) return a.x == b.x and a.y == b.y and a.z == b.z end function vector.length(v) + assert(v) return math.hypot(v.x, math.hypot(v.y, v.z)) end function vector.normalize(v) + assert(v) local len = vector.length(v) if len == 0 then return vector.new() @@ -30,6 +35,7 @@ function vector.normalize(v) end function vector.round(v) + assert(v) return { x = math.floor(v.x + 0.5), y = math.floor(v.y + 0.5), @@ -38,6 +44,7 @@ function vector.round(v) end function vector.distance(a, b) + assert(a and b) local x = a.x - b.x local y = a.y - b.y local z = a.z - b.z @@ -45,6 +52,7 @@ function vector.distance(a, b) end function vector.direction(pos1, pos2) + assert(pos1 and pos2) local x_raw = pos2.x - pos1.x local y_raw = pos2.y - pos1.y local z_raw = pos2.z - pos1.z @@ -74,6 +82,7 @@ end function vector.add(a, b) + assert(a and b) if type(b) == "table" then return {x = a.x + b.x, y = a.y + b.y, @@ -86,6 +95,7 @@ function vector.add(a, b) end function vector.subtract(a, b) + assert(a and b) if type(b) == "table" then return {x = a.x - b.x, y = a.y - b.y, @@ -98,6 +108,7 @@ function vector.subtract(a, b) end function vector.multiply(a, b) + assert(a and b) if type(b) == "table" then return {x = a.x * b.x, y = a.y * b.y, @@ -110,6 +121,7 @@ function vector.multiply(a, b) end function vector.divide(a, b) + assert(a and b) if type(b) == "table" then return {x = a.x / b.x, y = a.y / b.y, From a924409bd1c57fb96e67a1c6cea0b7331d11cb73 Mon Sep 17 00:00:00 2001 From: proller Date: Fri, 18 Oct 2013 01:32:49 +0400 Subject: [PATCH 029/198] Masterserver update --- src/server.cpp | 7 +-- src/server.h | 2 +- src/serverlist.cpp | 19 +++--- src/serverlist.h | 4 +- util/master/index.html | 1 + util/master/list.js | 131 ++++++++++++++++++++++++++--------------- util/master/master.cgi | 21 ++++++- util/master/style.css | 6 +- 8 files changed, 126 insertions(+), 65 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index c144be1ba..8350b7013 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -673,7 +673,6 @@ Server::Server( m_objectdata_timer = 0.0; m_emergethread_trigger_timer = 0.0; m_savemap_timer = 0.0; - m_clients_number = 0; m_env_mutex.Init(); m_con_mutex.Init(); @@ -1244,7 +1243,7 @@ void Server::AsyncRunStep() counter = 0.0; JMutexAutoLock lock2(m_con_mutex); - m_clients_number = 0; + m_clients_names.clear(); if(m_clients.size() != 0) infostream<<"Players:"<::iterator @@ -1258,7 +1257,7 @@ void Server::AsyncRunStep() continue; infostream<<"* "<getName()<<"\t"; client->PrintInfo(infostream); - ++m_clients_number; + m_clients_names.push_back(player->getName()); } } } @@ -1270,7 +1269,7 @@ void Server::AsyncRunStep() float &counter = m_masterserver_timer; if(!isSingleplayer() && (!counter || counter >= 300.0) && g_settings->getBool("server_announce") == true) { - ServerList::sendAnnounce(!counter ? "start" : "update", m_clients_number, m_uptime.get(), m_gamespec.id, m_mods); + ServerList::sendAnnounce(!counter ? "start" : "update", m_clients_names, m_uptime.get(), m_env->getGameTime(), m_gamespec.id, m_mods); counter = 0.01; } counter += dtime; diff --git a/src/server.h b/src/server.h index bc7829f74..b52ae02dc 100644 --- a/src/server.h +++ b/src/server.h @@ -685,7 +685,7 @@ private: JMutex m_con_mutex; // Connected clients (behind the con mutex) std::map m_clients; - u16 m_clients_number; //for announcing masterserver + std::vector m_clients_names; //for announcing masterserver // Ban checking BanManager *m_banmanager; diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 908f048cb..fb5bc9c87 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -194,11 +194,11 @@ static size_t ServerAnnounceCallback(void *contents, size_t size, size_t nmemb, //((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } -void sendAnnounce(std::string action, u16 clients, double uptime, std::string gameid, std::vector m_mods) { +void sendAnnounce(std::string action, const std::vector & clients_names, double uptime, u32 game_time, std::string gameid, std::vector mods) { Json::Value server; if (action.size()) server["action"] = action; - server["port"] = g_settings->get("port"); + server["port"] = g_settings->get("port"); server["address"] = g_settings->get("server_address"); if (action != "delete") { server["name"] = g_settings->get("server_name"); @@ -209,10 +209,15 @@ void sendAnnounce(std::string action, u16 clients, double uptime, std::string ga server["damage"] = g_settings->get("enable_damage"); server["password"] = g_settings->getBool("disallow_empty_password"); server["pvp"] = g_settings->getBool("enable_pvp"); - server["clients"] = clients; + server["clients"] = (int)clients_names.size(); server["clients_max"] = g_settings->get("max_users"); - if (uptime >=1) server["uptime"] = (int)uptime; - if (gameid!="") server["gameid"] = gameid; + server["clients_list"] = Json::Value(Json::arrayValue); + for(u32 i = 0; i < clients_names.size(); ++i) { + server["clients_list"].append(clients_names[i]); + } + if (uptime >= 1) server["uptime"] = (int)uptime; + if (gameid != "") server["gameid"] = gameid; + if (game_time >= 1) server["game_time"] = game_time; } if(server["action"] == "start") { @@ -220,8 +225,8 @@ void sendAnnounce(std::string action, u16 clients, double uptime, std::string ga server["rollback"] = g_settings->getBool("enable_rollback_recording"); server["liquid_finite"] = g_settings->getBool("liquid_finite"); server["mapgen"] = g_settings->get("mg_name"); - server["mods"] = Json::Value(Json::arrayValue); - for(std::vector::iterator m = m_mods.begin(); m != m_mods.end(); m++) { + server["mods"] = Json::Value(Json::arrayValue); + for(std::vector::iterator m = mods.begin(); m != mods.end(); m++) { server["mods"].append(m->name); } actionstream << "announcing to " << g_settings->get("serverlist_url") << std::endl; diff --git a/src/serverlist.h b/src/serverlist.h index 365e86beb..77eb29b14 100644 --- a/src/serverlist.h +++ b/src/serverlist.h @@ -40,7 +40,9 @@ namespace ServerList std::vector deSerializeJson(std::string liststring); std::string serializeJson(std::vector); #if USE_CURL - void sendAnnounce(std::string action = "", u16 clients = 0, double uptime = 0, std::string gameid = "", std::vector m_mods = std::vector()); + void sendAnnounce(std::string action = "", const std::vector & clients_names = std::vector(), + double uptime = 0, u32 game_time = 0,std::string gameid = "", + std::vector mods = std::vector()); #endif } //ServerList namespace diff --git a/util/master/index.html b/util/master/index.html index 328dd8934..ad908fca8 100644 --- a/util/master/index.html +++ b/util/master/index.html @@ -8,4 +8,5 @@
+ diff --git a/util/master/list.js b/util/master/list.js index a17458fb4..b5974619a 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -1,7 +1,13 @@ var master_root, output_to; +var master; +if (!master) master = { + root: master_root, + output: output_to +}; function e(s) { if (typeof s === "undefined") s = ''; + if (typeof s === "number") return s; return s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); //mc" } @@ -41,55 +47,88 @@ function human_time(t, abs) { function success(r) { if (!r || !r.list) return; - var h = ''; - for (var i = 0; i < r.list.length; ++i) { - var s = r.list[i]; - if (!s) continue; - if (/:/.test(s.address)) s.address = '[' + s.address + ']'; - h += ''; - h += ''; - h += ''; - var mods = 0; - if (s.mods && jQuery.isArray(s.mods)) { - mods = s.mods.length; - } - h += ''; - - h += ''; - h += ''; - h += ''; - if (!s.start || s.start < 0) s.start = 0; - h += ''; - h += ''; + var h = ''; + if (!master.no_total && r.total) + h += '
Now players: ' + r.total.clients + ' servers: ' + r.total.servers + '
'; + if (!master.no_total_max && r.total_max) + h += '
Max players: ' + r.total_max.clients + ' servers: ' + r.total_max.servers + '
'; + h += '
ip[:port]clients/maxversion gameid mapgennamedescriptionflagsuptimeping
' + e(s.address) + (s.port != 30000 ? (':' + e(s.port)) : '') + '' + e(s.clients) + (s.clients_max ? '/' + e(s.clients_max) : '') + (s.clients_top ? ', ' + e(s.clients_top) : '') + '' + e(s.version) + ' ' + e(s.gameid) + ' ' + e(s.mapgen); - if (mods) { - h += '
Mods ('+mods+'):
'; - for (m in s.mods) { - h += s.mods[m] + '
'; - } - h += '
'; - } - - h += '
'; - if (s.url) h += ''; - h += e(s.name || s.url); - if (s.url) h += ''; - h += '' + e(s.description) + '' + - (s.password ? 'Pwd ' : '') + - (s.creative ? 'Cre ' : '') + - (s.damage ? 'Dmg ' : '') + - (s.pvp ? 'Pvp ' : '') + - (s.dedicated ? 'Ded ' : '') + - (s.rollback ? 'Rol ' : '') + - (s.liquid_finite ? 'Liq ' : '') + - '' + (s.uptime ? human_time(s.uptime, 1) : s.start ? human_time(s.start) : '') + '' + (s.ping ? parseFloat(s.ping).toFixed(3) * 1000 : '') + '
'; + if (r.list.length) { + h += ''; + if (!master.no_address) h += ''; + if (!master.no_clients) h += ''; + if (!master.no_version) h += ''; + if (!master.no_name) h += ''; + if (!master.no_description) h += ''; + if (!master.no_flags) h += ''; + if (!master.no_uptime) h += ''; + if (!master.no_ping) h += ''; h += ''; } - h += '
ip[:port]players/maxversion gameid mapgennamedescriptionflagsuptime ageping
' - jQuery(output_to || '#servers_table').html(h); + var count = 0; + for (var i = 0; i < r.list.length; ++i) { + if (++count > master.limit && master.limit) break; + var s = r.list[i]; + if (!s) continue; + if (master.clients_min && s.clients < master.clients_min) continue; + if (/:/.test(s.address)) s.address = '[' + s.address + ']'; + h += ''; + if (!master.no_address) h += '' + e(s.address) + (s.port != 30000 ? (':' + e(s.port)) : '') + ''; + if (!master.no_clients) { + h += ''; + if (!master.no_clients_list && s.clients && s.clients_list) { + h += '
Players (' + e(s.clients) + '):
'; + for (var ii in s.clients_list) + h += e(s.clients_list[ii]) + '
'; + h += '
'; + } + h += e(s.clients) + (s.clients_max ? '/' + e(s.clients_max) : '') + (s.clients_top ? ', ' + e(s.clients_top) : '') + ''; + } + var mods = 0; + if (s.mods && jQuery.isArray(s.mods)) + mods = s.mods.length; + if (!master.no_version) { + h += '' + e(s.version) + ' ' + e(s.gameid) + ' ' + e(s.mapgen); + if (!master.no_mods && mods) { + h += '
Mods (' + mods + '):
'; + for (var ii in s.mods) + h += e(s.mods[ii]) + '
'; + h += '
'; + } + h += ''; + } + if (!master.no_name) { + h += ''; + if (s.url) h += ''; + h += e(s.name || s.url); + if (s.url) h += ''; + h += ''; + } + if (!master.no_description) h += '' + e(s.description) + ''; + if (!master.no_flags) { + h += '' + + (s.password ? 'Pwd ' : '') + + (s.creative ? 'Cre ' : '') + + (s.damage ? 'Dmg ' : '') + + (s.pvp ? 'Pvp ' : '') + + (s.dedicated ? 'Ded ' : '') + + (s.rollback ? 'Rol ' : '') + + (s.liquid_finite ? 'Liq ' : '') + + ''; + } + if (!s.start || s.start < 0) s.start = 0; + if (!master.no_uptime) h += '' + (s.uptime ? human_time(s.uptime, 1) : s.start ? human_time(s.start) : '') + (s.game_time ? ' ' + human_time(s.game_time, 1) : '') + ''; + if (!master.no_ping) h += '' + (s.ping ? parseFloat(s.ping).toFixed(3) * 1000 : '') + ''; + h += ''; + } + h += ''; + if (master.clients_min || master.limit) + h += 'more...'; + jQuery(master.output || '#servers_table').html(h); } -function get() { - jQuery.getJSON((master_root || '') + 'list', success); - setTimeout(get, 60000); +function get(refresh) { + jQuery.getJSON((master.root || '') + 'list', success); + if (!refresh && !master.no_refresh) setTimeout(get, 60000); } get(); diff --git a/util/master/master.cgi b/util/master/master.cgi index bf627a989..a916827fe 100755 --- a/util/master/master.cgi +++ b/util/master/master.cgi @@ -3,7 +3,7 @@ =info install: cpan JSON JSON::XS - touch list_full list + touch list_full list log.log chmod a+rw list_full list log.log freebsd: @@ -48,6 +48,7 @@ use strict; no strict qw(refs); use warnings "NONFATAL" => "all"; no warnings qw(uninitialized); +no if $] >= 5.017011, warnings => 'experimental::smartmatch'; use utf8; use Socket; BEGIN { @@ -72,7 +73,7 @@ our %config = ( list_full => $root_path . 'list_full', list_pub => $root_path . 'list', log => $root_path . 'log.log', - time_purge => 86400 * 30, + time_purge => 86400 * 1, time_alive => 650, source_check => 1, ping_timeout => 3, @@ -190,11 +191,13 @@ sub request (;$) { $param->{$_} = $j->{$_} for keys %$j; delete $param->{json}; } + #printlog 'recv', Dumper $param; if (%$param) { s/^false$// for values %$param; $param->{ip} = $r->{REMOTE_ADDR}; $param->{ip} =~ s/^::ffff://; for (@{$config{blacklist}}) { + #printlog("blacklist", $param->{ip} ~~ $_) if $config{debug}; return if $param->{ip} ~~ $_; } $param->{address} ||= $param->{ip}; @@ -223,6 +226,7 @@ sub request (;$) { $param->{ping} = $duration if $pingret; printlog " PING t=$config{ping_timeout}, $param->{address}:$param->{port} = ( $pingret, $duration, $ip )" if $config{debug}; } + return if !$param->{ping}; } my $list = read_json($config{list_full}) || {}; printlog "readed[$config{list_full}] list size=", scalar @{$list->{list}}; @@ -232,6 +236,7 @@ sub request (;$) { $param->{time} ||= int time; $param->{start} = $param->{action} ~~ 'start' ? $param->{time} : $old->{start} || $param->{time}; delete $param->{start} if $param->{off}; + $param->{clients} ||= scalar @{$param->{clients_list}} if ref $param->{clients_list} eq 'ARRAY'; $param->{first} ||= $old->{first} || $old->{time} || $param->{time}; $param->{clients_top} = $old->{clients_top} if $old->{clients_top} > $param->{clients}; $param->{clients_top} ||= $param->{clients} || 0; @@ -239,9 +244,12 @@ sub request (;$) { for (qw(dedicated rollback liquid_finite mapgen mods)) { $param->{$_} ||= $old->{$_} if $old->{$_} and !($param->{action} ~~ 'start'); } + $param->{pop_n} = $old->{pop_n} + 1; + $param->{pop_c} = $old->{pop_c} + $param->{clients}; + $param->{pop_v} = $param->{pop_c} / $param->{pop_n}; delete $param->{action}; $listk->{$param->{key}} = $param; - #printlog Dumper $param; + #printlog 'write', Dumper $param if $config{debug}; $list->{list} = [grep { $_->{time} > time - $config{time_purge} } values %$listk]; file_rewrite($config{list_full}, JSON->new->encode($list)); printlog "writed[$config{list_full}] list size=", scalar @{$list->{list}} if $config{debug}; @@ -250,6 +258,13 @@ sub request (;$) { grep { $_->{time} > time - $config{time_alive} and !$_->{off} and (!$config{ping} or !$config{pingable} or $_->{ping}) } @{$list->{list}} ]; + $list->{total} = {clients => 0, servers => 0}; + for (@{$list->{list}}) { + $list->{total}{clients} += $_->{clients}; + ++$list->{total}{servers}; + } + $list->{total_max}{clients} = $list->{total}{clients} if $list->{total_max}{clients} < $list->{total}{clients}; + $list->{total_max}{servers} = $list->{total}{servers} if $list->{total_max}{servers} < $list->{total}{servers}; file_rewrite($config{list_pub}, JSON->new->encode($list)); printlog "writed[$config{list_pub}] list size=", scalar @{$list->{list}} if $config{debug}; } diff --git a/util/master/style.css b/util/master/style.css index c92c56f6e..cff041216 100644 --- a/util/master/style.css +++ b/util/master/style.css @@ -13,7 +13,7 @@ div#table table { width: 100%; } -.mts_mods { +.mts_mods, .mts_clients_list { visibility: hidden; border:gray solid 1px; position:absolute; @@ -22,11 +22,11 @@ div#table table { padding:.5em; } -.mts_version:hover .mts_mods { +.mts_version:hover .mts_mods, .mts_clients:hover .mts_clients_list { visibility: visible; } -.mts_version.mts_ismods { +.mts_version.mts_is_mods, .mts_clients.mts_is_clients { text-decoration:underline; text-decoration-style:dashed; } From 382357d61cde9d6d1b3cb94053ab1127db9d5462 Mon Sep 17 00:00:00 2001 From: proller Date: Fri, 18 Oct 2013 21:56:34 +0400 Subject: [PATCH 030/198] Masterserver totals fix --- util/master/list.js | 6 ++---- util/master/master.cgi | 15 ++++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/util/master/list.js b/util/master/list.js index b5974619a..4e2104bc8 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -48,10 +48,8 @@ function human_time(t, abs) { function success(r) { if (!r || !r.list) return; var h = ''; - if (!master.no_total && r.total) - h += '
Now players: ' + r.total.clients + ' servers: ' + r.total.servers + '
'; - if (!master.no_total_max && r.total_max) - h += '
Max players: ' + r.total_max.clients + ' servers: ' + r.total_max.servers + '
'; + if (!master.no_total && r.total && r.total_max) + h += '
Players: ' + r.total.clients + ('/' + r.total_max.clients) + ' servers: ' + r.total.servers + ('/' + r.total_max.servers) + '
'; h += ''; if (r.list.length) { h += ''; diff --git a/util/master/master.cgi b/util/master/master.cgi index a916827fe..6dbf83fca 100755 --- a/util/master/master.cgi +++ b/util/master/master.cgi @@ -229,7 +229,7 @@ sub request (;$) { return if !$param->{ping}; } my $list = read_json($config{list_full}) || {}; - printlog "readed[$config{list_full}] list size=", scalar @{$list->{list}}; + printlog "readed[$config{list_full}] list size=", scalar @{$list->{list}} if $config{debug}; my $listk = {map { $_->{key} => $_ } @{$list->{list}}}; my $old = $listk->{$param->{key}}; $param->{time} = $old->{time} if $param->{off}; @@ -250,13 +250,12 @@ sub request (;$) { delete $param->{action}; $listk->{$param->{key}} = $param; #printlog 'write', Dumper $param if $config{debug}; - $list->{list} = [grep { $_->{time} > time - $config{time_purge} } values %$listk]; - file_rewrite($config{list_full}, JSON->new->encode($list)); - printlog "writed[$config{list_full}] list size=", scalar @{$list->{list}} if $config{debug}; + my $list_full = [grep { $_->{time} > time - $config{time_purge} } values %$listk]; + $list->{list} = [ sort { $b->{clients} <=> $a->{clients} || $a->{start} <=> $b->{start} } grep { $_->{time} > time - $config{time_alive} and !$_->{off} and (!$config{ping} or !$config{pingable} or $_->{ping}) } - @{$list->{list}} + @{$list_full} ]; $list->{total} = {clients => 0, servers => 0}; for (@{$list->{list}}) { @@ -265,8 +264,14 @@ sub request (;$) { } $list->{total_max}{clients} = $list->{total}{clients} if $list->{total_max}{clients} < $list->{total}{clients}; $list->{total_max}{servers} = $list->{total}{servers} if $list->{total_max}{servers} < $list->{total}{servers}; + file_rewrite($config{list_pub}, JSON->new->encode($list)); printlog "writed[$config{list_pub}] list size=", scalar @{$list->{list}} if $config{debug}; + + $list->{list} = $list_full; + file_rewrite($config{list_full}, JSON->new->encode($list)); + printlog "writed[$config{list_full}] list size=", scalar @{$list->{list}} if $config{debug}; + } }; return [200, ["Content-type", "application/json"], [JSON->new->encode({})]], $after; From 6e17503208e7edf1bd74ce4d57b09b1830571ec7 Mon Sep 17 00:00:00 2001 From: Novatux Date: Fri, 1 Nov 2013 12:27:50 +0100 Subject: [PATCH 031/198] Move new core devs to the "Core Developpers" section of mainmenu. --- builtin/mainmenu.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 5a1b6e929..0f34c67ea 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -1069,14 +1069,15 @@ function tabbuilder.tab_credits() "proller ,".. "sfan5 ,".. "kahrl ,".. + "sapier,".. + "ShadowNinja,".. + "Nathanaël Courant (Nore/Novatux) ,".. ",".. "#FFFF00" .. fgettext("Active Contributors") .. "," .. - "sapier,".. "Vanessa Ezekowitz (VanessaE) ,".. "Jurgen Doser (doserj) ,".. "Jeija ,".. "MirceaKitsune ,".. - "ShadowNinja,".. "dannydark ,".. "0gb.us <0gb.us@0gb.us>,".. "," .. From 8bc68645cb0c0145c8229bc6876bf590a8eef0ca Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 30 Oct 2013 15:46:52 -0400 Subject: [PATCH 032/198] Raise the maximum node limit to 0x7fff As agreed to by kahrl --- src/mapnode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapnode.h b/src/mapnode.h index 3c6208436..f19885d87 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -43,7 +43,7 @@ typedef u16 content_t; there is enough room for dummy node IDs, which are created when a MapBlock containing unknown node names is loaded from disk. */ -#define MAX_REGISTERED_CONTENT 0xfffU +#define MAX_REGISTERED_CONTENT 0x7fffU /* A solid walkable node with the texture unknown_node.png. From 2f10cfb226c6de8024f5efa9bf14ea22b5b90ce2 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Tue, 1 Oct 2013 17:14:58 -0400 Subject: [PATCH 033/198] Made unknown nodes stop falling nodes properly and shorten lines --- builtin/falling.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/builtin/falling.lua b/builtin/falling.lua index 605252b7b..c8f3bc556 100644 --- a/builtin/falling.lua +++ b/builtin/falling.lua @@ -54,19 +54,25 @@ minetest.register_entity("__builtin:falling_node", { local pos = self.object:getpos() local bcp = {x=pos.x, y=pos.y-0.7, z=pos.z} -- Position of bottom center point local bcn = minetest.get_node(bcp) + local bcd = minetest.registered_nodes[bcn.name] -- Note: walkable is in the node definition, not in item groups - if minetest.registered_nodes[bcn.name] and - minetest.registered_nodes[bcn.name].walkable or - (minetest.get_node_group(self.node.name, "float") ~= 0 and minetest.registered_nodes[bcn.name].liquidtype ~= "none") - then - if minetest.registered_nodes[bcn.name].leveled and bcn.name == self.node.name then + if not bcd or + (bcd.walkable or + (minetest.get_node_group(self.node.name, "float") ~= 0 and + bcd.liquidtype ~= "none")) then + if bcd and bcd.leveled and + bcn.name == self.node.name then local addlevel = self.node.level - if addlevel == nil or addlevel <= 0 then addlevel = minetest.registered_nodes[bcn.name].leveled end - if minetest.env:add_node_level(bcp, addlevel) == 0 then + if addlevel == nil or addlevel <= 0 then + addlevel = bcd.leveled + end + if minetest.add_node_level(bcp, addlevel) == 0 then self.object:remove() return end - elseif minetest.registered_nodes[bcn.name].buildable_to and (minetest.get_node_group(self.node.name, "float") == 0 or minetest.registered_nodes[bcn.name].liquidtype == "none") then + elseif bcd and bcd.buildable_to and + (minetest.get_node_group(self.node.name, "float") == 0 or + bcd.liquidtype == "none") then minetest.remove_node(bcp) return end From bd6d4666abe20247437ede28f73955d413fe5e22 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 26 Oct 2013 11:25:28 +0200 Subject: [PATCH 034/198] Add a callback: minetest.register_on_craft(itemstack, player, old_craft_grid, craft_inv) and minetest.register_craft_predict(itemstack, player, old_craft_grid, craft_inv) --- builtin/misc_register.lua | 16 +++++++++++ doc/lua_api.txt | 9 +++++++ src/inventorymanager.cpp | 8 ++++++ src/script/cpp_api/s_item.cpp | 51 +++++++++++++++++++++++++++++++++++ src/script/cpp_api/s_item.h | 6 +++++ src/server.cpp | 3 +++ 6 files changed, 93 insertions(+) diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index f1d816124..aa8399f16 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -230,6 +230,20 @@ function minetest.register_biome(biome) register_biome_raw(biome) end +function minetest.on_craft(itemstack, player, old_craft_list, craft_inv) + for _, func in ipairs(minetest.registered_on_crafts) do + itemstack = func(itemstack, player, old_craft_list, craft_inv) or itemstack + end + return itemstack +end + +function minetest.craft_predict(itemstack, player, old_craft_list, craft_inv) + for _, func in ipairs(minetest.registered_craft_predicts) do + itemstack = func(itemstack, player, old_craft_list, craft_inv) or itemstack + end + return itemstack +end + -- Alias the forbidden item names to "" so they can't be -- created via itemstrings (e.g. /give) local name @@ -327,4 +341,6 @@ minetest.registered_on_joinplayers, minetest.register_on_joinplayer = make_regis minetest.registered_on_leaveplayers, minetest.register_on_leaveplayer = make_registration() minetest.registered_on_player_receive_fields, minetest.register_on_player_receive_fields = make_registration_reverse() minetest.registered_on_cheats, minetest.register_on_cheat = make_registration() +minetest.registered_on_crafts, minetest.register_on_craft = make_registration() +minetest.registered_craft_predicts, minetest.register_craft_predict = make_registration() diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 5a0d5817f..e94fd30a9 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1145,6 +1145,15 @@ minetest.register_on_player_receive_fields(func(player, formname, fields)) minetest.register_on_mapgen_init(func(MapgenParams)) ^ Called just before the map generator is initialized but before the environment is initialized ^ MapgenParams consists of a table with the fields mgname, seed, water_level, and flags +minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv)) +^ Called when player crafts something +^ itemstack is the output +^ old_craft_grid contains the recipe (Note: the one in the inventory is cleared) +^ craft_inv is the inventory with the crafting grid +^ Return either an ItemStack, to replace the output, or nil, to not modify it +minetest.register_craft_predict(func(itemstack, player, old_craft_grid, craft_inv)) +^ The same as before, except that it is called before the player crafts, to make +^ craft prediction, and it should not change anything. Other registration functions: minetest.register_chatcommand(cmd, chatcommand definition) diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index c81f7a19e..1c511e9cb 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -724,13 +724,19 @@ void ICraftAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGam } ItemStack crafted; + ItemStack craftresultitem; int count_remaining = count; bool found = getCraftingResult(inv_craft, crafted, false, gamedef); + PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv); + found = !crafted.empty(); while(found && list_craftresult->itemFits(0, crafted)) { + InventoryList saved_craft_list = *list_craft; + // Decrement input and add crafting output getCraftingResult(inv_craft, crafted, true, gamedef); + PLAYER_TO_SA(player)->item_OnCraft(crafted, player, &saved_craft_list, craft_inv); list_craftresult->addItem(0, crafted); mgr->setInventoryModified(craft_inv); @@ -747,6 +753,8 @@ void ICraftAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGam // Get next crafting result found = getCraftingResult(inv_craft, crafted, false, gamedef); + PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv); + found = !crafted.empty(); } infostream<<"ICraftAction::apply(): crafted " diff --git a/src/script/cpp_api/s_item.cpp b/src/script/cpp_api/s_item.cpp index b4536ac63..1d5f218cf 100644 --- a/src/script/cpp_api/s_item.cpp +++ b/src/script/cpp_api/s_item.cpp @@ -22,9 +22,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common/c_converter.h" #include "common/c_content.h" #include "lua_api/l_item.h" +#include "lua_api/l_inventory.h" #include "server.h" #include "log.h" #include "util/pointedthing.h" +#include "inventory.h" +#include "inventorymanager.h" bool ScriptApiItem::item_OnDrop(ItemStack &item, ServerActiveObject *dropper, v3f pos) @@ -86,6 +89,54 @@ bool ScriptApiItem::item_OnUse(ItemStack &item, return true; } +bool ScriptApiItem::item_OnCraft(ItemStack &item, ServerActiveObject *user, + const InventoryList *old_craft_grid, const InventoryLocation &craft_inv) +{ + SCRIPTAPI_PRECHECKHEADER + + lua_getglobal(L, "minetest"); + lua_getfield(L, -1, "on_craft"); + LuaItemStack::create(L, item); + objectrefGetOrCreate(user); + + //Push inventory list + std::vector items; + for(u32 i=0; igetSize(); i++) + items.push_back(old_craft_grid->getItem(i)); + push_items(L, items); + + InvRef::create(L, craft_inv); + if(lua_pcall(L, 4, 1, 0)) + scriptError("error: %s", lua_tostring(L, -1)); + if(!lua_isnil(L, -1)) + item = read_item(L,-1, getServer()); + return true; +} + +bool ScriptApiItem::item_CraftPredict(ItemStack &item, ServerActiveObject *user, + const InventoryList *old_craft_grid, const InventoryLocation &craft_inv) +{ + SCRIPTAPI_PRECHECKHEADER + + lua_getglobal(L, "minetest"); + lua_getfield(L, -1, "craft_predict"); + LuaItemStack::create(L, item); + objectrefGetOrCreate(user); + + //Push inventory list + std::vector items; + for(u32 i=0; igetSize(); i++) + items.push_back(old_craft_grid->getItem(i)); + push_items(L, items); + + InvRef::create(L, craft_inv); + if(lua_pcall(L, 4, 1, 0)) + scriptError("error: %s", lua_tostring(L, -1)); + if(!lua_isnil(L, -1)) + item = read_item(L,-1, getServer()); + return true; +} + // Retrieves minetest.registered_items[name][callbackname] // If that is nil or on error, return false and stack is unchanged // If that is a function, returns true and pushes the diff --git a/src/script/cpp_api/s_item.h b/src/script/cpp_api/s_item.h index 0f2b16042..4964dd5b4 100644 --- a/src/script/cpp_api/s_item.h +++ b/src/script/cpp_api/s_item.h @@ -29,6 +29,8 @@ class ServerActiveObject; struct ItemDefinition; class LuaItemStack; class ModApiItemMod; +class InventoryList; +class InventoryLocation; class ScriptApiItem : virtual public ScriptApiBase @@ -40,6 +42,10 @@ public: ServerActiveObject *placer, const PointedThing &pointed); bool item_OnUse(ItemStack &item, ServerActiveObject *user, const PointedThing &pointed); + bool item_OnCraft(ItemStack &item, ServerActiveObject *user, + const InventoryList *old_craft_grid, const InventoryLocation &craft_inv); + bool item_CraftPredict(ItemStack &item, ServerActiveObject *user, + const InventoryList *old_craft_grid, const InventoryLocation &craft_inv); protected: friend class LuaItemStack; diff --git a/src/server.cpp b/src/server.cpp index 8350b7013..c29ec3d83 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4775,7 +4775,10 @@ void Server::UpdateCrafting(u16 peer_id) // Get a preview for crafting ItemStack preview; + InventoryLocation loc; + loc.setPlayer(player->getName()); getCraftingResult(&player->inventory, preview, false, this); + m_env->getScriptIface()->item_CraftPredict(preview, player->getPlayerSAO(), (&player->inventory)->getList("craft"), loc); // Put the new preview in InventoryList *plist = player->inventory.getList("craftpreview"); From 53ab2f8defa119477965b57218ec1f78c487a7e3 Mon Sep 17 00:00:00 2001 From: "0gb.us" <0gb.us@0gb.us> Date: Mon, 28 Oct 2013 17:25:10 -0700 Subject: [PATCH 035/198] Fixed ignoring of "diggable" property of nodes. --- builtin/item.lua | 3 +-- builtin/misc_register.lua | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/item.lua b/builtin/item.lua index 7f20d30c5..99614581d 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -370,8 +370,7 @@ end function minetest.node_dig(pos, node, digger) local def = ItemStack({name=node.name}):get_definition() - -- Check if def ~= 0 because we always want to be able to remove unknown nodes - if #def ~= 0 and not def.diggable or (def.can_dig and not def.can_dig(pos,digger)) then + if not def.diggable or (def.can_dig and not def.can_dig(pos,digger)) then minetest.log("info", digger:get_player_name() .. " tried to dig " .. node.name .. " which is not diggable " .. minetest.pos_to_string(pos)) diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index aa8399f16..242fe6092 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -270,6 +270,7 @@ minetest.register_item(":unknown", { on_place = minetest.item_place, on_drop = minetest.item_drop, groups = {not_in_creative_inventory=1}, + diggable = true, }) minetest.register_node(":air", { From 1cbba877ffaa1b080d08e7571665e086f4656805 Mon Sep 17 00:00:00 2001 From: BlockMen Date: Wed, 23 Oct 2013 12:58:23 +0200 Subject: [PATCH 036/198] Don't remove background of games in submenus --- builtin/mainmenu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 0f34c67ea..3b988cd8d 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -812,7 +812,7 @@ function tabbuilder.handle_tab_buttons(fields) --handle tab changes if tabbuilder.current_tab ~= tabbuilder.old_tab then - if tabbuilder.current_tab ~= "singleplayer" then + if tabbuilder.current_tab ~= "singleplayer" and not tabbuilder.is_dialog then menu.update_gametype(true) end end From fba2650e392ad4b3c1ec0d7839f24e1cbb53a1cb Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 30 Oct 2013 15:38:13 -0400 Subject: [PATCH 037/198] Add more checks to vector functions --- builtin/vector.lua | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/builtin/vector.lua b/builtin/vector.lua index 698309c4a..6b787366d 100644 --- a/builtin/vector.lua +++ b/builtin/vector.lua @@ -1,41 +1,46 @@ vector = {} +local function assert_vector(v) + assert(type(v) == "table" and v.x and v.y and v.z, "Invalid vector") +end + function vector.new(a, b, c) - assert(a) if type(a) == "table" then + assert(a.x and a.y and a.z, "Invalid vector passed to vector.new()") return {x=a.x, y=a.y, z=a.z} - else - assert(b and c) + elseif a then + assert(b and c, "Invalid arguments for vector.new()") return {x=a, y=b, z=c} end return {x=0, y=0, z=0} end function vector.equals(a, b) - assert(a and b) + assert_vector(a) + assert_vector(b) return a.x == b.x and a.y == b.y and a.z == b.z end function vector.length(v) - assert(v) + assert_vector(v) return math.hypot(v.x, math.hypot(v.y, v.z)) end function vector.normalize(v) - assert(v) + assert_vector(v) local len = vector.length(v) if len == 0 then - return vector.new() + return {x=0, y=0, z=0} else return vector.divide(v, len) end end function vector.round(v) - assert(v) + assert_vector(v) return { x = math.floor(v.x + 0.5), y = math.floor(v.y + 0.5), @@ -44,7 +49,8 @@ function vector.round(v) end function vector.distance(a, b) - assert(a and b) + assert_vector(a) + assert_vector(b) local x = a.x - b.x local y = a.y - b.y local z = a.z - b.z @@ -52,7 +58,8 @@ function vector.distance(a, b) end function vector.direction(pos1, pos2) - assert(pos1 and pos2) + assert_vector(pos1) + assert_vector(pos2) local x_raw = pos2.x - pos1.x local y_raw = pos2.y - pos1.y local z_raw = pos2.z - pos1.z @@ -82,7 +89,8 @@ end function vector.add(a, b) - assert(a and b) + assert_vector(a) + assert_vector(b) if type(b) == "table" then return {x = a.x + b.x, y = a.y + b.y, @@ -95,7 +103,8 @@ function vector.add(a, b) end function vector.subtract(a, b) - assert(a and b) + assert_vector(a) + assert_vector(b) if type(b) == "table" then return {x = a.x - b.x, y = a.y - b.y, @@ -108,7 +117,8 @@ function vector.subtract(a, b) end function vector.multiply(a, b) - assert(a and b) + assert_vector(a) + assert_vector(b) if type(b) == "table" then return {x = a.x * b.x, y = a.y * b.y, @@ -121,7 +131,8 @@ function vector.multiply(a, b) end function vector.divide(a, b) - assert(a and b) + assert_vector(a) + assert_vector(b) if type(b) == "table" then return {x = a.x / b.x, y = a.y / b.y, From b1c82f332caa778d698d665f9269ba1304d5d5a4 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 1 Nov 2013 16:30:30 -0400 Subject: [PATCH 038/198] Add my email address to the main menu credits --- builtin/mainmenu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 3b988cd8d..d67a37c8d 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -1070,7 +1070,7 @@ function tabbuilder.tab_credits() "sfan5 ,".. "kahrl ,".. "sapier,".. - "ShadowNinja,".. + "ShadowNinja ,".. "Nathanaël Courant (Nore/Novatux) ,".. ",".. "#FFFF00" .. fgettext("Active Contributors") .. "," .. From 69a59f1e419d8204cc90cfaa25ad690c9b3d9e16 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 2 Nov 2013 10:48:13 +0100 Subject: [PATCH 039/198] Move the sapling growing and grass adding/removing ABMs to Lua --- builtin/features.lua | 1 + games/minimal/mods/default/init.lua | 123 ++++++++++++++++++++++++ src/content_abm.cpp | 139 ---------------------------- src/treegen.cpp | 10 ++ 4 files changed, 134 insertions(+), 139 deletions(-) diff --git a/builtin/features.lua b/builtin/features.lua index 9d00cfd99..f3de3ba21 100644 --- a/builtin/features.lua +++ b/builtin/features.lua @@ -6,6 +6,7 @@ minetest.features = { chat_send_player_param3 = true, get_all_craft_recipes_works = true, use_texture_alpha = true, + no_legacy_abms = true, } function minetest.has_feature(arg) diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index afde19b52..ce110126e 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1519,6 +1519,129 @@ minetest.register_node("default:apple", { sounds = default.node_sound_defaults(), }) + +local c_air = minetest.get_content_id("air") +local c_ignore = minetest.get_content_id("ignore") +local c_tree = minetest.get_content_id("default:tree") +local c_leaves = minetest.get_content_id("default:leaves") +local c_apple = minetest.get_content_id("default:apple") +function default.grow_tree(data, a, pos, is_apple_tree, seed) + --[[ + NOTE: Tree-placing code is currently duplicated in the engine + and in games that have saplings; both are deprecated but not + replaced yet + ]]-- + local pr = PseudoRandom(seed) + local th = pr:next(4, 5) + local x, y, z = pos.x, pos.y, pos.z + for yy = y, y+th-1 do + local vi = a:index(x, yy, z) + if a:contains(x, yy, z) and (data[vi] == c_air or yy == y) then + data[vi] = c_tree + end + end + y = y+th-1 -- (x, y, z) is now last piece of trunk + local leaves_a = VoxelArea:new{MinEdge={x=-2, y=-1, z=-2}, MaxEdge={x=2, y=2, z=2}} + local leaves_buffer = {} + + -- Force leaves near the trunk + local d = 1 + for xi = -d, d do + for yi = -d, d do + for zi = -d, d do + leaves_buffer[leaves_a:index(xi, yi, zi)] = true + end + end + end + + -- Add leaves randomly + for iii = 1, 8 do + local d = 1 + local xx = pr:next(leaves_a.MinEdge.x, leaves_a.MaxEdge.x - d) + local yy = pr:next(leaves_a.MinEdge.y, leaves_a.MaxEdge.y - d) + local zz = pr:next(leaves_a.MinEdge.z, leaves_a.MaxEdge.z - d) + + for xi = 0, d do + for yi = 0, d do + for zi = 0, d do + leaves_buffer[leaves_a:index(xx+xi, yy+yi, zz+zi)] = true + end + end + end + end + + -- Add the leaves + for xi = leaves_a.MinEdge.x, leaves_a.MaxEdge.x do + for yi = leaves_a.MinEdge.y, leaves_a.MaxEdge.y do + for zi = leaves_a.MinEdge.z, leaves_a.MaxEdge.z do + if a:contains(x+xi, y+yi, z+zi) then + local vi = a:index(x+xi, y+yi, z+zi) + if data[vi] == c_air or data[vi] == c_ignore then + if leaves_buffer[leaves_a:index(xi, yi, zi)] then + if is_apple_tree and pr:next(1, 100) <= 10 then + data[vi] = c_apple + else + data[vi] = c_leaves + end + end + end + end + end + end + end +end + +minetest.register_abm({ + nodenames = {"default:sapling"}, + interval = 10, + chance = 50, + action = function(pos, node) + local is_soil = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name].groups.soil + if is_soil == nil or is_soil == 0 then return end + print("A sapling grows into a tree at "..minetest.pos_to_string(pos)) + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16}) + local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp} + local data = vm:get_data() + default.grow_tree(data, a, pos, math.random(1, 4) == 1, math.random(1,100000)) + vm:set_data(data) + vm:write_to_map(data) + vm:update_map() + end +}) + +minetest.register_abm({ + nodenames = {"default:dirt"}, + interval = 2, + chance = 200, + action = function(pos, node) + local above = {x=pos.x, y=pos.y+1, z=pos.z} + local name = minetest.get_node(above).name + local nodedef = minetest.registered_nodes[name] + if nodedef and nodedef.sunlight_propagates and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then + if name == "default:snow" or name == "default:snowblock" then + minetest.set_node(pos, {name = "default:dirt_with_snow"}) + else + minetest.set_node(pos, {name = "default:dirt_with_grass"}) + end + end + end +}) + +minetest.register_abm({ + nodenames = {"default:dirt_with_grass"}, + interval = 2, + chance = 20, + action = function(pos, node) + local above = {x=pos.x, y=pos.y+1, z=pos.z} + local name = minetest.get_node(above).name + local nodedef = minetest.registered_nodes[name] + if name ~= "ignore" and nodedef and not (nodedef.sunlight_propagates and nodedef.liquidtype == "none") then + minetest.set_node(pos, {name = "default:dirt"}) + end + end +}) + -- -- Crafting items -- diff --git a/src/content_abm.cpp b/src/content_abm.cpp index ada20a27c..9289035b8 100644 --- a/src/content_abm.cpp +++ b/src/content_abm.cpp @@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_sao.h" #include "settings.h" #include "mapblock.h" // For getNodeBlockPos -#include "treegen.h" // For treegen::make_tree #include "main.h" // for g_settings #include "map.h" #include "scripting_game.h" @@ -33,141 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" -class GrowGrassABM : public ActiveBlockModifier -{ -private: -public: - virtual std::set getTriggerContents() - { - std::set s; - s.insert("mapgen_dirt"); - return s; - } - virtual float getTriggerInterval() - { return 2.0; } - virtual u32 getTriggerChance() - { return 200; } - virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n) - { - INodeDefManager *ndef = env->getGameDef()->ndef(); - ServerMap *map = &env->getServerMap(); - - MapNode n_top = map->getNodeNoEx(p+v3s16(0,1,0)); - content_t c_snow = ndef->getId("snow"); - if(ndef->get(n_top).light_propagates && - !ndef->get(n_top).isLiquid() && - n_top.getLightBlend(env->getDayNightRatio(), ndef) >= 13) - { - if(c_snow != CONTENT_IGNORE && n_top.getContent() == c_snow) - n.setContent(ndef->getId("dirt_with_snow")); - else - n.setContent(ndef->getId("mapgen_dirt_with_grass")); - map->addNodeWithEvent(p, n); - } - } -}; - -class RemoveGrassABM : public ActiveBlockModifier -{ -private: -public: - virtual std::set getTriggerContents() - { - std::set s; - s.insert("mapgen_dirt_with_grass"); - return s; - } - virtual float getTriggerInterval() - { return 2.0; } - virtual u32 getTriggerChance() - { return 20; } - virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n) - { - INodeDefManager *ndef = env->getGameDef()->ndef(); - ServerMap *map = &env->getServerMap(); - - MapNode n_top = map->getNodeNoEx(p+v3s16(0,1,0)); - if((!ndef->get(n_top).light_propagates && - n_top.getContent() != CONTENT_IGNORE) || - ndef->get(n_top).isLiquid()) - { - n.setContent(ndef->getId("mapgen_dirt")); - map->addNodeWithEvent(p, n); - } - } -}; - -class MakeTreesFromSaplingsABM : public ActiveBlockModifier -{ -private: - content_t c_junglesapling; - -public: - MakeTreesFromSaplingsABM(ServerEnvironment *env, INodeDefManager *nodemgr) { - c_junglesapling = nodemgr->getId("junglesapling"); - } - - virtual std::set getTriggerContents() - { - std::set s; - s.insert("sapling"); - s.insert("junglesapling"); - return s; - } - virtual float getTriggerInterval() - { return 10.0; } - virtual u32 getTriggerChance() - { return 50; } - virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n, - u32 active_object_count, u32 active_object_count_wider) - { - INodeDefManager *ndef = env->getGameDef()->ndef(); - ServerMap *map = &env->getServerMap(); - - MapNode n_below = map->getNodeNoEx(p - v3s16(0, 1, 0)); - if (!((ItemGroupList) ndef->get(n_below).groups)["soil"]) - return; - - bool is_jungle_tree = n.getContent() == c_junglesapling; - - actionstream <<"A " << (is_jungle_tree ? "jungle " : "") - << "sapling grows into a tree at " - << PP(p) << std::endl; - - std::map modified_blocks; - v3s16 tree_p = p; - ManualMapVoxelManipulator vmanip(map); - v3s16 tree_blockp = getNodeBlockPos(tree_p); - vmanip.initialEmerge(tree_blockp - v3s16(1,1,1), tree_blockp + v3s16(1,1,1)); - - if (is_jungle_tree) { - treegen::make_jungletree(vmanip, tree_p, ndef, myrand()); - } else { - bool is_apple_tree = myrand() % 4 == 0; - treegen::make_tree(vmanip, tree_p, is_apple_tree, ndef, myrand()); - } - - vmanip.blitBackAll(&modified_blocks); - - // update lighting - std::map lighting_modified_blocks; - lighting_modified_blocks.insert(modified_blocks.begin(), modified_blocks.end()); - map->updateLighting(lighting_modified_blocks, modified_blocks); - - // Send a MEET_OTHER event - MapEditEvent event; - event.type = MEET_OTHER; -// event.modified_blocks.insert(modified_blocks.begin(), modified_blocks.end()); - for(std::map::iterator - i = modified_blocks.begin(); - i != modified_blocks.end(); ++i) - { - event.modified_blocks.insert(i->first); - } - map->dispatchEvent(&event); - } -}; - class LiquidFlowABM : public ActiveBlockModifier { private: std::set contents; @@ -370,9 +234,6 @@ class LiquidMeltAround : public LiquidMeltHot { */ void add_legacy_abms(ServerEnvironment *env, INodeDefManager *nodedef) { - env->addActiveBlockModifier(new GrowGrassABM()); - env->addActiveBlockModifier(new RemoveGrassABM()); - env->addActiveBlockModifier(new MakeTreesFromSaplingsABM(env, nodedef)); if (g_settings->getBool("liquid_finite")) { env->addActiveBlockModifier(new LiquidFlowABM(env, nodedef)); env->addActiveBlockModifier(new LiquidDropABM(env, nodedef)); diff --git a/src/treegen.cpp b/src/treegen.cpp index 6291567d5..914479391 100644 --- a/src/treegen.cpp +++ b/src/treegen.cpp @@ -33,6 +33,11 @@ namespace treegen void make_tree(ManualMapVoxelManipulator &vmanip, v3s16 p0, bool is_apple_tree, INodeDefManager *ndef, int seed) { + /* + NOTE: Tree-placing code is currently duplicated in the engine + and in games that have saplings; both are deprecated but not + replaced yet + */ MapNode treenode(ndef->getId("mapgen_tree")); MapNode leavesnode(ndef->getId("mapgen_leaves")); MapNode applenode(ndef->getId("mapgen_apple")); @@ -511,6 +516,11 @@ v3f transposeMatrix(irr::core::matrix4 M, v3f v) void make_jungletree(VoxelManipulator &vmanip, v3s16 p0, INodeDefManager *ndef, int seed) { + /* + NOTE: Tree-placing code is currently duplicated in the engine + and in games that have saplings; both are deprecated but not + replaced yet + */ content_t c_tree = ndef->getId("mapgen_jungletree"); content_t c_leaves = ndef->getId("mapgen_jungleleaves"); if (c_tree == CONTENT_IGNORE) From 2bf9abade2c758fcebc37a589b65e894c898fc6e Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 2 Nov 2013 13:49:22 +0100 Subject: [PATCH 040/198] Fix grass adding/removing ABM. --- games/minimal/mods/default/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index ce110126e..4e6ad67bd 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1618,7 +1618,7 @@ minetest.register_abm({ local above = {x=pos.x, y=pos.y+1, z=pos.z} local name = minetest.get_node(above).name local nodedef = minetest.registered_nodes[name] - if nodedef and nodedef.sunlight_propagates and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then + if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then if name == "default:snow" or name == "default:snowblock" then minetest.set_node(pos, {name = "default:dirt_with_snow"}) else @@ -1636,7 +1636,7 @@ minetest.register_abm({ local above = {x=pos.x, y=pos.y+1, z=pos.z} local name = minetest.get_node(above).name local nodedef = minetest.registered_nodes[name] - if name ~= "ignore" and nodedef and not (nodedef.sunlight_propagates and nodedef.liquidtype == "none") then + if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then minetest.set_node(pos, {name = "default:dirt"}) end end From 0d35350b698a9b82722c8568e2f2d987068cdbaf Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Mon, 9 Sep 2013 15:32:55 +0200 Subject: [PATCH 041/198] Fix liquid_range * Prevent graphical glitches on old servers * Fix flowing of liquids with viscosity != 1 and range != 8 * Fix range = 0, no flowing nodes will appear --- src/content_mapblock.cpp | 8 ++++++-- src/map.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 3cded5bdb..cda1846a8 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -395,7 +395,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data, l = getInteriorLight(n, 0, data); video::SColor c = MapBlock_LightColor(f.alpha, l, decode_light(f.light_source)); - u8 range = rangelim(nodedef->get(c_flowing).liquid_range, 0, 8); + u8 range = rangelim(nodedef->get(c_flowing).liquid_range, 1, 8); // Neighbor liquid levels (key = relative position) // Includes current node @@ -429,7 +429,11 @@ void mapblock_mesh_generate_special(MeshMakeData *data, if(n2.getContent() == c_source) level = (-0.5+node_liquid_level) * BS; else if(n2.getContent() == c_flowing){ - u8 liquid_level = (n2.param2&LIQUID_LEVEL_MASK) - (LIQUID_LEVEL_MAX+1-range); + u8 liquid_level = (n2.param2&LIQUID_LEVEL_MASK); + if (liquid_level <= LIQUID_LEVEL_MAX+1-range) + liquid_level = 0; + else + liquid_level -= (LIQUID_LEVEL_MAX+1-range); level = (-0.5 + ((float)liquid_level+ 0.5) / (float)range * node_liquid_level) * BS; } diff --git a/src/map.cpp b/src/map.cpp index e8115d39b..968897c0c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2136,6 +2136,7 @@ void Map::transformLiquids(std::map & modified_blocks) content_t new_node_content; s8 new_node_level = -1; s8 max_node_level = -1; + u8 range = rangelim(nodemgr->get(liquid_kind).liquid_range, 0, LIQUID_LEVEL_MAX+1); if ((num_sources >= 2 && nodemgr->get(liquid_kind).liquid_renewable) || liquid_type == LIQUID_SOURCE) { // liquid_kind will be set to either the flowing alternative of the node (if it's a liquid) // or the flowing alternative of the first of the surrounding sources (if it's air), so @@ -2145,6 +2146,8 @@ void Map::transformLiquids(std::map & modified_blocks) // liquid_kind is set properly, see above new_node_content = liquid_kind; max_node_level = new_node_level = LIQUID_LEVEL_MAX; + if (new_node_level < (LIQUID_LEVEL_MAX+1-range)) + new_node_content = CONTENT_AIR; } else { // no surrounding sources, so get the maximum level that can flow into this node for (u16 i = 0; i < num_flows; i++) { @@ -2185,8 +2188,7 @@ void Map::transformLiquids(std::map & modified_blocks) } else new_node_level = max_node_level; - u8 range = rangelim(nodemgr->get(liquid_kind).liquid_range, 0, LIQUID_LEVEL_MAX+1); - if (new_node_level >= (LIQUID_LEVEL_MAX+1-range)) + if (max_node_level >= (LIQUID_LEVEL_MAX+1-range)) new_node_content = liquid_kind; else new_node_content = CONTENT_AIR; From d11c76b9f2ed111d933fe0df3cc5c87c8aff4f73 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 2 Nov 2013 16:13:07 +0100 Subject: [PATCH 042/198] Fix possible crash with grass ABM. --- games/minimal/mods/default/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index 4e6ad67bd..eae1fabcc 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1618,7 +1618,9 @@ minetest.register_abm({ local above = {x=pos.x, y=pos.y+1, z=pos.z} local name = minetest.get_node(above).name local nodedef = minetest.registered_nodes[name] - if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then + if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") + and nodedef.liquidtype == "none" + and (minetest.get_node_light(above) or 0) >= 13 then if name == "default:snow" or name == "default:snowblock" then minetest.set_node(pos, {name = "default:dirt_with_snow"}) else @@ -1636,7 +1638,9 @@ minetest.register_abm({ local above = {x=pos.x, y=pos.y+1, z=pos.z} local name = minetest.get_node(above).name local nodedef = minetest.registered_nodes[name] - if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then + if name ~= "ignore" and nodedef + and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") + and nodedef.liquidtype == "none") then minetest.set_node(pos, {name = "default:dirt"}) end end From 2636c92075196b4c2cd65327b1f839f1e8919b83 Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Sun, 25 Aug 2013 12:19:31 -0400 Subject: [PATCH 043/198] Portability fixes for OpenBSD (and possibly NetBSD and others). --- src/porting.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/porting.cpp b/src/porting.cpp index 84df15b30..a080a44e5 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -373,8 +373,13 @@ void initializePaths() //TODO: Get path of executable. This assumes working directory is bin/ dstream<<"WARNING: Relative path not properly supported on this platform" < Date: Fri, 2 Aug 2013 16:41:36 -0400 Subject: [PATCH 044/198] Add basic protection support to builtin --- builtin/item.lua | 18 ++++++++++++++++++ builtin/misc.lua | 11 +++++++++++ builtin/misc_register.lua | 1 + doc/lua_api.txt | 23 +++++++++++++++++++++++ 4 files changed, 53 insertions(+) diff --git a/builtin/item.lua b/builtin/item.lua index 99614581d..b3ab9bc4c 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -218,6 +218,15 @@ function minetest.item_place_node(itemstack, placer, pointed_thing, param2) place_to = {x = under.x, y = under.y, z = under.z} end + if minetest.is_protected(place_to, placer:get_player_name()) then + minetest.log("action", placer:get_player_name() + .. " tried to place " .. def.name + .. " at protected position " + .. minetest.pos_to_string(place_to)) + minetest.record_protection_violation(place_to, placer:get_player_name()) + return itemstack + end + minetest.log("action", placer:get_player_name() .. " places node " .. def.name .. " at " .. minetest.pos_to_string(place_to)) @@ -377,6 +386,15 @@ function minetest.node_dig(pos, node, digger) return end + if minetest.is_protected(pos, digger:get_player_name()) then + minetest.log("action", digger:get_player_name() + .. " tried to dig " .. node.name + .. " at protected position " + .. minetest.pos_to_string(pos)) + minetest.record_protection_violation(pos, digger:get_player_name()) + return + end + minetest.log('action', digger:get_player_name() .. " digs " .. node.name .. " at " .. minetest.pos_to_string(pos)) diff --git a/builtin/misc.lua b/builtin/misc.lua index 3d2c496e3..a6a1718ad 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -106,3 +106,14 @@ function minetest.setting_get_pos(name) return minetest.string_to_pos(value) end +-- To be overriden by protection mods +function minetest.is_protected(pos, name) + return false +end + +function minetest.record_protection_violation(pos, name) + for _, func in pairs(minetest.registered_on_protection_violation) do + func(pos, name) + end +end + diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index 242fe6092..bb2c62ab8 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -344,4 +344,5 @@ minetest.registered_on_player_receive_fields, minetest.register_on_player_receiv minetest.registered_on_cheats, minetest.register_on_cheat = make_registration() minetest.registered_on_crafts, minetest.register_on_craft = make_registration() minetest.registered_craft_predicts, minetest.register_craft_predict = make_registration() +minetest.registered_on_protection_violation, minetest.register_on_protection_violation = make_registration() diff --git a/doc/lua_api.txt b/doc/lua_api.txt index e94fd30a9..933050224 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1154,6 +1154,13 @@ minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv)) minetest.register_craft_predict(func(itemstack, player, old_craft_grid, craft_inv)) ^ The same as before, except that it is called before the player crafts, to make ^ craft prediction, and it should not change anything. +minetest.register_on_protection_violation(func(pos, name)) +^ Called by builtin and mods when a player violates protection at a position + (eg, digs a node or punches a protected entity). +^ The registered functions can be called using minetest.record_protection_violation +^ The provided function should check that the position is protected by the mod + calling this function before it prints a message, if it does, to allow for + multiple protection mods. Other registration functions: minetest.register_chatcommand(cmd, chatcommand definition) @@ -1483,6 +1490,22 @@ minetest.deserialize(string) -> table ^ Example: deserialize('return { ["foo"] = "bar" }') -> {foo='bar'} ^ Example: deserialize('print("foo")') -> nil (function call fails) ^ error:[string "print("foo")"]:1: attempt to call global 'print' (a nil value) +minetest.is_protected(pos, name) -> bool +^ This function should be overriden by protection mods and should be used to + check if a player can interact at a position. +^ This function should call the old version of itself if the position is not + protected by the mod. +^ Example: + local old_is_protected = minetest.is_protected + function minetest.is_protected(pos, name) + if mymod:position_protected_from(pos, name) then + return true + end + return old_is_protected(pos, name) + end +minetest.record_protection_violation(pos, name) +^ This function calls functions registered with + minetest.register_on_protection_violation. Global objects: minetest.env - EnvRef of the server environment and world. From 0b788892898013cd430c48b98e21a3fd111c3c7f Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 26 Oct 2013 09:56:38 +0200 Subject: [PATCH 045/198] Send a on_receive_fields event when formspec is closed, with fields.quit = "true" --- src/guiFormSpecMenu.cpp | 30 ++++++++++++++++++++---------- src/guiFormSpecMenu.h | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 25adf8ea7..f3d4568ef 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2041,12 +2041,16 @@ ItemStack GUIFormSpecMenu::verifySelectedItem() return ItemStack(); } -void GUIFormSpecMenu::acceptInput() +void GUIFormSpecMenu::acceptInput(bool quit=false) { if(m_text_dst) { std::map fields; + if (quit) { + fields["quit"] = "true"; + } + if (current_keys_pending.key_down) { fields["key_down"] = "true"; current_keys_pending.key_down = false; @@ -2188,10 +2192,12 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) if (event.KeyInput.PressedDown && (kp == EscapeKey || kp == getKeySetting("keymap_inventory"))) { - if (m_allowclose) + if (m_allowclose) { + acceptInput(true); quitMenu(); - else + } else { m_text_dst->gotText(narrow_to_wide("MenuQuit")); + } return true; } if (event.KeyInput.PressedDown && @@ -2204,7 +2210,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) switch (event.KeyInput.Key) { case KEY_RETURN: if (m_allowclose) { - acceptInput(); + acceptInput(true); quitMenu(); } else @@ -2551,11 +2557,13 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) unsigned int btn_id = event.GUIEvent.Caller->getID(); if (btn_id == 257) { - acceptInput(); - if (m_allowclose) + if (m_allowclose) { + acceptInput(true); quitMenu(); - else + } else { + acceptInput(); m_text_dst->gotText(narrow_to_wide("ExitButton")); + } // quitMenu deallocates menu return true; } @@ -2572,10 +2580,12 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) s.send = true; acceptInput(); if(s.is_exit){ - if (m_allowclose) + if (m_allowclose) { + acceptInput(true); quitMenu(); - else + } else { m_text_dst->gotText(narrow_to_wide("ExitButton")); + } return true; }else{ s.send = false; @@ -2590,7 +2600,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) { if (m_allowclose) { - acceptInput(); + acceptInput(true); quitMenu(); } else { diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h index c244e458f..20ab52e8b 100644 --- a/src/guiFormSpecMenu.h +++ b/src/guiFormSpecMenu.h @@ -227,7 +227,7 @@ public: void updateSelectedItem(); ItemStack verifySelectedItem(); - void acceptInput(); + void acceptInput(bool quit); bool preprocessEvent(const SEvent& event); bool OnEvent(const SEvent& event); From 25edae00ea1d5a9af4a6599fc7c200bb810fbd49 Mon Sep 17 00:00:00 2001 From: BlockMen Date: Sat, 2 Nov 2013 04:26:44 +0100 Subject: [PATCH 046/198] Reworked formspecs and kahrl's hexcolor parser --- builtin/mm_menubar.lua | 4 +- builtin/modstore.lua | 6 +- doc/lua_api.txt | 45 ++++++- src/guiFormSpecMenu.cpp | 263 +++++++++++++++++++++++++++++++--------- src/guiFormSpecMenu.h | 12 +- 5 files changed, 260 insertions(+), 70 deletions(-) diff --git a/builtin/mm_menubar.lua b/builtin/mm_menubar.lua index c3ddbb289..a60ea7ae5 100644 --- a/builtin/mm_menubar.lua +++ b/builtin/mm_menubar.lua @@ -30,8 +30,8 @@ end -------------------------------------------------------------------------------- function menubar.refresh() - menubar.formspec = "box[-0.3,5.625;12.4,1.3;000000]" .. - "box[-0.3,5.6;12.4,0.05;FFFFFF]" + menubar.formspec = "box[-0.3,5.625;12.4,1.3;#000000]" .. + "box[-0.3,5.6;12.4,0.05;#FFFFFF]" menubar.buttons = {} local button_base = -0.25 diff --git a/builtin/modstore.lua b/builtin/modstore.lua index 43f7759ad..b364ce6bd 100644 --- a/builtin/modstore.lua +++ b/builtin/modstore.lua @@ -183,9 +183,9 @@ function modstore.getmodlist(list) retval = retval .. "label[10,-0.4;" .. fgettext("Page $1 of $2", list.page+1, list.pagecount) .. "]" retval = retval .. "button[11.6,-0.1;0.5,0.5;btn_modstore_page_up;^]" - retval = retval .. "box[11.6,0.35;0.28,8.6;000000]" + retval = retval .. "box[11.6,0.35;0.28,8.6;#000000]" local scrollbarpos = 0.35 + (8.1/(list.pagecount-1)) * list.page - retval = retval .. "box[11.6," ..scrollbarpos .. ";0.28,0.5;32CD32]" + retval = retval .. "box[11.6," ..scrollbarpos .. ";0.28,0.5;#32CD32]" retval = retval .. "button[11.6,9.0;0.5,0.5;btn_modstore_page_down;v]" @@ -206,7 +206,7 @@ function modstore.getmodlist(list) if details ~= nil then local screenshot_ypos = (i-1 - (list.page * modstore.modsperpage))*1.9 +0.2 - retval = retval .. "box[0," .. screenshot_ypos .. ";11.4,1.75;FFFFFF]" + retval = retval .. "box[0," .. screenshot_ypos .. ";11.4,1.75;#FFFFFF]" --screenshot if details.screenshot_url ~= nil and diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 933050224..689496e22 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -873,6 +873,22 @@ list[;;,;,;] list[;;,;,;] ^ Show an inventory list +listcolors[;] +^ Sets background color of slots in HEX-Color format +^ Sets background color of slots on mouse hovering + +listcolors[;;] +^ Sets background color of slots in HEX-Color format +^ Sets background color of slots on mouse hovering +^ Sets color of slots border + +listcolors[;;;;] +^ Sets background color of slots in HEX-Color format +^ Sets background color of slots on mouse hovering +^ Sets color of slots border +^ Sets background color of tooltips +^ Sets font color of tooltips + image[,;,;] ^ Show an image ^ Position and size units are inventory slots @@ -881,11 +897,21 @@ item_image[,;,;] ^ Show an inventory image of registered item/node ^ Position and size units are inventory slots +bgcolor[;] +^ Sets background color of formspec in HEX-Color format +^ If true the background color is drawn fullscreen (does not effect the size of the formspec) + background[,;,;] ^ Use a background. Inventory rectangles are not drawn then. ^ Position and size units are inventory slots ^ Example for formspec 8x4 in 16x resolution: image shall be sized 8*16px x 4*16px +background[,;,;;] +^ Use a background. Inventory rectangles are not drawn then. +^ Position and size units are inventory slots +^ Example for formspec 8x4 in 16x resolution: image shall be sized 8*16px x 4*16px +^ If true the background is clipped to formspec size (x and y are used as offset values, w and h are ignored) + pwdfield[,;,;;
'; - if (r.list.length) { - h += ''; - if (!master.no_address) h += ''; - if (!master.no_clients) h += ''; - if (!master.no_version) h += ''; - if (!master.no_name) h += ''; - if (!master.no_description) h += ''; - if (!master.no_flags) h += ''; - if (!master.no_uptime) h += ''; - if (!master.no_ping) h += ''; - h += ''; - } - var count = 0; - for (var i = 0; i < r.list.length; ++i) { - if (++count > master.limit && master.limit) break; - var s = r.list[i]; - if (!s) continue; - if (master.clients_min && s.clients < master.clients_min) continue; - if (/:/.test(s.address)) s.address = '[' + s.address + ']'; - h += ''; - if (!master.no_address) h += ''; - if (!master.no_clients) { - h += ''; - } - var mods = 0; - if (s.mods && jQuery.isArray(s.mods)) - mods = s.mods.length; - if (!master.no_version) { - h += ''; - } - if (!master.no_name) { - h += ''; - } - if (!master.no_description) h += ''; - if (!master.no_flags) { - h += ''; - } - if (!s.start || s.start < 0) s.start = 0; - if (!master.no_uptime) h += ''; - if (!master.no_ping) h += ''; - h += ''; - } - h += '
ip[:port]players/maxversion gameid mapgennamedescriptionflagsuptime ageping
' + e(s.address) + (s.port != 30000 ? (':' + e(s.port)) : '') + ''; - if (!master.no_clients_list && s.clients && s.clients_list) { - h += '
Players (' + e(s.clients) + '):
'; - for (var ii in s.clients_list) - h += e(s.clients_list[ii]) + '
'; - h += '
'; - } - h += e(s.clients) + (s.clients_max ? '/' + e(s.clients_max) : '') + (s.clients_top ? ', ' + e(s.clients_top) : '') + '
' + e(s.version) + ' ' + e(s.gameid) + ' ' + e(s.mapgen); - if (!master.no_mods && mods) { - h += '
Mods (' + mods + '):
'; - for (var ii in s.mods) - h += e(s.mods[ii]) + '
'; - h += '
'; - } - h += '
'; - if (s.url) h += ''; - h += e(s.name || s.url); - if (s.url) h += ''; - h += '' + e(s.description) + '' + - (s.password ? 'Pwd ' : '') + - (s.creative ? 'Cre ' : '') + - (s.damage ? 'Dmg ' : '') + - (s.pvp ? 'Pvp ' : '') + - (s.dedicated ? 'Ded ' : '') + - (s.rollback ? 'Rol ' : '') + - (s.liquid_finite ? 'Liq ' : '') + - '' + (s.uptime ? human_time(s.uptime, 1) : s.start ? human_time(s.start) : '') + (s.game_time ? ' ' + human_time(s.game_time, 1) : '') + '' + (s.ping ? parseFloat(s.ping).toFixed(3) * 1000 : '') + '
'; - if (master.clients_min || master.limit) - h += 'more...'; - jQuery(master.output || '#servers_table').html(h); +function escapeHTML(str) { + return str.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); } -function get(refresh) { - jQuery.getJSON((master.root || '') + 'list', success); - if (!refresh && !master.no_refresh) setTimeout(get, 60000); +function addressString(server) { + var isIPv6 = server.address.indexOf(":") != -1; + var addrStr = (isIPv6 ? '[' : '') + + escapeHTML(server.address) + + (isIPv6 ? ']' : ''); + var shortStr = addrStr; + addrStr += ':' + server.port; + var str = ' 25) { + shortStr = shortStr.substr(0, 23) + "…"; + str += ' class="tooltip" title="' + addrStr + '"' + } + if (server.port != 30000) + shortStr += ':' + server.port; + return str + '>' + shortStr + ''; } + +function tooltipString(str, maxLen) { + str = escapeHTML(str); + var shortStr = str; + var ret = ' maxLen) { + shortStr = shortStr.substr(0, maxLen - 2) + "…"; + ret += ' class="tooltip" title="' + str + '"'; + } + return ret + '>' + shortStr + ''; +} + +function hoverList(name, list) { + if (!list || list.length == 0) return ''; + var str = '
' + str += name + '(' + list.length + ')
'; + for (var i in list) { + str += escapeHTML(list[i]) + '
'; + } + return str + '
'; +} + +function draw(json) { + html = window.render.servers(json); + jQuery(master.output || '#server_list').html(html); +} + +function get() { + jQuery.getJSON(master.url, draw); +} + +if (!master.no_refresh) { + setInterval(get, 60 * 1000); +} + get(); + diff --git a/util/master/servers.jst b/util/master/servers.jst new file mode 100644 index 000000000..bbefe3062 --- /dev/null +++ b/util/master/servers.jst @@ -0,0 +1,68 @@ +{{? !master.no_total}} +
+ Players: {{=it.total.clients}}/{{=it.total_max.clients}}  + Servers: {{=it.total.servers}}/{{=it.total_max.servers}} +
+{{?}} + + + {{? !master.no_address}}{{?}} + {{? !master.no_clients}}{{?}} + {{? !master.no_version}}{{?}} + {{? !master.no_name}}{{?}} + {{? !master.no_description}}{{?}} + {{? !master.no_flags}}{{?}} + {{? !master.no_uptime}}{{?}} + {{? !master.no_ping}}{{?}} + + {{~it.list :server:index}} + {{ if (master.limit && index + 1 > master.limit) break;}} + + {{? !master.no_address}} + {{?}} + {{? !master.no_clients}} + {{?}} + {{? !master.no_version}} + {{?}} + {{? !master.no_name}} + {{?}} + {{? !master.no_description}} + {{?}} + {{? !master.no_flags}} + {{?}} + {{? !master.no_uptime}} + {{?}} + {{? !master.no_ping}} + {{?}} + + {{~}} +
IP[:Port]Players/MaxVersion, Gameid, MapGenNameDescriptionFlagsUptime, AgePing
+ {{=addressString(server)}} + + {{=server.clients}}/{{=server.clients_max}} {{=server.clients_top}} + {{=hoverList("Clients", server.clients_list)}} + + {{=escapeHTML(server.version)}}, {{=escapeHTML(server.gameid)}},  + {{=escapeHTML(server.mapgen || '?')}} + {{=hoverList("Mods", server.mods)}} + + {{? server.url}} + {{=tooltipString(server.name, 25)}} + {{??}} + {{=tooltipString(server.name, 25)}} + {{?}} + + {{=tooltipString(server.description, 50)}} + + {{=server.creative ? 'Cre ' : ''}} + {{=server.dedicated ? 'Ded ' : ''}} + {{=server.damage ? 'Dmg ' : ''}} + {{=server.liquid_finite ? 'Liq ' : ''}} + {{=server.pvp ? 'PvP ' : ''}} + {{=server.password ? 'Pwd ' : ''}} + {{=server.rollback ? 'Rol ' : ''}} + + {{=humanTime(server.uptime)}}, {{=humanTime(server.game_time)}} + + {{=Math.floor(server.ping * 1000)}} +
diff --git a/util/master/style.css b/util/master/style.css index cff041216..47d58029b 100644 --- a/util/master/style.css +++ b/util/master/style.css @@ -1,32 +1,31 @@ -table { - max-width: 100%; - background-color: transparent; - border-collapse: collapse; - border-spacing: 0; +#server_list table { + max-width: 100%; + width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; + font-size: small; } -td, th { - border: 1px solid gray; +#server_list td, #server_list th { + border: 1px solid gray; } -div#table table { - width: 100%; +.hover_list{ + visibility: hidden; + border: gray solid 1px; + position: absolute; + z-index: 100; + background-color: white; + padding: 0.5em; } -.mts_mods, .mts_clients_list { - visibility: hidden; - border:gray solid 1px; - position:absolute; - z-index:100; - background-color:white; - padding:.5em; +td:hover .hover_list { + visibility: visible; } -.mts_version:hover .mts_mods, .mts_clients:hover .mts_clients_list { - visibility: visible; +.hover_list_text, .tooltip { + text-decoration: underline; + text-decoration-style: dashed; } -.mts_version.mts_is_mods, .mts_clients.mts_is_clients { - text-decoration:underline; - text-decoration-style:dashed; -} From 4c2687775fc8b7045d06456a211161b46014c8d8 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 3 Nov 2013 18:02:07 -0500 Subject: [PATCH 050/198] Only show servers with at least master.min_clients clients --- util/master/servers.jst | 1 + 1 file changed, 1 insertion(+) diff --git a/util/master/servers.jst b/util/master/servers.jst index bbefe3062..ffeb45d31 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -17,6 +17,7 @@ {{~it.list :server:index}} {{ if (master.limit && index + 1 > master.limit) break;}} + {{ if (master.min_clients && server.clients < master.min_clients) continue;}} {{? !master.no_address}} From 0fd29b7e09883c730af175cf2c8e78fe3898cad2 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 3 Nov 2013 18:21:53 -0500 Subject: [PATCH 051/198] Add a "More..." link when the serverlist is filtered --- util/master/servers.jst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/master/servers.jst b/util/master/servers.jst index ffeb45d31..ff17c2d10 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -67,3 +67,6 @@ {{~}} +{{? master.min_clients || master.limit}} + More... +{{?}} From 4a8a50a2a22e9a87089b817f966bf5270eb4bc2f Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 4 Nov 2013 04:55:35 +0400 Subject: [PATCH 052/198] Masterserver show privs and js autoload --- src/serverlist.cpp | 1 + util/master/README.md | 10 ++++++++++ util/master/index.html | 6 +----- util/master/list.js | 22 ++++++++++++++++------ util/master/master.cgi | 2 +- util/master/servers.jst | 6 +++--- util/master/style.css | 7 +++---- 7 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/serverlist.cpp b/src/serverlist.cpp index fb5bc9c87..fa2ddad15 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -222,6 +222,7 @@ void sendAnnounce(std::string action, const std::vector & clients_n if(server["action"] == "start") { server["dedicated"] = g_settings->get("server_dedicated"); + server["privs"] = g_settings->get("default_privs"); server["rollback"] = g_settings->getBool("enable_rollback_recording"); server["liquid_finite"] = g_settings->getBool("liquid_finite"); server["mapgen"] = g_settings->get("mg_name"); diff --git a/util/master/README.md b/util/master/README.md index 4730dc269..232986deb 100644 --- a/util/master/README.md +++ b/util/master/README.md @@ -17,8 +17,18 @@ Then install doT.js and it's dependencies: $ cd doT $ npm install +Or by npm: + $ npm install dot commander mkdirp + And finally compile the template: $ cd ~/minetest/util/master $ ~/code/doT/bin/dot-packer -s . -d . +or + $ ./node_modules/dot/bin/dot-packer -s . -d . +Embending to any page +---------------------- + + + diff --git a/util/master/index.html b/util/master/index.html index 339ebe565..48a973eac 100644 --- a/util/master/index.html +++ b/util/master/index.html @@ -3,13 +3,9 @@ Minetest server list - - - -
- + diff --git a/util/master/list.js b/util/master/list.js index ee4568e24..a47111342 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -35,7 +35,7 @@ function addressString(server) { var str = ' 25) { shortStr = shortStr.substr(0, 23) + "…"; - str += ' class="tooltip" title="' + addrStr + '"' + str += ' class="mts_tooltip" title="' + addrStr + '"' } if (server.port != 30000) shortStr += ':' + server.port; @@ -48,14 +48,14 @@ function tooltipString(str, maxLen) { var ret = ' maxLen) { shortStr = shortStr.substr(0, maxLen - 2) + "…"; - ret += ' class="tooltip" title="' + str + '"'; + ret += ' class="mts_tooltip" title="' + str + '"'; } return ret + '>' + shortStr + ''; } function hoverList(name, list) { if (!list || list.length == 0) return ''; - var str = '
' + var str = '
' str += name + '(' + list.length + ')
'; for (var i in list) { str += escapeHTML(list[i]) + '
'; @@ -72,9 +72,19 @@ function get() { jQuery.getJSON(master.url, draw); } -if (!master.no_refresh) { - setInterval(get, 60 * 1000); +function loaded(){ + if (!master.no_refresh) { + setInterval(get, 60 * 1000); + } + get(); } -get(); +// https://github.com/pyrsmk/toast +this.toast=function(){var e=document,t=e.getElementsByTagName("head")[0],n=this.setTimeout,r="createElement",i="appendChild",s="addEventListener",o="onreadystatechange",u="styleSheet",a=10,f=0,l=function(){--f},c,h=function(e,r,i,s){if(!t)n(function(){h(e)},a);else if(e.length){c=-1;while(i=e[++c]){if((s=typeof i)=="function"){r=function(){return i(),!0};break}if(s=="string")p(i);else if(i.pop){p(i[0]),r=i[1];break}}d(r,Array.prototype.slice.call(e,c+1))}},p=function(n,s){++f,/\.css$/.test(n)?(s=e[r]("link"),s.rel=u,s.href=n,t[i](s),v(s)):(s=e[r]("script"),s.src=n,t[i](s),s[o]===null?s[o]=m:s.onload=l)},d=function(e,t){if(!f)if(!e||e()){h(t);return}n(function(){d(e,t)},a)},v=function(e){if(e.sheet||e[u]){l();return}n(function(){v(e)},a)},m=function(){/ded|co/.test(this.readyState)&&l()};h(arguments)}; +toast('style.css', 'servers.js', function() { + if (typeof(jQuery)!='undefined') + loaded(); + else + toast('//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', loaded); +}); diff --git a/util/master/master.cgi b/util/master/master.cgi index 6dbf83fca..f48816c5d 100755 --- a/util/master/master.cgi +++ b/util/master/master.cgi @@ -241,7 +241,7 @@ sub request (;$) { $param->{clients_top} = $old->{clients_top} if $old->{clients_top} > $param->{clients}; $param->{clients_top} ||= $param->{clients} || 0; # params reported once on start, must be same as src/serverlist.cpp:~221 if(server["action"] == "start") { ... - for (qw(dedicated rollback liquid_finite mapgen mods)) { + for (qw(dedicated rollback liquid_finite mapgen mods privs)) { $param->{$_} ||= $old->{$_} if $old->{$_} and !($param->{action} ~~ 'start'); } $param->{pop_n} = $old->{pop_n} + 1; diff --git a/util/master/servers.jst b/util/master/servers.jst index ff17c2d10..5031f083d 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -24,12 +24,12 @@ {{=addressString(server)}} {{?}} {{? !master.no_clients}} - + {{=server.clients}}/{{=server.clients_max}} {{=server.clients_top}} {{=hoverList("Clients", server.clients_list)}} {{?}} {{? !master.no_version}} - + {{=escapeHTML(server.version)}}, {{=escapeHTML(server.gameid)}},  {{=escapeHTML(server.mapgen || '?')}} {{=hoverList("Mods", server.mods)}} @@ -47,7 +47,7 @@ {{=tooltipString(server.description, 50)}} {{?}} {{? !master.no_flags}} - + {{=server.creative ? 'Cre ' : ''}} {{=server.dedicated ? 'Ded ' : ''}} {{=server.damage ? 'Dmg ' : ''}} diff --git a/util/master/style.css b/util/master/style.css index 47d58029b..76a4f998d 100644 --- a/util/master/style.css +++ b/util/master/style.css @@ -11,7 +11,7 @@ border: 1px solid gray; } -.hover_list{ +.mts_hover_list{ visibility: hidden; border: gray solid 1px; position: absolute; @@ -20,12 +20,11 @@ padding: 0.5em; } -td:hover .hover_list { +td:hover .mts_hover_list { visibility: visible; } -.hover_list_text, .tooltip { +.mts_hover_list_text, .mts_tooltip { text-decoration: underline; text-decoration-style: dashed; } - From cf0786dc9d3e900692b54d2654fc8f298600f3bd Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 4 Nov 2013 12:59:55 +0400 Subject: [PATCH 053/198] Masterserver fixes --- util/master/list.js | 26 +++++++++++++++++--------- util/master/servers.jst | 3 ++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/util/master/list.js b/util/master/list.js index a47111342..2a831a268 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -1,10 +1,10 @@ var master; -if (!master) { - master = { - url: "http://servers.minetest.net/list", - output: "#server_list" - }; -} +if (!master) master = {}; +if (typeof(master.root)=='undefined') master.root = "http://servers.minetest.net/"; +if (!master.output) master.output = '#server_list'; +if (!master.list) master.list = "list"; +if (!master.list_root) master.list_root = master.root; +if (!master.list_url) master.list_url = master.list_root + master.list; function humanTime(seconds) { if (!seconds) return '?'; @@ -63,13 +63,21 @@ function hoverList(name, list) { return str + '
'; } +function hoverString(name, string) { + if (!string) return ''; + return '
' + + name + ':
' + + escapeHTML(string) + '
' + + '
'; +} + function draw(json) { html = window.render.servers(json); - jQuery(master.output || '#server_list').html(html); + jQuery(master.output).html(html); } function get() { - jQuery.getJSON(master.url, draw); + jQuery.getJSON(master.list_url, draw); } function loaded(){ @@ -82,7 +90,7 @@ function loaded(){ // https://github.com/pyrsmk/toast this.toast=function(){var e=document,t=e.getElementsByTagName("head")[0],n=this.setTimeout,r="createElement",i="appendChild",s="addEventListener",o="onreadystatechange",u="styleSheet",a=10,f=0,l=function(){--f},c,h=function(e,r,i,s){if(!t)n(function(){h(e)},a);else if(e.length){c=-1;while(i=e[++c]){if((s=typeof i)=="function"){r=function(){return i(),!0};break}if(s=="string")p(i);else if(i.pop){p(i[0]),r=i[1];break}}d(r,Array.prototype.slice.call(e,c+1))}},p=function(n,s){++f,/\.css$/.test(n)?(s=e[r]("link"),s.rel=u,s.href=n,t[i](s),v(s)):(s=e[r]("script"),s.src=n,t[i](s),s[o]===null?s[o]=m:s.onload=l)},d=function(e,t){if(!f)if(!e||e()){h(t);return}n(function(){d(e,t)},a)},v=function(e){if(e.sheet||e[u]){l();return}n(function(){v(e)},a)},m=function(){/ded|co/.test(this.readyState)&&l()};h(arguments)}; -toast('style.css', 'servers.js', function() { +toast(master.root+'style.css', master.root+'servers.js', function() { if (typeof(jQuery)!='undefined') loaded(); else diff --git a/util/master/servers.jst b/util/master/servers.jst index 5031f083d..bf4a4bf54 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -47,7 +47,8 @@ {{=tooltipString(server.description, 50)}} {{?}} {{? !master.no_flags}} - + + {{=hoverString("Privs", server.privs)}} {{=server.creative ? 'Cre ' : ''}} {{=server.dedicated ? 'Ded ' : ''}} {{=server.damage ? 'Dmg ' : ''}} From 7be18657b11f6995adac92648be6e6bcb922d7ee Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Mon, 4 Nov 2013 21:54:25 +0400 Subject: [PATCH 054/198] Fix masterserver README.md --- util/master/README.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/util/master/README.md b/util/master/README.md index 232986deb..411fff3e9 100644 --- a/util/master/README.md +++ b/util/master/README.md @@ -7,28 +7,43 @@ You will have to install node.js, doT.js and their dependencies to compile the serverlist webpage template. First install node.js, eg: + # apt-get install nodejs # pacman -S nodejs # emerge nodejs -Then install doT.js and it's dependencies: +Then install doT.js and its dependencies: + $ cd ~/code $ git clone https://github.com/olado/doT.git $ cd doT $ npm install -Or by npm: +Or with npm: + $ npm install dot commander mkdirp And finally compile the template: + $ cd ~/minetest/util/master $ ~/code/doT/bin/dot-packer -s . -d . + or - $ ./node_modules/dot/bin/dot-packer -s . -d . + + $ ~/node_modules/dot/bin/dot-packer -s . -d . -Embending to any page +Embedding to any page ---------------------- - - + + From 1a96987d0fbbcf689825851ee282fe79e4658c02 Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 4 Nov 2013 17:04:55 +0100 Subject: [PATCH 055/198] Fix invalid use of pointer to temporary object in json2lua conversion --- src/convert_json.cpp | 58 +++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/src/convert_json.cpp b/src/convert_json.cpp index 61db67fd5..edb37024c 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -105,13 +105,17 @@ std::vector readModStoreList(Json::Value& modlist) { //id if (modlist[i]["id"].asString().size()) { - const char* id_raw = modlist[i]["id"].asString().c_str(); + std::string id_raw = modlist[i]["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { toadd.id = numbervalue; } + else { + errorstream << "readModStoreList: missing id" << std::endl; + toadd.valid = false; + } } else { errorstream << "readModStoreList: missing id" << std::endl; @@ -163,11 +167,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { ModStoreVersionEntry toadd; if (details["version_set"][i]["id"].asString().size()) { - const char* id_raw = details["version_set"][i]["id"].asString().c_str(); + std::string id_raw = details["version_set"][i]["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { toadd.id = numbervalue; } } @@ -215,11 +219,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { if (details["categories"][i]["id"].asString().size()) { - const char* id_raw = details["categories"][i]["id"].asString().c_str(); + std::string id_raw = details["categories"][i]["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { toadd.id = numbervalue; } } @@ -248,11 +252,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { if (details["author"].isObject()) { if (details["author"]["id"].asString().size()) { - const char* id_raw = details["author"]["id"].asString().c_str(); + std::string id_raw = details["author"]["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { retval.author.id = numbervalue; } else { @@ -282,11 +286,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { if (details["license"].isObject()) { if (details["license"]["id"].asString().size()) { - const char* id_raw = details["license"]["id"].asString().c_str(); + std::string id_raw = details["license"]["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { retval.license.id = numbervalue; } } @@ -313,11 +317,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { if (details["titlepic"].isObject()) { if (details["titlepic"]["id"].asString().size()) { - const char* id_raw = details["titlepic"]["id"].asString().c_str(); + std::string id_raw = details["titlepic"]["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { retval.titlepic.id = numbervalue; } } @@ -332,11 +336,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { if (details["titlepic"]["mod"].asString().size()) { - const char* mod_raw = details["titlepic"]["mod"].asString().c_str(); + std::string mod_raw = details["titlepic"]["mod"].asString(); char* endptr = 0; - int numbervalue = strtol(mod_raw,&endptr,10); + int numbervalue = strtol(mod_raw.c_str(),&endptr,10); - if ((*mod_raw != 0) && (*endptr == 0)) { + if ((mod_raw != "") && (*endptr == 0)) { retval.titlepic.mod = numbervalue; } } @@ -345,11 +349,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { //id if (details["id"].asString().size()) { - const char* id_raw = details["id"].asString().c_str(); + std::string id_raw = details["id"].asString(); char* endptr = 0; - int numbervalue = strtol(id_raw,&endptr,10); + int numbervalue = strtol(id_raw.c_str(),&endptr,10); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { retval.id = numbervalue; } } @@ -389,11 +393,11 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { //value if (details["rating"].asString().size()) { - const char* id_raw = details["rating"].asString().c_str(); + std::string id_raw = details["rating"].asString(); char* endptr = 0; - float numbervalue = strtof(id_raw,&endptr); + float numbervalue = strtof(id_raw.c_str(),&endptr); - if ((*id_raw != 0) && (*endptr == 0)) { + if ((id_raw != "") && (*endptr == 0)) { retval.rating = numbervalue; } } From e46c5277334e7435b74eedba7fdfe2c773f48d06 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 17 Sep 2013 02:57:10 -0400 Subject: [PATCH 056/198] Accept hexadecimal and string values for seeds --- src/emerge.cpp | 5 ++++- src/map.cpp | 2 +- src/util/numeric.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/util/numeric.h | 2 ++ src/util/string.cpp | 16 ++++++++++++++++ src/util/string.h | 1 + 6 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/emerge.cpp b/src/emerge.cpp index ed9aa9044..569f1b80a 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -351,8 +351,11 @@ MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) { if (!mgparams) return NULL; + std::string seedstr = settings->get(settings == g_settings ? + "fixed_map_seed" : "seed"); + mgparams->mg_name = mg_name; - mgparams->seed = settings->getU64(settings == g_settings ? "fixed_map_seed" : "seed"); + mgparams->seed = read_seed(seedstr.c_str()); mgparams->water_level = settings->getS16("water_level"); mgparams->chunksize = settings->getS16("chunksize"); mgparams->flags = settings->getFlagStr("mg_flags", flagdesc_mapgen); diff --git a/src/map.cpp b/src/map.cpp index 968897c0c..cea20b0d3 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3507,7 +3507,7 @@ void ServerMap::loadMapMeta() m_seed = mgparams->seed; } else { if (params.exists("seed")) { - m_seed = params.getU64("seed"); + m_seed = read_seed(params.get("seed").c_str()); m_mgparams->seed = m_seed; } } diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp index 67df4ffba..0426656a5 100644 --- a/src/util/numeric.cpp +++ b/src/util/numeric.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "../log.h" #include "../constants.h" // BS, MAP_BLOCKSIZE +#include #include // Calculate the borders of a "d-radius" cube @@ -139,6 +140,49 @@ int myrand_range(int min, int max) return (myrand()%(max-min+1))+min; } +// 64-bit unaligned version of MurmurHash +u64 murmur_hash_64_ua(const void *key, int len, unsigned int seed) +{ + const u64 m = 0xc6a4a7935bd1e995; + const int r = 47; + u64 h = seed ^ (len * m); + + const u64 *data = (const u64 *)key; + const u64 *end = data + (len / 8); + + while (data != end) { + u64 k; + memcpy(&k, data, sizeof(u64)); + data++; + + k *= m; + k ^= k >> r; + k *= m; + + h ^= k; + h *= m; + } + + const unsigned char *data2 = (const unsigned char *)data; + switch (len & 7) { + case 7: h ^= (u64)data2[6] << 48; + case 6: h ^= (u64)data2[5] << 40; + case 5: h ^= (u64)data2[4] << 32; + case 4: h ^= (u64)data2[3] << 24; + case 3: h ^= (u64)data2[2] << 16; + case 2: h ^= (u64)data2[1] << 8; + case 1: h ^= (u64)data2[0]; + h *= m; + } + + h ^= h >> r; + h *= m; + h ^= h >> r; + + return h; +} + + /* blockpos: position of block in block coordinates camera_pos: position of camera in nodes diff --git a/src/util/numeric.h b/src/util/numeric.h index b96c94faa..8e3a617ff 100644 --- a/src/util/numeric.h +++ b/src/util/numeric.h @@ -222,6 +222,8 @@ int myrand_range(int min, int max); Miscellaneous functions */ +u64 murmur_hash_64_ua(const void *key, int len, unsigned int seed); + bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir, f32 camera_fov, f32 range, f32 *distance_ptr=NULL); diff --git a/src/util/string.cpp b/src/util/string.cpp index 2c1dea497..a2312baf8 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "string.h" #include "pointer.h" +#include "numeric.h" #include "../sha1.h" #include "../base64.h" @@ -136,3 +137,18 @@ char *mystrtok_r(char *s, const char *sep, char **lasts) { *lasts = t; return s; } + +u64 read_seed(const char *str) { + char *endptr; + u64 num; + + if (str[0] == '0' && str[1] == 'x') + num = strtoull(str, &endptr, 16); + else + num = strtoull(str, &endptr, 10); + + if (*endptr) + num = murmur_hash_64_ua(str, (int)strlen(str), 0x1337); + + return num; +} diff --git a/src/util/string.h b/src/util/string.h index 7531600e3..81855962f 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -321,6 +321,7 @@ size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata); u32 readFlagString(std::string str, FlagDesc *flagdesc); std::string writeFlagString(u32 flags, FlagDesc *flagdesc); char *mystrtok_r(char *s, const char *sep, char **lasts); +u64 read_seed(const char *str); #endif From 2e89209cf1902b93352f6eeeb8ac2c5d5fcb3b70 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 17 Sep 2013 03:18:50 -0400 Subject: [PATCH 057/198] Add seed entry to world creation dialog --- builtin/mainmenu.lua | 176 +++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 89 deletions(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index d67a37c8d..d818773c3 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -142,23 +142,22 @@ function init_globals() filterlist.add_sort_mechanism(worldlist,"alphabetic",sort_worlds_alphabetic) filterlist.set_sortmode(worldlist,"alphabetic") - end -------------------------------------------------------------------------------- function update_menu() - local formspec = "size[12,5.2]" + local formspec -- handle errors if gamedata.errormessage ~= nil then - formspec = formspec .. + formspec = "size[12,5.2]" .. "field[1,2;10,2;;ERROR: " .. gamedata.errormessage .. ";]".. "button[4.5,4.2;3,0.5;btn_error_confirm;" .. fgettext("Ok") .. "]" else - formspec = formspec .. tabbuilder.gettab() + formspec = tabbuilder.gettab() end engine.update_formspec(formspec) @@ -279,7 +278,8 @@ end function tabbuilder.dialog_create_world() local mapgens = {"v6", "v7", "indev", "singlenode", "math"} - local current_mg = engine.setting_get("mg_name") + local current_seed = engine.setting_get("fixed_map_seed") or "" + local current_mg = engine.setting_get("mg_name") local mglist = "" local selindex = 1 @@ -295,15 +295,20 @@ function tabbuilder.dialog_create_world() local retval = "label[2,0;" .. fgettext("World name") .. "]".. - "label[2,1;" .. fgettext("Mapgen") .. "]".. "field[4.5,0.4;6,0.5;te_world_name;;]" .. - "label[2,2;" .. fgettext("Game") .. "]".. - "button[5,4.5;2.6,0.5;world_create_confirm;" .. fgettext("Create") .. "]" .. - "button[7.5,4.5;2.8,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]" .. - "dropdown[4.2,1;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" .. - "textlist[4.2,1.9;5.8,2.3;games;" .. - gamemgr.gamelist() .. - ";" .. menu.last_game .. ";true]" + + "label[2,1;" .. fgettext("Seed") .. "]".. + "field[4.5,1.4;6,0.5;te_seed;;".. current_seed .. "]" .. + + "label[2,2;" .. fgettext("Mapgen") .. "]".. + "dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" .. + + "label[2,3;" .. fgettext("Game") .. "]".. + "textlist[4.2,3;5.8,2.3;games;" .. gamemgr.gamelist() .. + ";" .. menu.last_game .. ";true]" .. + + "button[5,5.5;2.6,0.5;world_create_confirm;" .. fgettext("Create") .. "]" .. + "button[7.5,5.5;2.8,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]" return retval end @@ -317,43 +322,18 @@ function tabbuilder.dialog_delete_world() end -------------------------------------------------------------------------------- + function tabbuilder.gettab() - local retval = "" - + local tsize = tabbuilder.tabsizes[tabbuilder.current_tab] or {width=12, height=5.2} + local retval = "size[" .. tsize.width .. "," .. tsize.height .. "]" + if tabbuilder.show_buttons then retval = retval .. tabbuilder.tab_header() end - if tabbuilder.current_tab == "singleplayer" then - retval = retval .. tabbuilder.tab_singleplayer() - end - - if tabbuilder.current_tab == "multiplayer" then - retval = retval .. tabbuilder.tab_multiplayer() - end - - if tabbuilder.current_tab == "server" then - retval = retval .. tabbuilder.tab_server() - end - - if tabbuilder.current_tab == "settings" then - retval = retval .. tabbuilder.tab_settings() - end - - if tabbuilder.current_tab == "texture_packs" then - retval = retval .. tabbuilder.tab_texture_packs() - end - - if tabbuilder.current_tab == "credits" then - retval = retval .. tabbuilder.tab_credits() - end - - if tabbuilder.current_tab == "dialog_create_world" then - retval = retval .. tabbuilder.dialog_create_world() - end - - if tabbuilder.current_tab == "dialog_delete_world" then - retval = retval .. tabbuilder.dialog_delete_world() + local buildfunc = tabbuilder.tabfuncs[tabbuilder.current_tab] + if buildfunc ~= nil then + retval = retval .. buildfunc() end retval = retval .. modmgr.gettab(tabbuilder.current_tab) @@ -383,6 +363,8 @@ function tabbuilder.handle_create_world_buttons(fields) else message = fgettext("A world named \"$1\" already exists", worldname) end + + engine.setting_set("fixed_map_seed", fields["te_seed"]) if message ~= nil then gamedata.errormessage = message @@ -824,50 +806,6 @@ function tabbuilder.handle_tab_buttons(fields) tabbuilder.old_tab = tabbuilder.current_tab end --------------------------------------------------------------------------------- -function tabbuilder.init() - tabbuilder.current_tab = engine.setting_get("main_menu_tab") - - if tabbuilder.current_tab == nil or - tabbuilder.current_tab == "" then - tabbuilder.current_tab = "singleplayer" - engine.setting_set("main_menu_tab",tabbuilder.current_tab) - end - - --initialize tab buttons - tabbuilder.last_tab = nil - tabbuilder.show_buttons = true - - tabbuilder.current_buttons = {} - table.insert(tabbuilder.current_buttons,{name="singleplayer", caption=fgettext("Singleplayer")}) - table.insert(tabbuilder.current_buttons,{name="multiplayer", caption=fgettext("Client")}) - table.insert(tabbuilder.current_buttons,{name="server", caption=fgettext("Server")}) - table.insert(tabbuilder.current_buttons,{name="settings", caption=fgettext("Settings")}) - table.insert(tabbuilder.current_buttons,{name="texture_packs", caption=fgettext("Texture Packs")}) - - if engine.setting_getbool("main_menu_game_mgr") then - table.insert(tabbuilder.current_buttons,{name="game_mgr", caption=fgettext("Games")}) - end - - if engine.setting_getbool("main_menu_mod_mgr") then - table.insert(tabbuilder.current_buttons,{name="mod_mgr", caption=fgettext("Mods")}) - end - table.insert(tabbuilder.current_buttons,{name="credits", caption=fgettext("Credits")}) - - - for i=1,#tabbuilder.current_buttons,1 do - if tabbuilder.current_buttons[i].name == tabbuilder.current_tab then - tabbuilder.last_tab_index = i - end - end - - if tabbuilder.current_tab ~= "singleplayer" then - menu.update_gametype(true) - else - menu.update_gametype() - end -end - -------------------------------------------------------------------------------- function tabbuilder.tab_multiplayer() @@ -1091,6 +1029,66 @@ function tabbuilder.tab_credits() ";0;true]" end +-------------------------------------------------------------------------------- +function tabbuilder.init() + tabbuilder.tabfuncs = { + singleplayer = tabbuilder.tab_singleplayer, + multiplayer = tabbuilder.tab_multiplayer, + server = tabbuilder.tab_server, + settings = tabbuilder.tab_settings, + texture_packs = tabbuilder.tab_texture_packs, + credits = tabbuilder.tab_credits, + dialog_create_world = tabbuilder.dialog_create_world, + dialog_delete_world = tabbuilder.dialog_delete_world + } + + tabbuilder.tabsizes = { + dialog_create_world = {width=12, height=7}, + dialog_delete_world = {width=12, height=5.2} + } + + tabbuilder.current_tab = engine.setting_get("main_menu_tab") + + if tabbuilder.current_tab == nil or + tabbuilder.current_tab == "" then + tabbuilder.current_tab = "singleplayer" + engine.setting_set("main_menu_tab",tabbuilder.current_tab) + end + + --initialize tab buttons + tabbuilder.last_tab = nil + tabbuilder.show_buttons = true + + tabbuilder.current_buttons = {} + table.insert(tabbuilder.current_buttons,{name="singleplayer", caption=fgettext("Singleplayer")}) + table.insert(tabbuilder.current_buttons,{name="multiplayer", caption=fgettext("Client")}) + table.insert(tabbuilder.current_buttons,{name="server", caption=fgettext("Server")}) + table.insert(tabbuilder.current_buttons,{name="settings", caption=fgettext("Settings")}) + table.insert(tabbuilder.current_buttons,{name="texture_packs", caption=fgettext("Texture Packs")}) + + if engine.setting_getbool("main_menu_game_mgr") then + table.insert(tabbuilder.current_buttons,{name="game_mgr", caption=fgettext("Games")}) + end + + if engine.setting_getbool("main_menu_mod_mgr") then + table.insert(tabbuilder.current_buttons,{name="mod_mgr", caption=fgettext("Mods")}) + end + table.insert(tabbuilder.current_buttons,{name="credits", caption=fgettext("Credits")}) + + + for i=1,#tabbuilder.current_buttons,1 do + if tabbuilder.current_buttons[i].name == tabbuilder.current_tab then + tabbuilder.last_tab_index = i + end + end + + if tabbuilder.current_tab ~= "singleplayer" then + menu.update_gametype(true) + else + menu.update_gametype() + end +end + -------------------------------------------------------------------------------- function tabbuilder.checkretval(retval) From 6f44492238c89079402a984466d037f4558924e6 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 5 Nov 2013 21:17:33 +0400 Subject: [PATCH 058/198] Masterserver uptime fix --- util/master/list.js | 1 + util/master/servers.jst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/util/master/list.js b/util/master/list.js index 2a831a268..59c12cd9e 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -19,6 +19,7 @@ function humanTime(seconds) { return (seconds / conv[i]).toFixed(1) + i; } } + return seconds + 's'; } function escapeHTML(str) { diff --git a/util/master/servers.jst b/util/master/servers.jst index bf4a4bf54..3db07d05a 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -7,7 +7,7 @@ {{? !master.no_address}}{{?}} - {{? !master.no_clients}}{{?}} + {{? !master.no_clients}}{{?}} {{? !master.no_version}}{{?}} {{? !master.no_name}}{{?}} {{? !master.no_description}}{{?}} @@ -25,7 +25,7 @@ {{?}} {{? !master.no_clients}} {{?}} {{? !master.no_version}} From 8903c68460d79aeac6b1c5074003743f98371339 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 5 Nov 2013 16:57:43 +0400 Subject: [PATCH 059/198] Correct useragent in http queries Net struct init --- src/client.cpp | 2 ++ src/convert_json.cpp | 2 ++ src/guiEngine.cpp | 2 +- src/serverlist.cpp | 2 +- src/socket.cpp | 9 +++++++-- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 98c9af972..5e8f20620 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -48,6 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/serialize.h" #include "config.h" #include "util/directiontables.h" +#include "version.h" #if USE_CURL #include @@ -245,6 +246,7 @@ void * MediaFetchThread::Thread() std::ostringstream stream; curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &stream); + curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); res = curl_easy_perform(curl); if (res == CURLE_OK) { std::string data = stream.str(); diff --git a/src/convert_json.cpp b/src/convert_json.cpp index edb37024c..e8eede0b1 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "main.h" // for g_settings #include "settings.h" +#include "version.h" #if USE_CURL #include @@ -56,6 +57,7 @@ Json::Value fetchJsonValue(const std::string url, curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring); curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout")); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, g_settings->getS32("curl_timeout")); + curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); if (chunk != 0) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index a96a832c4..d5f528f3b 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -532,7 +532,7 @@ bool GUIEngine::downloadFile(std::string url,std::string target) { curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, targetfile); - + curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); res = curl_easy_perform(curl); if (res != CURLE_OK) { errorstream << "File at url \"" << url diff --git a/src/serverlist.cpp b/src/serverlist.cpp index fa2ddad15..f9e3c6734 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -241,7 +241,7 @@ void sendAnnounce(std::string action, const std::vector & clients_n CURLcode res; curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl, CURLOPT_URL, (g_settings->get("serverlist_url")+std::string("/announce?json=")+curl_easy_escape(curl, writer.write( server ).c_str(), 0)).c_str()); - //curl_easy_setopt(curl, CURLOPT_USERAGENT, "minetest"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ServerList::ServerAnnounceCallback); //curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1); diff --git a/src/socket.cpp b/src/socket.cpp index 1c07c44d5..c3873dab6 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -345,6 +345,8 @@ void UDPSocket::Bind(u16 port) if(m_addr_family == AF_INET6) { struct sockaddr_in6 address; + memset(&address, 0, sizeof(address)); + address.sin6_family = AF_INET6; address.sin6_addr = in6addr_any; address.sin6_port = htons(port); @@ -360,6 +362,8 @@ void UDPSocket::Bind(u16 port) else { struct sockaddr_in address; + memset(&address, 0, sizeof(address)); + address.sin_family = AF_INET; address.sin_addr.s_addr = INADDR_ANY; address.sin_port = htons(port); @@ -454,6 +458,7 @@ int UDPSocket::Receive(Address & sender, void * data, int size) if(m_addr_family == AF_INET6) { struct sockaddr_in6 address; + memset(&address, 0, sizeof(address)); socklen_t address_len = sizeof(address); received = recvfrom(m_handle, (char *) data, @@ -470,6 +475,8 @@ int UDPSocket::Receive(Address & sender, void * data, int size) else { struct sockaddr_in address; + memset(&address, 0, sizeof(address)); + socklen_t address_len = sizeof(address); received = recvfrom(m_handle, (char *) data, @@ -568,5 +575,3 @@ bool UDPSocket::WaitData(int timeout_ms) // There is data return true; } - - From d886f340035d35e0cfc12dc57e35679430830919 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 5 Nov 2013 02:11:35 -0500 Subject: [PATCH 060/198] Add 6d facedir rotation prediction routine --- builtin/misc_helpers.lua | 78 ++++++++++++++++++++++++++++++++++++++++ doc/lua_api.txt | 17 +++++++++ 2 files changed, 95 insertions(+) diff --git a/builtin/misc_helpers.lua b/builtin/misc_helpers.lua index 3a325e0d3..d847db42c 100644 --- a/builtin/misc_helpers.lua +++ b/builtin/misc_helpers.lua @@ -205,6 +205,84 @@ function tbl.formspec_escape(text) return text end +-------------------------------------------------------------------------------- + +if minetest then + local dirs1 = { 9, 18, 7, 12 } + local dirs2 = { 20, 23, 22, 21 } + + function minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orient_flags) + + local node = minetest.get_node(pointed_thing.under) + if not minetest.registered_nodes[node.name] + or not minetest.registered_nodes[node.name].on_rightclick then + + local above = pointed_thing.above + local under = pointed_thing.under + local pitch = placer:get_look_pitch() + local pname = minetest.get_node(under).name + local node = minetest.get_node(above) + local fdir = minetest.dir_to_facedir(placer:get_look_dir()) + local wield_name = itemstack:get_name() + local reg_node = minetest.registered_nodes[pname] + + if not reg_node or not reg_node.on_rightclick then + + local iswall = (above.x ~= under.x) or (above.z ~= under.z) + local isceiling = (above.x == under.x) and (above.z == under.z) + and (pitch > 0) + local pos1 = above + + if reg_node and reg_node.buildable_to then + pos1 = under + iswall = false + end + + reg_node = minetest.registered_nodes[minetest.get_node(pos1).name] + if not reg_node or not reg_node.buildable_to then + return + end + + if orient_flags.force_floor then + iswall = false + isceiling = false + elseif orient_flags.force_ceiling then + iswall = false + isceiling = true + elseif orient_flags.force_wall then + iswall = true + isceiling = false + elseif orient_flags.invert_wall then + iswall = not iswall + end + + if iswall then + minetest.add_node(pos1, {name = wield_name, param2 = dirs1[fdir+1] }) + elseif isceiling then + if orient_flags.force_facedir then + minetest.add_node(pos1, {name = wield_name, param2 = 20 }) + else + minetest.add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) + end + else -- place right side up + if orient_flags.force_facedir then + minetest.add_node(pos1, {name = wield_name, param2 = 0 }) + else + minetest.add_node(pos1, {name = wield_name, param2 = fdir }) + end + end + + if not infinitestacks then + itemstack:take_item() + return itemstack + end + end + else + minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) + end + end +end + -------------------------------------------------------------------------------- -- mainmenu only functions -------------------------------------------------------------------------------- diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 689496e22..122fbde99 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1543,6 +1543,23 @@ minetest.is_protected(pos, name) -> bool minetest.record_protection_violation(pos, name) ^ This function calls functions registered with minetest.register_on_protection_violation. +minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orient_flags) +^ Attempt to predict the desired orientation of the facedir-capable node + defined by itemstack, and place it accordingly (on-wall, on the floor, or + hanging from the ceiling). Stacks are handled normally if the infinitestacks + field is false or omitted (else, the itemstack is not changed). orient_flags + is an optional table containing extra tweaks to the placement code: + invert_wall: if true, place wall-orientation on the ground and ground- + orientation on the wall. + force_wall: if true, always place the node in wall orientation. + force_ceiling: if true, always place on the ceiling. + force_floor: if true, always place the node on the floor. + + The above four options are mutually-exclusive; the last in the list takes + precedence over the first. + + force_facedir: if true, forcably reset the facedir to north when placing on + the floor or ceiling Global objects: minetest.env - EnvRef of the server environment and world. From 8ad052881cb40032db63cbc9c76ae3c9786f8ef9 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Wed, 6 Nov 2013 22:09:06 -0500 Subject: [PATCH 061/198] Fix orient_flags to be optional. --- builtin/misc_helpers.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/misc_helpers.lua b/builtin/misc_helpers.lua index d847db42c..c9bc59c3a 100644 --- a/builtin/misc_helpers.lua +++ b/builtin/misc_helpers.lua @@ -212,6 +212,7 @@ if minetest then local dirs2 = { 20, 23, 22, 21 } function minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orient_flags) + orient_flags = orient_flags or {} local node = minetest.get_node(pointed_thing.under) if not minetest.registered_nodes[node.name] From 3d63492f50ecc547197df1818417d339906091f6 Mon Sep 17 00:00:00 2001 From: Cy Date: Wed, 6 Nov 2013 19:08:18 -0800 Subject: [PATCH 062/198] Don't assert scalars must be vectors. --- builtin/vector.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/vector.lua b/builtin/vector.lua index 6b787366d..77944b612 100644 --- a/builtin/vector.lua +++ b/builtin/vector.lua @@ -90,8 +90,8 @@ end function vector.add(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x + b.x, y = a.y + b.y, z = a.z + b.z} @@ -104,8 +104,8 @@ end function vector.subtract(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x - b.x, y = a.y - b.y, z = a.z - b.z} @@ -118,8 +118,8 @@ end function vector.multiply(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x * b.x, y = a.y * b.y, z = a.z * b.z} @@ -132,8 +132,8 @@ end function vector.divide(a, b) assert_vector(a) - assert_vector(b) if type(b) == "table" then + assert_vector(b) return {x = a.x / b.x, y = a.y / b.y, z = a.z / b.z} From 1d856b734b735129da209bc25f45abb2852328a0 Mon Sep 17 00:00:00 2001 From: 4Evergreen4 Date: Thu, 7 Nov 2013 16:20:04 -0500 Subject: [PATCH 063/198] Add wrapper for minetest.rotate_and_place. --- builtin/misc_helpers.lua | 14 ++++++++++++++ doc/lua_api.txt | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/builtin/misc_helpers.lua b/builtin/misc_helpers.lua index c9bc59c3a..38909ec1d 100644 --- a/builtin/misc_helpers.lua +++ b/builtin/misc_helpers.lua @@ -282,6 +282,20 @@ if minetest then minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) end end + + +-------------------------------------------------------------------------------- +--Wrapper for rotate_and_place() to check for sneak and assume Creative mode +--implies infinite stacks when performing a 6d rotation. +-------------------------------------------------------------------------------- + + + minetest.rotate_node = function(itemstack, placer, pointed_thing) + minetest.rotate_and_place(itemstack, placer, pointed_thing, + minetest.setting_getbool("creative_mode"), + {invert_wall = placer:get_player_control().sneak}) + return itemstack + end end -------------------------------------------------------------------------------- diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 122fbde99..76eea95cc 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1561,6 +1561,11 @@ minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orie force_facedir: if true, forcably reset the facedir to north when placing on the floor or ceiling +minetest.rotate_node(itemstack, placer, pointed_thing) +^ calls rotate_and_place() with infinitestacks set according to the state of + the creative mode setting, and checks for "sneak" to set the invert_wall + parameter. + Global objects: minetest.env - EnvRef of the server environment and world. ^ Any function in the minetest namespace can be called using the syntax From 1afd3595505e1f1cbcf727682194ab755ac005f4 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Fri, 8 Nov 2013 18:16:08 +0100 Subject: [PATCH 064/198] Fix typo in lua_api.txt --- doc/lua_api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 76eea95cc..c4d12db0f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1073,7 +1073,7 @@ vector.distance(p1, p2) -> number vector.length(v) -> number vector.normalize(v) -> vector vector.round(v) -> vector -vector.equal(v1, v2) -> bool +vector.equals(v1, v2) -> bool For the folowing x can be either a vector or a number. vector.add(v, x) -> vector vector.subtract(v, x) -> vector From 7bd30b59eee2f18ac7b893151f18d04711d665bc Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 9 Nov 2013 11:01:16 +0100 Subject: [PATCH 065/198] Fix crash updating gametype without game --- builtin/mainmenu.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index d818773c3..7f3bf7f07 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -1191,12 +1191,13 @@ end -------------------------------------------------------------------------------- function menu.update_gametype(reset) - if reset then + local game = menu.lastgame() + + if reset or game == nil then mm_texture.reset() engine.set_topleft_text("") filterlist.set_filtercriteria(worldlist,nil) else - local game = menu.lastgame() mm_texture.update(tabbuilder.current_tab,game) engine.set_topleft_text(game.name) filterlist.set_filtercriteria(worldlist,game.id) From b6bb3ffec43197b808fdc3c1dda6cb7823cd49e5 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 9 Nov 2013 13:56:36 +0100 Subject: [PATCH 066/198] Fix game buttons not beeing 48x48 --- builtin/mm_menubar.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/builtin/mm_menubar.lua b/builtin/mm_menubar.lua index a60ea7ae5..2e4d5f8b8 100644 --- a/builtin/mm_menubar.lua +++ b/builtin/mm_menubar.lua @@ -30,27 +30,28 @@ end -------------------------------------------------------------------------------- function menubar.refresh() - menubar.formspec = "box[-0.3,5.625;12.4,1.3;#000000]" .. + + menubar.formspec = "box[-0.3,5.625;12.4,1.2;#000000]" .. "box[-0.3,5.6;12.4,0.05;#FFFFFF]" menubar.buttons = {} - local button_base = -0.25 + local button_base = -0.08 local maxbuttons = #gamemgr.games - if maxbuttons > 10 then - maxbuttons = 10 + if maxbuttons > 11 then + maxbuttons = 11 end for i=1,maxbuttons,1 do local btn_name = "menubar_btn_" .. gamemgr.games[i].id - local buttonpos = button_base + (i-1) * 1.245 + local buttonpos = button_base + (i-1) * 1.1 if gamemgr.games[i].menuicon_path ~= nil and gamemgr.games[i].menuicon_path ~= "" then menubar.formspec = menubar.formspec .. - "image_button[" .. buttonpos .. ",5.7;1.3,1.3;" .. + "image_button[" .. buttonpos .. ",5.72;1.165,1.175;" .. engine.formspec_escape(gamemgr.games[i].menuicon_path) .. ";" .. btn_name .. ";;true;false]" else @@ -65,7 +66,7 @@ function menubar.refresh() text = text .. "\n" .. part3 end menubar.formspec = menubar.formspec .. - "image_button[" .. buttonpos .. ",5.7;1.3,1.3;;" ..btn_name .. + "image_button[" .. buttonpos .. ",5.72;1.165,1.175;;" ..btn_name .. ";" .. text .. ";true;true]" end From 0aeecf3f7f1adb37de46d1e6d68653082dd8111a Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 9 Nov 2013 14:28:00 +0100 Subject: [PATCH 067/198] Add BlockMen to core dev list --- builtin/mainmenu.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 7f3bf7f07..7ef5129c3 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -1010,6 +1010,7 @@ function tabbuilder.tab_credits() "sapier,".. "ShadowNinja ,".. "Nathanaël Courant (Nore/Novatux) ,".. + "BlockMen,".. ",".. "#FFFF00" .. fgettext("Active Contributors") .. "," .. "Vanessa Ezekowitz (VanessaE) ,".. From b401e58c0dcf0993c6198dcc21e8787c2282d8f6 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 9 Nov 2013 15:26:04 -0500 Subject: [PATCH 068/198] Weather: Fix uninitialized weather_update_time (sorry proller) --- src/map.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/map.cpp b/src/map.cpp index cea20b0d3..f74011933 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2841,6 +2841,8 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data, y<=blockpos_max.Y+extra_borders.Y; y++) { v3s16 p(x, y, z); + MapBlock *block = getBlockNoCreateNoEx(p); + block->weather_update_time = 0; updateBlockHeat(senv, p * MAP_BLOCKSIZE, NULL); updateBlockHumidity(senv, p * MAP_BLOCKSIZE, NULL); } From a92e90f6841c0f4ff7b321f635fc84863c602f1d Mon Sep 17 00:00:00 2001 From: "0gb.us" <0gb.us@0gb.us> Date: Sat, 9 Nov 2013 17:37:05 -0800 Subject: [PATCH 069/198] FIxed floating isle generation at chunk boundaries A mapgen fix authored by paramat, as mentioned here: https://github.com/minetest/minetest/issues/989 --- src/mapgen_indev.cpp | 86 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/src/mapgen_indev.cpp b/src/mapgen_indev.cpp index 430359be2..bd922a4df 100644 --- a/src/mapgen_indev.cpp +++ b/src/mapgen_indev.cpp @@ -345,50 +345,52 @@ void MapgenIndev::generateFloatIslands(int min_y) { */ void MapgenIndev::generateFloatIslands(int min_y) { - if (node_min.Y < min_y) return; - PseudoRandom pr(blockseed + 985); - // originally from http://forum.minetest.net/viewtopic.php?id=4776 - float RAR = 0.8 * farscale(0.4, node_min.Y); // 0.4; // Island rarity in chunk layer. -0.4 = thick layer with holes, 0 = 50%, 0.4 = desert rarity, 0.7 = very rare. - float AMPY = 24; // 24; // Amplitude of island centre y variation. - float TGRAD = 24; // 24; // Noise gradient to create top surface. Tallness of island top. - float BGRAD = 24; // 24; // Noise gradient to create bottom surface. Tallness of island bottom. + if (node_min.Y < min_y) return; + PseudoRandom pr(blockseed + 985); + // originally from http://forum.minetest.net/viewtopic.php?id=4776 + float RAR = 0.8 * farscale(0.4, node_min.Y); // 0.4; // Island rarity. + float AMPY = 24; // 24; // Amplitude of island centre y variation. + float TGRAD = 24; // 24; // Noise gradient to create top surface. + float BGRAD = 24; // 24; // Noise gradient to create bottom surface. - v3s16 p0(node_min.X, node_min.Y, node_min.Z); - MapNode n1(c_stone); + v3s16 p0(node_min.X, node_min.Y, node_min.Z); + MapNode n1(c_stone); - float xl = node_max.X - node_min.X; - float yl = node_max.Y - node_min.Y; - float zl = node_max.Z - node_min.Z; - float midy = node_min.Y + yl * 0.5; - u32 index = 0, index2d = 0; - for (int x1 = 0; x1 <= xl; ++x1) - { - for (int z1 = 0; z1 <= zl; ++z1, ++index2d) - { - float noise3 = noiseindev_float_islands3->result[index2d]; - float pmidy = midy + noise3 / 1.5 * AMPY; - for (int y1 = 0; y1 <= yl; ++y1, ++index) - { - int y = y1 + node_min.Y; - float noise1 = noiseindev_float_islands1->result[index]; - float offset = y > pmidy ? (y - pmidy) / TGRAD : (pmidy - y) / BGRAD; - float noise1off = noise1 - offset - RAR; - if (noise1off > 0 && noise1off < 0.7) { - float noise2 = noiseindev_float_islands2->result[index]; - if (noise2 - noise1off > -0.7){ - v3s16 p = p0 + v3s16(x1, y1, z1); - u32 i = vm->m_area.index(p); - if (!vm->m_area.contains(i)) - continue; - // Cancel if not air - if (vm->m_data[i].getContent() != CONTENT_AIR) - continue; - vm->m_data[i] = n1; - } - } - } - } - } + float xl = node_max.X - node_min.X; + float yl = node_max.Y - node_min.Y; + float zl = node_max.Z - node_min.Z; + u32 zstride = xl + 1; + float midy = node_min.Y + yl * 0.5; + u32 index = 0; + for (int z1 = 0; z1 <= zl; ++z1) + { + for (int y1 = 0; y1 <= yl; ++y1) + { + for (int x1 = 0; x1 <= xl; ++x1, ++index) + { + int y = y1 + node_min.Y; + u32 index2d = z1 * zstride + x1; + float noise3 = noiseindev_float_islands3->result[index2d]; + float pmidy = midy + noise3 / 1.5 * AMPY; + float noise1 = noiseindev_float_islands1->result[index]; + float offset = y > pmidy ? (y - pmidy) / TGRAD : (pmidy - y) / BGRAD; + float noise1off = noise1 - offset - RAR; + if (noise1off > 0 && noise1off < 0.7) { + float noise2 = noiseindev_float_islands2->result[index]; + if (noise2 - noise1off > -0.7){ + v3s16 p = p0 + v3s16(x1, y1, z1); + u32 i = vm->m_area.index(p); + if (!vm->m_area.contains(i)) + continue; + // Cancel if not air + if (vm->m_data[i].getContent() != CONTENT_AIR) + continue; + vm->m_data[i] = n1; + } + } + } + } + } } void MapgenIndev::generateExperimental() { From d75b1718f8768cca1390c463215e65c4ec9ef6c4 Mon Sep 17 00:00:00 2001 From: proller Date: Sun, 10 Nov 2013 18:24:45 +0400 Subject: [PATCH 070/198] Fix spaces float islands code --- src/mapgen_indev.cpp | 83 +++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/src/mapgen_indev.cpp b/src/mapgen_indev.cpp index bd922a4df..7203fc85d 100644 --- a/src/mapgen_indev.cpp +++ b/src/mapgen_indev.cpp @@ -345,52 +345,47 @@ void MapgenIndev::generateFloatIslands(int min_y) { */ void MapgenIndev::generateFloatIslands(int min_y) { - if (node_min.Y < min_y) return; - PseudoRandom pr(blockseed + 985); - // originally from http://forum.minetest.net/viewtopic.php?id=4776 - float RAR = 0.8 * farscale(0.4, node_min.Y); // 0.4; // Island rarity. - float AMPY = 24; // 24; // Amplitude of island centre y variation. - float TGRAD = 24; // 24; // Noise gradient to create top surface. - float BGRAD = 24; // 24; // Noise gradient to create bottom surface. + if (node_min.Y < min_y) return; + PseudoRandom pr(blockseed + 985); + // originally from http://forum.minetest.net/viewtopic.php?id=4776 + float RAR = 0.8 * farscale(0.4, node_min.Y); // 0.4; // Island rarity in chunk layer. -0.4 = thick layer with holes, 0 = 50%, 0.4 = desert rarity, 0.7 = very rare. + float AMPY = 24; // 24; // Amplitude of island centre y variation. + float TGRAD = 24; // 24; // Noise gradient to create top surface. Tallness of island top. + float BGRAD = 24; // 24; // Noise gradient to create bottom surface. Tallness of island bottom. - v3s16 p0(node_min.X, node_min.Y, node_min.Z); - MapNode n1(c_stone); + v3s16 p0(node_min.X, node_min.Y, node_min.Z); + MapNode n1(c_stone); - float xl = node_max.X - node_min.X; - float yl = node_max.Y - node_min.Y; - float zl = node_max.Z - node_min.Z; - u32 zstride = xl + 1; - float midy = node_min.Y + yl * 0.5; - u32 index = 0; - for (int z1 = 0; z1 <= zl; ++z1) - { - for (int y1 = 0; y1 <= yl; ++y1) - { - for (int x1 = 0; x1 <= xl; ++x1, ++index) - { - int y = y1 + node_min.Y; - u32 index2d = z1 * zstride + x1; - float noise3 = noiseindev_float_islands3->result[index2d]; - float pmidy = midy + noise3 / 1.5 * AMPY; - float noise1 = noiseindev_float_islands1->result[index]; - float offset = y > pmidy ? (y - pmidy) / TGRAD : (pmidy - y) / BGRAD; - float noise1off = noise1 - offset - RAR; - if (noise1off > 0 && noise1off < 0.7) { - float noise2 = noiseindev_float_islands2->result[index]; - if (noise2 - noise1off > -0.7){ - v3s16 p = p0 + v3s16(x1, y1, z1); - u32 i = vm->m_area.index(p); - if (!vm->m_area.contains(i)) - continue; - // Cancel if not air - if (vm->m_data[i].getContent() != CONTENT_AIR) - continue; - vm->m_data[i] = n1; - } - } - } - } - } + float xl = node_max.X - node_min.X; + float yl = node_max.Y - node_min.Y; + float zl = node_max.Z - node_min.Z; + u32 zstride = xl + 1; + float midy = node_min.Y + yl * 0.5; + u32 index = 0; + for (int z1 = 0; z1 <= zl; ++z1) + for (int y1 = 0; y1 <= yl; ++y1) + for (int x1 = 0; x1 <= xl; ++x1, ++index) { + int y = y1 + node_min.Y; + u32 index2d = z1 * zstride + x1; + float noise3 = noiseindev_float_islands3->result[index2d]; + float pmidy = midy + noise3 / 1.5 * AMPY; + float noise1 = noiseindev_float_islands1->result[index]; + float offset = y > pmidy ? (y - pmidy) / TGRAD : (pmidy - y) / BGRAD; + float noise1off = noise1 - offset - RAR; + if (noise1off > 0 && noise1off < 0.7) { + float noise2 = noiseindev_float_islands2->result[index]; + if (noise2 - noise1off > -0.7) { + v3s16 p = p0 + v3s16(x1, y1, z1); + u32 i = vm->m_area.index(p); + if (!vm->m_area.contains(i)) + continue; + // Cancel if not air + if (vm->m_data[i].getContent() != CONTENT_AIR) + continue; + vm->m_data[i] = n1; + } + } + } } void MapgenIndev::generateExperimental() { From 0f9440fa61fbfd95b0c06217d08b07c81c897ee0 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 10 Nov 2013 19:37:45 +0100 Subject: [PATCH 071/198] Fix "TODO read modinfo" in modmanager to improve ui usability --- builtin/misc_helpers.lua | 56 ++++++++++++++++++++++++++++++ builtin/modmgr.lua | 74 +++++++++++++++++++++++++++++++--------- doc/lua_api.txt | 8 +++++ src/guiFormSpecMenu.cpp | 9 ++++- 4 files changed, 130 insertions(+), 17 deletions(-) diff --git a/builtin/misc_helpers.lua b/builtin/misc_helpers.lua index 38909ec1d..55c5798d7 100644 --- a/builtin/misc_helpers.lua +++ b/builtin/misc_helpers.lua @@ -205,6 +205,62 @@ function tbl.formspec_escape(text) return text end + +function tbl.splittext(text,charlimit) + local retval = {} + + local current_idx = 1 + + local start,stop = string.find(text," ",current_idx) + local nl_start,nl_stop = string.find(text,"\n",current_idx) + local gotnewline = false + if nl_start ~= nil and (start == nil or nl_start < start) then + start = nl_start + stop = nl_stop + gotnewline = true + end + local last_line = "" + while start ~= nil do + if string.len(last_line) + (stop-start) > charlimit then + table.insert(retval,last_line) + last_line = "" + end + + if last_line ~= "" then + last_line = last_line .. " " + end + + last_line = last_line .. string.sub(text,current_idx,stop -1) + + if gotnewline then + table.insert(retval,last_line) + last_line = "" + gotnewline = false + end + current_idx = stop+1 + + start,stop = string.find(text," ",current_idx) + nl_start,nl_stop = string.find(text,"\n",current_idx) + + if nl_start ~= nil and (start == nil or nl_start < start) then + start = nl_start + stop = nl_stop + gotnewline = true + end + end + + --add last part of text + if string.len(last_line) + (string.len(text) - current_idx) > charlimit then + table.insert(retval,last_line) + table.insert(retval,string.sub(text,current_idx)) + else + last_line = last_line .. " " .. string.sub(text,current_idx) + table.insert(retval,last_line) + end + + return retval +end + -------------------------------------------------------------------------------- if minetest then diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index d9579c652..04f19ec86 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -235,13 +235,14 @@ function modmgr.tab() local retval = "vertlabel[0,-0.25;".. fgettext("MODS") .. "]" .. "label[0.8,-0.25;".. fgettext("Installed Mods:") .. "]" .. - "textlist[0.75,0.25;4.5,4.3;modlist;" .. + "textlist[0.75,0.25;4.5,4;modlist;" .. modmgr.render_modlist(modmgr.global_mods) .. ";" .. modmgr.selected_mod .. "]" retval = retval .. - "button[1,4.85;2,0.5;btn_mod_mgr_install_local;".. fgettext("Install") .. "]" .. - "button[3,4.85;2,0.5;btn_mod_mgr_download;".. fgettext("Download") .. "]" + "label[0.8,4.2;" .. fgettext("Add mod:") .. "]" .. + "button[0.75,4.85;1.8,0.5;btn_mod_mgr_install_local;".. fgettext("Local install") .. "]" .. + "button[2.45,4.85;3.05,0.5;btn_mod_mgr_download;".. fgettext("Online mod repository") .. "]" local selected_mod = nil @@ -250,25 +251,66 @@ function modmgr.tab() end if selected_mod ~= nil then - if selected_mod.is_modpack then - retval = retval - .. "button[10,4.85;2,0.5;btn_mod_mgr_rename_modpack;" .. - fgettext("Rename") .. "]" + local modscreenshot = nil + + --check for screenshot beeing available + local screenshotfilename = selected_mod.path .. DIR_DELIM .. "screenshot.png" + local error = nil + screenshotfile,error = io.open(screenshotfilename,"r") + if error == nil then + screenshotfile:close() + modscreenshot = screenshotfilename + end + + if modscreenshot == nil then + modscreenshot = modstore.basetexturedir .. "no_screenshot.png" + end + + retval = retval + .. "image[5.5,0;3,2;" .. modscreenshot .. "]" + .. "label[8.25,0.6;" .. selected_mod.name .. "]" + + local descriptionlines = nil + error = nil + local descriptionfilename = selected_mod.path .. "description.txt" + descriptionfile,error = io.open(descriptionfilename,"r") + if error == nil then + descriptiontext = descriptionfile:read("*all") + + descriptionlines = engine.splittext(descriptiontext,42) + descriptionfile:close() else - --show dependencies - retval = retval .. - "label[6,1.9;".. fgettext("Depends:") .. "]" .. - "textlist[6,2.4;5.7,2;deplist;" + descriptionlines = {} + table.insert(descriptionlines,fgettext("No mod description available")) + end + + retval = retval .. + "label[5.5,1.7;".. fgettext("Mod information:") .. "]" .. + "textlist[5.5,2.2;6.2,2.4;description;" + + for i=1,#descriptionlines,1 do + retval = retval .. engine.formspec_escape(descriptionlines[i]) .. "," + end + + + if selected_mod.is_modpack then + retval = retval .. ";0]" .. + "button[10,4.85;2,0.5;btn_mod_mgr_rename_modpack;" .. + fgettext("Rename") .. "]" + retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;" + .. fgettext("Uninstall selected modpack") .. "]" + else + --show dependencies + + retval = retval .. ",Depends:," toadd = modmgr.get_dependencies(selected_mod.path) - retval = retval .. toadd .. ";0;true,false]" + retval = retval .. toadd .. ";0]" - --TODO read modinfo + retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;" + .. fgettext("Uninstall selected mod") .. "]" end - --show delete button - retval = retval .. "button[8,4.85;2,0.5;btn_mod_mgr_delete_mod;" - .. fgettext("Delete") .. "]" end return retval end diff --git a/doc/lua_api.txt b/doc/lua_api.txt index c4d12db0f..db9a5e8fa 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -100,6 +100,8 @@ Mod directory structure mods |-- modname | |-- depends.txt +| |-- screenshot.png +| |-- description.txt | |-- init.lua | |-- textures | | |-- modname_stuff.png @@ -121,6 +123,12 @@ depends.txt: to a single modname. Their meaning is that if the specified mod is missing, that does not prevent this mod from being loaded. +screenshot.png: + A screenshot shown in modmanager within mainmenu. + +description.txt: + File containing desctiption to be shown within mainmenu. + optdepends.txt: An alternative way of specifying optional dependencies. Like depends.txt, a single line contains a single modname. diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index e0ef55acd..aa1e2d9c9 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -721,8 +721,15 @@ void GUIFormSpecMenu::parseTextList(parserData* data,std::string element) { scrollbar->setPos(data->listbox_scroll[fname_w]); } } + else { + gui::IGUIScrollBar *scrollbar = getListboxScrollbar(e); + if (scrollbar) { + scrollbar->setPos(0); + } + } - if (str_initial_selection != "") + if ((str_initial_selection != "") && + (str_initial_selection != "0")) e->setSelected(stoi(str_initial_selection.c_str())-1); m_listboxes.push_back(std::pair(spec,e)); From 22a59b3912ff5e7bb1516faa06f1841545a8117c Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 3 Nov 2013 17:28:16 +0100 Subject: [PATCH 072/198] Fix win32/msvc i18n (quite UGLY version, blame Microsoft) --- src/CMakeLists.txt | 1 + src/cguittfont/irrUString.h | 16 ++- src/gettext.cpp | 259 ++++++++++++++++++++++++++++++++++++ src/gettext.h | 69 +++++----- src/guiDeathScreen.cpp | 3 +- src/guiFileSelectMenu.cpp | 2 - src/guiFileSelectMenu.h | 2 - src/guiFormSpecMenu.cpp | 4 +- src/guiKeyChangeMenu.cpp | 17 +-- src/guiMessageMenu.cpp | 3 +- src/guiPasswordChange.cpp | 9 -- src/guiPauseMenu.cpp | 2 - src/guiTextInputMenu.cpp | 2 - src/guiVolumeChange.cpp | 2 - src/main.cpp | 29 +--- src/util/pointer.h | 1 + src/util/string.cpp | 5 +- 17 files changed, 315 insertions(+), 111 deletions(-) create mode 100644 src/gettext.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7b9ca0eae..a30dc9854 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -306,6 +306,7 @@ set(common_SRCS serverlist.cpp pathfinder.cpp convert_json.cpp + gettext.cpp ${JTHREAD_SRCS} ${common_SCRIPT_SRCS} ${UTIL_SRCS} diff --git a/src/cguittfont/irrUString.h b/src/cguittfont/irrUString.h index f41fa1f7b..21109ea48 100644 --- a/src/cguittfont/irrUString.h +++ b/src/cguittfont/irrUString.h @@ -205,6 +205,10 @@ inline core::array getUnicodeBOM(EUTF_ENCODE mode) case EUTFE_UTF32_LE: COPY_ARRAY(BOM_ENCODE_UTF32_LE, BOM_ENCODE_UTF32_LEN); break; + case EUTFE_NONE: + // TODO sapier: fixed warning only, + // don't know if something needs to be done here + break; } return ret; @@ -257,7 +261,7 @@ public: _set(c); return *this; } - + //! Increments the value by 1. //! \return Myself. _ustring16_iterator_access& operator++() @@ -392,7 +396,7 @@ public: return unicode::toUTF32(a[pos], a[pos + 1]); } } - + //! Sets a uchar32_t at our current position. void _set(uchar32_t c) { @@ -707,7 +711,6 @@ public: //! Moves the iterator to the end of the string. void toEnd() { - const uchar16_t* a = ref->c_str(); pos = ref->size_raw(); } @@ -732,12 +735,13 @@ public: typedef typename _Base::const_pointer const_pointer; typedef typename _Base::const_reference const_reference; + typedef typename _Base::value_type value_type; typedef typename _Base::difference_type difference_type; typedef typename _Base::distance_type distance_type; typedef access pointer; typedef access reference; - + using _Base::pos; using _Base::ref; @@ -2096,7 +2100,7 @@ public: } #endif - + //! Appends a number to this ustring16. //! \param c Number to append. //! \return A reference to our current string. @@ -2958,7 +2962,7 @@ public: if (endian != unicode::EUTFEE_NATIVE && getEndianness() != endian) { for (u32 i = 0; i <= used; ++i) - *ptr++ = unicode::swapEndian16(*ptr); + ptr[i] = unicode::swapEndian16(ptr[i]); } ret.set_used(used + (addBOM ? unicode::BOM_UTF16_LEN : 0)); ret.push_back(0); diff --git a/src/gettext.cpp b/src/gettext.cpp new file mode 100644 index 000000000..455c78584 --- /dev/null +++ b/src/gettext.cpp @@ -0,0 +1,259 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include +#include +#include +#include +#include "gettext.h" +#include "util/string.h" + +#if USE_GETTEXT and defined(_MSC_VER) +#include +#include +#include +#include "filesys.h" + +#define setlocale(category,localename) \ + setlocale(category,MSVC_LocaleLookup(localename)) + +static std::map glb_supported_locales; + +/******************************************************************************/ +BOOL CALLBACK UpdateLocaleCallback(LPTSTR pStr) +{ + char* endptr = 0; + int LOCALEID = strtol(pStr,&endptr,16); + + wchar_t buffer[LOCALE_NAME_MAX_LENGTH]; + memset(buffer,0,sizeof(buffer)); + if (GetLocaleInfoW( + LOCALEID, + LOCALE_SISO639LANGNAME, + buffer, + LOCALE_NAME_MAX_LENGTH)) { + + std::wstring name = buffer; + + memset(buffer,0,sizeof(buffer)); + GetLocaleInfoW( + LOCALEID, + LOCALE_SISO3166CTRYNAME, + buffer, + LOCALE_NAME_MAX_LENGTH); + + std::wstring country = buffer; + + memset(buffer,0,sizeof(buffer)); + GetLocaleInfoW( + LOCALEID, + LOCALE_SENGLISHLANGUAGENAME, + buffer, + LOCALE_NAME_MAX_LENGTH); + + std::wstring languagename = buffer; + + /* set both short and long variant */ + glb_supported_locales[name] = languagename; + glb_supported_locales[name + L"_" + country] = languagename; + } + return true; +} + +/******************************************************************************/ +const char* MSVC_LocaleLookup(const char* raw_shortname) { + + /* NULL is used to read locale only so we need to return it too */ + if (raw_shortname == NULL) return NULL; + + std::string shortname(raw_shortname); + if (shortname == "C") return "C"; + if (shortname == "") return ""; + + static std::string last_raw_value = ""; + static std::string last_full_name = ""; + static bool first_use = true; + + if (last_raw_value == shortname) { + return last_full_name.c_str(); + } + + if (first_use) { + EnumSystemLocalesA(UpdateLocaleCallback,LCID_SUPPORTED | LCID_ALTERNATE_SORTS); + first_use = false; + } + + last_raw_value = shortname; + + if (glb_supported_locales.find(narrow_to_wide(shortname)) != glb_supported_locales.end()) { + last_full_name = wide_to_narrow(glb_supported_locales[narrow_to_wide(shortname)]); + return last_full_name.c_str(); + } + + /* empty string is system default */ + errorstream << "MSVC_LocaleLookup: unsupported locale: \"" << shortname + << "\" switching to system default!" << std::endl; + return ""; +} + +#endif + +/******************************************************************************/ +#ifdef _MSC_VER +void init_gettext(const char *path,std::string configured_language,int argc, char** argv) { +#else +void init_gettext(const char *path,std::string configured_language) { +#endif +#if USE_GETTEXT + /** first try to set user override environment **/ + if (configured_language.length() != 0) { +#ifndef _WIN32 + /* add user specified locale to environment */ + setenv("LANGUAGE", configured_language.c_str(), 1); + + /* reload locale with changed environment */ + setlocale(LC_ALL, ""); +#elif defined(_MSC_VER) + std::string current_language_var(""); + if (getenv("LANGUAGE") != 0) { + current_language_var = std::string(getenv("LANGUAGE")); + } + + char *lang_str = (char*)calloc(10 + configured_language.length(), sizeof(char)); + strcat(lang_str, "LANGUAGE="); + strcat(lang_str, configured_language.c_str()); + putenv(lang_str); + + SetEnvironmentVariableA("LANGUAGE",configured_language.c_str()); + + //very very dirty workaround to force gettext to see the right environment + if (current_language_var != configured_language) { + STARTUPINFO startupinfo; + PROCESS_INFORMATION processinfo; + memset(&startupinfo,0,sizeof(startupinfo)); + memset(&processinfo,0,sizeof(processinfo)); + errorstream << "MSVC localization workaround aktive restating minetest in new environment!" << std::endl; + + std::string parameters = ""; + + for (unsigned int i=1;i < argc; i++) { + if (parameters != "") { + parameters += " "; + } + parameters += argv[i]; + } + + const char* ptr_parameters = 0; + + if (parameters != "") { + ptr_parameters = parameters.c_str(); + } + + /** users may start by short name in commandline without extention **/ + std::string appname = argv[0]; + if (appname.substr(appname.length() -4) != ".exe") { + appname += ".exe"; + } + + if (!CreateProcess(appname.c_str(), + (char*) ptr_parameters, + NULL, + NULL, + false, + DETACHED_PROCESS | CREATE_UNICODE_ENVIRONMENT, + NULL, + NULL, + &startupinfo, + &processinfo)) { + char buffer[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), + buffer, + sizeof(buffer)-1, + NULL); + errorstream << "*******************************************************" << std::endl; + errorstream << "CMD: " << appname << std::endl; + errorstream << "Failed to restart with current locale: " << std::endl; + errorstream << buffer; + errorstream << "Expect language to be broken!" << std::endl; + errorstream << "*******************************************************" << std::endl; + } + else { + exit(0); + } + } + + setlocale(LC_ALL,configured_language.c_str()); +#else // Mingw + char *lang_str = (char*)calloc(10 + configured_language.length(), sizeof(char)); + strcat(lang_str, "LANGUAGE="); + strcat(lang_str, configured_language.c_str()); + putenv(lang_str); + + setlocale(LC_ALL, ""); +#endif // ifndef _WIN32 + } + else { + /* set current system default locale */ + setlocale(LC_ALL, ""); + } + +#if defined(_WIN32) + if (getenv("LANGUAGE") != 0) { + setlocale(LC_ALL, getenv("LANGUAGE")); + } +#ifdef _MSC_VER + else if (getenv("LANG") != 0) { + setlocale(LC_ALL, getenv("LANG")); + } +#endif +#endif + + bindtextdomain(PROJECT_NAME, path); + textdomain(PROJECT_NAME); + +#if defined(_WIN32) + // Set character encoding for Win32 + char *tdomain = textdomain( (char *) NULL ); + if( tdomain == NULL ) + { + errorstream << "Warning: domainname parameter is the null pointer" << + ", default domain is not set" << std::endl; + tdomain = (char *) "messages"; + } + /* char *codeset = */bind_textdomain_codeset( tdomain, "UTF-8" ); + //errorstream << "Gettext debug: domainname = " << tdomain << "; codeset = "<< codeset << std::endl; +#endif // defined(_WIN32) + + /* no matter what locale is used we need number format to be "C" */ + /* to ensure formspec parameters are evaluated correct! */ + + + setlocale(LC_NUMERIC,"C"); + infostream << "Message locale is now set to: " + << setlocale(LC_ALL,0) << std::endl; + +#endif // if USE_GETTEXT +} + + + + diff --git a/src/gettext.h b/src/gettext.h index fd32e082f..862274a31 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,4 +1,25 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + #ifndef GETTEXT_HEADER +#define GETTEXT_HEADER + #include "config.h" // for USE_GETTEXT #include "log.h" @@ -18,34 +39,16 @@ #define _WIN32_WINNT 0x0501 #endif #include + +#endif // #if defined(_WIN32) + +#ifdef _MSC_VER +void init_gettext(const char *path,std::string configured_language,int argc, char** argv); +#else +void init_gettext(const char *path,std::string configured_language); #endif -inline void init_gettext(const char *path) { -#if USE_GETTEXT - // don't do this if MSVC compiler is used, it gives an assertion fail - #ifndef _MSC_VER - setlocale(LC_MESSAGES, ""); - #endif - bindtextdomain(PROJECT_NAME, path); - textdomain(PROJECT_NAME); -#if defined(_WIN32) - // As linux is successfully switched to UTF-8 completely at about year 2005 - // Windows still uses obsolete codepage based locales because you - // cannot recompile closed-source applications - - // Set character encoding for Win32 - char *tdomain = textdomain( (char *) NULL ); - if( tdomain == NULL ) - { - fprintf( stderr, "warning: domainname parameter is the null pointer, default domain is not set\n" ); - tdomain = (char *) "messages"; - } - /*char *codeset = */bind_textdomain_codeset( tdomain, "UTF-8" ); - //fprintf( stdout, "%s: debug: domainname = %s; codeset = %s\n", argv[0], tdomain, codeset ); -#endif // defined(_WIN32) -#endif -} - +/******************************************************************************/ inline wchar_t* chartowchar_t(const char *str) { wchar_t* nstr = 0; @@ -69,26 +72,18 @@ inline wchar_t* chartowchar_t(const char *str) return nstr; } +/******************************************************************************/ inline wchar_t* wgettext(const char *str) { return chartowchar_t(gettext(str)); } -inline void changeCtype(const char *l) -{ - /*char *ret = NULL; - ret = setlocale(LC_CTYPE, l); - if(ret == NULL) - infostream<<"locale could not be set"< rect(0, 0, 400, 50); rect = rect + v2s32(size.X/2-400/2, size.Y/2-50/2-25); @@ -108,7 +108,6 @@ void GUIDeathScreen::regenerateGui(v2u32 screensize) delete[] text; Environment->setFocus(e); } - changeCtype("C"); } void GUIDeathScreen::drawMenu() diff --git a/src/guiFileSelectMenu.cpp b/src/guiFileSelectMenu.cpp index 54ab62df4..e98b025c6 100644 --- a/src/guiFileSelectMenu.cpp +++ b/src/guiFileSelectMenu.cpp @@ -31,13 +31,11 @@ GUIModalMenu(env, parent, id, menumgr) m_formname = formname; m_text_dst = 0; m_accepted = false; - m_previous_locale = setlocale(LC_ALL,0); } GUIFileSelectMenu::~GUIFileSelectMenu() { removeChildren(); - setlocale(LC_ALL,m_previous_locale.c_str()); } void GUIFileSelectMenu::removeChildren() diff --git a/src/guiFileSelectMenu.h b/src/guiFileSelectMenu.h index 987a9f2ee..e37d3d8df 100644 --- a/src/guiFileSelectMenu.h +++ b/src/guiFileSelectMenu.h @@ -66,8 +66,6 @@ private: gui::IGUIFileOpenDialog* m_fileOpenDialog; - std::string m_previous_locale; - bool m_running; TextDest *m_text_dst; diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index aa1e2d9c9..eecd2c1b2 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1629,7 +1629,6 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) std::vector elements = split(m_formspec_string,']'); - for (unsigned int i=0;i< elements.size();i++) { parseElement(&mydata,elements[i]); } @@ -1648,7 +1647,6 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) recalculateAbsolutePosition(false); mydata.basepos = getBasePos(); - changeCtype(""); { v2s32 pos = mydata.basepos; pos.Y = ((m_fields.size()+2)*60); @@ -1659,7 +1657,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) Environment->addButton(mydata.rect, this, 257, text); delete[] text; } - changeCtype("C"); + } //set initial focus if parser didn't set it diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index c660ed870..85222431e 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -113,7 +113,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) recalculateAbsolutePosition(false); v2s32 topleft(0, 0); - changeCtype(""); + { core::rect < s32 > rect(0, 0, 600, 40); rect += topleft + v2s32(25, 3); @@ -196,9 +196,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, text ); delete[] text; - } - changeCtype("C"); - + } } void GUIKeyChangeMenu::drawMenu() @@ -265,7 +263,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0 && event.KeyInput.PressedDown) { - changeCtype(""); + bool prefer_character = shift_down; KeyPress kp(event.KeyInput, prefer_character); @@ -313,7 +311,6 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) this->key_used.push_back(kp); - changeCtype("C"); // Allow characters made with shift if(shift_went_down){ shift_down = true; @@ -339,12 +336,6 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) } if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) { - if(event.GUIEvent.Caller->getID() != GUI_ID_BACK_BUTTON && - event.GUIEvent.Caller->getID() != GUI_ID_ABORT_BUTTON) - { - changeCtype(""); - } - switch (event.GUIEvent.Caller->getID()) { case GUI_ID_BACK_BUTTON: //back @@ -377,8 +368,6 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) break; } Environment->setFocus(this); - //Buttons - changeCtype("C"); } } return Parent ? Parent->OnEvent(event) : false; diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index c6592e51c..dd9c0a261 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -99,7 +99,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(m_message_text.c_str(), rect, false, true, this, -1); } - changeCtype(""); + int bw = 140; { core::rect rect(0, 0, bw, 30); @@ -111,7 +111,6 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) Environment->setFocus(e); delete[] text; } - changeCtype("C"); } void GUIMessageMenu::drawMenu() diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index 8b55234c2..c8a2214b6 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -100,7 +100,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Add stuff */ s32 ypos = 50; - changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); @@ -108,7 +107,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; } - changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -118,7 +116,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; - changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); @@ -126,7 +123,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; } - changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -135,7 +131,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; - changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); @@ -143,7 +138,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Environment->addStaticText(text, rect, false, true, this, -1); delete[] text; } - changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -153,7 +147,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; - changeCtype(""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); @@ -174,8 +167,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setVisible(false); delete[] text; } - changeCtype("C"); - } void GUIPasswordChange::drawMenu() diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index ba103b740..d7a51488e 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -116,7 +116,6 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) const s32 btn_gap = 20; const s32 btn_num = m_simple_singleplayer_mode ? 4 : 5; s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2; - changeCtype(""); { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); @@ -201,7 +200,6 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259); } - changeCtype("C"); } void GUIPauseMenu::drawMenu() diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index 9285aaa81..535bf497e 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -133,7 +133,6 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) evt.KeyInput.Shift = 0; e->OnEvent(evt); } - changeCtype(""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); @@ -142,7 +141,6 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) text); delete[] text; } - changeCtype("C"); } void GUITextInputMenu::drawMenu() diff --git a/src/guiVolumeChange.cpp b/src/guiVolumeChange.cpp index 2f462b772..5e7476bb5 100644 --- a/src/guiVolumeChange.cpp +++ b/src/guiVolumeChange.cpp @@ -101,7 +101,6 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize) /* Add stuff */ - changeCtype(""); { core::rect rect(0, 0, 120, 20); rect = rect + v2s32(size.X/2-60, size.Y/2-35); @@ -132,7 +131,6 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize) e->setMax(100); e->setPos(volume); } - changeCtype(""); } void GUIVolumeChange::drawMenu() diff --git a/src/main.cpp b/src/main.cpp index 455138d5b..ea66f1334 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -750,20 +750,6 @@ int main(int argc, char *argv[]) log_add_output_all_levs(&main_dstream_no_stderr_log_out); log_register_thread("main"); - - // This enables internatonal characters input - if( setlocale(LC_ALL, "") == NULL ) - { - fprintf( stderr, "%s: warning: could not set default locale\n", argv[0] ); - } - - // Set locale. This is for forcing '.' as the decimal point. - try { - std::locale::global(std::locale(std::locale(""), "C", std::locale::numeric)); - setlocale(LC_NUMERIC, "C"); - } catch (const std::exception& ex) { - errorstream<<"Could not set numeric locale to C"<get("language"),argc,argv); #else - char *lang_str = (char*)calloc(10 + language.length(), sizeof(char)); - strcat(lang_str, "LANGUAGE="); - strcat(lang_str, language.c_str()); - putenv(lang_str); + init_gettext((porting::path_share + DIR_DELIM + "locale").c_str(),g_settings->get("language")); #endif - } /* Game parameters diff --git a/src/util/pointer.h b/src/util/pointer.h index f65683332..ba43b7844 100644 --- a/src/util/pointer.h +++ b/src/util/pointer.h @@ -197,6 +197,7 @@ public: else data = NULL; refcount = new unsigned int; + memset(data,0,sizeof(T)*m_size); (*refcount) = 1; } SharedBuffer(const SharedBuffer &buffer) diff --git a/src/util/string.cpp b/src/util/string.cpp index a2312baf8..39a14598b 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -41,8 +41,9 @@ std::string wide_to_narrow(const std::wstring& wcs) size_t mbl = wcs.size()*4; SharedBuffer mbs(mbl+1); size_t l = wcstombs(*mbs, wcs.c_str(), mbl); - if(l == (size_t)(-1)) - mbs[0] = 0; + if(l == (size_t)(-1)) { + return "Character conversion failed!"; + } else mbs[l] = 0; return *mbs; From bb54e2cf1d91381e46ba24654a39cc9c1cbadb23 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 9 Nov 2013 10:57:41 +0100 Subject: [PATCH 073/198] Disable localization workaround in server --- src/gettext.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gettext.cpp b/src/gettext.cpp index 455c78584..d4dc719b4 100644 --- a/src/gettext.cpp +++ b/src/gettext.cpp @@ -142,13 +142,14 @@ void init_gettext(const char *path,std::string configured_language) { SetEnvironmentVariableA("LANGUAGE",configured_language.c_str()); +#ifndef SERVER //very very dirty workaround to force gettext to see the right environment if (current_language_var != configured_language) { STARTUPINFO startupinfo; PROCESS_INFORMATION processinfo; memset(&startupinfo,0,sizeof(startupinfo)); memset(&processinfo,0,sizeof(processinfo)); - errorstream << "MSVC localization workaround aktive restating minetest in new environment!" << std::endl; + errorstream << "MSVC localization workaround active restating minetest in new environment!" << std::endl; std::string parameters = ""; @@ -199,6 +200,13 @@ void init_gettext(const char *path,std::string configured_language) { else { exit(0); } +#else + errorstream << "*******************************************************" << std::endl; + errorstream << "Can't apply locale workaround for server!" << std::encl; + errorstream << "Expect language to be broken!" << std::endl; + errorstream << "*******************************************************" << std::endl; + +#endif } setlocale(LC_ALL,configured_language.c_str()); From a935d810537853eaeda702b7dc341df1e9de1fd1 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 9 Nov 2013 22:51:12 +0100 Subject: [PATCH 074/198] Fix invalid usage of temporary object in mainmenu json conversion --- src/script/lua_api/l_mainmenu.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index ff0d52774..498ac0383 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -453,12 +453,11 @@ int ModApiMainMenu::l_get_favorites(lua_State *L) int top_lvl2 = lua_gettop(L); if (servers[i]["clients"].asString().size()) { - - const char* clients_raw = servers[i]["clients"].asString().c_str(); + std::string clients_raw = servers[i]["clients"].asString(); char* endptr = 0; - int numbervalue = strtol(clients_raw,&endptr,10); + int numbervalue = strtol(clients_raw.c_str(),&endptr,10); - if ((*clients_raw != 0) && (*endptr == 0)) { + if ((clients_raw != "") && (*endptr == 0)) { lua_pushstring(L,"clients"); lua_pushnumber(L,numbervalue); lua_settable(L, top_lvl2); @@ -467,11 +466,11 @@ int ModApiMainMenu::l_get_favorites(lua_State *L) if (servers[i]["clients_max"].asString().size()) { - const char* clients_max_raw = servers[i]["clients_max"].asString().c_str(); + std::string clients_max_raw = servers[i]["clients_max"].asString(); char* endptr = 0; - int numbervalue = strtol(clients_max_raw,&endptr,10); + int numbervalue = strtol(clients_max_raw.c_str(),&endptr,10); - if ((*clients_max_raw != 0) && (*endptr == 0)) { + if ((clients_max_raw != "") && (*endptr == 0)) { lua_pushstring(L,"clients_max"); lua_pushnumber(L,numbervalue); lua_settable(L, top_lvl2); @@ -480,7 +479,8 @@ int ModApiMainMenu::l_get_favorites(lua_State *L) if (servers[i]["version"].asString().size()) { lua_pushstring(L,"version"); - lua_pushstring(L,servers[i]["version"].asString().c_str()); + std::string topush = servers[i]["version"].asString(); + lua_pushstring(L,topush.c_str()); lua_settable(L, top_lvl2); } @@ -510,25 +510,29 @@ int ModApiMainMenu::l_get_favorites(lua_State *L) if (servers[i]["description"].asString().size()) { lua_pushstring(L,"description"); - lua_pushstring(L,servers[i]["description"].asString().c_str()); + std::string topush = servers[i]["description"].asString(); + lua_pushstring(L,topush.c_str()); lua_settable(L, top_lvl2); } if (servers[i]["name"].asString().size()) { lua_pushstring(L,"name"); - lua_pushstring(L,servers[i]["name"].asString().c_str()); + std::string topush = servers[i]["name"].asString(); + lua_pushstring(L,topush.c_str()); lua_settable(L, top_lvl2); } if (servers[i]["address"].asString().size()) { lua_pushstring(L,"address"); - lua_pushstring(L,servers[i]["address"].asString().c_str()); + std::string topush = servers[i]["address"].asString(); + lua_pushstring(L,topush.c_str()); lua_settable(L, top_lvl2); } if (servers[i]["port"].asString().size()) { lua_pushstring(L,"port"); - lua_pushstring(L,servers[i]["port"].asString().c_str()); + std::string topush = servers[i]["port"].asString(); + lua_pushstring(L,topush.c_str()); lua_settable(L, top_lvl2); } From 5094a39f052fff2df304daf2be02c23603906661 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Tue, 12 Nov 2013 15:18:20 +0100 Subject: [PATCH 075/198] Fix compiling with 32bit MinGW --- src/util/numeric.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp index 0426656a5..6173515ee 100644 --- a/src/util/numeric.cpp +++ b/src/util/numeric.cpp @@ -143,7 +143,7 @@ int myrand_range(int min, int max) // 64-bit unaligned version of MurmurHash u64 murmur_hash_64_ua(const void *key, int len, unsigned int seed) { - const u64 m = 0xc6a4a7935bd1e995; + const u64 m = 0xc6a4a7935bd1e995ULL; const int r = 47; u64 h = seed ^ (len * m); From 9a750450edb2b71422f2a10cff281a2ef4b116df Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Nov 2013 15:05:07 +0400 Subject: [PATCH 076/198] Improved default settings for floatland perlin noise 1. Larger, more detailed floatlands. --- src/defaultsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index c0d3df291..c4e9d08ef 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -262,7 +262,7 @@ void set_default_settings(Settings *settings) settings->setDefault("mgindev_np_terrain_higher", "20, 16, (500, 500, 500), 85039, 5, 0.6, 10, 10"); settings->setDefault("mgindev_np_steepness", "0.85, 0.5, (125, 125, 125), -932, 5, 0.7, 2, 10"); settings->setDefault("mgindev_np_mud", "4, 2, (200, 200, 200), 91013, 3, 0.55, 1, 1"); - settings->setDefault("mgindev_np_float_islands1", "0, 1, (64, 64, 64 ), 3683, 5, 0.5, 1, 1.5"); + settings->setDefault("mgindev_np_float_islands1", "0, 1, (256, 256, 256), 3683, 6, 0.6, 1, 1.5"); settings->setDefault("mgindev_np_float_islands2", "0, 1, (8, 8, 8 ), 9292, 2, 0.5, 1, 1.5"); settings->setDefault("mgindev_np_float_islands3", "0, 1, (256, 256, 256), 6412, 2, 0.5, 1, 0.5"); settings->setDefault("mgindev_np_biome", "0, 1, (250, 250, 250), 9130, 3, 0.50, 1, 10"); From 3f519eb72922607329e1e6a48768d84d1f443efc Mon Sep 17 00:00:00 2001 From: BlockMen Date: Thu, 14 Nov 2013 19:03:55 +0100 Subject: [PATCH 077/198] Fix formspec background padding when clipped --- src/guiFormSpecMenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index eecd2c1b2..2416e4c8a 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1875,8 +1875,8 @@ void GUIFormSpecMenu::drawMenu() core::dimension2d absrec_size = AbsoluteRect.getSize(); rect = core::rect(AbsoluteRect.UpperLeftCorner.X - spec.pos.X, AbsoluteRect.UpperLeftCorner.Y - spec.pos.Y, - AbsoluteRect.UpperLeftCorner.X + absrec_size.Width + spec.pos.X*2, - AbsoluteRect.UpperLeftCorner.Y + absrec_size.Height + spec.pos.Y*2); + AbsoluteRect.UpperLeftCorner.X + absrec_size.Width + spec.pos.X, + AbsoluteRect.UpperLeftCorner.Y + absrec_size.Height + spec.pos.Y); } const video::SColor color(255,255,255,255); From 371b39a09a0bf248d674fae718f5ff369e895b66 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Tue, 5 Nov 2013 12:06:15 -0500 Subject: [PATCH 078/198] Pass a errfunc to lua_pcall to get a traceback --- src/script/common/c_content.cpp | 9 +- src/script/common/c_internal.cpp | 58 +++++++---- src/script/common/c_internal.h | 9 +- src/script/common/c_types.cpp | 5 +- src/script/cpp_api/s_base.cpp | 33 +----- src/script/cpp_api/s_base.h | 3 +- src/script/cpp_api/s_entity.cpp | 60 +++++++---- src/script/cpp_api/s_inventory.cpp | 147 +++++++++++++------------- src/script/cpp_api/s_item.cpp | 70 +++++++------ src/script/cpp_api/s_mainmenu.cpp | 28 +++-- src/script/cpp_api/s_node.cpp | 92 ++++++++++------ src/script/cpp_api/s_nodemeta.cpp | 162 ++++++++++++++--------------- src/script/cpp_api/s_server.cpp | 31 ++++-- src/script/lua_api/l_base.h | 1 + src/script/lua_api/l_craft.cpp | 2 +- src/script/lua_api/l_env.cpp | 28 +++-- src/script/lua_api/l_noise.cpp | 5 +- src/script/lua_api/l_rollback.cpp | 2 +- src/script/lua_api/l_server.cpp | 3 +- 19 files changed, 424 insertions(+), 324 deletions(-) diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index a035b32a2..2ad4c9565 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -871,6 +871,8 @@ void read_groups(lua_State *L, int index, /******************************************************************************/ void push_items(lua_State *L, const std::vector &items) { + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); // Get the table insert function lua_getglobal(L, "table"); lua_getfield(L, -1, "insert"); @@ -883,11 +885,12 @@ void push_items(lua_State *L, const std::vector &items) lua_pushvalue(L, table_insert); lua_pushvalue(L, table); LuaItemStack::create(L, item); - if(lua_pcall(L, 2, 0, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 2, 0, errorhandler)) + script_error(L); } - lua_remove(L, -2); // Remove table lua_remove(L, -2); // Remove insert + lua_remove(L, -2); // Remove table + lua_remove(L, -2); // Remove error handler } /******************************************************************************/ diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp index 5c16b88d9..7415aecb8 100644 --- a/src/script/common/c_internal.cpp +++ b/src/script/common/c_internal.cpp @@ -23,32 +23,41 @@ with this program; if not, write to the Free Software Foundation, Inc., std::string script_get_backtrace(lua_State *L) { std::string s; - lua_getfield(L, LUA_GLOBALSINDEX, "debug"); + lua_getglobal(L, "debug"); if(lua_istable(L, -1)){ lua_getfield(L, -1, "traceback"); - if(lua_isfunction(L, -1)){ + if(lua_isfunction(L, -1)) { lua_call(L, 0, 1); if(lua_isstring(L, -1)){ - s += lua_tostring(L, -1); + s = lua_tostring(L, -1); } - lua_pop(L, 1); - } - else{ - lua_pop(L, 1); } + lua_pop(L, 1); } lua_pop(L, 1); return s; } -void script_error(lua_State *L, const char *fmt, ...) +int script_error_handler(lua_State *L) { + lua_getglobal(L, "debug"); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + return 1; + } + lua_getfield(L, -1, "traceback"); + if (!lua_isfunction(L, -1)) { + lua_pop(L, 2); + return 1; + } + lua_pushvalue(L, 1); + lua_pushinteger(L, 2); + lua_call(L, 2, 1); + return 1; +} + +void script_error(lua_State *L) { - va_list argp; - va_start(argp, fmt); - char buf[10000]; - vsnprintf(buf, 10000, fmt, argp); - va_end(argp); - throw LuaError(L, buf); + throw LuaError(NULL, lua_tostring(L, -1)); } // Push the list of callbacks (a lua table). @@ -61,13 +70,20 @@ void script_run_callbacks(lua_State *L, int nargs, RunCallbacksMode mode) { // Insert the return value into the lua stack, below the table assert(lua_gettop(L) >= nargs + 1); - lua_pushnil(L); - lua_insert(L, -(nargs + 1) - 1); - // Stack now looks like this: - // ...
IP[:Port]Players/MaxPlayers/Max{{? !master.no_avgtop}}
Avg/Top{{?}}
Version, Gameid, MapGenNameDescription - {{=server.clients}}/{{=server.clients_max}} {{=server.clients_top}} + {{=server.clients}}/{{=server.clients_max}}{{? !master.no_avgtop}}   {{=Math.floor(server.pop_v)}}/{{=server.clients_top}}{{?}} {{=hoverList("Clients", server.clients_list)}}
... + lua_pushnil(L); int rv = lua_gettop(L) - nargs - 1; - int table = rv + 1; + lua_insert(L, rv); + + // Insert error handler after return value + lua_pushcfunction(L, script_error_handler); + int errorhandler = rv + 1; + lua_insert(L, errorhandler); + + // Stack now looks like this: + // ...
... + + int table = errorhandler + 1; int arg = table + 1; luaL_checktype(L, table, LUA_TTABLE); @@ -81,8 +97,8 @@ void script_run_callbacks(lua_State *L, int nargs, RunCallbacksMode mode) // Call function for(int i = 0; i < nargs; i++) lua_pushvalue(L, arg+i); - if(lua_pcall(L, nargs, 1, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, nargs, 1, errorhandler)) + script_error(L); // Move return value to designated space in stack // Or pop it diff --git a/src/script/common/c_internal.h b/src/script/common/c_internal.h index 9a50b8e96..eb6aa06e8 100644 --- a/src/script/common/c_internal.h +++ b/src/script/common/c_internal.h @@ -64,9 +64,10 @@ enum RunCallbacksMode // are converted by lua_toboolean to true or false, respectively. }; -std::string script_get_backtrace (lua_State *L); -void script_error (lua_State *L, const char *fmt, ...); -void script_run_callbacks (lua_State *L, int nargs, - RunCallbacksMode mode); +std::string script_get_backtrace(lua_State *L); +int script_error_handler(lua_State *L); +void script_error(lua_State *L); +void script_run_callbacks(lua_State *L, int nargs, + RunCallbacksMode mode); #endif /* C_INTERNAL_H_ */ diff --git a/src/script/common/c_types.cpp b/src/script/common/c_types.cpp index ac724c42c..a6faf9819 100644 --- a/src/script/common/c_types.cpp +++ b/src/script/common/c_types.cpp @@ -25,9 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc., LuaError::LuaError(lua_State *L, const std::string &s) { - m_s = "LuaError: "; - m_s += s + "\n"; - m_s += script_get_backtrace(L); + m_s = "LuaError: " + s; + if (L) m_s += '\n' + script_get_backtrace(L); } struct EnumString es_ItemType[] = diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index e26d54ba7..b1272b64e 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -55,23 +55,6 @@ public: } }; -static int loadScript_ErrorHandler(lua_State *L) { - lua_getfield(L, LUA_GLOBALSINDEX, "debug"); - if (!lua_istable(L, -1)) { - lua_pop(L, 1); - return 1; - } - lua_getfield(L, -1, "traceback"); - if (!lua_isfunction(L, -1)) { - lua_pop(L, 2); - return 1; - } - lua_pushvalue(L, 1); - lua_pushinteger(L, 2); - lua_call(L, 2, 1); - return 1; -} - /* ScriptApiBase @@ -133,7 +116,7 @@ bool ScriptApiBase::loadScript(const std::string &scriptpath) lua_State *L = getStack(); - lua_pushcfunction(L, loadScript_ErrorHandler); + lua_pushcfunction(L, script_error_handler); int errorhandler = lua_gettop(L); int ret = luaL_loadfile(L, scriptpath.c_str()) || lua_pcall(L, 0, 0, errorhandler); @@ -144,7 +127,7 @@ bool ScriptApiBase::loadScript(const std::string &scriptpath) errorstream<= 30){ dstream<<"Stack is over 30:"< items; for(u32 i=0; igetSize(); i++) @@ -130,10 +149,11 @@ bool ScriptApiItem::item_CraftPredict(ItemStack &item, ServerActiveObject *user, push_items(L, items); InvRef::create(L, craft_inv); - if(lua_pcall(L, 4, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 4, 1, errorhandler)) + scriptError(); if(!lua_isnil(L, -1)) item = read_item(L,-1, getServer()); + lua_pop(L, 2); // Pop item and error handler return true; } @@ -149,15 +169,15 @@ bool ScriptApiItem::getItemCallback(const char *name, const char *callbackname) lua_getglobal(L, "minetest"); lua_getfield(L, -1, "registered_items"); - lua_remove(L, -2); + lua_remove(L, -2); // Remove minetest luaL_checktype(L, -1, LUA_TTABLE); lua_getfield(L, -1, name); - lua_remove(L, -2); + lua_remove(L, -2); // Remove registered_items // Should be a table if(lua_type(L, -1) != LUA_TTABLE) { // Report error and clean up - errorstream<<"Item \""< fields) { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + // Get handler function lua_getglobal(L, "engine"); lua_getfield(L, -1, "button_handler"); - if(lua_isnil(L, -1)) + lua_remove(L, -2); // Remove engine + if(lua_isnil(L, -1)) { + lua_pop(L, 1); // Pop button handler return; + } luaL_checktype(L, -1, LUA_TFUNCTION); // Convert fields to lua table @@ -74,7 +86,7 @@ void ScriptApiMainMenu::handleMainMenuButtons(std::map } // Call it - if(lua_pcall(L, 1, 0, 0)) - scriptError("error running function engine.button_handler: %s\n", - lua_tostring(L, -1)); + if(lua_pcall(L, 1, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } diff --git a/src/script/cpp_api/s_node.cpp b/src/script/cpp_api/s_node.cpp index 92fd00a74..cd8451cf0 100644 --- a/src/script/cpp_api/s_node.cpp +++ b/src/script/cpp_api/s_node.cpp @@ -91,6 +91,9 @@ bool ScriptApiNode::node_on_punch(v3s16 p, MapNode node, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack @@ -101,8 +104,9 @@ bool ScriptApiNode::node_on_punch(v3s16 p, MapNode node, push_v3s16(L, p); pushnode(L, node, ndef); objectrefGetOrCreate(puncher); - if(lua_pcall(L, 3, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 3, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler return true; } @@ -111,6 +115,9 @@ bool ScriptApiNode::node_on_dig(v3s16 p, MapNode node, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack @@ -121,8 +128,9 @@ bool ScriptApiNode::node_on_dig(v3s16 p, MapNode node, push_v3s16(L, p); pushnode(L, node, ndef); objectrefGetOrCreate(digger); - if(lua_pcall(L, 3, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 3, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler return true; } @@ -130,6 +138,9 @@ void ScriptApiNode::node_on_construct(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack @@ -138,14 +149,18 @@ void ScriptApiNode::node_on_construct(v3s16 p, MapNode node) // Call function push_v3s16(L, p); - if(lua_pcall(L, 1, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 1, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } void ScriptApiNode::node_on_destruct(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack @@ -154,14 +169,18 @@ void ScriptApiNode::node_on_destruct(v3s16 p, MapNode node) // Call function push_v3s16(L, p); - if(lua_pcall(L, 1, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 1, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } void ScriptApiNode::node_after_destruct(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack @@ -171,14 +190,18 @@ void ScriptApiNode::node_after_destruct(v3s16 p, MapNode node) // Call function push_v3s16(L, p); pushnode(L, node, ndef); - if(lua_pcall(L, 2, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 2, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } bool ScriptApiNode::node_on_timer(v3s16 p, MapNode node, f32 dtime) { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack @@ -188,12 +211,10 @@ bool ScriptApiNode::node_on_timer(v3s16 p, MapNode node, f32 dtime) // Call function push_v3s16(L, p); lua_pushnumber(L,dtime); - if(lua_pcall(L, 2, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); - if((bool)lua_isboolean(L,-1) && (bool)lua_toboolean(L,-1) == true) - return true; - - return false; + if(lua_pcall(L, 2, 1, errorhandler)) + scriptError(); + lua_remove(L, errorhandler); // Remove error handler + return (bool) lua_isboolean(L, -1) && (bool) lua_toboolean(L, -1) == true; } void ScriptApiNode::node_on_receive_fields(v3s16 p, @@ -203,6 +224,9 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -215,12 +239,9 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p, return; // Call function - // param 1 - push_v3s16(L, p); - // param 2 - lua_pushstring(L, formname.c_str()); - // param 3 - lua_newtable(L); + push_v3s16(L, p); // pos + lua_pushstring(L, formname.c_str()); // formname + lua_newtable(L); // fields for(std::map::const_iterator i = fields.begin(); i != fields.end(); i++){ const std::string &name = i->first; @@ -229,26 +250,37 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p, lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } - // param 4 - objectrefGetOrCreate(sender); - if(lua_pcall(L, 4, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + objectrefGetOrCreate(sender); // player + if(lua_pcall(L, 4, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } void ScriptApiNode::node_falling_update(v3s16 p) { SCRIPTAPI_PRECHECKHEADER + + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + lua_getglobal(L, "nodeupdate"); push_v3s16(L, p); - if(lua_pcall(L, 1, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 1, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } void ScriptApiNode::node_falling_update_single(v3s16 p) { SCRIPTAPI_PRECHECKHEADER + + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + lua_getglobal(L, "nodeupdate_single"); push_v3s16(L, p); - if(lua_pcall(L, 1, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 1, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } + diff --git a/src/script/cpp_api/s_nodemeta.cpp b/src/script/cpp_api/s_nodemeta.cpp index e87464c61..1f04383f1 100644 --- a/src/script/cpp_api/s_nodemeta.cpp +++ b/src/script/cpp_api/s_nodemeta.cpp @@ -34,6 +34,9 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowMove(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -47,25 +50,21 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowMove(v3s16 p, return count; // function(pos, from_list, from_index, to_list, to_index, count, player) - // pos - push_v3s16(L, p); - // from_list - lua_pushstring(L, from_list.c_str()); - // from_index - lua_pushinteger(L, from_index + 1); - // to_list - lua_pushstring(L, to_list.c_str()); - // to_index - lua_pushinteger(L, to_index + 1); - // count - lua_pushinteger(L, count); - // player - objectrefGetOrCreate(player); - if(lua_pcall(L, 7, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + push_v3s16(L, p); // pos + lua_pushstring(L, from_list.c_str()); // from_list + lua_pushinteger(L, from_index + 1); // from_index + lua_pushstring(L, to_list.c_str()); // to_list + lua_pushinteger(L, to_index + 1); // to_index + lua_pushinteger(L, count); // count + objectrefGetOrCreate(player); // player + if(lua_pcall(L, 7, 1, errorhandler)) + scriptError(); + lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) throw LuaError(L, "allow_metadata_inventory_move should return a number"); - return luaL_checkinteger(L, -1); + int num = luaL_checkinteger(L, -1); + lua_pop(L, 1); // Pop integer + return num; } // Return number of accepted items to be put @@ -75,6 +74,9 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowPut(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -88,21 +90,19 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowPut(v3s16 p, return stack.count; // Call function(pos, listname, index, stack, player) - // pos - push_v3s16(L, p); - // listname - lua_pushstring(L, listname.c_str()); - // index - lua_pushinteger(L, index + 1); - // stack - LuaItemStack::create(L, stack); - // player - objectrefGetOrCreate(player); - if(lua_pcall(L, 5, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + push_v3s16(L, p); // pos + lua_pushstring(L, listname.c_str()); // listname + lua_pushinteger(L, index + 1); // index + LuaItemStack::create(L, stack); // stack + objectrefGetOrCreate(player); // player + if(lua_pcall(L, 5, 1, errorhandler)) + scriptError(); + lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) throw LuaError(L, "allow_metadata_inventory_put should return a number"); - return luaL_checkinteger(L, -1); + int num = luaL_checkinteger(L, -1); + lua_pop(L, 1); // Pop integer + return num; } // Return number of accepted items to be taken @@ -112,6 +112,9 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -125,21 +128,19 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p, return stack.count; // Call function(pos, listname, index, count, player) - // pos - push_v3s16(L, p); - // listname - lua_pushstring(L, listname.c_str()); - // index - lua_pushinteger(L, index + 1); - // stack - LuaItemStack::create(L, stack); - // player - objectrefGetOrCreate(player); - if(lua_pcall(L, 5, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + push_v3s16(L, p); // pos + lua_pushstring(L, listname.c_str()); // listname + lua_pushinteger(L, index + 1); // index + LuaItemStack::create(L, stack); // stack + objectrefGetOrCreate(player); // player + if(lua_pcall(L, 5, 1, errorhandler)) + scriptError(); + lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) throw LuaError(L, "allow_metadata_inventory_take should return a number"); - return luaL_checkinteger(L, -1); + int num = luaL_checkinteger(L, -1); + lua_pop(L, 1); // Pop integer + return num; } // Report moved items @@ -150,6 +151,9 @@ void ScriptApiNodemeta::nodemeta_inventory_OnMove(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -163,22 +167,16 @@ void ScriptApiNodemeta::nodemeta_inventory_OnMove(v3s16 p, return; // function(pos, from_list, from_index, to_list, to_index, count, player) - // pos - push_v3s16(L, p); - // from_list - lua_pushstring(L, from_list.c_str()); - // from_index - lua_pushinteger(L, from_index + 1); - // to_list - lua_pushstring(L, to_list.c_str()); - // to_index - lua_pushinteger(L, to_index + 1); - // count - lua_pushinteger(L, count); - // player - objectrefGetOrCreate(player); - if(lua_pcall(L, 7, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + push_v3s16(L, p); // pos + lua_pushstring(L, from_list.c_str()); // from_list + lua_pushinteger(L, from_index + 1); // from_index + lua_pushstring(L, to_list.c_str()); // to_list + lua_pushinteger(L, to_index + 1); // to_index + lua_pushinteger(L, count); // count + objectrefGetOrCreate(player); // player + if(lua_pcall(L, 7, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } // Report put items @@ -188,6 +186,9 @@ void ScriptApiNodemeta::nodemeta_inventory_OnPut(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -201,18 +202,14 @@ void ScriptApiNodemeta::nodemeta_inventory_OnPut(v3s16 p, return; // Call function(pos, listname, index, stack, player) - // pos - push_v3s16(L, p); - // listname - lua_pushstring(L, listname.c_str()); - // index - lua_pushinteger(L, index + 1); - // stack - LuaItemStack::create(L, stack); - // player - objectrefGetOrCreate(player); - if(lua_pcall(L, 5, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + push_v3s16(L, p); // pos + lua_pushstring(L, listname.c_str()); // listname + lua_pushinteger(L, index + 1); // index + LuaItemStack::create(L, stack); // stack + objectrefGetOrCreate(player); // player + if(lua_pcall(L, 5, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } // Report taken items @@ -222,6 +219,9 @@ void ScriptApiNodemeta::nodemeta_inventory_OnTake(v3s16 p, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + INodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call @@ -235,18 +235,14 @@ void ScriptApiNodemeta::nodemeta_inventory_OnTake(v3s16 p, return; // Call function(pos, listname, index, stack, player) - // pos - push_v3s16(L, p); - // listname - lua_pushstring(L, listname.c_str()); - // index - lua_pushinteger(L, index + 1); - // stack - LuaItemStack::create(L, stack); - // player - objectrefGetOrCreate(player); - if(lua_pcall(L, 5, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + push_v3s16(L, p); // pos + lua_pushstring(L, listname.c_str()); // listname + lua_pushinteger(L, index + 1); // index + LuaItemStack::create(L, stack); // stack + objectrefGetOrCreate(player); // player + if(lua_pcall(L, 5, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } ScriptApiNodemeta::ScriptApiNodemeta() { diff --git a/src/script/cpp_api/s_server.cpp b/src/script/cpp_api/s_server.cpp index d41805b7b..4baf90636 100644 --- a/src/script/cpp_api/s_server.cpp +++ b/src/script/cpp_api/s_server.cpp @@ -27,13 +27,18 @@ bool ScriptApiServer::getAuth(const std::string &playername, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + getAuthHandler(); lua_getfield(L, -1, "get_auth"); if(lua_type(L, -1) != LUA_TFUNCTION) throw LuaError(L, "Authentication handler missing get_auth"); lua_pushstring(L, playername.c_str()); - if(lua_pcall(L, 1, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 1, 1, errorhandler)) + scriptError(); + lua_remove(L, -2); // Remove auth handler + lua_remove(L, errorhandler); // Remove error handler // nil = login not allowed if(lua_isnil(L, -1)) @@ -49,8 +54,7 @@ bool ScriptApiServer::getAuth(const std::string &playername, lua_getfield(L, -1, "privileges"); if(!lua_istable(L, -1)) - throw LuaError(L, - "Authentication handler didn't return privilege table"); + throw LuaError(L, "Authentication handler didn't return privilege table"); if(dst_privs) readPrivileges(-1, *dst_privs); lua_pop(L, 1); @@ -68,6 +72,7 @@ void ScriptApiServer::getAuthHandler() lua_pop(L, 1); lua_getfield(L, -1, "builtin_auth_handler"); } + lua_remove(L, -2); // Remove minetest if(lua_type(L, -1) != LUA_TTABLE) throw LuaError(L, "Authentication handler table not valid"); } @@ -96,14 +101,19 @@ void ScriptApiServer::createAuth(const std::string &playername, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + getAuthHandler(); lua_getfield(L, -1, "create_auth"); + lua_remove(L, -2); // Remove auth handler if(lua_type(L, -1) != LUA_TFUNCTION) throw LuaError(L, "Authentication handler missing create_auth"); lua_pushstring(L, playername.c_str()); lua_pushstring(L, password.c_str()); - if(lua_pcall(L, 2, 0, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 2, 0, errorhandler)) + scriptError(); + lua_pop(L, 1); // Pop error handler } bool ScriptApiServer::setPassword(const std::string &playername, @@ -111,14 +121,19 @@ bool ScriptApiServer::setPassword(const std::string &playername, { SCRIPTAPI_PRECHECKHEADER + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + getAuthHandler(); lua_getfield(L, -1, "set_password"); + lua_remove(L, -2); // Remove auth handler if(lua_type(L, -1) != LUA_TFUNCTION) throw LuaError(L, "Authentication handler missing set_password"); lua_pushstring(L, playername.c_str()); lua_pushstring(L, password.c_str()); - if(lua_pcall(L, 2, 1, 0)) - scriptError("error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 2, 1, errorhandler)) + scriptError(); + lua_remove(L, -2); // Remove error handler return lua_toboolean(L, -1); } diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h index 71ebd215c..808043bd4 100644 --- a/src/script/lua_api/l_base.h +++ b/src/script/lua_api/l_base.h @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define L_BASE_H_ #include "common/c_types.h" +#include "common/c_internal.h" extern "C" { #include diff --git a/src/script/lua_api/l_craft.cpp b/src/script/lua_api/l_craft.cpp index b0a47bfc1..c5732bad2 100644 --- a/src/script/lua_api/l_craft.cpp +++ b/src/script/lua_api/l_craft.cpp @@ -449,7 +449,7 @@ int ModApiCraft::l_get_all_craft_recipes(lua_State *L) lua_pushstring(L, &tmpout.item[0]); lua_setfield(L, -2, "output"); if (lua_pcall(L, 2, 0, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + script_error(L); } } return 1; diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 436eb014d..9bed23d47 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -53,28 +53,34 @@ void LuaABM::trigger(ServerEnvironment *env, v3s16 p, MapNode n, assert(lua_checkstack(L, 20)); StackUnroller stack_unroller(L); + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + // Get minetest.registered_abms lua_getglobal(L, "minetest"); lua_getfield(L, -1, "registered_abms"); luaL_checktype(L, -1, LUA_TTABLE); - int registered_abms = lua_gettop(L); + lua_remove(L, -2); // Remove "minetest" // Get minetest.registered_abms[m_id] lua_pushnumber(L, m_id); - lua_gettable(L, registered_abms); + lua_gettable(L, -2); if(lua_isnil(L, -1)) assert(0); + lua_remove(L, -2); // Remove "registered_abms" // Call action luaL_checktype(L, -1, LUA_TTABLE); lua_getfield(L, -1, "action"); luaL_checktype(L, -1, LUA_TFUNCTION); + lua_remove(L, -2); // Remove "registered_abms[m_id]" push_v3s16(L, p); pushnode(L, n, env->getGameDef()->ndef()); lua_pushnumber(L, active_object_count); lua_pushnumber(L, active_object_count_wider); - if(lua_pcall(L, 4, 0, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 4, 0, errorhandler)) + script_error(L); + lua_pop(L, 1); // Pop error handler } // Exported functions @@ -370,15 +376,21 @@ int ModApiEnvMod::l_add_item(lua_State *L) ItemStack item = read_item(L, 2,getServer(L)); if(item.empty() || !item.isKnown(getServer(L)->idef())) return 0; + + lua_pushcfunction(L, script_error_handler); + int errorhandler = lua_gettop(L); + // Use minetest.spawn_item to spawn a __builtin:item lua_getglobal(L, "minetest"); lua_getfield(L, -1, "spawn_item"); + lua_remove(L, -2); // Remove minetest if(lua_isnil(L, -1)) return 0; lua_pushvalue(L, 1); lua_pushstring(L, item.getItemString().c_str()); - if(lua_pcall(L, 2, 1, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + if(lua_pcall(L, 2, 1, errorhandler)) + script_error(L); + lua_remove(L, errorhandler); // Remove error handler return 1; /*lua_pushvalue(L, 1); lua_pushstring(L, "__builtin:item"); @@ -441,7 +453,7 @@ int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L) lua_pushvalue(L, table); getScriptApiBase(L)->objectrefGetOrCreate(obj); if(lua_pcall(L, 2, 0, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + script_error(L); } return 1; } @@ -569,7 +581,7 @@ int ModApiEnvMod::l_find_nodes_in_area(lua_State *L) lua_pushvalue(L, table); push_v3s16(L, p); if(lua_pcall(L, 2, 0, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + script_error(L); } } return 1; diff --git a/src/script/lua_api/l_noise.cpp b/src/script/lua_api/l_noise.cpp index ecbda9fad..4b0c7932d 100644 --- a/src/script/lua_api/l_noise.cpp +++ b/src/script/lua_api/l_noise.cpp @@ -333,7 +333,10 @@ int LuaPseudoRandom::l_next(lua_State *L) throw LuaError(L, "PseudoRandom.next(): max < min"); } if(max - min != 32767 && max - min > 32767/5) - throw LuaError(L, "PseudoRandom.next() max-min is not 32767 and is > 32768/5. This is disallowed due to the bad random distribution the implementation would otherwise make."); + throw LuaError(L, "PseudoRandom.next() max-min is not 32767" + " and is > 32768/5. This is disallowed due to" + " the bad random distribution the" + " implementation would otherwise make."); PseudoRandom &pseudo = o->m_pseudo; int val = pseudo.next(); val = (val % (max-min+1)) + min; diff --git a/src/script/lua_api/l_rollback.cpp b/src/script/lua_api/l_rollback.cpp index 6076399ae..d5abe176e 100644 --- a/src/script/lua_api/l_rollback.cpp +++ b/src/script/lua_api/l_rollback.cpp @@ -66,7 +66,7 @@ int ModApiRollback::l_rollback_revert_actions_by(lua_State *L) lua_pushvalue(L, table); lua_pushstring(L, i->c_str()); if(lua_pcall(L, 2, 0, 0)) - script_error(L, "error: %s", lua_tostring(L, -1)); + script_error(L); } lua_remove(L, -2); // Remove table lua_remove(L, -2); // Remove insert diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 8e809c36a..19e2f1bcb 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -220,6 +220,7 @@ int ModApiServer::l_get_modpath(lua_State *L) int ModApiServer::l_get_modnames(lua_State *L) { NO_MAP_LOCK_REQUIRED; + // Get a list of mods std::list mods_unsorted, mods_sorted; getServer(L)->getModNames(mods_unsorted); @@ -263,7 +264,7 @@ int ModApiServer::l_get_modnames(lua_State *L) lua_pushstring(L, (*i).c_str()); if(lua_pcall(L, 2, 0, 0) != 0) { - script_error(L, "error: %s", lua_tostring(L, -1)); + script_error(L); } ++i; } From 35606cfb679d2d5ead0780c84371089745630c1b Mon Sep 17 00:00:00 2001 From: MetaDucky Date: Thu, 14 Nov 2013 18:31:45 +0100 Subject: [PATCH 079/198] fixed array limit check when reading Lua specialtiles table --- src/script/common/c_content.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 2ad4c9565..65239ff1f 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -334,7 +334,7 @@ ContentFeatures read_content_features(lua_State *L, int index) // removes value, keeps key for next iteration lua_pop(L, 1); i++; - if(i==6){ + if(i==CF_SPECIAL_COUNT){ lua_pop(L, 1); break; } From 90e7832408eb313676d40b747ec533c3b07e5c28 Mon Sep 17 00:00:00 2001 From: sapier Date: Tue, 12 Nov 2013 00:06:14 +0100 Subject: [PATCH 080/198] Fix invalid listname and listsize not handled correctly in set_size --- doc/lua_api.txt | 1 + src/inventory.cpp | 3 +++ src/script/lua_api/l_inventory.cpp | 20 +++++++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index db9a5e8fa..7da978672 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1726,6 +1726,7 @@ methods: - is_empty(listname): return true if list is empty - get_size(listname): get size of a list - set_size(listname, size): set size of a list + ^ returns false on error (e.g. invalid listname or listsize) - get_width(listname): get width of a list - set_width(listname, width): set width of list; currently used for crafting - get_stack(listname, i): get a copy of stack index i in list diff --git a/src/inventory.cpp b/src/inventory.cpp index 2ce50e019..f4a87bec1 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -957,6 +957,9 @@ InventoryList * Inventory::addList(const std::string &name, u32 size) } else { + //don't create list with invalid name + if (name.find(" ") != std::string::npos) return NULL; + InventoryList *list = new InventoryList(name, size, m_itemdef); m_lists.push_back(list); return list; diff --git a/src/script/lua_api/l_inventory.cpp b/src/script/lua_api/l_inventory.cpp index 67b78bcaf..d783cf60f 100644 --- a/src/script/lua_api/l_inventory.cpp +++ b/src/script/lua_api/l_inventory.cpp @@ -117,24 +117,38 @@ int InvRef::l_set_size(lua_State *L) NO_MAP_LOCK_REQUIRED; InvRef *ref = checkobject(L, 1); const char *listname = luaL_checkstring(L, 2); + int newsize = luaL_checknumber(L, 3); + if (newsize < 0) { + lua_pushboolean(L, false); + return 1; + } + Inventory *inv = getinv(L, ref); if(inv == NULL){ - return 0; + lua_pushboolean(L, false); + return 1; } if(newsize == 0){ inv->deleteList(listname); reportInventoryChange(L, ref); - return 0; + lua_pushboolean(L, true); + return 1; } InventoryList *list = inv->getList(listname); if(list){ list->setSize(newsize); } else { list = inv->addList(listname, newsize); + if (!list) + { + lua_pushboolean(L, false); + return 1; + } } reportInventoryChange(L, ref); - return 0; + lua_pushboolean(L, true); + return 1; } // set_width(self, listname, size) From e396fb29840c3b87b0442fe6d641c94e8165ed27 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 01:59:04 -0500 Subject: [PATCH 081/198] Actually fix weather The real problem was that MapBlocks were not activated before getting sent to the client --- src/emerge.cpp | 2 ++ src/environment.cpp | 10 ------- src/map.cpp | 63 +++++++++++++++++++++++++-------------------- src/map.h | 3 +++ src/mapblock.cpp | 3 ++- src/mapblock.h | 3 ++- 6 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/emerge.cpp b/src/emerge.cpp index 569f1b80a..167473ecf 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -429,6 +429,8 @@ bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b, if (!block || block->isDummy() || !block->isGenerated()) { EMERGE_DBG_OUT("not in memory, attempting to load from disk"); block = map->loadBlock(p); + if (block && block->isGenerated()) + map->prepareBlock(block); } // If could not load and allowed to generate, diff --git a/src/environment.cpp b/src/environment.cpp index dd160d1f7..8a52a143d 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -809,16 +809,6 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime) // Activate stored objects activateObjects(block, dtime_s); - - // Calculate weather conditions - if (m_use_weather) { - m_map->updateBlockHeat(this, block->getPos() * MAP_BLOCKSIZE, block); - m_map->updateBlockHumidity(this, block->getPos() * MAP_BLOCKSIZE, block); - } else { - block->heat = HEAT_UNDEFINED; - block->humidity = HUMIDITY_UNDEFINED; - block->weather_update_time = 0; - } // Run node timers std::map elapsed_timers = diff --git a/src/map.cpp b/src/map.cpp index f74011933..0dbfd42f4 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2832,32 +2832,23 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data, Update weather data in blocks */ ServerEnvironment *senv = &((Server *)m_gamedef)->getEnv(); - if (senv->m_use_weather) { - for(s16 x=blockpos_min.X-extra_borders.X; - x<=blockpos_max.X+extra_borders.X; x++) - for(s16 z=blockpos_min.Z-extra_borders.Z; - z<=blockpos_max.Z+extra_borders.Z; z++) - for(s16 y=blockpos_min.Y-extra_borders.Y; - y<=blockpos_max.Y+extra_borders.Y; y++) - { - v3s16 p(x, y, z); - MapBlock *block = getBlockNoCreateNoEx(p); - block->weather_update_time = 0; - updateBlockHeat(senv, p * MAP_BLOCKSIZE, NULL); - updateBlockHumidity(senv, p * MAP_BLOCKSIZE, NULL); - } - } else { - for(s16 x=blockpos_min.X-extra_borders.X; - x<=blockpos_max.X+extra_borders.X; x++) - for(s16 z=blockpos_min.Z-extra_borders.Z; - z<=blockpos_max.Z+extra_borders.Z; z++) - for(s16 y=blockpos_min.Y-extra_borders.Y; - y<=blockpos_max.Y+extra_borders.Y; y++) - { - MapBlock *block = getBlockNoCreateNoEx(v3s16(x, y, z)); + for(s16 x=blockpos_min.X-extra_borders.X; + x<=blockpos_max.X+extra_borders.X; x++) + for(s16 z=blockpos_min.Z-extra_borders.Z; + z<=blockpos_max.Z+extra_borders.Z; z++) + for(s16 y=blockpos_min.Y-extra_borders.Y; + y<=blockpos_max.Y+extra_borders.Y; y++) + { + v3s16 p(x, y, z); + MapBlock *block = getBlockNoCreateNoEx(p); + block->heat_last_update = 0; + block->humidity_last_update = 0; + if (senv->m_use_weather) { + updateBlockHeat(senv, p * MAP_BLOCKSIZE, block); + updateBlockHumidity(senv, p * MAP_BLOCKSIZE, block); + } else { block->heat = HEAT_UNDEFINED; block->humidity = HUMIDITY_UNDEFINED; - block->weather_update_time = 0; } } @@ -3181,6 +3172,22 @@ MapBlock * ServerMap::emergeBlock(v3s16 p, bool create_blank) return NULL; } +void ServerMap::prepareBlock(MapBlock *block) { + ServerEnvironment *senv = &((Server *)m_gamedef)->getEnv(); + + // Calculate weather conditions + block->heat_last_update = 0; + block->humidity_last_update = 0; + if (senv->m_use_weather) { + v3s16 p = block->getPos() * MAP_BLOCKSIZE; + updateBlockHeat(senv, p, block); + updateBlockHumidity(senv, p, block); + } else { + block->heat = HEAT_UNDEFINED; + block->humidity = HUMIDITY_UNDEFINED; + } +} + s16 ServerMap::findGroundLevel(v2s16 p2d) { #if 0 @@ -3930,7 +3937,7 @@ s16 ServerMap::updateBlockHeat(ServerEnvironment *env, v3s16 p, MapBlock *block) u32 gametime = env->getGameTime(); if (block) { - if (gametime - block->weather_update_time < 10) + if (gametime - block->heat_last_update < 10) return block->heat; } else { block = getBlockNoCreateNoEx(getNodeBlockPos(p)); @@ -3941,7 +3948,7 @@ s16 ServerMap::updateBlockHeat(ServerEnvironment *env, v3s16 p, MapBlock *block) if(block) { block->heat = heat; - block->weather_update_time = gametime; + block->heat_last_update = gametime; } return heat; } @@ -3951,7 +3958,7 @@ s16 ServerMap::updateBlockHumidity(ServerEnvironment *env, v3s16 p, MapBlock *bl u32 gametime = env->getGameTime(); if (block) { - if (gametime - block->weather_update_time < 10) + if (gametime - block->humidity_last_update < 10) return block->humidity; } else { block = getBlockNoCreateNoEx(getNodeBlockPos(p)); @@ -3962,7 +3969,7 @@ s16 ServerMap::updateBlockHumidity(ServerEnvironment *env, v3s16 p, MapBlock *bl if(block) { block->humidity = humidity; - block->weather_update_time = gametime; + block->humidity_last_update = gametime; } return humidity; } diff --git a/src/map.h b/src/map.h index b70b18acc..a6480c569 100644 --- a/src/map.h +++ b/src/map.h @@ -403,6 +403,9 @@ public: */ MapBlock * emergeBlock(v3s16 p, bool create_blank=true); + + // Carries out any initialization necessary before block is sent + void prepareBlock(MapBlock *block); // Helper for placing objects on ground level s16 findGroundLevel(v2s16 p2d); diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 3fb2ec5ed..e45af9cdb 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -45,7 +45,8 @@ with this program; if not, write to the Free Software Foundation, Inc., MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy): heat(0), humidity(0), - weather_update_time(0), + heat_last_update(0), + humidity_last_update(0), m_parent(parent), m_pos(pos), m_gamedef(gamedef), diff --git a/src/mapblock.h b/src/mapblock.h index e0730ffcf..501ab75da 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -516,7 +516,8 @@ public: s16 heat; s16 humidity; - u32 weather_update_time; + u32 heat_last_update; + u32 humidity_last_update; private: /* From cca4f09ba15eca707a6ae1717a00fcf73c6efa6f Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 02:22:24 -0500 Subject: [PATCH 082/198] Decoration: Stop DecoSimple::resolveNodeNames from complaining about no node name if decolist is used Fix warning message for spawnby nodes Prevent type-punning warning caused by casting enum to int --- src/mapgen.cpp | 4 ++-- src/script/lua_api/l_mapgen.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 301601b6c..f63118491 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -382,7 +382,7 @@ void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) void DecoSimple::resolveNodeNames(INodeDefManager *ndef) { Decoration::resolveNodeNames(ndef); - if (c_deco == CONTENT_IGNORE) { + if (c_deco == CONTENT_IGNORE && !decolist_names.size()) { c_deco = ndef->getId(deco_name); if (c_deco == CONTENT_IGNORE) { errorstream << "DecoSimple::resolveNodeNames: decoration node '" @@ -394,7 +394,7 @@ void DecoSimple::resolveNodeNames(INodeDefManager *ndef) { c_spawnby = ndef->getId(spawnby_name); if (c_spawnby == CONTENT_IGNORE) { errorstream << "DecoSimple::resolveNodeNames: spawnby node '" - << deco_name << "' not defined" << std::endl; + << spawnby_name << "' not defined" << std::endl; nspawnby = -1; c_spawnby = CONTENT_AIR; } diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index 822685e34..b0ad202be 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -522,11 +522,11 @@ int ModApiMapgen::l_place_schematic(lua_State *L) if (!read_schematic(L, 2, &dschem, getServer(L))) return 0; - Rotation rot = ROTATE_0; + int rot = ROTATE_0; if (lua_isstring(L, 3)) - string_to_enum(es_Rotation, (int &)rot, std::string(lua_tostring(L, 3))); + string_to_enum(es_Rotation, rot, std::string(lua_tostring(L, 3))); - dschem.rotation = rot; + dschem.rotation = (Rotation)rot; if (lua_istable(L, 4)) { int index = 4; From 3985c01ad71159b888677d0fe2019d7a05debeed Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 27 Oct 2013 13:13:40 +0100 Subject: [PATCH 083/198] Don't use msvc libs for mingw build --- src/serialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialization.cpp b/src/serialization.cpp index 118bad467..1fd75c97a 100644 --- a/src/serialization.cpp +++ b/src/serialization.cpp @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include "util/serialize.h" -#ifdef _WIN32 +#ifdef _MSC_VER #define ZLIB_WINAPI #endif #include "zlib.h" From 533785ec9a95de696c57d0dc2a17947acfb0dc46 Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 4 Nov 2013 17:49:33 +0100 Subject: [PATCH 084/198] Add CURL_DLL search to show up CURL_DLL in cmake gui and don't silently ignore missing CURL_DLL --- cmake/Modules/FindCURL.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Modules/FindCURL.cmake b/cmake/Modules/FindCURL.cmake index 3644d192e..975b8088c 100644 --- a/cmake/Modules/FindCURL.cmake +++ b/cmake/Modules/FindCURL.cmake @@ -20,6 +20,10 @@ if( UNIX ) else( UNIX ) FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h) # Look for the header file. FIND_LIBRARY(CURL_LIBRARY NAMES curl) # Look for the library. + FIND_FILE(CURL_DLL NAMES libcurl.dll + PATHS + "c:/windows/system32" + DOC "Path of the cURL dll (for installation)") INCLUDE(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR) # all listed variables are TRUE endif( UNIX ) @@ -40,3 +44,4 @@ endif ( WIN32 ) MESSAGE(STATUS "CURL_INCLUDE_DIR = ${CURL_INCLUDE_DIR}") MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}") +MESSAGE(STATUS "CURL_DLL = ${CURL_DLL}") From a92fc3563ccc34f1fb93170f5943c719d843fb35 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 02:46:05 -0500 Subject: [PATCH 085/198] Prevent shaders from being created when disabled --- src/mapblock_mesh.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index 6cbc2c521..253703ddc 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -1109,18 +1109,22 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data): /* Convert MeshCollector to SMesh */ + bool enable_shaders = g_settings->getBool("enable_shaders"); bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping"); - bool enable_shaders = g_settings->getBool("enable_shaders"); - video::E_MATERIAL_TYPE shadermat1 = m_gamedef->getShaderSource()-> - getShader("test_shader_1").material; - video::E_MATERIAL_TYPE shadermat2 = m_gamedef->getShaderSource()-> - getShader("test_shader_2").material; - video::E_MATERIAL_TYPE shadermat3 = m_gamedef->getShaderSource()-> - getShader("test_shader_3").material; - video::E_MATERIAL_TYPE bumpmaps1 = m_gamedef->getShaderSource()-> - getShader("bumpmaps_solids").material; - video::E_MATERIAL_TYPE bumpmaps2 = m_gamedef->getShaderSource()-> - getShader("bumpmaps_liquids").material; + + video::E_MATERIAL_TYPE shadermat1, shadermat2, shadermat3, bumpmaps1, bumpmaps2; + shadermat1 = shadermat2 = shadermat3 = bumpmaps1 = bumpmaps2 = video::EMT_SOLID; + + if (enable_shaders) { + IShaderSource *shdrsrc = m_gamedef->getShaderSource(); + shadermat1 = shdrsrc->getShader("test_shader_1").material; + shadermat2 = shdrsrc->getShader("test_shader_2").material; + shadermat3 = shdrsrc->getShader("test_shader_3").material; + if (enable_bumpmapping) { + bumpmaps1 = shdrsrc->getShader("bumpmaps_solids").material; + bumpmaps2 = shdrsrc->getShader("bumpmaps_liquids").material; + } + } for(u32 i = 0; i < collector.prebuffers.size(); i++) { From 367b5382a394e853128092afd23fc7e360d369d1 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 17 Nov 2013 12:11:44 +0100 Subject: [PATCH 086/198] Replace print()s with minetest.log() in builtin --- builtin/chatcommands.lua | 6 +++--- builtin/modmgr.lua | 4 ++-- builtin/serialize.lua | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua index 7d1c2b62a..831d3a7b4 100644 --- a/builtin/chatcommands.lua +++ b/builtin/chatcommands.lua @@ -471,10 +471,10 @@ minetest.register_chatcommand("spawnentity", { minetest.chat_send_player(name, "entityname required") return end - print('/spawnentity invoked, entityname="'..entityname..'"') + minetest.log("action", '/spawnentity invoked, entityname="'..entityname..'"') local player = minetest.get_player_by_name(name) if player == nil then - print("Unable to spawn entity, player is nil") + minetest.log("error", "Unable to spawn entity, player is nil") return true -- Handled chat message end local p = player:getpos() @@ -491,7 +491,7 @@ minetest.register_chatcommand("pulverize", { func = function(name, param) local player = minetest.get_player_by_name(name) if player == nil then - print("Unable to pulverize, player is nil") + minetest.log("error", "Unable to pulverize, player is nil") return true -- Handled chat message end if player:get_wielded_item():is_empty() then diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index 04f19ec86..490336f06 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -778,7 +778,7 @@ function modmgr.handle_configure_world_buttons(fields) end if not worldfile:write() then - print("failed to write world config file") + minetest.log("error", "Failed to write world config file") end modmgr.modlist = nil @@ -932,7 +932,7 @@ function modmgr.preparemodlist(data) if element ~= nil then element.enabled = engine.is_yes(value) else - print("Mod: " .. key .. " " .. dump(value) .. " but not found") + minetest.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found") end end end diff --git a/builtin/serialize.lua b/builtin/serialize.lua index 61b923ce4..165cc6731 100644 --- a/builtin/serialize.lua +++ b/builtin/serialize.lua @@ -178,7 +178,7 @@ function minetest.deserialize(sdata) if okay then return results end - print('error:'.. results) + minetest.log('error', 'minetest.deserialize(): '.. results) return nil end From a439aea9ba2cc54a64611edc62285ad51bdf880e Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 10:33:58 -0500 Subject: [PATCH 087/198] Revert "Don't use msvc libs for mingw build" This reverts commit 3985c01ad71159b888677d0fe2019d7a05debeed. --- src/serialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialization.cpp b/src/serialization.cpp index 1fd75c97a..118bad467 100644 --- a/src/serialization.cpp +++ b/src/serialization.cpp @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include "util/serialize.h" -#ifdef _MSC_VER +#ifdef _WIN32 #define ZLIB_WINAPI #endif #include "zlib.h" From aa172bdda47555096524ac2331f0a285666f037b Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 10:57:45 -0500 Subject: [PATCH 088/198] Handle blank blocks in database Fix screwed-up indentation --- src/database-sqlite3.cpp | 165 +++++++++++++++++++++------------------ 1 file changed, 88 insertions(+), 77 deletions(-) diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index 9714d1035..b86f0806f 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -208,93 +208,104 @@ void Database_SQLite3::saveBlock(MapBlock *block) MapBlock* Database_SQLite3::loadBlock(v3s16 blockpos) { v2s16 p2d(blockpos.X, blockpos.Z); - verifyDatabase(); - - if(sqlite3_bind_int64(m_database_read, 1, getBlockAsInteger(blockpos)) != SQLITE_OK) - infostream<<"WARNING: Could not bind block position for load: " - <createSector(p2d); - - /* - Load block - */ - const char * data = (const char *)sqlite3_column_blob(m_database_read, 0); - size_t len = sqlite3_column_bytes(m_database_read, 0); - - std::string datastr(data, len); - -// srvmap->loadBlock(&datastr, blockpos, sector, false); + verifyDatabase(); + + if (sqlite3_bind_int64(m_database_read, 1, getBlockAsInteger(blockpos)) != SQLITE_OK) { + infostream << "WARNING: Could not bind block position for load: " + << sqlite3_errmsg(m_database)<createSector(p2d); + + /* + Load block + */ + const char *data = (const char *)sqlite3_column_blob(m_database_read, 0); + size_t len = sqlite3_column_bytes(m_database_read, 0); + if (data == NULL || len == 0) { + errorstream << "Blank block data in database (data == NULL || len" + " == 0) (" << blockpos.X << "," << blockpos.Y << "," + << blockpos.Z << ")" << std::endl; + + if (g_settings->getBool("ignore_world_load_errors")) { + errorstream << "Ignoring block load error. Duck and cover! " + << "(ignore_world_load_errors)" << std::endl; + } else { + throw SerializationError("Blank block data in database"); + } + } + + std::string datastr(data, len); + + //srvmap->loadBlock(&datastr, blockpos, sector, false); try { - std::istringstream is(datastr, std::ios_base::binary); - - u8 version = SER_FMT_VER_INVALID; - is.read((char*)&version, 1); + std::istringstream is(datastr, std::ios_base::binary); - if(is.fail()) - throw SerializationError("ServerMap::loadBlock(): Failed" - " to read MapBlock version"); + u8 version = SER_FMT_VER_INVALID; + is.read((char*)&version, 1); - MapBlock *block = NULL; - bool created_new = false; - block = sector->getBlockNoCreateNoEx(blockpos.Y); - if(block == NULL) - { - block = sector->createBlankBlockNoInsert(blockpos.Y); - created_new = true; - } - - // Read basic data - block->deSerialize(is, version, true); - - // If it's a new block, insert it to the map - if(created_new) - sector->insertBlock(block); - - /* - Save blocks loaded in old format in new format - */ + if (is.fail()) + throw SerializationError("ServerMap::loadBlock(): Failed" + " to read MapBlock version"); - //if(version < SER_FMT_VER_HIGHEST || save_after_load) - // Only save if asked to; no need to update version - //if(save_after_load) - // saveBlock(block); - - // We just loaded it from, so it's up-to-date. - block->resetModified(); + MapBlock *block = NULL; + bool created_new = false; + block = sector->getBlockNoCreateNoEx(blockpos.Y); + if (block == NULL) + { + block = sector->createBlankBlockNoInsert(blockpos.Y); + created_new = true; + } - } - catch(SerializationError &e) - { - errorstream<<"Invalid block data in database" - <<" ("<deSerialize(is, version, true); - if(g_settings->getBool("ignore_world_load_errors")){ - errorstream<<"Ignoring block load error. Duck and cover! " - <<"(ignore_world_load_errors)"<insertBlock(block); + /* + Save blocks loaded in old format in new format + */ + //if(version < SER_FMT_VER_HIGHEST || save_after_load) + // Only save if asked to; no need to update version + //if(save_after_load) + // saveBlock(block); - sqlite3_step(m_database_read); - // We should never get more than 1 row, so ok to reset - sqlite3_reset(m_database_read); + // We just loaded it from, so it's up-to-date. + block->resetModified(); + } + catch(SerializationError &e) + { + errorstream << "Invalid block data in database" + << " (" << blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" + << " (SerializationError): " << e.what() << std::endl; - return srvmap->getBlockNoCreateNoEx(blockpos); // should not be using this here - } - sqlite3_reset(m_database_read); - return(NULL); + // TODO: Block should be marked as invalid in memory so that it is + // not touched but the game can run + + if (g_settings->getBool("ignore_world_load_errors")) { + errorstream << "Ignoring block load error. Duck and cover! " + << "(ignore_world_load_errors)" << std::endl; + } else { + throw SerializationError("Invalid block data in database"); + //assert(0); + } + } + + sqlite3_step(m_database_read); + // We should never get more than 1 row, so ok to reset + sqlite3_reset(m_database_read); + + return srvmap->getBlockNoCreateNoEx(blockpos); // should not be using this here + } + sqlite3_reset(m_database_read); + return NULL; } void Database_SQLite3::createDatabase() From d419e4cbb65d899239fafb5027b16fb9cb564adf Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 11:26:34 -0500 Subject: [PATCH 089/198] Do the same for LevelDB interface --- src/database-leveldb.cpp | 119 ++++++++++++++++++++++----------------- src/database-sqlite3.cpp | 4 +- 2 files changed, 68 insertions(+), 55 deletions(-) diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index 8f8d18290..ec28198b5 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -92,68 +92,81 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos) v2s16 p2d(blockpos.X, blockpos.Z); std::string datastr; - leveldb::Status s = m_database->Get(leveldb::ReadOptions(), i64tos(getBlockAsInteger(blockpos)), &datastr); + leveldb::Status s = m_database->Get(leveldb::ReadOptions(), + i64tos(getBlockAsInteger(blockpos)), &datastr); + if (datastr.length() == 0) { + errorstream << "Blank block data in database (datastr.length() == 0) (" + << blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" << std::endl; - if(s.ok()) { - /* - Make sure sector is loaded - */ - MapSector *sector = srvmap->createSector(p2d); + if (g_settings->getBool("ignore_world_load_errors")) { + errorstream << "Ignoring block load error. Duck and cover! " + << "(ignore_world_load_errors)" << std::endl; + } else { + throw SerializationError("Blank block data in database"); + } + } + + if (s.ok()) { + /* + Make sure sector is loaded + */ + MapSector *sector = srvmap->createSector(p2d); try { - std::istringstream is(datastr, std::ios_base::binary); - u8 version = SER_FMT_VER_INVALID; - is.read((char*)&version, 1); + std::istringstream is(datastr, std::ios_base::binary); + u8 version = SER_FMT_VER_INVALID; + is.read((char *)&version, 1); - if(is.fail()) - throw SerializationError("ServerMap::loadBlock(): Failed" - " to read MapBlock version"); + if (is.fail()) + throw SerializationError("ServerMap::loadBlock(): Failed" + " to read MapBlock version"); - MapBlock *block = NULL; - bool created_new = false; - block = sector->getBlockNoCreateNoEx(blockpos.Y); - if(block == NULL) - { - block = sector->createBlankBlockNoInsert(blockpos.Y); - created_new = true; - } - // Read basic data - block->deSerialize(is, version, true); - // If it's a new block, insert it to the map - if(created_new) - sector->insertBlock(block); - /* - Save blocks loaded in old format in new format - */ + MapBlock *block = NULL; + bool created_new = false; + block = sector->getBlockNoCreateNoEx(blockpos.Y); + if (block == NULL) + { + block = sector->createBlankBlockNoInsert(blockpos.Y); + created_new = true; + } - //if(version < SER_FMT_VER_HIGHEST || save_after_load) - // Only save if asked to; no need to update version - //if(save_after_load) - // saveBlock(block); - // We just loaded it from, so it's up-to-date. - block->resetModified(); + // Read basic data + block->deSerialize(is, version, true); - } - catch(SerializationError &e) - { - errorstream<<"Invalid block data in database" - <<" ("<insertBlock(block); - if(g_settings->getBool("ignore_world_load_errors")){ - errorstream<<"Ignoring block load error. Duck and cover! " - <<"(ignore_world_load_errors)"<resetModified(); + } + catch (SerializationError &e) + { + errorstream << "Invalid block data in database" + << " (" << blockpos.X << "," << blockpos.Y << "," << blockpos.Z + << ") (SerializationError): " << e.what() << std::endl; + // TODO: Block should be marked as invalid in memory so that it is + // not touched but the game can run - return srvmap->getBlockNoCreateNoEx(blockpos); // should not be using this here - } - return(NULL); + if (g_settings->getBool("ignore_world_load_errors")) { + errorstream << "Ignoring block load error. Duck and cover! " + << "(ignore_world_load_errors)" << std::endl; + } else { + throw SerializationError("Invalid block data in database"); + //assert(0); + } + } + + return srvmap->getBlockNoCreateNoEx(blockpos); // should not be using this here + } + return NULL; } void Database_LevelDB::listAllLoadableBlocks(std::list &dst) diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index b86f0806f..44eb86f54 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -247,7 +247,7 @@ MapBlock* Database_SQLite3::loadBlock(v3s16 blockpos) std::istringstream is(datastr, std::ios_base::binary); u8 version = SER_FMT_VER_INVALID; - is.read((char*)&version, 1); + is.read((char *)&version, 1); if (is.fail()) throw SerializationError("ServerMap::loadBlock(): Failed" @@ -280,7 +280,7 @@ MapBlock* Database_SQLite3::loadBlock(v3s16 blockpos) // We just loaded it from, so it's up-to-date. block->resetModified(); } - catch(SerializationError &e) + catch (SerializationError &e) { errorstream << "Invalid block data in database" << " (" << blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" From dc407e219f8b0394f3a4d10ea8379b8678d98d1c Mon Sep 17 00:00:00 2001 From: sapier Date: Wed, 13 Nov 2013 21:46:14 +0100 Subject: [PATCH 090/198] Fix multicaller support in RequestQueue --- src/itemdef.cpp | 9 +++---- src/shader.cpp | 8 +----- src/tile.cpp | 8 +----- src/util/thread.h | 62 +++++++++++++++++++++++++++++------------------ 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/src/itemdef.cpp b/src/itemdef.cpp index 83a70f1d7..c520ea902 100644 --- a/src/itemdef.cpp +++ b/src/itemdef.cpp @@ -638,12 +638,9 @@ public: { GetRequest request = m_get_clientcached_queue.pop(); - GetResult - result; - result.key = request.key; - result.callers = request.callers; - result.item = createClientCachedDirect(request.key, gamedef); - request.dest->push_back(result); + + m_get_clientcached_queue.pushResult(request, + createClientCachedDirect(request.key, gamedef)); } #endif } diff --git a/src/shader.cpp b/src/shader.cpp index ed8cc5b73..122cbea19 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -546,13 +546,7 @@ void ShaderSource::processQueue() <<"name=\""< - result; - result.key = request.key; - result.callers = request.callers; - result.item = getShaderIdDirect(request.key); - - request.dest->push_back(result); + m_get_shader_queue.pushResult(request,getShaderIdDirect(request.key)); } } diff --git a/src/tile.cpp b/src/tile.cpp index 3c4989ea8..5dec79a10 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -786,13 +786,7 @@ void TextureSource::processQueue() <<"name=\""< - result; - result.key = request.key; - result.callers = request.callers; - result.item = getTextureIdDirect(request.key); - - request.dest->push_back(result); + m_get_texture_queue.pushResult(request,getTextureIdDirect(request.key)); } } diff --git a/src/util/thread.h b/src/util/thread.h index 678d9cf9b..70d41aeb9 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -106,13 +106,7 @@ public: A single worker thread - multiple client threads queue framework. */ -template -class CallerInfo -{ -public: - Caller caller; - Data data; -}; + template class GetResult @@ -120,7 +114,7 @@ class GetResult public: Key key; T item; - std::list > callers; + std::pair caller; }; template @@ -128,22 +122,24 @@ class ResultQueue: public MutexedQueue< GetResult > { }; +template +class CallerInfo +{ +public: + Caller caller; + Data data; + ResultQueue< Key, T, Caller, Data>* dest; +}; + template class GetRequest { public: GetRequest() { - dest = NULL; } - GetRequest(ResultQueue *a_dest) + GetRequest(Key a_key) { - dest = a_dest; - } - GetRequest(ResultQueue *a_dest, - Key a_key) - { - dest = a_dest; key = a_key; } ~GetRequest() @@ -151,8 +147,7 @@ public: } Key key; - ResultQueue *dest; - std::list > callers; + std::list > callers; }; template @@ -180,20 +175,21 @@ public: if(request.key == key) { - for(typename std::list< CallerInfo >::iterator + for(typename std::list< CallerInfo >::iterator i = request.callers.begin(); i != request.callers.end(); ++i) { - CallerInfo &ca = *i; + CallerInfo &ca = *i; if(ca.caller == caller) { ca.data = callerdata; return; } } - CallerInfo ca; + CallerInfo ca; ca.caller = caller; ca.data = callerdata; + ca.dest = dest; request.callers.push_back(ca); return; } @@ -205,11 +201,11 @@ public: GetRequest request; request.key = key; - CallerInfo ca; + CallerInfo ca; ca.caller = caller; ca.data = callerdata; + ca.dest = dest; request.callers.push_back(ca); - request.dest = dest; m_queue.getList().push_back(request); } @@ -219,6 +215,26 @@ public: return m_queue.pop_front(wait_if_empty); } + void pushResult(GetRequest req, + T res) { + + for(typename std::list< CallerInfo >::iterator + i = req.callers.begin(); + i != req.callers.end(); ++i) + { + CallerInfo &ca = *i; + + GetResult result; + + result.key = req.key; + result.item = res; + result.caller.first = ca.caller; + result.caller.second = ca.data; + + ca.dest->push_back(result); + } + } + private: MutexedQueue< GetRequest > m_queue; }; From eadc9431592f1e21a9211c3487334cd31ed54db1 Mon Sep 17 00:00:00 2001 From: sapier Date: Wed, 13 Nov 2013 21:49:50 +0100 Subject: [PATCH 091/198] Add missing RequestQueue doc --- src/util/thread.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/thread.h b/src/util/thread.h index 70d41aeb9..6258a09a1 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -150,6 +150,13 @@ public: std::list > callers; }; +/** + * Notes for RequestQueue usage + * @param Key unique key to identify a request for a specific resource + * @param T ? + * @param Caller unique id of calling thread + * @param CallerData data passed back to caller + */ template class RequestQueue { From b2d9205796eef23fd5d9a436d438fa2ca31ec21a Mon Sep 17 00:00:00 2001 From: sapier Date: Thu, 14 Nov 2013 18:30:43 +0100 Subject: [PATCH 092/198] Fix Result of processed Request was written to invalid (non existent) ResultQueue if requesting thread timed out before --- src/itemdef.cpp | 21 ++++---- src/shader.cpp | 30 ++++++------ src/tile.cpp | 127 ++++++++++++++++++++++++------------------------ 3 files changed, 92 insertions(+), 86 deletions(-) diff --git a/src/itemdef.cpp b/src/itemdef.cpp index c520ea902..d34d68582 100644 --- a/src/itemdef.cpp +++ b/src/itemdef.cpp @@ -477,21 +477,24 @@ public: else { // We're gonna ask the result to be put into here - ResultQueue result_queue; + static ResultQueue result_queue; + // Throw a request in m_get_clientcached_queue.add(name, 0, 0, &result_queue); try{ - // Wait result for a second - GetResult + while(true) { + // Wait result for a second + GetResult result = result_queue.pop_front(1000); - // Check that at least something worked OK - assert(result.key == name); - // Return it - return result.item; + + if (result.key == name) { + return result.item; + } + } } catch(ItemNotFoundException &e) { - errorstream<<"Waiting for clientcached timed out."< result_queue; + + static ResultQueue result_queue; // Throw a request in m_get_shader_queue.add(name, 0, 0, &result_queue); - infostream<<"Waiting for shader from main thread, name=\"" - < + while(true) { + // Wait result for a second + GetResult result = result_queue.pop_front(1000); - // Check that at least something worked OK - assert(result.key == name); - - return result.item; + if (result.key == name) { + return result.item; + } + } } catch(ItemNotFoundException &e){ - infostream<<"Waiting for shader timed out."< request = m_get_shader_queue.pop(); - /*infostream<<"ShaderSource::processQueue(): " + /**errorstream<<"ShaderSource::processQueue(): " <<"got shader request with " <<"name=\""<onSetConstants(services, is_highlevel); } } - + ShaderInfo generate_shader(std::string name, IrrlichtDevice *device, video::IShaderConstantSetCallBack *callback, SourceShaderCache *sourcecache) diff --git a/src/tile.cpp b/src/tile.cpp index 5dec79a10..71c7290b7 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -58,7 +58,7 @@ static bool replace_ext(std::string &path, const char *ext) last_dot_i = i; break; } - + if(path[i] == '\\' || path[i] == '/') break; } @@ -97,7 +97,7 @@ std::string getImagePath(std::string path) return path; } while((++ext) != NULL); - + return ""; } @@ -120,7 +120,7 @@ std::string getTexturePath(const std::string &filename) bool incache = g_texturename_to_path_cache.get(filename, &fullpath); if(incache) return fullpath; - + /* Check from texture_path */ @@ -143,10 +143,10 @@ std::string getTexturePath(const std::string &filename) // Check all filename extensions. Returns "" if not found. fullpath = getImagePath(testpath); } - + // Add to cache (also an empty result is cached) g_texturename_to_path_cache.set(filename, fullpath); - + // Finally return it return fullpath; } @@ -302,14 +302,14 @@ public: getTextureId("stone.png^mineral_coal.png^crack0"). */ - + /* Gets a texture id from cache or - if main thread, from getTextureIdDirect - if other thread, adds to request queue and waits for main thread */ u32 getTextureId(const std::string &name); - + /* Example names: "stone.png" @@ -363,21 +363,21 @@ public: // Processes queued texture requests from other threads. // Shall be called from the main thread. void processQueue(); - + // Insert an image into the cache without touching the filesystem. // Shall be called from the main thread. void insertSourceImage(const std::string &name, video::IImage *img); - + // Rebuild images and textures from the current set of source images // Shall be called from the main thread. void rebuildImagesAndTextures(); - + // Render a mesh to a texture. // Returns NULL if render-to-texture failed. // Shall be called from the main thread. video::ITexture* generateTextureFromMesh( const TextureFromMeshParams ¶ms); - + // Generates an image from a full string like // "stone.png^mineral_coal.png^[crack:1:0". // Shall be called from the main thread. @@ -389,12 +389,12 @@ public: bool generateImage(std::string part_of_name, video::IImage *& baseimg); private: - + // The id of the thread that is allowed to use irrlicht directly threadid_t m_main_thread; // The irrlicht device IrrlichtDevice *m_device; - + // Cache of source images // This should be only accessed from the main thread SourceImageCache m_sourcecache; @@ -409,7 +409,7 @@ private: std::map m_name_to_id; // The two former containers are behind this mutex JMutex m_textureinfo_cache_mutex; - + // Queued texture fetches (to be processed by the main thread) RequestQueue m_get_texture_queue; @@ -432,15 +432,15 @@ TextureSource::TextureSource(IrrlichtDevice *device): m_device(device) { assert(m_device); - + m_textureinfo_cache_mutex.Init(); - + m_main_thread = get_current_thread_id(); - + // Add a NULL TextureInfo as the first index, named "" m_textureinfo_cache.push_back(TextureInfo("")); m_name_to_id[""] = 0; - + // Cache some settings // Note: Since this is only done once, the game must be restarted // for these settings to take effect @@ -499,7 +499,7 @@ u32 TextureSource::getTextureId(const std::string &name) return n->second; } } - + /* Get texture */ @@ -512,32 +512,33 @@ u32 TextureSource::getTextureId(const std::string &name) infostream<<"getTextureId(): Queued: name=\""< result_queue; - + static ResultQueue result_queue; + // Throw a request in m_get_texture_queue.add(name, 0, 0, &result_queue); - - infostream<<"Waiting for texture from main thread, name=\"" - < + while(true) { + // Wait result for a second + GetResult result = result_queue.pop_front(1000); - - // Check that at least something worked OK - assert(result.key == name); - return result.item; + if (result.key == name) { + return result.item; + } + } } catch(ItemNotFoundException &e) { - infostream<<"Waiting for texture timed out."<=0; i--) @@ -647,9 +648,9 @@ u32 TextureSource::getTextureIdDirect(const std::string &name) <addTexture(name.c_str(), baseimg); } - + /* Add texture to caches (add NULL textures too) */ JMutexAutoLock lock(m_textureinfo_cache_mutex); - + u32 id = m_textureinfo_cache.size(); TextureInfo ti(name, t, baseimg); m_textureinfo_cache.push_back(ti); @@ -733,7 +734,7 @@ u32 TextureSource::getTextureIdDirect(const std::string &name) /*infostream<<"getTextureIdDirect(): " <<"Returning id="< dim = image->getDimension(); @@ -1031,7 +1032,7 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas /*infostream<<"generateImage(): generating special " <<"modification \""< dim = baseimg->getDimension(); - + // Set alpha to full for(u32 y=0; y dim = baseimg->getDimension(); - + /*video::IImage *oldbaseimg = baseimg; baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); oldbaseimg->copyTo(baseimg); @@ -1292,7 +1293,7 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas img_top->drop(); img_left->drop(); img_right->drop(); - + /* Draw a cube mesh into a render target texture */ @@ -1322,9 +1323,9 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas params.light_position.set(10, 100, -50); params.light_color.set(1.0, 0.5, 0.5, 0.5); params.light_radius = 1000; - + video::ITexture *rtt = generateTextureFromMesh(params); - + // Drop mesh cube->drop(); @@ -1332,7 +1333,7 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas driver->removeTexture(texture_top); driver->removeTexture(texture_left); driver->removeTexture(texture_right); - + if(rtt == NULL) { baseimg = generateImageFromScratch(imagename_top); @@ -1407,7 +1408,7 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas <<"\", cancelling."<getDimension(); frame_size.Y /= frame_count; @@ -1566,7 +1567,7 @@ void brighten(video::IImage *image) { if(image == NULL) return; - + core::dimension2d dim = image->getDimension(); for(u32 y=0; y srcdim = src->getDimension(); core::dimension2d dstdim = dst->getDimension(); From 21789ccc5f2e372fe462e54944fef3a31c790110 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 12 Nov 2013 19:54:32 +0200 Subject: [PATCH 093/198] Revert patch 58f036ad1 that causes object duplication (which tried to fix objects getting hidden from client) and fix the original problem correctly. This fixes the second distinct object duplication bug. --- src/environment.cpp | 83 ++++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index 8a52a143d..f019591df 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1417,8 +1417,8 @@ void ServerEnvironment::getAddedActiveObjects(v3s16 pos, s16 radius, ServerActiveObject *object = i->second; if(object == NULL) continue; - // Discard if removed - if(object->m_removed) + // Discard if removed or deactivating + if(object->m_removed || object->m_pending_deactivation) continue; if(object->unlimitedTransferDistance() == false){ // Discard if too far @@ -1468,7 +1468,7 @@ void ServerEnvironment::getRemovedActiveObjects(v3s16 pos, s16 radius, continue; } - if(object->m_removed) + if(object->m_removed || object->m_pending_deactivation) { removed_objects.insert(id); continue; @@ -1556,9 +1556,8 @@ u16 ServerEnvironment::addActiveObjectRaw(ServerActiveObject *object, StaticObject s_obj(object->getType(), objectpos, staticdata); // Add to the block where the object is located in v3s16 blockpos = getNodeBlockPos(floatToInt(objectpos, BS)); - MapBlock *block = m_map->getBlockNoCreateNoEx(blockpos); - if(block) - { + MapBlock *block = m_map->emergeBlock(blockpos); + if(block){ block->m_static_objects.m_active[object->getId()] = s_obj; object->m_static_exists = true; object->m_static_block = blockpos; @@ -1566,11 +1565,10 @@ u16 ServerEnvironment::addActiveObjectRaw(ServerActiveObject *object, if(set_changed) block->raiseModified(MOD_STATE_WRITE_NEEDED, "addActiveObjectRaw"); - } - else{ + } else { v3s16 p = floatToInt(objectpos, BS); errorstream<<"ServerEnvironment::addActiveObjectRaw(): " - <<"could not find block for storing id="<getId() + <<"could not emerge block for storing id="<getId() <<" statically (pos="<m_static_objects.remove(id); block->raiseModified(MOD_STATE_WRITE_NEEDED, - "removeRemovedObjects"); + "removeRemovedObjects/remove"); obj->m_static_exists = false; } else { - infostream << "failed to emerge block from which " - "an object to be removed was loaded from. id="< new_stored; - // Loop through stored static objects for(std::list::iterator i = block->m_static_objects.m_stored.begin(); i != block->m_static_objects.m_stored.end(); ++i) @@ -1750,6 +1768,19 @@ void ServerEnvironment::activateObjects(MapBlock *block, u32 dtime_s) StaticObject &s_obj = *i; block->m_static_objects.m_stored.push_back(s_obj); } + + // Turn the active counterparts of activated objects not pending for + // deactivation + for(std::map::iterator + i = block->m_static_objects.m_active.begin(); + i != block->m_static_objects.m_active.end(); ++i) + { + u16 id = i->first; + ServerActiveObject *object = getActiveObject(id); + assert(object); + object->m_pending_deactivation = false; + } + /* Note: Block hasn't really been modified here. The objects have just been activated and moved from the stored @@ -1910,6 +1941,8 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) block = m_map->emergeBlock(blockpos); } catch(InvalidPositionException &e){ // Handled via NULL pointer + // NOTE: emergeBlock's failure is usually determined by it + // actually returning NULL } if(block) @@ -1923,17 +1956,21 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) <<" Forcing delete."<m_static_block, but happens rarely for some unknown + // reason. Unsuccessful attempts have been made to find + // said reason. if(id && block->m_static_objects.m_active.find(id) != block->m_static_objects.m_active.end()){ infostream<<"ServerEnv: WARNING: Performing hack #83274" <m_static_objects.remove(id); } - //store static data - block->m_static_objects.insert(0, s_obj); + // Store static data + u16 store_id = pending_delete ? id : 0; + block->m_static_objects.insert(store_id, s_obj); // Only mark block as modified if data changed considerably if(shall_be_written) From a55c073ce9bd78a6ebbb867ab4db2ec611eb66cf Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 17 Nov 2013 21:05:14 +0100 Subject: [PATCH 094/198] Increase liquid_loop_max to 10000 again --- minetest.conf.example | 2 +- src/defaultsettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index e90d18b06..ee22e9f04 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -94,7 +94,7 @@ # Constant volume liquids #liquid_finite = false # Max liquids processed per step -#liquid_loop_max = 1000 +#liquid_loop_max = 10000 # Update liquids every .. recommend for finite: 0.2 #liquid_update = 1.0 # Relax flowing blocks to source if level near max and N nearby diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index c4e9d08ef..9df9b3aa5 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -221,7 +221,7 @@ void set_default_settings(Settings *settings) //liquid stuff settings->setDefault("liquid_finite", "false"); - settings->setDefault("liquid_loop_max", "1000"); + settings->setDefault("liquid_loop_max", "10000"); settings->setDefault("liquid_update", "1.0"); settings->setDefault("liquid_relax", "2"); settings->setDefault("liquid_fast_flood", "1"); From 86ef7147b60868f86d38d55a1dcf6271d68427ce Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Nov 2013 02:57:40 -0500 Subject: [PATCH 095/198] Fix issue #1009 (minetest.get_connected_players() returns non-existing players) --- builtin/misc.lua | 4 +++- src/script/lua_api/l_object.cpp | 11 +++++++++++ src/script/lua_api/l_object.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/builtin/misc.lua b/builtin/misc.lua index a6a1718ad..fd80aacf6 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -53,7 +53,9 @@ end) function minetest.get_connected_players() local temp_table = {} for index, value in pairs(player_list) do - table.insert(temp_table, value) + if value:is_player_connected() then + table.insert(temp_table, value) + end end return temp_table end diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index c324ced1a..cbcaa40eb 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -621,6 +621,16 @@ int ObjectRef::l_is_player(lua_State *L) return 1; } +// is_player_connected(self) +int ObjectRef::l_is_player_connected(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + ObjectRef *ref = checkobject(L, 1); + Player *player = getplayer(ref); + lua_pushboolean(L, (player != NULL && player->peer_id != 0)); + return 1; +} + // get_player_name(self) int ObjectRef::l_get_player_name(lua_State *L) { @@ -1148,6 +1158,7 @@ const luaL_reg ObjectRef::methods[] = { luamethod(ObjectRef, get_luaentity), // Player-only luamethod(ObjectRef, is_player), + luamethod(ObjectRef, is_player_connected), luamethod(ObjectRef, get_player_name), luamethod(ObjectRef, get_look_dir), luamethod(ObjectRef, get_look_pitch), diff --git a/src/script/lua_api/l_object.h b/src/script/lua_api/l_object.h index 8fd6c8e71..4b4f5eff7 100644 --- a/src/script/lua_api/l_object.h +++ b/src/script/lua_api/l_object.h @@ -158,6 +158,9 @@ private: // is_player(self) static int l_is_player(lua_State *L); + // is_player_connected(self) + static int l_is_player_connected(lua_State *L); + // get_player_name(self) static int l_get_player_name(lua_State *L); From 0930911efa35344d40b3977882ed516ab6ae1088 Mon Sep 17 00:00:00 2001 From: MetaDucky Date: Thu, 14 Nov 2013 20:09:37 +0100 Subject: [PATCH 096/198] fix gettext compile issues under win32 --- src/gettext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gettext.h b/src/gettext.h index 862274a31..02aa6979d 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -56,7 +56,7 @@ inline wchar_t* chartowchar_t(const char *str) int nResult = MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) str, -1, 0, 0 ); if( nResult == 0 ) { - fprintf( stderr, "error: MultiByteToWideChar returned null\n" ); + errorstream<<"gettext: MultiByteToWideChar returned null"< Date: Tue, 19 Nov 2013 15:39:40 +0100 Subject: [PATCH 097/198] Fix modmanager screenshot path --- builtin/modmgr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index 490336f06..611032d4a 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -267,7 +267,7 @@ function modmgr.tab() end retval = retval - .. "image[5.5,0;3,2;" .. modscreenshot .. "]" + .. "image[5.5,0;3,2;" .. engine.formspec_escape(modscreenshot) .. "]" .. "label[8.25,0.6;" .. selected_mod.name .. "]" local descriptionlines = nil From b38afc9311e235d2b90d61dbbcf1a18e549073a7 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Thu, 21 Nov 2013 00:43:15 -0500 Subject: [PATCH 098/198] Mapgen V6: Respect water_level setting --- src/mapgen_v6.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index 7643f3a48..64f3b9ed9 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -149,8 +149,8 @@ bool MapgenV6::block_is_underground(u64 seed, v3s16 blockpos) float MapgenV6::baseTerrainLevel(float terrain_base, float terrain_higher, float steepness, float height_select) { - float base = water_level + terrain_base; - float higher = water_level + terrain_higher; + float base = 1 + terrain_base; + float higher = 1 + terrain_higher; // Limit higher ground level to at least base if(higher < base) From 98e4e2b373ccb138c1e1244c2995e80b95340ca1 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Thu, 21 Nov 2013 00:45:17 -0500 Subject: [PATCH 099/198] LuaVoxelManip: Update parameter index of set_lighting() --- src/script/lua_api/l_vmanip.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index 1e9cc350f..db8884e10 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -163,8 +163,8 @@ int LuaVoxelManip::l_set_lighting(lua_State *L) return 0; u8 light; - light = (getintfield_default(L, 4, "day", 0) & 0x0F); - light |= (getintfield_default(L, 4, "night", 0) & 0x0F) << 8; + light = (getintfield_default(L, 2, "day", 0) & 0x0F); + light |= (getintfield_default(L, 2, "night", 0) & 0x0F) << 8; ManualMapVoxelManipulator *vm = o->vm; From 5323d800cc67814938fb668730d474011631fab5 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Thu, 21 Nov 2013 00:49:32 -0500 Subject: [PATCH 100/198] Fix possible implicit conversion of NULL to std::string --- src/script/common/c_internal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp index 7415aecb8..f22e9b0ff 100644 --- a/src/script/common/c_internal.cpp +++ b/src/script/common/c_internal.cpp @@ -57,7 +57,9 @@ int script_error_handler(lua_State *L) { void script_error(lua_State *L) { - throw LuaError(NULL, lua_tostring(L, -1)); + const char *s = lua_tostring(L, -1); + std::string str(s ? s : ""); + throw LuaError(NULL, str); } // Push the list of callbacks (a lua table). From e52d811110392e864332fb1a463a19983553087f Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 21 Nov 2013 21:24:04 -0500 Subject: [PATCH 101/198] Fix usage of 'minetest' where 'engine' was intended --- builtin/modmgr.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index 611032d4a..7b50f0882 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -778,7 +778,7 @@ function modmgr.handle_configure_world_buttons(fields) end if not worldfile:write() then - minetest.log("error", "Failed to write world config file") + engine.log("error", "Failed to write world config file") end modmgr.modlist = nil @@ -932,7 +932,7 @@ function modmgr.preparemodlist(data) if element ~= nil then element.enabled = engine.is_yes(value) else - minetest.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found") + engine.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found") end end end From 6f851c969251895efc3c3f02650456a2eac05d95 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sat, 23 Nov 2013 00:30:16 +0100 Subject: [PATCH 102/198] Fix crash when pressing Enter key in formspec menu --- src/guiFormSpecMenu.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 2416e4c8a..8ffddcbc6 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2297,12 +2297,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) switch (event.KeyInput.Key) { case KEY_RETURN: - if (m_allowclose) { - acceptInput(true); - quitMenu(); - } - else - current_keys_pending.key_enter = true; + current_keys_pending.key_enter = true; break; case KEY_UP: current_keys_pending.key_up = true; @@ -2316,7 +2311,13 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) assert("reached a source line that can't ever been reached" == 0); break; } - acceptInput(); + if (current_keys_pending.key_enter && m_allowclose) { + acceptInput(true); + quitMenu(); + } + else { + acceptInput(); + } return true; } From ee0b8da844451509ff9afc07912f6b31cf12f40b Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sat, 23 Nov 2013 08:55:48 +0100 Subject: [PATCH 103/198] Prevent enabling Shaders if Direct3D is used --- builtin/mainmenu.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 7ef5129c3..a8adca54f 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -645,7 +645,12 @@ function tabbuilder.handle_settings_buttons(fields) end if fields["cb_shaders"] then - engine.setting_set("enable_shaders", fields["cb_shaders"]) + if (engine.setting_get("video_driver") == "direct3d8" or engine.setting_get("video_driver") == "direct3d9") then + engine.setting_set("enable_shaders", "false") + gamedata.errormessage = fgettext("To enable shaders the OpenGL driver needs to be used.") + else + engine.setting_set("enable_shaders", fields["cb_shaders"]) + end end if fields["cb_pre_ivis"] then engine.setting_set("preload_item_visuals", fields["cb_pre_ivis"]) From ab601e87109c3ac880dcbcd11fe5ab456954ec35 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sat, 23 Nov 2013 16:09:38 +0100 Subject: [PATCH 104/198] Fix invalid escape sequence in database migration code --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ea66f1334..9ffab816e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1253,7 +1253,7 @@ int main(int argc, char *argv[]) ++count; if (count % 500 == 0) actionstream << "Migrated " << count << " blocks " - << (100.0 * count / blocks.size()) << "\% completed" << std::endl; + << (100.0 * count / blocks.size()) << "% completed" << std::endl; } new_db->endSave(); From 80981f80f3206ea4124542243b321464ea1d7688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20H=C3=A1la?= Date: Tue, 8 Oct 2013 07:06:49 +0200 Subject: [PATCH 105/198] Translated using Weblate (Czech) --- po/cs/minetest.po | 185 ++++++++++++++++++++++++---------------------- 1 file changed, 97 insertions(+), 88 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index f821542b6..5e998f601 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -3,128 +3,129 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2013-10-08 07:06+0200\n" +"Last-Translator: Petr Hála \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: cs\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 msgid "Game Name" -msgstr "" +msgstr "Název hry" #: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 msgid "Create" -msgstr "" +msgstr "Vytvořit" #: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 #: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" -msgstr "" +msgstr "Zrušit" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Nepovedlo se zkopírovat mod\"$1\" do hry\"$2\"" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "Hry" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 msgid "Games" -msgstr "" +msgstr "Hry" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Mody:" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "" +msgstr "editovat hru" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "" +msgstr "nová hra" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "" +msgstr "Editovat hru" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Odstranit vybraný mod" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "" +msgstr "<-- Přidat mod" #: builtin/mainmenu.lua:159 msgid "Ok" -msgstr "" +msgstr "Ok" #: builtin/mainmenu.lua:297 msgid "World name" -msgstr "" +msgstr "Název světa" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Generátor světa" #: builtin/mainmenu.lua:300 msgid "Game" -msgstr "" +msgstr "Hra" #: builtin/mainmenu.lua:314 msgid "Delete World \"$1\"?" -msgstr "" +msgstr "Doopravdy chcete smazat svět \"$1\"?" #: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 msgid "Yes" -msgstr "" +msgstr "Ano" #: builtin/mainmenu.lua:316 msgid "No" -msgstr "" +msgstr "Ne" #: builtin/mainmenu.lua:384 msgid "A world named \"$1\" already exists" -msgstr "" +msgstr "Svět s názvem \"$1\" už existuje" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" -msgstr "" +msgstr "Nebyla vybrána žádná hra" #: builtin/mainmenu.lua:852 msgid "Singleplayer" -msgstr "" +msgstr "Hra jednoho hráče" #: builtin/mainmenu.lua:853 msgid "Client" -msgstr "" +msgstr "Hra více hráčů" #: builtin/mainmenu.lua:854 msgid "Server" -msgstr "" +msgstr "Místní server" #: builtin/mainmenu.lua:855 msgid "Settings" -msgstr "" +msgstr "Nastavení" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Balíčky textur" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Mody" #: builtin/mainmenu.lua:865 msgid "Credits" @@ -132,52 +133,52 @@ msgstr "" #: builtin/mainmenu.lua:885 msgid "CLIENT" -msgstr "" +msgstr "CLIENT" #: builtin/mainmenu.lua:886 msgid "Favorites:" -msgstr "" +msgstr "Oblíbené:" #: builtin/mainmenu.lua:887 msgid "Address/Port" -msgstr "" +msgstr "Adresa/port" #: builtin/mainmenu.lua:888 msgid "Name/Password" -msgstr "" +msgstr "Jméno/Heslo" #: builtin/mainmenu.lua:891 msgid "Public Serverlist" -msgstr "" +msgstr "Veřejný seznam serverů" #: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 #: builtin/modmgr.lua:271 src/keycode.cpp:229 msgid "Delete" -msgstr "" +msgstr "Vymazat" #: builtin/mainmenu.lua:900 msgid "Connect" -msgstr "" +msgstr "Připojit" #: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 msgid "New" -msgstr "" +msgstr "Nový" #: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 msgid "Configure" -msgstr "" +msgstr "Nastavit" #: builtin/mainmenu.lua:944 msgid "Start Game" -msgstr "" +msgstr "Začít hru" #: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 msgid "Select World:" -msgstr "" +msgstr "Vyber svět:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "MÍSTNÍ SERVER" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -185,19 +186,19 @@ msgstr "" #: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 msgid "Enable Damage" -msgstr "" +msgstr "Povolit poškození" #: builtin/mainmenu.lua:951 msgid "Public" -msgstr "" +msgstr "Veřejný" #: builtin/mainmenu.lua:953 msgid "Name" -msgstr "" +msgstr "Jméno" #: builtin/mainmenu.lua:955 msgid "Password" -msgstr "" +msgstr "Heslo" #: builtin/mainmenu.lua:956 msgid "Server Port" @@ -205,11 +206,11 @@ msgstr "" #: builtin/mainmenu.lua:966 msgid "SETTINGS" -msgstr "" +msgstr "NASTAVENÍ" #: builtin/mainmenu.lua:967 msgid "Fancy trees" -msgstr "" +msgstr "Pěkné stromy" #: builtin/mainmenu.lua:969 msgid "Smooth Lighting" @@ -217,11 +218,11 @@ msgstr "" #: builtin/mainmenu.lua:971 msgid "3D Clouds" -msgstr "" +msgstr "3D Mraky" #: builtin/mainmenu.lua:973 msgid "Opaque Water" -msgstr "" +msgstr "Neprůhledná voda" #: builtin/mainmenu.lua:976 msgid "Mip-Mapping" @@ -229,153 +230,161 @@ msgstr "" #: builtin/mainmenu.lua:978 msgid "Anisotropic Filtering" -msgstr "" +msgstr "Anizotropní Filtrování" #: builtin/mainmenu.lua:980 msgid "Bi-Linear Filtering" -msgstr "" +msgstr "Bilineární filtrování" #: builtin/mainmenu.lua:982 msgid "Tri-Linear Filtering" -msgstr "" +msgstr "Trilineární Filtrování" #: builtin/mainmenu.lua:985 msgid "Shaders" -msgstr "" +msgstr "Shadery" #: builtin/mainmenu.lua:987 +#, fuzzy msgid "Preload item visuals" -msgstr "" +msgstr "Preload item visuals" #: builtin/mainmenu.lua:989 msgid "Enable Particles" -msgstr "" +msgstr "Povolit Částice" #: builtin/mainmenu.lua:991 +#, fuzzy msgid "Finite Liquid" -msgstr "" +msgstr "Finite Liquid" #: builtin/mainmenu.lua:994 msgid "Change keys" -msgstr "" +msgstr "Změnit nastavení klávesy" #: builtin/mainmenu.lua:1007 src/keycode.cpp:248 msgid "Play" -msgstr "" +msgstr "Hrát" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "HRA JEDNOHO HRÁČE" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Vyberte balíček textur:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "BALÍČKY TEXTUR" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "" +msgstr "Žádné informace dostupné" #: builtin/mainmenu.lua:1071 +#, fuzzy msgid "Core Developers" -msgstr "" +msgstr "Hlavní vývojáři" #: builtin/mainmenu.lua:1082 +#, fuzzy msgid "Active Contributors" -msgstr "" +msgstr "Aktivní Přispívatelé" #: builtin/mainmenu.lua:1092 +#, fuzzy msgid "Previous Contributors" -msgstr "" +msgstr "Bývalí Přispívatelé" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MODY" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Instalované Mody:" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Instalovat" #: builtin/modmgr.lua:244 msgid "Download" -msgstr "" +msgstr "Stáhnout" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Přejmenovat" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 msgid "Depends:" -msgstr "" +msgstr "Závislosti:" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Přejmenovat Modpack:" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" -msgstr "" +msgstr "Přijmout" #: builtin/modmgr.lua:381 msgid "World:" -msgstr "" +msgstr "Svět:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 msgid "Hide Game" -msgstr "" +msgstr "Skrýt Hru" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#, fuzzy msgid "Hide mp content" -msgstr "" +msgstr "Hide mp content" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mody:" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" -msgstr "" +msgstr "Uložit" #: builtin/modmgr.lua:422 msgid "Enable MP" -msgstr "" +msgstr "Povolit Hru více hráčů" #: builtin/modmgr.lua:424 msgid "Disable MP" -msgstr "" +msgstr "Zakázat Hru více hráčů" #: builtin/modmgr.lua:428 builtin/modmgr.lua:430 msgid "enabled" -msgstr "" +msgstr "povoleno" #: builtin/modmgr.lua:436 msgid "Enable all" -msgstr "" +msgstr "Povolit vše" #: builtin/modmgr.lua:551 msgid "Select Mod File:" -msgstr "" +msgstr "Vybrat Soubor s Modem:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Instalace Modu: ze souboru: \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Instalace Modu: nepodporovaný typ souboru \"$1\"" #: builtin/modmgr.lua:612 msgid "Failed to install $1 to $2" -msgstr "" +msgstr "Selhala instalace $1 do $2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" From e023e7228e2a2726d8df921b99703575c64f06e4 Mon Sep 17 00:00:00 2001 From: Heisenberg CZE Date: Tue, 8 Oct 2013 10:30:49 +0200 Subject: [PATCH 106/198] Translated using Weblate (Czech) --- po/cs/minetest.po | 270 ++++++++++++++++++++++++---------------------- 1 file changed, 141 insertions(+), 129 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 5e998f601..08ad7ee62 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -33,11 +33,11 @@ msgstr "Zrušit" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "Nepovedlo se zkopírovat mod\"$1\" do hry\"$2\"" +msgstr "Gamemgr: Nepovedlo se zkopírovat mod \"$1\" do hry\"$2\"" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "Hry" +msgstr "HRY" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 msgid "Games" @@ -49,7 +49,7 @@ msgstr "Mody:" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "editovat hru" +msgstr "upravit hru" #: builtin/gamemgr.lua:237 msgid "new game" @@ -57,7 +57,7 @@ msgstr "nová hra" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "Editovat hru" +msgstr "UPRAVIT HRU" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" @@ -65,7 +65,7 @@ msgstr "Odstranit vybraný mod" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "<-- Přidat mod" +msgstr "<<-- Přidat mod" #: builtin/mainmenu.lua:159 msgid "Ok" @@ -129,7 +129,7 @@ msgstr "Mody" #: builtin/mainmenu.lua:865 msgid "Credits" -msgstr "" +msgstr "Autoři" #: builtin/mainmenu.lua:885 msgid "CLIENT" @@ -182,7 +182,7 @@ msgstr "MÍSTNÍ SERVER" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" -msgstr "" +msgstr "Kreativní mód" #: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 msgid "Enable Damage" @@ -202,7 +202,7 @@ msgstr "Heslo" #: builtin/mainmenu.lua:956 msgid "Server Port" -msgstr "" +msgstr "Port serveru" #: builtin/mainmenu.lua:966 msgid "SETTINGS" @@ -214,7 +214,7 @@ msgstr "Pěkné stromy" #: builtin/mainmenu.lua:969 msgid "Smooth Lighting" -msgstr "" +msgstr "Hladké osvětlení" #: builtin/mainmenu.lua:971 msgid "3D Clouds" @@ -230,7 +230,7 @@ msgstr "" #: builtin/mainmenu.lua:978 msgid "Anisotropic Filtering" -msgstr "Anizotropní Filtrování" +msgstr "Anizotropní filtrování" #: builtin/mainmenu.lua:980 msgid "Bi-Linear Filtering" @@ -238,7 +238,7 @@ msgstr "Bilineární filtrování" #: builtin/mainmenu.lua:982 msgid "Tri-Linear Filtering" -msgstr "Trilineární Filtrování" +msgstr "Trilineární filtrování" #: builtin/mainmenu.lua:985 msgid "Shaders" @@ -283,19 +283,16 @@ msgid "No information available" msgstr "Žádné informace dostupné" #: builtin/mainmenu.lua:1071 -#, fuzzy msgid "Core Developers" -msgstr "Hlavní vývojáři" +msgstr "Vývojáři jádra" #: builtin/mainmenu.lua:1082 -#, fuzzy msgid "Active Contributors" -msgstr "Aktivní Přispívatelé" +msgstr "Aktivní přispěvatelé" #: builtin/mainmenu.lua:1092 -#, fuzzy msgid "Previous Contributors" -msgstr "Bývalí Přispívatelé" +msgstr "Bývalí přispěvatelé" #: builtin/modmgr.lua:236 msgid "MODS" @@ -388,102 +385,105 @@ msgstr "Selhala instalace $1 do $2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" -msgstr "" +msgstr "Install Mod: nenalezen adresář s příslušným názvem pro balíček modu $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "Install Mod: Nenašel jsem skutečné jméno modu: $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr: Nepodařilo se odstranit \"$1\"" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr: Neplatná cesta k modu \"$1\"" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "Skutečně chcete odstranit \"$1\"?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "Jistě, že ne!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Strana $1 z $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Hodnocení" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "přeinstalovat" #: src/client.cpp:2915 msgid "Item textures..." -msgstr "" +msgstr "Textury předmětů..." #: src/game.cpp:939 msgid "Loading..." -msgstr "" +msgstr "Nahrávám..." #: src/game.cpp:999 msgid "Creating server...." -msgstr "" +msgstr "Vytvářím server..." #: src/game.cpp:1015 msgid "Creating client..." -msgstr "" +msgstr "Vytvářím klienta..." #: src/game.cpp:1024 msgid "Resolving address..." -msgstr "" +msgstr "Překládám adresu..." #: src/game.cpp:1121 msgid "Connecting to server..." -msgstr "" +msgstr "Připojuji se k serveru..." #: src/game.cpp:1218 msgid "Item definitions..." -msgstr "" +msgstr "Definice předmětů..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Definice uzlů..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Média..." #: src/game.cpp:3405 msgid "Shutting down stuff..." -msgstr "" +msgstr "Vypínám to..." #: src/game.cpp:3435 msgid "" "\n" "Check debug.txt for details." msgstr "" +"\n" +"Pro detaily se podívej do debug.txt." #: src/guiDeathScreen.cpp:96 msgid "You died." -msgstr "" +msgstr "Zemřel jsi." #: src/guiDeathScreen.cpp:104 msgid "Respawn" -msgstr "" +msgstr "Oživení" #: src/guiFormSpecMenu.cpp:1569 msgid "Left click: Move all items, Right click: Move single item" msgstr "" +"Levý klik: Přesunout všechny předměty, Pravý klik: Přesunout jeden předmět" #: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 #: src/guiTextInputMenu.cpp:140 msgid "Proceed" -msgstr "" +msgstr "Pokračovat" #: src/guiKeyChangeMenu.cpp:121 msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" @@ -491,7 +491,7 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" -msgstr "" +msgstr "\"Použít\" = slézt dolů" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" @@ -499,67 +499,67 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" -msgstr "" +msgstr "Klávesa je již používána." #: src/guiKeyChangeMenu.cpp:372 msgid "press key" -msgstr "" +msgstr "stiskni klávesu" #: src/guiKeyChangeMenu.cpp:400 msgid "Forward" -msgstr "" +msgstr "Vpřed" #: src/guiKeyChangeMenu.cpp:401 msgid "Backward" -msgstr "" +msgstr "Vzad" #: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 msgid "Left" -msgstr "" +msgstr "Vlevo" #: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 msgid "Right" -msgstr "" +msgstr "Vpravo" #: src/guiKeyChangeMenu.cpp:404 msgid "Use" -msgstr "" +msgstr "Použít" #: src/guiKeyChangeMenu.cpp:405 msgid "Jump" -msgstr "" +msgstr "Skočit" #: src/guiKeyChangeMenu.cpp:406 msgid "Sneak" -msgstr "" +msgstr "Plížení" #: src/guiKeyChangeMenu.cpp:407 msgid "Drop" -msgstr "" +msgstr "Zahodit" #: src/guiKeyChangeMenu.cpp:408 msgid "Inventory" -msgstr "" +msgstr "Inventář" #: src/guiKeyChangeMenu.cpp:409 msgid "Chat" -msgstr "" +msgstr "Chat" #: src/guiKeyChangeMenu.cpp:410 msgid "Command" -msgstr "" +msgstr "Příkaz" #: src/guiKeyChangeMenu.cpp:411 msgid "Console" -msgstr "" +msgstr "Konzole" #: src/guiKeyChangeMenu.cpp:412 msgid "Toggle fly" -msgstr "" +msgstr "Přepnout létání" #: src/guiKeyChangeMenu.cpp:413 msgid "Toggle fast" -msgstr "" +msgstr "Přepnout rychlý pohyb" #: src/guiKeyChangeMenu.cpp:414 msgid "Toggle noclip" @@ -567,7 +567,7 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:415 msgid "Range select" -msgstr "" +msgstr "Vybrat rozmezí" #: src/guiKeyChangeMenu.cpp:416 msgid "Print stacks" @@ -575,43 +575,43 @@ msgstr "" #: src/guiPasswordChange.cpp:107 msgid "Old Password" -msgstr "" +msgstr "Staré heslo" #: src/guiPasswordChange.cpp:125 msgid "New Password" -msgstr "" +msgstr "Nové heslo" #: src/guiPasswordChange.cpp:142 msgid "Confirm Password" -msgstr "" +msgstr "Potvrdit heslo" #: src/guiPasswordChange.cpp:160 msgid "Change" -msgstr "" +msgstr "Změnit" #: src/guiPasswordChange.cpp:169 msgid "Passwords do not match!" -msgstr "" +msgstr "Hesla si neodpovídají!" #: src/guiPauseMenu.cpp:122 msgid "Continue" -msgstr "" +msgstr "Pokračovat" #: src/guiPauseMenu.cpp:133 msgid "Change Password" -msgstr "" +msgstr "Změnit heslo" #: src/guiPauseMenu.cpp:143 msgid "Sound Volume" -msgstr "" +msgstr "Hlasitost" #: src/guiPauseMenu.cpp:152 msgid "Exit to Menu" -msgstr "" +msgstr "Odejít do Nabídky" #: src/guiPauseMenu.cpp:161 msgid "Exit to OS" -msgstr "" +msgstr "Ukončit hru" #: src/guiPauseMenu.cpp:170 msgid "" @@ -627,26 +627,37 @@ msgid "" "- Mouse wheel: select item\n" "- T: chat\n" msgstr "" +"Výchozí ovládání:\n" +"- WASD: pohyb\n" +"- Mezera: skákání/šplhání\n" +"- Shift: plížení\n" +"- Q: zahodit\n" +"- I: inventář\n" +"- Myš: otáčení,rozhlížení\n" +"- Myš(levé tl.): kopat, štípat\n" +"- Myš(pravé tl.): položit, použít\n" +"- Myš(kolečko): vybrat předmět\n" +"- T: chat\n" #: src/guiVolumeChange.cpp:108 msgid "Sound Volume: " -msgstr "" +msgstr "Hlasitost:" #: src/guiVolumeChange.cpp:122 msgid "Exit" -msgstr "" +msgstr "Odejít" #: src/keycode.cpp:223 msgid "Left Button" -msgstr "" +msgstr "Levé tlačítko myši" #: src/keycode.cpp:223 msgid "Middle Button" -msgstr "" +msgstr "Prostřední tlačítko myši" #: src/keycode.cpp:223 msgid "Right Button" -msgstr "" +msgstr "Pravé tlačítko myši" #: src/keycode.cpp:223 msgid "X Button 1" @@ -654,19 +665,19 @@ msgstr "" #: src/keycode.cpp:224 msgid "Back" -msgstr "" +msgstr "Zpět" #: src/keycode.cpp:224 msgid "Clear" -msgstr "" +msgstr "Vyčistit" #: src/keycode.cpp:224 msgid "Return" -msgstr "" +msgstr "Vrátit" #: src/keycode.cpp:224 msgid "Tab" -msgstr "" +msgstr "Tab" #: src/keycode.cpp:224 msgid "X Button 2" @@ -678,35 +689,35 @@ msgstr "" #: src/keycode.cpp:225 msgid "Control" -msgstr "" +msgstr "Control" #: src/keycode.cpp:225 msgid "Kana" -msgstr "" +msgstr "Kana" #: src/keycode.cpp:225 msgid "Menu" -msgstr "" +msgstr "Nabídka" #: src/keycode.cpp:225 msgid "Pause" -msgstr "" +msgstr "Pauza" #: src/keycode.cpp:225 msgid "Shift" -msgstr "" +msgstr "Shift" #: src/keycode.cpp:226 msgid "Convert" -msgstr "" +msgstr "Převést" #: src/keycode.cpp:226 msgid "Escape" -msgstr "" +msgstr "Esc" #: src/keycode.cpp:226 msgid "Final" -msgstr "" +msgstr "Konečný" #: src/keycode.cpp:226 msgid "Junja" @@ -714,7 +725,7 @@ msgstr "" #: src/keycode.cpp:226 msgid "Kanji" -msgstr "" +msgstr "Kanji" #: src/keycode.cpp:226 msgid "Nonconvert" @@ -722,19 +733,19 @@ msgstr "" #: src/keycode.cpp:227 msgid "End" -msgstr "" +msgstr "End" #: src/keycode.cpp:227 msgid "Home" -msgstr "" +msgstr "Home" #: src/keycode.cpp:227 msgid "Mode Change" -msgstr "" +msgstr "Změna modu" #: src/keycode.cpp:227 msgid "Next" -msgstr "" +msgstr "Další" #: src/keycode.cpp:227 msgid "Prior" @@ -742,15 +753,15 @@ msgstr "" #: src/keycode.cpp:227 msgid "Space" -msgstr "" +msgstr "Mezerník" #: src/keycode.cpp:228 msgid "Down" -msgstr "" +msgstr "Dolů" #: src/keycode.cpp:228 msgid "Execute" -msgstr "" +msgstr "Spustit" #: src/keycode.cpp:228 msgid "Print" @@ -758,23 +769,23 @@ msgstr "" #: src/keycode.cpp:228 msgid "Select" -msgstr "" +msgstr "Vybrat" #: src/keycode.cpp:228 msgid "Up" -msgstr "" +msgstr "Nahoru" #: src/keycode.cpp:229 msgid "Help" -msgstr "" +msgstr "Pomoc" #: src/keycode.cpp:229 msgid "Insert" -msgstr "" +msgstr "Vložit" #: src/keycode.cpp:229 msgid "Snapshot" -msgstr "" +msgstr "Momentka" #: src/keycode.cpp:232 msgid "Left Windows" @@ -782,15 +793,15 @@ msgstr "" #: src/keycode.cpp:233 msgid "Apps" -msgstr "" +msgstr "Aplikace" #: src/keycode.cpp:233 msgid "Numpad 0" -msgstr "" +msgstr "Numerická klávesnice: 0" #: src/keycode.cpp:233 msgid "Numpad 1" -msgstr "" +msgstr "Numerická klávesnice: 1" #: src/keycode.cpp:233 msgid "Right Windows" @@ -798,75 +809,75 @@ msgstr "" #: src/keycode.cpp:233 msgid "Sleep" -msgstr "" +msgstr "Spát" #: src/keycode.cpp:234 msgid "Numpad 2" -msgstr "" +msgstr "Numerická klávesnice: 2" #: src/keycode.cpp:234 msgid "Numpad 3" -msgstr "" +msgstr "Numerická klávesnice: 3" #: src/keycode.cpp:234 msgid "Numpad 4" -msgstr "" +msgstr "Numerická klávesnice: 4" #: src/keycode.cpp:234 msgid "Numpad 5" -msgstr "" +msgstr "Numerická klávesnice: 5" #: src/keycode.cpp:234 msgid "Numpad 6" -msgstr "" +msgstr "Numerická klávesnice: 6" #: src/keycode.cpp:234 msgid "Numpad 7" -msgstr "" +msgstr "Numerická klávesnice: 7" #: src/keycode.cpp:235 msgid "Numpad *" -msgstr "" +msgstr "Numerická klávesnice: *" #: src/keycode.cpp:235 msgid "Numpad +" -msgstr "" +msgstr "Numerická klávesnice: +" #: src/keycode.cpp:235 msgid "Numpad -" -msgstr "" +msgstr "Numerická klávesnice: -" #: src/keycode.cpp:235 msgid "Numpad /" -msgstr "" +msgstr "Numerická klávesnice: /" #: src/keycode.cpp:235 msgid "Numpad 8" -msgstr "" +msgstr "Numerická klávesnice: 8" #: src/keycode.cpp:235 msgid "Numpad 9" -msgstr "" +msgstr "Numerická klávesnice: 9" #: src/keycode.cpp:239 msgid "Num Lock" -msgstr "" +msgstr "Num Lock" #: src/keycode.cpp:239 msgid "Scroll Lock" -msgstr "" +msgstr "Scroll Lock" #: src/keycode.cpp:240 msgid "Left Shift" -msgstr "" +msgstr "Levý Shift" #: src/keycode.cpp:240 msgid "Right Shift" -msgstr "" +msgstr "Pravý Shift" #: src/keycode.cpp:241 msgid "Left Control" -msgstr "" +msgstr "Levý Control" #: src/keycode.cpp:241 msgid "Left Menu" @@ -874,7 +885,7 @@ msgstr "" #: src/keycode.cpp:241 msgid "Right Control" -msgstr "" +msgstr "Pravý Control" #: src/keycode.cpp:241 msgid "Right Menu" @@ -882,19 +893,19 @@ msgstr "" #: src/keycode.cpp:243 msgid "Comma" -msgstr "" +msgstr "Čárka" #: src/keycode.cpp:243 msgid "Minus" -msgstr "" +msgstr "Mínus" #: src/keycode.cpp:243 msgid "Period" -msgstr "" +msgstr "Tečka" #: src/keycode.cpp:243 msgid "Plus" -msgstr "" +msgstr "Plus" #: src/keycode.cpp:247 msgid "Attn" @@ -906,7 +917,7 @@ msgstr "" #: src/keycode.cpp:248 msgid "Erase OEF" -msgstr "" +msgstr "Smazat EOF" #: src/keycode.cpp:248 msgid "ExSel" @@ -922,7 +933,7 @@ msgstr "" #: src/keycode.cpp:248 msgid "Zoom" -msgstr "" +msgstr "Zoom" #: src/main.cpp:1411 msgid "needs_fallback_font" @@ -930,20 +941,21 @@ msgstr "" #: src/main.cpp:1486 msgid "Main Menu" -msgstr "" +msgstr "Hlavní nabídka" #: src/main.cpp:1662 msgid "No world selected and no address provided. Nothing to do." msgstr "" +"Nebyl vybrán žádný svět a nebyla poskytnuta žádná adresa. Nemám co dělat." #: src/main.cpp:1670 msgid "Could not find or load game \"" -msgstr "" +msgstr "Hru nebylo možné najít nebo nahrát \"" #: src/main.cpp:1684 msgid "Invalid gamespec." -msgstr "" +msgstr "Neplatná specifikace hry." #: src/main.cpp:1729 msgid "Connection error (timed out?)" -msgstr "" +msgstr "Chyba spojení (vypršel čas?)" From 71cc575ea0f424f92d7b43b7a3bbf45a0d0af91a Mon Sep 17 00:00:00 2001 From: Heisenberg CZE Date: Tue, 8 Oct 2013 10:39:34 +0200 Subject: [PATCH 107/198] Translated using Weblate (Czech) --- po/cs/minetest.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 08ad7ee62..3dbec7187 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-08 07:06+0200\n" -"Last-Translator: Petr Hála \n" +"PO-Revision-Date: 2013-10-08 10:39+0200\n" +"Last-Translator: Heisenberg CZE \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" @@ -499,7 +499,7 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" -msgstr "Klávesa je již používána." +msgstr "Klávesa je již používána" #: src/guiKeyChangeMenu.cpp:372 msgid "press key" @@ -641,7 +641,7 @@ msgstr "" #: src/guiVolumeChange.cpp:108 msgid "Sound Volume: " -msgstr "Hlasitost:" +msgstr "Hlasitost: " #: src/guiVolumeChange.cpp:122 msgid "Exit" @@ -677,7 +677,7 @@ msgstr "Vrátit" #: src/keycode.cpp:224 msgid "Tab" -msgstr "Tab" +msgstr "Tabulátor" #: src/keycode.cpp:224 msgid "X Button 2" @@ -933,11 +933,11 @@ msgstr "" #: src/keycode.cpp:248 msgid "Zoom" -msgstr "Zoom" +msgstr "Přiblížení" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "vyzaduje_fallback_font" #: src/main.cpp:1486 msgid "Main Menu" From 4d165f5ea5c59b7f0db7277e4e02dffac7b13bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20H=C3=A1la?= Date: Tue, 8 Oct 2013 14:45:02 +0200 Subject: [PATCH 108/198] Translated using Weblate (Czech) --- po/cs/minetest.po | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 3dbec7187..74815c0f3 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-08 10:39+0200\n" -"Last-Translator: Heisenberg CZE \n" +"PO-Revision-Date: 2013-10-08 14:45+0200\n" +"Last-Translator: Petr Hála \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" @@ -226,7 +226,7 @@ msgstr "Neprůhledná voda" #: builtin/mainmenu.lua:976 msgid "Mip-Mapping" -msgstr "" +msgstr "Mip-Mapování" #: builtin/mainmenu.lua:978 msgid "Anisotropic Filtering" @@ -245,9 +245,8 @@ msgid "Shaders" msgstr "Shadery" #: builtin/mainmenu.lua:987 -#, fuzzy msgid "Preload item visuals" -msgstr "Preload item visuals" +msgstr "Přednačtené textury itemů" #: builtin/mainmenu.lua:989 msgid "Enable Particles" @@ -488,6 +487,8 @@ msgstr "Pokračovat" #: src/guiKeyChangeMenu.cpp:121 msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" msgstr "" +"Nastavení kláves. (Pokud tohle menu nebude v pořádku, odstraňte nastavení z " +"minetest.conf" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" @@ -495,7 +496,7 @@ msgstr "\"Použít\" = slézt dolů" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" -msgstr "" +msgstr "Dvakrát zmáčkněte \"skok\" pro zapnutí létání" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" @@ -563,7 +564,7 @@ msgstr "Přepnout rychlý pohyb" #: src/guiKeyChangeMenu.cpp:414 msgid "Toggle noclip" -msgstr "" +msgstr "Zapnout noclip" #: src/guiKeyChangeMenu.cpp:415 msgid "Range select" @@ -721,7 +722,7 @@ msgstr "Konečný" #: src/keycode.cpp:226 msgid "Junja" -msgstr "" +msgstr "Junja" #: src/keycode.cpp:226 msgid "Kanji" @@ -909,11 +910,11 @@ msgstr "Plus" #: src/keycode.cpp:247 msgid "Attn" -msgstr "" +msgstr "Attn" #: src/keycode.cpp:247 msgid "CrSel" -msgstr "" +msgstr "CrSel" #: src/keycode.cpp:248 msgid "Erase OEF" @@ -921,15 +922,15 @@ msgstr "Smazat EOF" #: src/keycode.cpp:248 msgid "ExSel" -msgstr "" +msgstr "ExSel" #: src/keycode.cpp:248 msgid "OEM Clear" -msgstr "" +msgstr "OEM Clear" #: src/keycode.cpp:248 msgid "PA1" -msgstr "" +msgstr "PA1" #: src/keycode.cpp:248 msgid "Zoom" @@ -937,7 +938,7 @@ msgstr "Přiblížení" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "vyzaduje_fallback_font" +msgstr "vyžaduje_fallback_font" #: src/main.cpp:1486 msgid "Main Menu" From 012551f16f82e3ae23646f55b0146531df574caa Mon Sep 17 00:00:00 2001 From: Pablo Lezaeta Date: Tue, 8 Oct 2013 20:45:10 +0200 Subject: [PATCH 109/198] Translated using Weblate (Spanish) --- po/es/minetest.po | 87 +++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/po/es/minetest.po b/po/es/minetest.po index 6f87c2f24..dbe85ac5c 100644 --- a/po/es/minetest.po +++ b/po/es/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-09-14 04:33+0200\n" -"Last-Translator: William Strealy \n" +"PO-Revision-Date: 2013-10-08 20:44+0200\n" +"Last-Translator: Pablo Lezaeta \n" "Language-Team: LANGUAGE \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -33,7 +33,7 @@ msgstr "Cancelar" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Gamemgr: Imposible copiar el mod \"$1\" al juego \"$2\"" #: builtin/gamemgr.lua:216 msgid "GAMES" @@ -61,7 +61,7 @@ msgstr "EDITAR JUEGO" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Eliminar mod seleccionado" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" @@ -77,7 +77,7 @@ msgstr "Nombre del mundo" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Mapgen" #: builtin/mainmenu.lua:300 msgid "Game" @@ -101,7 +101,7 @@ msgstr "Ya hay un mundo llamado \"$1\"" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" -msgstr "" +msgstr "No se a dado un nombre al mundo o no se ha seleccionado uno" #: builtin/mainmenu.lua:852 msgid "Singleplayer" @@ -121,11 +121,11 @@ msgstr "Configuración" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Paquete de texturas" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Mods" #: builtin/mainmenu.lua:865 msgid "Credits" @@ -178,7 +178,7 @@ msgstr "Selecciona un mundo:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "INICIAR SERVIDOR" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -266,43 +266,43 @@ msgstr "Jugar" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "UN JUGADOR" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Seleccione paquete de texturas:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "PAQUETES DE TEXTURAS" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "No hay informacion disponible" +msgstr "Sin informacion disponible" #: builtin/mainmenu.lua:1071 msgid "Core Developers" -msgstr "" +msgstr "Núcleo de desarrolladores" #: builtin/mainmenu.lua:1082 msgid "Active Contributors" -msgstr "" +msgstr "Colaboradores activos" #: builtin/mainmenu.lua:1092 msgid "Previous Contributors" -msgstr "" +msgstr "Antiguos colaboradores" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MODS" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Mods instalados:" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Instalar" #: builtin/modmgr.lua:244 msgid "Download" @@ -310,7 +310,7 @@ msgstr "Descargar" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Renombrar" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 msgid "Depends:" @@ -318,7 +318,7 @@ msgstr "Dependencias:" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Renombrar paquete de mod:" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" @@ -334,11 +334,11 @@ msgstr "Ocultar Juego" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" -msgstr "" +msgstr "Esconder contenido mp" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mod:" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" @@ -366,13 +366,15 @@ msgstr "Selecciona fichero de mod:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Instalar mod: Archivo: \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Instalar mod: Tipo de archivo sin soporte \"$1\"" #: builtin/modmgr.lua:612 msgid "Failed to install $1 to $2" @@ -381,38 +383,40 @@ msgstr "Fallo al instalar $1 en $2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" +"Instalar mod: Imposible encontrar un nombre de archivo adecuado para el " +"Paquete de mod $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "Instalar mod: imposible encontrar el nombre real del mod para: $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr: Error al borrar \"$1\"" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr: Dirección de mod \"$1\" inválida" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "¿Realmente desea borrar \"$1\"?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "¡No, por su puesto que no!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Página $1 de $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Clasificación" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "Reinstalar" #: src/client.cpp:2915 msgid "Item textures..." @@ -444,11 +448,11 @@ msgstr "Definición de objetos..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Definiendo nodos..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Media..." #: src/game.cpp:3405 msgid "Shutting down stuff..." @@ -600,7 +604,7 @@ msgstr "Modificar contraseña" #: src/guiPauseMenu.cpp:143 msgid "Sound Volume" -msgstr "Volúmen del Sonido" +msgstr "Volumen del Sonido" #: src/guiPauseMenu.cpp:152 msgid "Exit to Menu" @@ -702,7 +706,7 @@ msgstr "Pausa" #: src/keycode.cpp:225 msgid "Shift" -msgstr "Mayús" +msgstr "Shift" #: src/keycode.cpp:226 msgid "Convert" @@ -866,11 +870,11 @@ msgstr "Bloq Despl" #: src/keycode.cpp:240 msgid "Left Shift" -msgstr "Mayús Izqda" +msgstr "Shift Izqda" #: src/keycode.cpp:240 msgid "Right Shift" -msgstr "Mayús Dcha" +msgstr "Shift Dcha" #: src/keycode.cpp:241 msgid "Left Control" @@ -922,7 +926,7 @@ msgstr "ExSel" #: src/keycode.cpp:248 msgid "OEM Clear" -msgstr "OEM Limpiar" +msgstr "Limpiar OEM" #: src/keycode.cpp:248 msgid "PA1" @@ -934,7 +938,7 @@ msgstr "Zoom" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "needs_fallback_font" #: src/main.cpp:1486 msgid "Main Menu" @@ -943,7 +947,8 @@ msgstr "Menú Principal" #: src/main.cpp:1662 msgid "No world selected and no address provided. Nothing to do." msgstr "" -"No se seleccionó mundo y no se ha especificado una dirección. Nada que hacer." +"No se seleccionó mundo y no se ha especificado una dirección. Nada que " +"hacer." #: src/main.cpp:1670 msgid "Could not find or load game \"" From c28810f6dfa502f64ba908f7f600df337b8c419c Mon Sep 17 00:00:00 2001 From: Heisenberg CZE Date: Tue, 8 Oct 2013 20:04:49 +0200 Subject: [PATCH 110/198] Translated using Weblate (Czech) --- po/cs/minetest.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 74815c0f3..8e3909db6 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-08 14:45+0200\n" -"Last-Translator: Petr Hála \n" +"PO-Revision-Date: 2013-10-08 20:04+0200\n" +"Last-Translator: Heisenberg CZE \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" @@ -488,7 +488,7 @@ msgstr "Pokračovat" msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" msgstr "" "Nastavení kláves. (Pokud tohle menu nebude v pořádku, odstraňte nastavení z " -"minetest.conf" +"minetest.conf)" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" From 8c3cf606a6075db4c85fe8c06fe6af97e21241ec Mon Sep 17 00:00:00 2001 From: Pablo Lezaeta Date: Sat, 19 Oct 2013 08:14:21 +0200 Subject: [PATCH 111/198] Translated using Weblate (Spanish) --- po/es/minetest.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/es/minetest.po b/po/es/minetest.po index dbe85ac5c..974a3e290 100644 --- a/po/es/minetest.po +++ b/po/es/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-08 20:44+0200\n" +"PO-Revision-Date: 2013-10-19 08:14+0200\n" "Last-Translator: Pablo Lezaeta \n" "Language-Team: LANGUAGE \n" "Language: es\n" From dfc268d88bb71f4a89668f35b54c040da75a06b3 Mon Sep 17 00:00:00 2001 From: Frantisek Simorda Date: Tue, 8 Oct 2013 21:41:01 +0200 Subject: [PATCH 112/198] Translated using Weblate (Czech) --- po/cs/minetest.po | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 8e3909db6..40ea3baf0 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-08 20:04+0200\n" -"Last-Translator: Heisenberg CZE \n" +"PO-Revision-Date: 2013-10-08 21:41+0200\n" +"Last-Translator: Frantisek Simorda \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" @@ -334,9 +334,8 @@ msgid "Hide Game" msgstr "Skrýt Hru" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 -#, fuzzy msgid "Hide mp content" -msgstr "Hide mp content" +msgstr "Skrýt obsah mp" #: builtin/modmgr.lua:400 msgid "Mod:" @@ -572,7 +571,7 @@ msgstr "Vybrat rozmezí" #: src/guiKeyChangeMenu.cpp:416 msgid "Print stacks" -msgstr "" +msgstr "Vytisknout zásobníky" #: src/guiPasswordChange.cpp:107 msgid "Old Password" @@ -750,7 +749,7 @@ msgstr "Další" #: src/keycode.cpp:227 msgid "Prior" -msgstr "" +msgstr "Předchozí" #: src/keycode.cpp:227 msgid "Space" From e5b1447d7217726eb963e7fd5af92cbb3dccc575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=C4=9Bk?= Date: Wed, 30 Oct 2013 15:03:48 +0100 Subject: [PATCH 113/198] Translated using Weblate (Czech) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Myslím, že se jedná o IME NonConvert klávesu: http://msdn.microsoft.com/en-us/library/system.windows.input.key.aspx --- po/cs/minetest.po | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 40ea3baf0..fa83c86f5 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-08 21:41+0200\n" -"Last-Translator: Frantisek Simorda \n" +"PO-Revision-Date: 2013-10-30 15:03+0200\n" +"Last-Translator: Jakub Vaněk \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" @@ -253,9 +253,8 @@ msgid "Enable Particles" msgstr "Povolit Částice" #: builtin/mainmenu.lua:991 -#, fuzzy msgid "Finite Liquid" -msgstr "Finite Liquid" +msgstr "Konečná voda" #: builtin/mainmenu.lua:994 msgid "Change keys" @@ -661,7 +660,7 @@ msgstr "Pravé tlačítko myši" #: src/keycode.cpp:223 msgid "X Button 1" -msgstr "" +msgstr "X Tlačítko 1" #: src/keycode.cpp:224 msgid "Back" @@ -681,11 +680,11 @@ msgstr "Tabulátor" #: src/keycode.cpp:224 msgid "X Button 2" -msgstr "" +msgstr "X Tlačítko 2" #: src/keycode.cpp:225 msgid "Capital" -msgstr "" +msgstr "Klávesa velkého písmene" #: src/keycode.cpp:225 msgid "Control" @@ -729,7 +728,7 @@ msgstr "Kanji" #: src/keycode.cpp:226 msgid "Nonconvert" -msgstr "" +msgstr "Nepřevádět" #: src/keycode.cpp:227 msgid "End" @@ -765,7 +764,7 @@ msgstr "Spustit" #: src/keycode.cpp:228 msgid "Print" -msgstr "" +msgstr "Print Screen" #: src/keycode.cpp:228 msgid "Select" @@ -789,7 +788,7 @@ msgstr "Momentka" #: src/keycode.cpp:232 msgid "Left Windows" -msgstr "" +msgstr "Levá klávesa Windows" #: src/keycode.cpp:233 msgid "Apps" @@ -805,7 +804,7 @@ msgstr "Numerická klávesnice: 1" #: src/keycode.cpp:233 msgid "Right Windows" -msgstr "" +msgstr "Pravá klávesa Windows" #: src/keycode.cpp:233 msgid "Sleep" @@ -881,7 +880,7 @@ msgstr "Levý Control" #: src/keycode.cpp:241 msgid "Left Menu" -msgstr "" +msgstr "Levá klávesa Menu" #: src/keycode.cpp:241 msgid "Right Control" @@ -889,7 +888,7 @@ msgstr "Pravý Control" #: src/keycode.cpp:241 msgid "Right Menu" -msgstr "" +msgstr "Pravá klávesa Menu" #: src/keycode.cpp:243 msgid "Comma" From d7b0fcb2f06498d589c425622667c07fefd25259 Mon Sep 17 00:00:00 2001 From: King Artur Date: Sat, 16 Nov 2013 20:43:09 +0100 Subject: [PATCH 114/198] Translated using Weblate (Romanian) --- po/ro/minetest.po | 469 ++++++++++++++++++++++++---------------------- 1 file changed, 245 insertions(+), 224 deletions(-) diff --git a/po/ro/minetest.po b/po/ro/minetest.po index ace90daa0..eeedcdd48 100644 --- a/po/ro/minetest.po +++ b/po/ro/minetest.po @@ -3,606 +3,616 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2013-11-16 20:43+0200\n" +"Last-Translator: King Artur \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2;\n" +"X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 msgid "Game Name" -msgstr "" +msgstr "Numele jocului" #: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 msgid "Create" -msgstr "" +msgstr "Creează" #: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 #: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" -msgstr "" +msgstr "Anulează" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Gamemgr: Nu se poate copia modul \"$1\" în jocul \"$2\"" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "JOCURI" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 msgid "Games" -msgstr "" +msgstr "Jocuri" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Moduri:" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "" +msgstr "modifică jocul" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "" +msgstr "joc nou" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "" +msgstr "MODIFICĂ JOCUL" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Șterge modul selectat" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "" +msgstr "<<-- Adaugă modul" #: builtin/mainmenu.lua:159 msgid "Ok" -msgstr "" +msgstr "Ok" #: builtin/mainmenu.lua:297 msgid "World name" -msgstr "" +msgstr "Numele lumii" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Mapgen" #: builtin/mainmenu.lua:300 msgid "Game" -msgstr "" +msgstr "Joc" #: builtin/mainmenu.lua:314 msgid "Delete World \"$1\"?" -msgstr "" +msgstr "Ștergi lumea \"$1\"?" #: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 msgid "Yes" -msgstr "" +msgstr "Da" #: builtin/mainmenu.lua:316 msgid "No" -msgstr "" +msgstr "Nu" #: builtin/mainmenu.lua:384 msgid "A world named \"$1\" already exists" -msgstr "" +msgstr "O lume cu numele \"$1\" deja există" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" -msgstr "" +msgstr "Jocul nu are nume, sau nu ai selectat un joc" #: builtin/mainmenu.lua:852 msgid "Singleplayer" -msgstr "" +msgstr "Singleplayer" #: builtin/mainmenu.lua:853 msgid "Client" -msgstr "" +msgstr "Client" #: builtin/mainmenu.lua:854 msgid "Server" -msgstr "" +msgstr "Server" #: builtin/mainmenu.lua:855 msgid "Settings" -msgstr "" +msgstr "Setări" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Pachete de tetură" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Moduri" #: builtin/mainmenu.lua:865 msgid "Credits" -msgstr "" +msgstr "Credits" #: builtin/mainmenu.lua:885 msgid "CLIENT" -msgstr "" +msgstr "CLIENT" #: builtin/mainmenu.lua:886 msgid "Favorites:" -msgstr "" +msgstr "Preferate:" #: builtin/mainmenu.lua:887 msgid "Address/Port" -msgstr "" +msgstr "Adresă/Port" #: builtin/mainmenu.lua:888 msgid "Name/Password" -msgstr "" +msgstr "Nume/Parolă" #: builtin/mainmenu.lua:891 msgid "Public Serverlist" -msgstr "" +msgstr "Listă de servere publică" #: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 #: builtin/modmgr.lua:271 src/keycode.cpp:229 msgid "Delete" -msgstr "" +msgstr "Șterge" #: builtin/mainmenu.lua:900 msgid "Connect" -msgstr "" +msgstr "Conectează" #: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 msgid "New" -msgstr "" +msgstr "Nou" #: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 msgid "Configure" -msgstr "" +msgstr "Configurează" #: builtin/mainmenu.lua:944 msgid "Start Game" -msgstr "" +msgstr "Începe jocul" #: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 msgid "Select World:" -msgstr "" +msgstr "Selectează lumea:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "DESCHIDE SERVERUL" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" -msgstr "" +msgstr "Modul Creativ" #: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 msgid "Enable Damage" -msgstr "" +msgstr "Activează Daune" #: builtin/mainmenu.lua:951 msgid "Public" -msgstr "" +msgstr "Public" #: builtin/mainmenu.lua:953 msgid "Name" -msgstr "" +msgstr "Nume" #: builtin/mainmenu.lua:955 msgid "Password" -msgstr "" +msgstr "Parolă" #: builtin/mainmenu.lua:956 msgid "Server Port" -msgstr "" +msgstr "Port server" #: builtin/mainmenu.lua:966 msgid "SETTINGS" -msgstr "" +msgstr "SETĂRI" #: builtin/mainmenu.lua:967 msgid "Fancy trees" -msgstr "" +msgstr "Copaci fantezici" #: builtin/mainmenu.lua:969 msgid "Smooth Lighting" -msgstr "" +msgstr "Lumină mai bună" #: builtin/mainmenu.lua:971 msgid "3D Clouds" -msgstr "" +msgstr "Nori 3D" #: builtin/mainmenu.lua:973 msgid "Opaque Water" -msgstr "" +msgstr "Apă opacă" #: builtin/mainmenu.lua:976 msgid "Mip-Mapping" -msgstr "" +msgstr "Mip Mapping" #: builtin/mainmenu.lua:978 msgid "Anisotropic Filtering" -msgstr "" +msgstr "Filtru Anizotropic" #: builtin/mainmenu.lua:980 msgid "Bi-Linear Filtering" -msgstr "" +msgstr "Filtrare Biliniară" #: builtin/mainmenu.lua:982 msgid "Tri-Linear Filtering" -msgstr "" +msgstr "Filtrare Triliniară" #: builtin/mainmenu.lua:985 msgid "Shaders" -msgstr "" +msgstr "Umbră" #: builtin/mainmenu.lua:987 msgid "Preload item visuals" -msgstr "" +msgstr "Pre-încarcă imaginile obiectelor" #: builtin/mainmenu.lua:989 msgid "Enable Particles" -msgstr "" +msgstr "Activează particulele" #: builtin/mainmenu.lua:991 msgid "Finite Liquid" -msgstr "" +msgstr "Lichid finit" #: builtin/mainmenu.lua:994 msgid "Change keys" -msgstr "" +msgstr "Modifică tastele" #: builtin/mainmenu.lua:1007 src/keycode.cpp:248 msgid "Play" -msgstr "" +msgstr "Joacă" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "SINGLE PLAYER" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Selectează pachetul de textură:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "PACHETE DE TEXTURĂ" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "" +msgstr "Nici o informație disponibilă" #: builtin/mainmenu.lua:1071 msgid "Core Developers" -msgstr "" +msgstr "Dezvoltatori de bază" #: builtin/mainmenu.lua:1082 msgid "Active Contributors" -msgstr "" +msgstr "Contribuitori activi" #: builtin/mainmenu.lua:1092 msgid "Previous Contributors" -msgstr "" +msgstr "Foști contribuitori" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MODURI" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Moduri Instalate:" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Instalează" #: builtin/modmgr.lua:244 msgid "Download" -msgstr "" +msgstr "Descarcă" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Redenumește" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 msgid "Depends:" -msgstr "" +msgstr "Dependințe:" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Redenumește Pachetul de mod:" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" -msgstr "" +msgstr "Acceptă" #: builtin/modmgr.lua:381 msgid "World:" -msgstr "" +msgstr "Lume:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 msgid "Hide Game" -msgstr "" +msgstr "Ascunde Joc" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" -msgstr "" +msgstr "Ascunde conținutul mp" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mod:" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" -msgstr "" +msgstr "Salvează" #: builtin/modmgr.lua:422 msgid "Enable MP" -msgstr "" +msgstr "Activează MP" #: builtin/modmgr.lua:424 msgid "Disable MP" -msgstr "" +msgstr "Dezactivează MP" #: builtin/modmgr.lua:428 builtin/modmgr.lua:430 msgid "enabled" -msgstr "" +msgstr "activat" #: builtin/modmgr.lua:436 msgid "Enable all" -msgstr "" +msgstr "Activează tot" #: builtin/modmgr.lua:551 msgid "Select Mod File:" -msgstr "" +msgstr "Selectează Fișierul Modului:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Instalare Mod: fișier: \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Instalare Mod: tip de fișier neacceptat \"$1\"" #: builtin/modmgr.lua:612 msgid "Failed to install $1 to $2" -msgstr "" +msgstr "Eșuare la instalarea $1 în $2" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" +"Instalare Mod: nu se poate găsi nume de folder potrivit pentru pachetul de " +"mod $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "Instalare mod: nu se poate găsi numele real pentru: $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr: Eroare la ștergerea \"$1\"" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr: Pacht de mod invalid \"$1\"" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "Ești sigur că vrei să ștergi \"$1\"?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "Nu, sigur că nu!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Pagina $1 din $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Notă" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "Reinstalează" #: src/client.cpp:2915 msgid "Item textures..." -msgstr "" +msgstr "Texturi..." #: src/game.cpp:939 msgid "Loading..." -msgstr "" +msgstr "Se încarcă..." #: src/game.cpp:999 msgid "Creating server...." -msgstr "" +msgstr "Se crează serverul..." #: src/game.cpp:1015 msgid "Creating client..." -msgstr "" +msgstr "Se creează clientul..." #: src/game.cpp:1024 msgid "Resolving address..." -msgstr "" +msgstr "Se rezolvă adresa..." #: src/game.cpp:1121 msgid "Connecting to server..." -msgstr "" +msgstr "Se conectează la server..." #: src/game.cpp:1218 msgid "Item definitions..." -msgstr "" +msgstr "Definițiile obiectelor..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Definițiile Blocurilor..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Media..." #: src/game.cpp:3405 msgid "Shutting down stuff..." -msgstr "" +msgstr "Se închide..." #: src/game.cpp:3435 msgid "" "\n" "Check debug.txt for details." msgstr "" +"\n" +"Verifică deug.txt pentru detalii." #: src/guiDeathScreen.cpp:96 msgid "You died." -msgstr "" +msgstr "Ai murit." #: src/guiDeathScreen.cpp:104 msgid "Respawn" -msgstr "" +msgstr "Reînviere" #: src/guiFormSpecMenu.cpp:1569 msgid "Left click: Move all items, Right click: Move single item" msgstr "" +"Click stânga: Mută toate obiectele, Click dreapta: Mută un singur obiect" #: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 #: src/guiTextInputMenu.cpp:140 msgid "Proceed" -msgstr "" +msgstr "Continuă" #: src/guiKeyChangeMenu.cpp:121 msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" msgstr "" +"Keybindings. (Dacă acest meniu apare, șterge lucrurile din minetest.conf)" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" -msgstr "" +msgstr "\"Aleargă\" = coboară" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" -msgstr "" +msgstr "Apasă de 2 ori \"sari\" pentru a zbura" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" -msgstr "" +msgstr "Tastă deja folosită" #: src/guiKeyChangeMenu.cpp:372 msgid "press key" -msgstr "" +msgstr "apasă o tastă" #: src/guiKeyChangeMenu.cpp:400 msgid "Forward" -msgstr "" +msgstr "Înainte" #: src/guiKeyChangeMenu.cpp:401 msgid "Backward" -msgstr "" +msgstr "Înapoi" #: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 msgid "Left" -msgstr "" +msgstr "Stânga" #: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 msgid "Right" -msgstr "" +msgstr "Dreapta" #: src/guiKeyChangeMenu.cpp:404 msgid "Use" -msgstr "" +msgstr "Aleargă" #: src/guiKeyChangeMenu.cpp:405 msgid "Jump" -msgstr "" +msgstr "Sari" #: src/guiKeyChangeMenu.cpp:406 msgid "Sneak" -msgstr "" +msgstr "Furișează" #: src/guiKeyChangeMenu.cpp:407 msgid "Drop" -msgstr "" +msgstr "Aruncă" #: src/guiKeyChangeMenu.cpp:408 msgid "Inventory" -msgstr "" +msgstr "Inventar" #: src/guiKeyChangeMenu.cpp:409 msgid "Chat" -msgstr "" +msgstr "Chat" #: src/guiKeyChangeMenu.cpp:410 msgid "Command" -msgstr "" +msgstr "Comandă" #: src/guiKeyChangeMenu.cpp:411 msgid "Console" -msgstr "" +msgstr "Consloă" #: src/guiKeyChangeMenu.cpp:412 msgid "Toggle fly" -msgstr "" +msgstr "Intră pe zbor" #: src/guiKeyChangeMenu.cpp:413 msgid "Toggle fast" -msgstr "" +msgstr "Intră pe rapid" #: src/guiKeyChangeMenu.cpp:414 msgid "Toggle noclip" -msgstr "" +msgstr "Intră pe noclip" #: src/guiKeyChangeMenu.cpp:415 msgid "Range select" -msgstr "" +msgstr "Selectare distanță" #: src/guiKeyChangeMenu.cpp:416 msgid "Print stacks" -msgstr "" +msgstr "Salvează logurile" #: src/guiPasswordChange.cpp:107 msgid "Old Password" -msgstr "" +msgstr "Vechea parolă" #: src/guiPasswordChange.cpp:125 msgid "New Password" -msgstr "" +msgstr "Noua parolă" #: src/guiPasswordChange.cpp:142 msgid "Confirm Password" -msgstr "" +msgstr "Confirmarea parolei" #: src/guiPasswordChange.cpp:160 msgid "Change" -msgstr "" +msgstr "Schimbă" #: src/guiPasswordChange.cpp:169 msgid "Passwords do not match!" -msgstr "" +msgstr "Parolele nu se potrivesc!" #: src/guiPauseMenu.cpp:122 msgid "Continue" -msgstr "" +msgstr "Continuă" #: src/guiPauseMenu.cpp:133 msgid "Change Password" -msgstr "" +msgstr "Schimbă Parola" #: src/guiPauseMenu.cpp:143 msgid "Sound Volume" -msgstr "" +msgstr "Volum Sunet" #: src/guiPauseMenu.cpp:152 msgid "Exit to Menu" -msgstr "" +msgstr "Ieși în Meniu" #: src/guiPauseMenu.cpp:161 msgid "Exit to OS" -msgstr "" +msgstr "Ieși din joc" #: src/guiPauseMenu.cpp:170 msgid "" @@ -618,323 +628,334 @@ msgid "" "- Mouse wheel: select item\n" "- T: chat\n" msgstr "" +"Controale prestabilite:\n" +"- WASD: mișcare\n" +"- Spațiu: sărire/urcare\n" +"- Shift: furișare/coborâre\n" +"- Q: aruncă obiect\n" +"- I: inventar\n" +"- Mouse: întoarcere/vedere\n" +"- Click stânga: săpare/lovire\n" +"- Click dreapta: pune/folosește\n" +"- Rotiță mouse: selectează obiect\n" +"- T: chat\n" #: src/guiVolumeChange.cpp:108 msgid "Sound Volume: " -msgstr "" +msgstr "Volum sunet: " #: src/guiVolumeChange.cpp:122 msgid "Exit" -msgstr "" +msgstr "Ieșire" #: src/keycode.cpp:223 msgid "Left Button" -msgstr "" +msgstr "Stânga" #: src/keycode.cpp:223 msgid "Middle Button" -msgstr "" +msgstr "Rotiță" #: src/keycode.cpp:223 msgid "Right Button" -msgstr "" +msgstr "Drepata" #: src/keycode.cpp:223 msgid "X Button 1" -msgstr "" +msgstr "X Butonul 1" #: src/keycode.cpp:224 msgid "Back" -msgstr "" +msgstr "Înapoi" #: src/keycode.cpp:224 msgid "Clear" -msgstr "" +msgstr "Șterge" #: src/keycode.cpp:224 msgid "Return" -msgstr "" +msgstr "Înapoi" #: src/keycode.cpp:224 msgid "Tab" -msgstr "" +msgstr "Tab" #: src/keycode.cpp:224 msgid "X Button 2" -msgstr "" +msgstr "X Butonul 2" #: src/keycode.cpp:225 msgid "Capital" -msgstr "" +msgstr "Capital" #: src/keycode.cpp:225 msgid "Control" -msgstr "" +msgstr "Control" #: src/keycode.cpp:225 msgid "Kana" -msgstr "" +msgstr "Kana" #: src/keycode.cpp:225 msgid "Menu" -msgstr "" +msgstr "Meniu" #: src/keycode.cpp:225 msgid "Pause" -msgstr "" +msgstr "Pauză" #: src/keycode.cpp:225 msgid "Shift" -msgstr "" +msgstr "Shift" #: src/keycode.cpp:226 msgid "Convert" -msgstr "" +msgstr "Convert" #: src/keycode.cpp:226 msgid "Escape" -msgstr "" +msgstr "Escape" #: src/keycode.cpp:226 msgid "Final" -msgstr "" +msgstr "Final" #: src/keycode.cpp:226 msgid "Junja" -msgstr "" +msgstr "Junja" #: src/keycode.cpp:226 msgid "Kanji" -msgstr "" +msgstr "Kanji" #: src/keycode.cpp:226 msgid "Nonconvert" -msgstr "" +msgstr "Nonconvert" #: src/keycode.cpp:227 msgid "End" -msgstr "" +msgstr "End" #: src/keycode.cpp:227 msgid "Home" -msgstr "" +msgstr "Home" #: src/keycode.cpp:227 msgid "Mode Change" -msgstr "" +msgstr "Schimbă modul" #: src/keycode.cpp:227 msgid "Next" -msgstr "" +msgstr "Următorul" #: src/keycode.cpp:227 msgid "Prior" -msgstr "" +msgstr "Anteriorul" #: src/keycode.cpp:227 msgid "Space" -msgstr "" +msgstr "Spațiu" #: src/keycode.cpp:228 msgid "Down" -msgstr "" +msgstr "Jos" #: src/keycode.cpp:228 msgid "Execute" -msgstr "" +msgstr "Execută" #: src/keycode.cpp:228 msgid "Print" -msgstr "" +msgstr "Print" #: src/keycode.cpp:228 msgid "Select" -msgstr "" +msgstr "Selectează" #: src/keycode.cpp:228 msgid "Up" -msgstr "" +msgstr "Sus" #: src/keycode.cpp:229 msgid "Help" -msgstr "" +msgstr "Ajutor" #: src/keycode.cpp:229 msgid "Insert" -msgstr "" +msgstr "Insert" #: src/keycode.cpp:229 msgid "Snapshot" -msgstr "" +msgstr "PrintScreen" #: src/keycode.cpp:232 msgid "Left Windows" -msgstr "" +msgstr "Windows Stânga" #: src/keycode.cpp:233 msgid "Apps" -msgstr "" +msgstr "Aplicații" #: src/keycode.cpp:233 msgid "Numpad 0" -msgstr "" +msgstr "Numpad 0" #: src/keycode.cpp:233 msgid "Numpad 1" -msgstr "" +msgstr "Numpad 1" #: src/keycode.cpp:233 msgid "Right Windows" -msgstr "" +msgstr "Windows Dreapta" #: src/keycode.cpp:233 msgid "Sleep" -msgstr "" +msgstr "Sleep" #: src/keycode.cpp:234 msgid "Numpad 2" -msgstr "" +msgstr "Numpad 2" #: src/keycode.cpp:234 msgid "Numpad 3" -msgstr "" +msgstr "Numpad 3" #: src/keycode.cpp:234 msgid "Numpad 4" -msgstr "" +msgstr "Numpad 4" #: src/keycode.cpp:234 msgid "Numpad 5" -msgstr "" +msgstr "Numpad 5" #: src/keycode.cpp:234 msgid "Numpad 6" -msgstr "" +msgstr "Numpad 6" #: src/keycode.cpp:234 msgid "Numpad 7" -msgstr "" +msgstr "Numpad 7" #: src/keycode.cpp:235 msgid "Numpad *" -msgstr "" +msgstr "Numpad *" #: src/keycode.cpp:235 msgid "Numpad +" -msgstr "" +msgstr "Numpad +" #: src/keycode.cpp:235 msgid "Numpad -" -msgstr "" +msgstr "Numpad -" #: src/keycode.cpp:235 msgid "Numpad /" -msgstr "" +msgstr "Numpad /" #: src/keycode.cpp:235 msgid "Numpad 8" -msgstr "" +msgstr "Numpad 8" #: src/keycode.cpp:235 msgid "Numpad 9" -msgstr "" +msgstr "Numpad 9" #: src/keycode.cpp:239 msgid "Num Lock" -msgstr "" +msgstr "Num Lock" #: src/keycode.cpp:239 msgid "Scroll Lock" -msgstr "" +msgstr "Scroll Lock" #: src/keycode.cpp:240 msgid "Left Shift" -msgstr "" +msgstr "Shift Stânga" #: src/keycode.cpp:240 msgid "Right Shift" -msgstr "" +msgstr "Shift Dreapta" #: src/keycode.cpp:241 msgid "Left Control" -msgstr "" +msgstr "Ctrl Stânga" #: src/keycode.cpp:241 msgid "Left Menu" -msgstr "" +msgstr "Meniu Stânga" #: src/keycode.cpp:241 msgid "Right Control" -msgstr "" +msgstr "Ctrl Dreapta" #: src/keycode.cpp:241 msgid "Right Menu" -msgstr "" +msgstr "Meniu Drepata" #: src/keycode.cpp:243 msgid "Comma" -msgstr "" +msgstr "Virgulă" #: src/keycode.cpp:243 msgid "Minus" -msgstr "" +msgstr "Minus" #: src/keycode.cpp:243 msgid "Period" -msgstr "" +msgstr "Punct" #: src/keycode.cpp:243 msgid "Plus" -msgstr "" +msgstr "Plus" #: src/keycode.cpp:247 msgid "Attn" -msgstr "" +msgstr "Attn" #: src/keycode.cpp:247 msgid "CrSel" -msgstr "" +msgstr "CrSel" #: src/keycode.cpp:248 msgid "Erase OEF" -msgstr "" +msgstr "Ștergere OEF" #: src/keycode.cpp:248 msgid "ExSel" -msgstr "" +msgstr "ExSel" #: src/keycode.cpp:248 msgid "OEM Clear" -msgstr "" +msgstr "Curățare OEM" #: src/keycode.cpp:248 msgid "PA1" -msgstr "" +msgstr "PA1" #: src/keycode.cpp:248 msgid "Zoom" -msgstr "" +msgstr "Mărire" #: src/main.cpp:1411 msgid "needs_fallback_font" -msgstr "" +msgstr "lipsă_tip_font" #: src/main.cpp:1486 msgid "Main Menu" -msgstr "" +msgstr "Meniul Principal" #: src/main.cpp:1662 msgid "No world selected and no address provided. Nothing to do." -msgstr "" +msgstr "Nici un cuvânt selectat și nici o adresă scrisă. Nimic de făcut." #: src/main.cpp:1670 msgid "Could not find or load game \"" -msgstr "" +msgstr "Nu se poate găsi sau încărca jocul \"" #: src/main.cpp:1684 msgid "Invalid gamespec." -msgstr "" +msgstr "Specificare invalidă" #: src/main.cpp:1729 msgid "Connection error (timed out?)" -msgstr "" +msgstr "Eroare de conexiune (timeout?)" From 28c21ed566fbc3564f186ef37c5a220cd8b487ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=C4=9Bk?= Date: Wed, 30 Oct 2013 15:04:25 +0100 Subject: [PATCH 115/198] Translated using Weblate (Czech) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Myslím, že se jedná o IME Convert klávesu: http://msdn.microsoft.com/en-us/library/system.windows.input.key.aspx --- po/cs/minetest.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index fa83c86f5..9bae192df 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-30 15:03+0200\n" +"PO-Revision-Date: 2013-10-30 15:04+0200\n" "Last-Translator: Jakub Vaněk \n" "Language-Team: LANGUAGE \n" "Language: cs\n" @@ -708,7 +708,7 @@ msgstr "Shift" #: src/keycode.cpp:226 msgid "Convert" -msgstr "Převést" +msgstr "Převádět" #: src/keycode.cpp:226 msgid "Escape" From 78f1fcf4506c7a27a1be135ca054085372cf7d6d Mon Sep 17 00:00:00 2001 From: Maciej Kasatkin Date: Tue, 8 Oct 2013 21:22:42 +0200 Subject: [PATCH 116/198] Translated using Weblate (Polish) --- po/pl/minetest.po | 172 +++++++++++++++++++++++----------------------- 1 file changed, 85 insertions(+), 87 deletions(-) diff --git a/po/pl/minetest.po b/po/pl/minetest.po index d10280e84..95df51aef 100644 --- a/po/pl/minetest.po +++ b/po/pl/minetest.po @@ -8,21 +8,20 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-04-21 23:38+0200\n" -"Last-Translator: Daniel \"Tracerneo\" Ziółkowski \n" +"PO-Revision-Date: 2013-10-08 21:22+0200\n" +"Last-Translator: Maciej Kasatkin \n" "Language-Team: Polish <>\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" -"X-Generator: Weblate 1.4-dev\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 -#, fuzzy msgid "Game Name" -msgstr "Gra" +msgstr "Nazwa Gry" #: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 msgid "Create" @@ -35,44 +34,43 @@ msgstr "Anuluj" #: builtin/gamemgr.lua:118 msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" -msgstr "" +msgstr "Gamemgr: Kopiowanie moda \"$1\" do gry \"$2\" nie powiodło się" #: builtin/gamemgr.lua:216 msgid "GAMES" -msgstr "" +msgstr "GRY" #: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 -#, fuzzy msgid "Games" -msgstr "Gra" +msgstr "Gry" #: builtin/gamemgr.lua:233 msgid "Mods:" -msgstr "" +msgstr "Mody:" #: builtin/gamemgr.lua:234 msgid "edit game" -msgstr "" +msgstr "edytuj grę" #: builtin/gamemgr.lua:237 msgid "new game" -msgstr "" +msgstr "nowa gra" #: builtin/gamemgr.lua:247 msgid "EDIT GAME" -msgstr "" +msgstr "EDYTUJ GRĘ" #: builtin/gamemgr.lua:267 msgid "Remove selected mod" -msgstr "" +msgstr "Usuń zaznaczony mod" #: builtin/gamemgr.lua:270 msgid "<<-- Add mod" -msgstr "" +msgstr "<<--Dodaj mod" #: builtin/mainmenu.lua:159 msgid "Ok" -msgstr "" +msgstr "OK" #: builtin/mainmenu.lua:297 msgid "World name" @@ -80,16 +78,15 @@ msgstr "Nazwa świata" #: builtin/mainmenu.lua:298 msgid "Mapgen" -msgstr "" +msgstr "Generator mapy" #: builtin/mainmenu.lua:300 msgid "Game" msgstr "Gra" #: builtin/mainmenu.lua:314 -#, fuzzy msgid "Delete World \"$1\"?" -msgstr "Usuń świat" +msgstr "Usunąć świat \"$1\"?" #: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 msgid "Yes" @@ -100,13 +97,12 @@ msgid "No" msgstr "Nie" #: builtin/mainmenu.lua:384 -#, fuzzy msgid "A world named \"$1\" already exists" -msgstr "Nie można stworzyć świata: Istnieje już świat o takiej nazwie" +msgstr "Istnieje już świat o nazwie \"$1\"" #: builtin/mainmenu.lua:399 msgid "No worldname given or no game selected" -msgstr "" +msgstr "Nie podano nazwy świata lub nie wybrano gry" #: builtin/mainmenu.lua:852 msgid "Singleplayer" @@ -114,11 +110,11 @@ msgstr "Pojedynczy gracz" #: builtin/mainmenu.lua:853 msgid "Client" -msgstr "" +msgstr "Klient" #: builtin/mainmenu.lua:854 msgid "Server" -msgstr "" +msgstr "Serwer" #: builtin/mainmenu.lua:855 msgid "Settings" @@ -126,11 +122,11 @@ msgstr "Ustawienia" #: builtin/mainmenu.lua:856 msgid "Texture Packs" -msgstr "" +msgstr "Paczki tekstur" #: builtin/mainmenu.lua:863 msgid "Mods" -msgstr "" +msgstr "Mody" #: builtin/mainmenu.lua:865 msgid "Credits" @@ -138,7 +134,7 @@ msgstr "Autorzy" #: builtin/mainmenu.lua:885 msgid "CLIENT" -msgstr "" +msgstr "KLIENT" #: builtin/mainmenu.lua:886 msgid "Favorites:" @@ -153,9 +149,8 @@ msgid "Name/Password" msgstr "Nazwa gracza/Hasło" #: builtin/mainmenu.lua:891 -#, fuzzy msgid "Public Serverlist" -msgstr "Lista publicznych serwerów:" +msgstr "Lista publicznych serwerów" #: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 #: builtin/modmgr.lua:271 src/keycode.cpp:229 @@ -175,7 +170,6 @@ msgid "Configure" msgstr "Ustaw" #: builtin/mainmenu.lua:944 -#, fuzzy msgid "Start Game" msgstr "Rozpocznij grę/Połącz" @@ -185,7 +179,7 @@ msgstr "Wybierz świat:" #: builtin/mainmenu.lua:946 msgid "START SERVER" -msgstr "" +msgstr "URUCHOM SERWER" #: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 msgid "Creative Mode" @@ -201,20 +195,19 @@ msgstr "Publiczne" #: builtin/mainmenu.lua:953 msgid "Name" -msgstr "" +msgstr "Nazwa" #: builtin/mainmenu.lua:955 -#, fuzzy msgid "Password" -msgstr "Stare hasło" +msgstr "Hasło" #: builtin/mainmenu.lua:956 msgid "Server Port" -msgstr "" +msgstr "Port Serwera" #: builtin/mainmenu.lua:966 msgid "SETTINGS" -msgstr "" +msgstr "USTAWIENIA" #: builtin/mainmenu.lua:967 msgid "Fancy trees" @@ -229,7 +222,6 @@ msgid "3D Clouds" msgstr "Chmury 3D" #: builtin/mainmenu.lua:973 -#, fuzzy msgid "Opaque Water" msgstr "Nieprzeźroczysta woda" @@ -243,11 +235,11 @@ msgstr "Filtrowanie anizotropowe" #: builtin/mainmenu.lua:980 msgid "Bi-Linear Filtering" -msgstr "Dwuliniowe filtrowanie" +msgstr "Filtrowanie dwuliniowe" #: builtin/mainmenu.lua:982 msgid "Tri-Linear Filtering" -msgstr "Trójliniowe filtrowanie" +msgstr "Filtrowanie trójliniowe" #: builtin/mainmenu.lua:985 msgid "Shaders" @@ -262,7 +254,6 @@ msgid "Enable Particles" msgstr "Włącz cząstki" #: builtin/mainmenu.lua:991 -#, fuzzy msgid "Finite Liquid" msgstr "Realistyczne ciecze" @@ -276,75 +267,71 @@ msgstr "Graj" #: builtin/mainmenu.lua:1009 msgid "SINGLE PLAYER" -msgstr "" +msgstr "TRYB JEDNOOSOBOWY" #: builtin/mainmenu.lua:1022 msgid "Select texture pack:" -msgstr "" +msgstr "Wybierz paczkę tekstur:" #: builtin/mainmenu.lua:1023 msgid "TEXTURE PACKS" -msgstr "" +msgstr "PACZKI TEKSTUR" #: builtin/mainmenu.lua:1043 msgid "No information available" -msgstr "" +msgstr "Brak informacjii" #: builtin/mainmenu.lua:1071 msgid "Core Developers" -msgstr "" +msgstr "Twórcy" #: builtin/mainmenu.lua:1082 msgid "Active Contributors" -msgstr "" +msgstr "Aktywni współautorzy" #: builtin/mainmenu.lua:1092 msgid "Previous Contributors" -msgstr "" +msgstr "Byli współautorzy" #: builtin/modmgr.lua:236 msgid "MODS" -msgstr "" +msgstr "MODY" #: builtin/modmgr.lua:237 msgid "Installed Mods:" -msgstr "" +msgstr "Zainstalowane Mody:" #: builtin/modmgr.lua:243 builtin/modstore.lua:253 msgid "Install" -msgstr "" +msgstr "Instaluj" #: builtin/modmgr.lua:244 -#, fuzzy msgid "Download" -msgstr "Dół" +msgstr "Ściągnij" #: builtin/modmgr.lua:256 msgid "Rename" -msgstr "" +msgstr "Zmień nazwę" #: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy msgid "Depends:" -msgstr "zależne od:" +msgstr "Zależy od:" #: builtin/modmgr.lua:282 msgid "Rename Modpack:" -msgstr "" +msgstr "Zmień nazwe Paczki Modów:" #: builtin/modmgr.lua:287 src/keycode.cpp:227 msgid "Accept" msgstr "Accept" #: builtin/modmgr.lua:381 -#, fuzzy msgid "World:" -msgstr "Wybierz świat:" +msgstr "Świat:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 -#, fuzzy msgid "Hide Game" -msgstr "Gra" +msgstr "Ukryj Grę" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" @@ -352,7 +339,7 @@ msgstr "" #: builtin/modmgr.lua:400 msgid "Mod:" -msgstr "" +msgstr "Mod:" #: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 msgid "Save" @@ -373,105 +360,105 @@ msgid "enabled" msgstr "włączone" #: builtin/modmgr.lua:436 -#, fuzzy msgid "Enable all" msgstr "Włącz wszystkie" #: builtin/modmgr.lua:551 -#, fuzzy msgid "Select Mod File:" -msgstr "Wybierz świat:" +msgstr "Wybierz plik moda:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" -msgstr "" +msgstr "Zainstaluj mod: plik: \"$1\"" #: builtin/modmgr.lua:591 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" +"\n" +"Instalacja moda: nieznany typ pliku \"$1\"" #: builtin/modmgr.lua:612 -#, fuzzy msgid "Failed to install $1 to $2" -msgstr "Inicjalizacja świata nie powiodła się" +msgstr "Instalacja $1 do $2 nie powiodła się" #: builtin/modmgr.lua:615 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" +"Instalacja moda: nie można znaleźć odpowiedniego folderu dla paczki modów $1" #: builtin/modmgr.lua:635 msgid "Install Mod: unable to find real modname for: $1" -msgstr "" +msgstr "Instalacja moda: nie można znaleźć nazwy moda $1" #: builtin/modmgr.lua:824 msgid "Modmgr: failed to delete \"$1\"" -msgstr "" +msgstr "Modmgr: nie można usunąć \"$1\"" #: builtin/modmgr.lua:828 msgid "Modmgr: invalid modpath \"$1\"" -msgstr "" +msgstr "Modmgr: nieprawidłowy katalog \"$1\"" #: builtin/modmgr.lua:845 msgid "Are you sure you want to delete \"$1\"?" -msgstr "" +msgstr "Na pewno usunąć \"$1\"?" #: builtin/modmgr.lua:847 msgid "No of course not!" -msgstr "" +msgstr "Oczywiście, że nie!" #: builtin/modstore.lua:183 msgid "Page $1 of $2" -msgstr "" +msgstr "Strona $1 z $2" #: builtin/modstore.lua:243 msgid "Rating" -msgstr "" +msgstr "Ocena" #: builtin/modstore.lua:251 msgid "re-Install" -msgstr "" +msgstr "Ponowna instalacja" #: src/client.cpp:2915 msgid "Item textures..." -msgstr "" +msgstr "Tekstury przedmiotów..." #: src/game.cpp:939 msgid "Loading..." -msgstr "" +msgstr "Ładowanie..." #: src/game.cpp:999 msgid "Creating server...." -msgstr "" +msgstr "Tworzenie serwera...." #: src/game.cpp:1015 msgid "Creating client..." -msgstr "" +msgstr "Tworzenie klienta..." #: src/game.cpp:1024 msgid "Resolving address..." -msgstr "" +msgstr "Sprawdzanie adresu..." #: src/game.cpp:1121 msgid "Connecting to server..." -msgstr "" +msgstr "Łączenie z serwerem..." #: src/game.cpp:1218 msgid "Item definitions..." -msgstr "" +msgstr "Definicje przedmiotów..." #: src/game.cpp:1225 msgid "Node definitions..." -msgstr "" +msgstr "Definicje nod..." #: src/game.cpp:1232 msgid "Media..." -msgstr "" +msgstr "Media..." #: src/game.cpp:3405 msgid "Shutting down stuff..." -msgstr "" +msgstr "Wyłączanie..." #: src/game.cpp:3435 msgid "" @@ -644,6 +631,17 @@ msgid "" "- Mouse wheel: select item\n" "- T: chat\n" msgstr "" +"Domyślne sterowanie:↵\n" +"- WASD: ruch↵\n" +"- Spacja: skok/wspinanie się↵\n" +"- Shift: skradanie się/schodzenie w dół↵\n" +"- Q: upuszczenie przedmiotu↵\n" +"- I: ekwipunek↵\n" +"- Mysz: obracanie się/patrzenie↵\n" +"- Lewy przycisk myszy: kopanie/uderzanie↵\n" +"- Prawy przycisk myszy: postawienie/użycie przedmiotu↵\n" +"- Rolka myszy: wybór przedmiotu↵\n" +"- T: chat\n" #: src/guiVolumeChange.cpp:108 msgid "Sound Volume: " From d661cb320d092fbd856cb716fc4b48bf77de790c Mon Sep 17 00:00:00 2001 From: Anton Tsyganenko Date: Fri, 22 Nov 2013 11:45:37 +0100 Subject: [PATCH 117/198] Translated using Weblate (Russian) --- po/ru/minetest.po | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/po/ru/minetest.po b/po/ru/minetest.po index e31bd6538..cb6c8d7a2 100644 --- a/po/ru/minetest.po +++ b/po/ru/minetest.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-08-30 23:15+0200\n" -"Last-Translator: Ilya Zhuravlev \n" +"PO-Revision-Date: 2013-11-22 11:45+0200\n" +"Last-Translator: Anton Tsyganenko \n" "Language-Team: Russian\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 @@ -330,9 +330,8 @@ msgid "World:" msgstr "Мир:" #: builtin/modmgr.lua:385 builtin/modmgr.lua:387 -#, fuzzy msgid "Hide Game" -msgstr "Игра" +msgstr "Скрыть игру" #: builtin/modmgr.lua:391 builtin/modmgr.lua:393 msgid "Hide mp content" From c439bdd4e52fc8b3713650307d0907744a8905d1 Mon Sep 17 00:00:00 2001 From: Pablo Lezaeta Date: Sat, 19 Oct 2013 08:15:53 +0200 Subject: [PATCH 118/198] Translated using Weblate (Spanish) --- po/es/minetest.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/es/minetest.po b/po/es/minetest.po index 974a3e290..1b20be2f9 100644 --- a/po/es/minetest.po +++ b/po/es/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-09-07 22:01+0400\n" -"PO-Revision-Date: 2013-10-19 08:14+0200\n" +"PO-Revision-Date: 2013-10-19 08:15+0200\n" "Last-Translator: Pablo Lezaeta \n" "Language-Team: LANGUAGE \n" "Language: es\n" @@ -362,7 +362,7 @@ msgstr "Activar todos" #: builtin/modmgr.lua:551 msgid "Select Mod File:" -msgstr "Selecciona fichero de mod:" +msgstr "Selecciona fichero mod:" #: builtin/modmgr.lua:590 msgid "Install Mod: file: \"$1\"" @@ -496,7 +496,7 @@ msgstr "\"Usar\" = Descender" #: src/guiKeyChangeMenu.cpp:176 msgid "Double tap \"jump\" to toggle fly" -msgstr "Dos veces \"saltar\" para volar" +msgstr "Pulsa dos veces \"saltar\" para volar" #: src/guiKeyChangeMenu.cpp:290 msgid "Key already in use" From fb150e05043022ff2bb96ea892a31c632f130aca Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 23 Nov 2013 17:38:01 +0100 Subject: [PATCH 119/198] Run updatepo.sh --- po/cs/minetest.po | 373 +++++++++++++++++--------------- po/da/minetest.po | 484 ++++++++++++++++++++++-------------------- po/de/minetest.po | 493 ++++++++++++++++++++++-------------------- po/es/minetest.po | 490 ++++++++++++++++++++++-------------------- po/et/minetest.po | 483 ++++++++++++++++++++++-------------------- po/fr/minetest.po | 489 ++++++++++++++++++++++-------------------- po/hu/minetest.po | 452 +++++++++++++++++++++------------------ po/it/minetest.po | 487 ++++++++++++++++++++++-------------------- po/ja/minetest.po | 471 ++++++++++++++++++++++------------------- po/ko/minetest.po | 352 ++++++++++++++++-------------- po/ky/minetest.po | 456 +++++++++++++++++++++------------------ po/minetest.pot | 352 ++++++++++++++++-------------- po/nb/minetest.po | 378 ++++++++++++++++++--------------- po/nl/minetest.po | 489 ++++++++++++++++++++++-------------------- po/pl/minetest.po | 489 ++++++++++++++++++++++-------------------- po/pt/minetest.po | 487 ++++++++++++++++++++++-------------------- po/pt_BR/minetest.po | 494 +++++++++++++++++++++++-------------------- po/ro/minetest.po | 373 +++++++++++++++++--------------- po/ru/minetest.po | 493 ++++++++++++++++++++++-------------------- po/uk/minetest.po | 456 +++++++++++++++++++++------------------ po/zh_CN/minetest.po | 487 ++++++++++++++++++++++-------------------- 21 files changed, 5140 insertions(+), 4388 deletions(-) diff --git a/po/cs/minetest.po b/po/cs/minetest.po index 9bae192df..6cd400aa7 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-10-30 15:04+0200\n" "Last-Translator: Jakub Vaněk \n" "Language-Team: LANGUAGE \n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Název hry" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Vytvořit" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Zrušit" @@ -39,35 +39,35 @@ msgstr "Gamemgr: Nepovedlo se zkopírovat mod \"$1\" do hry\"$2\"" msgid "GAMES" msgstr "HRY" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Hry" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Mody:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "upravit hru" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "nová hra" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "UPRAVIT HRU" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Odstranit vybraný mod" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Přidat mod" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -75,223 +75,231 @@ msgstr "Ok" msgid "World name" msgstr "Název světa" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Generátor světa" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Hra" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Doopravdy chcete smazat svět \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Ano" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Ne" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Svět s názvem \"$1\" už existuje" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Nebyla vybrána žádná hra" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Hra jednoho hráče" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Hra více hráčů" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Místní server" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Nastavení" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Balíčky textur" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Mody" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Autoři" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENT" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Oblíbené:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Adresa/port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Jméno/Heslo" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Veřejný seznam serverů" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Vymazat" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Připojit" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nový" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Nastavit" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Začít hru" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Vyber svět:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "MÍSTNÍ SERVER" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Kreativní mód" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Povolit poškození" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Veřejný" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Jméno" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Heslo" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Port serveru" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "NASTAVENÍ" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Pěkné stromy" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Hladké osvětlení" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D Mraky" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Neprůhledná voda" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-Mapování" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Anizotropní filtrování" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Bilineární filtrování" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Trilineární filtrování" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shadery" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Přednačtené textury itemů" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Povolit Částice" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Konečná voda" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Změnit nastavení klávesy" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Hrát" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "HRA JEDNOHO HRÁČE" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Vyberte balíček textur:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "BALÍČKY TEXTUR" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Žádné informace dostupné" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Vývojáři jádra" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Aktivní přispěvatelé" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Bývalí přispěvatelé" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Hra jednoho hráče" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Hra více hráčů" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Místní server" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Nastavení" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Balíčky textur" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Mody" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Autoři" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODY" @@ -300,75 +308,100 @@ msgstr "MODY" msgid "Installed Mods:" msgstr "Instalované Mody:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Instalovat" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Přidat mod" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Stáhnout" +#, fuzzy +msgid "Local install" +msgstr "Instalovat" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Žádné informace dostupné" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Žádné informace dostupné" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Přejmenovat" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Závislosti:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Odstranit vybraný mod" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Přejmenovat Modpack:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Přijmout" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Svět:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Skrýt Hru" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Skrýt obsah mp" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mody:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Závislosti:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Uložit" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "Povolit Hru více hráčů" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "Zakázat Hru více hráčů" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "povoleno" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Povolit vše" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Vybrat Soubor s Modem:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Instalace Modu: ze souboru: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -376,31 +409,31 @@ msgstr "" "\n" "Instalace Modu: nepodporovaný typ souboru \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Selhala instalace $1 do $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "Install Mod: nenalezen adresář s příslušným názvem pro balíček modu $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Install Mod: Nenašel jsem skutečné jméno modu: $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: Nepodařilo se odstranit \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: Neplatná cesta k modu \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Skutečně chcete odstranit \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Jistě, že ne!" @@ -416,47 +449,51 @@ msgstr "Hodnocení" msgid "re-Install" msgstr "přeinstalovat" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Instalovat" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Textury předmětů..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Nahrávám..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Vytvářím server..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Vytvářím klienta..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Překládám adresu..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Připojuji se k serveru..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Definice předmětů..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Definice uzlů..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Média..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Vypínám to..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -472,13 +509,8 @@ msgstr "Zemřel jsi." msgid "Respawn" msgstr "Oživení" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Levý klik: Přesunout všechny předměty, Pravý klik: Přesunout jeden předmět" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Pokračovat" @@ -496,99 +528,99 @@ msgstr "\"Použít\" = slézt dolů" msgid "Double tap \"jump\" to toggle fly" msgstr "Dvakrát zmáčkněte \"skok\" pro zapnutí létání" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Klávesa je již používána" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "stiskni klávesu" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Vpřed" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Vzad" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Vlevo" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Vpravo" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Použít" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Skočit" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Plížení" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Zahodit" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventář" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Chat" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Příkaz" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Konzole" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Přepnout létání" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Přepnout rychlý pohyb" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Zapnout noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Vybrat rozmezí" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Vytisknout zásobníky" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Staré heslo" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nové heslo" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Potvrdit heslo" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Změnit" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Hesla si neodpovídají!" @@ -638,11 +670,11 @@ msgstr "" "- Myš(kolečko): vybrat předmět\n" "- T: chat\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Hlasitost: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Odejít" @@ -934,27 +966,34 @@ msgstr "PA1" msgid "Zoom" msgstr "Přiblížení" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "vyžaduje_fallback_font" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Hlavní nabídka" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" "Nebyl vybrán žádný svět a nebyla poskytnuta žádná adresa. Nemám co dělat." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Hru nebylo možné najít nebo nahrát \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Neplatná specifikace hry." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Chyba spojení (vypršel čas?)" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "" +#~ "Levý klik: Přesunout všechny předměty, Pravý klik: Přesunout jeden předmět" + +#~ msgid "Download" +#~ msgstr "Stáhnout" diff --git a/po/da/minetest.po b/po/da/minetest.po index 7dfd072bd..a16e24905 100644 --- a/po/da/minetest.po +++ b/po/da/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-02-17 00:41+0200\n" "Last-Translator: Rune Biskopstö Christensen \n" "Language-Team: \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Spil" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Skab" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Anuller" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Spil" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,230 +77,238 @@ msgstr "" msgid "World name" msgstr "Verdens navn" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Spil" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "Slet verden" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Ja" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nej" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 #, fuzzy msgid "A world named \"$1\" already exists" msgstr "Kan ikke skabe verden: en verden med dette navn eksisterer allerede" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Enligspiller" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Indstillinger" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Skabt af" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 #, fuzzy msgid "Favorites:" msgstr "Vis favoritter" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Adresse/port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Navn/kodeord" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Slet" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Forbind" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Ny" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Konfigurér" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "Start spil / Forbind" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Vælg verden:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Kreativ tilstand" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Aktivér skade" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 #, fuzzy msgid "Public" msgstr "Vis offentlig" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "Gammelt kodeord" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "\"Smarte\" træer" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Glat belysning" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D skyer" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "Opakt (uigennemsigtigt) vand" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Anisotropisk filtréring" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Bi-lineær filtréring" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Tri-lineær filtréring" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shadere" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "For-indlæs elementernes grafik" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Aktivér partikler" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Skift bindinger" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Afspil" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Enligspiller" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Indstillinger" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Skabt af" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -309,114 +317,133 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Ned" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "afhænger af:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Accepter" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Vælg verden:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Spil" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "afhænger af:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Gem" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Aktivér alle" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Deaktivér alle" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "aktiveret" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Aktivér alle" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "Vælg verden:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "Mislykkedes i at initialisere verden" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -432,47 +459,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -488,12 +519,8 @@ msgstr "Du døde." msgid "Respawn" msgstr "Genopstå" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "Venstre klik: flyt alle enheder. Højre klik: flyt en enkelt enhed" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Fortsæt" @@ -513,99 +540,99 @@ msgstr "" "Tryk på \"hop\" hurtigt to gange for at skifte frem og tilbage mellem flyve-" "tilstand" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Tast allerede i brug" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "Tryk på en tast" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Fremad" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Baglæns" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Venstre" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Højre" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Brug" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Hop" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Snige" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Slip" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Beholdning" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Snak" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Kommando" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Konsol" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Omstil flyvning" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Omstil hurtig" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Omstil fylde" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Afstands vælg" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Udskriv stakke" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Gammelt kodeord" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nyt kodeord" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Bekræft kodeord" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Skift" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Kodeordene er ikke ens!" @@ -644,11 +671,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "" @@ -943,77 +970,46 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Hovedmenu" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Ingen verden valgt og ingen adresse angivet. Ingen opgave at lave." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Kunne ikke finde eller indlæse spil \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Ugyldig spilspecifikationer." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Forbindelses fejl (udløbelse af tidsfrist?)" -#~ msgid "is required by:" -#~ msgstr "er påkrævet af:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Advarsel: nogle modifikationer er endnu ikke konfigureret.\n" +#~ "De vil blive aktiveret som standard når du gemmer konfigurationen. " -#~ msgid "Configuration saved. " -#~ msgstr "Konfiguration gemt. " +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Advarsel: nogle konfigurerede modifikationer mangler.\n" +#~ "Deres indstillinger vil blive fjernet når du gemmer konfigurationen. " -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Advarsel: konfigurationen er ikke sammenhængende. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Kan ikke skabe verden: navnet indeholder ugyldige bogstaver" - -#~ msgid "Multiplayer" -#~ msgstr "Flerspiller" - -#~ msgid "Advanced" -#~ msgstr "Avanceret" - -#~ msgid "Show Public" -#~ msgstr "Vis offentlig" - -#~ msgid "Show Favorites" -#~ msgstr "Vis favoritter" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Lad adresse-feltet være tomt for at starte en lokal server." - -#~ msgid "Create world" -#~ msgstr "Skab verden" - -#~ msgid "Address required." -#~ msgstr "Adresse påkrævet." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Kan ikke slette verden: ingenting valgt" - -#~ msgid "Files to be deleted" -#~ msgstr "Filer som slettes" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Kan ikke skabe verden: ingen spil fundet" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Kan ikke konfigurere verden: ingenting valgt" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Mislykkedes i at slette alle verdenens filer" +#~ msgid "Delete map" +#~ msgstr "Slet mappen" #~ msgid "" #~ "Default Controls:\n" @@ -1040,19 +1036,57 @@ msgstr "Forbindelses fejl (udløbelse af tidsfrist?)" #~ "- ESC: denne menu\n" #~ "- T: snak\n" -#~ msgid "Delete map" -#~ msgstr "Slet mappen" +#~ msgid "Failed to delete all world files" +#~ msgstr "Mislykkedes i at slette alle verdenens filer" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Advarsel: nogle konfigurerede modifikationer mangler.\n" -#~ "Deres indstillinger vil blive fjernet når du gemmer konfigurationen. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Kan ikke konfigurere verden: ingenting valgt" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "Advarsel: nogle modifikationer er endnu ikke konfigureret.\n" -#~ "De vil blive aktiveret som standard når du gemmer konfigurationen. " +#~ msgid "Cannot create world: No games found" +#~ msgstr "Kan ikke skabe verden: ingen spil fundet" + +#~ msgid "Files to be deleted" +#~ msgstr "Filer som slettes" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Kan ikke slette verden: ingenting valgt" + +#~ msgid "Address required." +#~ msgstr "Adresse påkrævet." + +#~ msgid "Create world" +#~ msgstr "Skab verden" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Lad adresse-feltet være tomt for at starte en lokal server." + +#~ msgid "Show Favorites" +#~ msgstr "Vis favoritter" + +#~ msgid "Show Public" +#~ msgstr "Vis offentlig" + +#~ msgid "Advanced" +#~ msgstr "Avanceret" + +#~ msgid "Multiplayer" +#~ msgstr "Flerspiller" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Kan ikke skabe verden: navnet indeholder ugyldige bogstaver" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Advarsel: konfigurationen er ikke sammenhængende. " + +#~ msgid "Configuration saved. " +#~ msgstr "Konfiguration gemt. " + +#~ msgid "is required by:" +#~ msgstr "er påkrævet af:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "Venstre klik: flyt alle enheder. Højre klik: flyt en enkelt enhed" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Ned" diff --git a/po/de/minetest.po b/po/de/minetest.po index dc2664444..ef50c1638 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-09-09 18:31+0200\n" "Last-Translator: Pilz Adam \n" "Language-Team: Deutsch <>\n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Spielname" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Erstellen" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Abbrechen" @@ -39,35 +39,35 @@ msgstr "Gamemgr: Kann mod \"$1\" nicht in Spiel \"$2\" kopieren" msgid "GAMES" msgstr "SPIELE" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Spiele" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Mods:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "Spiel ändern" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "neues Spiel" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "SPIEL ÄNDERN" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Ausgewählte Mod löschen" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Mod hinzufügen" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -75,223 +75,231 @@ msgstr "Ok" msgid "World name" msgstr "Weltname" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Weltgenerator" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Spiel" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Welt \"$1\" löschen?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Ja" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nein" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Eine Welt namens \"$1\" existiert bereits" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Keine Weltname gegeben oder kein Spiel ausgewählt" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Einzelspieler" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Client" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Server" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Einstellungen" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Texturen Pakete" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Mods" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Credits" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENT" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Favoriten:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Adresse / Port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Name/Passwort" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Öffentliche Serverliste" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Entfernen" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Verbinden" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Neu" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Konfigurieren" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Spiel starten" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Welt wählen:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "SERVER STARTEN" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Kreativitätsmodus" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Schaden einschalten" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Öffentlich" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Name" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Passwort" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Server Port" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "EINSTELLUNGEN" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Schöne Bäume" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Besseres Licht" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D Wolken" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Undurchs. Wasser" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-Mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Anisotroper Filter" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Bi-Linearer Filter" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Tri-Linearer Filter" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shader" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Lade Inventarbilder vor" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Aktiviere Partikel" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Endliches Wasser" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Tasten ändern" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Spielen" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "EINZELSPIELER" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Texturen Paket auswählen:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "TEXTUREN PAKETE" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Keine Informationen vorhanden" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Core Entwickler" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Aktive Mitwirkende" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Frühere Mitwirkende" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Einzelspieler" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Client" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Server" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Einstellungen" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Texturen Pakete" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Mods" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Credits" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODS" @@ -300,75 +308,100 @@ msgstr "MODS" msgid "Installed Mods:" msgstr "Installierte Mods:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Installieren" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Mod hinzufügen" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Runterladen" +#, fuzzy +msgid "Local install" +msgstr "Installieren" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Keine Informationen vorhanden" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Keine Informationen vorhanden" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Umbenennen" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Abhängig von:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Ausgewählte Mod löschen" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Modpack umbenennen:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Annehmen" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Welt:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Spiel verstecken" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "MP mods verstecken" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Abhängig von:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Speichern" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "MP aktivieren" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "MP deaktivieren" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "Aktiviert" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Alle an" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Mod Datei auswählen:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Mod installieren: Datei: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -376,31 +409,31 @@ msgstr "" "\n" "Mod installieren: Nicht unterstützter Dateityp \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Fehler beim installieren von $1 zu $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "Mod installieren: Kann keinen Ordnernamen für Modpack $1 finden" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Mod installieren: Kann echten Namen für $1 nicht finden" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: Fehler beim löschen von \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: Unzulässiger Modpfad \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "\"$1\" wirklich löschen?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Nein, natürlich nicht!" @@ -416,47 +449,51 @@ msgstr "Bewertung" msgid "re-Install" msgstr "erneut installieren" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Installieren" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Inventarbilder..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Lädt..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Erstelle Server..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Erstelle Client..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Löse Adresse auf..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Verbinde zum Server..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Item Definitionen..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Node Definitionen..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Medien..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Herunterfahren..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -472,12 +509,8 @@ msgstr "Sie sind gestorben." msgid "Respawn" msgstr "Wiederbeleben" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "Linksklick: Alle Items bewegen, Rechtsklick: Einzelnes Item bewegen" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Fortsetzen" @@ -493,99 +526,99 @@ msgstr "\"Benutzen\" = herunterklettern" msgid "Double tap \"jump\" to toggle fly" msgstr "Doppelt \"springen\" zum fliegen" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Taste bereits in Benutzung" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "Taste drücken" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Vorwärts" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Rückwärts" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Links" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Rechts" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Benutzen" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Springen" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Schleichen" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Wegwerfen" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventar" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Chat" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Befehl" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Konsole" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Fliegen umsch." -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Speed umsch." -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Noclip umsch." -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Entfernung wählen" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Stack ausgeben" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Altes Passwort" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Neues Passwort" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Passwort wiederholen" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Ändern" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Passwörter passen nicht zusammen!" @@ -635,11 +668,11 @@ msgstr "" "- Mausrad: Item auswählen\n" "- T: Chat\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Sound Lautstärke: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Zurück" @@ -931,77 +964,50 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "no" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Hauptmenü" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Keine Welt ausgewählt und keine Adresse angegeben. Nichts zu tun." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Kann Spiel nicht finden/laden \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Invalide Spielspezif." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Verbindungsfehler (Zeitüberschreitung?)" -#~ msgid "is required by:" -#~ msgstr "wird benötigt von:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Warnung: Einige Mods sind noch nicht konfiguriert.\n" +#~ "Sie werden aktiviert wenn die Konfiguration gespeichert wird. " -#~ msgid "Configuration saved. " -#~ msgstr "Konfiguration gespeichert. " +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Warnung: Einige konfigurierte Mods fehlen.\n" +#~ "Mod Einstellungen werden gelöscht wenn die Konfiguration gespeichert " +#~ "wird. " -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Warnung: Konfiguration nicht konsistent. " +#~ msgid "KEYBINDINGS" +#~ msgstr "TASTEN EINST." -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Kann Welt nicht erstellen: Name enthält ungültige Zeichen" - -#~ msgid "Multiplayer" -#~ msgstr "Mehrspieler" - -#~ msgid "Advanced" -#~ msgstr "Erweitert" - -#~ msgid "Show Public" -#~ msgstr "Zeige öffentliche" - -#~ msgid "Show Favorites" -#~ msgstr "Zeige Favoriten" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Lasse die Adresse frei um einen eigenen Server zu starten." - -#~ msgid "Create world" -#~ msgstr "Welt erstellen" - -#~ msgid "Address required." -#~ msgstr "Adresse benötigt." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Kann Welt nicht löchen: Nichts ausgewählt" - -#~ msgid "Files to be deleted" -#~ msgstr "Zu löschende Dateien" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Kann Welt nicht erstellen: Keine Spiele gefunden" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Kann Welt nicht konfigurieren: Nichts ausgewählt" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Es konnten nicht alle Welt Dateien gelöscht werden" +#~ msgid "Delete map" +#~ msgstr "Karte löschen" #~ msgid "" #~ "Default Controls:\n" @@ -1027,23 +1033,56 @@ msgstr "Verbindungsfehler (Zeitüberschreitung?)" #~ "- I: Inventar\n" #~ "- T: Chat\n" -#~ msgid "Delete map" -#~ msgstr "Karte löschen" +#~ msgid "Failed to delete all world files" +#~ msgstr "Es konnten nicht alle Welt Dateien gelöscht werden" -#~ msgid "KEYBINDINGS" -#~ msgstr "TASTEN EINST." +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Kann Welt nicht konfigurieren: Nichts ausgewählt" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Warnung: Einige konfigurierte Mods fehlen.\n" -#~ "Mod Einstellungen werden gelöscht wenn die Konfiguration gespeichert " -#~ "wird. " +#~ msgid "Cannot create world: No games found" +#~ msgstr "Kann Welt nicht erstellen: Keine Spiele gefunden" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "Warnung: Einige Mods sind noch nicht konfiguriert.\n" -#~ "Sie werden aktiviert wenn die Konfiguration gespeichert wird. " +#~ msgid "Files to be deleted" +#~ msgstr "Zu löschende Dateien" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Kann Welt nicht löchen: Nichts ausgewählt" + +#~ msgid "Address required." +#~ msgstr "Adresse benötigt." + +#~ msgid "Create world" +#~ msgstr "Welt erstellen" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Lasse die Adresse frei um einen eigenen Server zu starten." + +#~ msgid "Show Favorites" +#~ msgstr "Zeige Favoriten" + +#~ msgid "Show Public" +#~ msgstr "Zeige öffentliche" + +#~ msgid "Advanced" +#~ msgstr "Erweitert" + +#~ msgid "Multiplayer" +#~ msgstr "Mehrspieler" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Kann Welt nicht erstellen: Name enthält ungültige Zeichen" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Warnung: Konfiguration nicht konsistent. " + +#~ msgid "Configuration saved. " +#~ msgstr "Konfiguration gespeichert. " + +#~ msgid "is required by:" +#~ msgstr "wird benötigt von:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "Linksklick: Alle Items bewegen, Rechtsklick: Einzelnes Item bewegen" + +#~ msgid "Download" +#~ msgstr "Runterladen" diff --git a/po/es/minetest.po b/po/es/minetest.po index 1b20be2f9..561f33083 100644 --- a/po/es/minetest.po +++ b/po/es/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-10-19 08:15+0200\n" "Last-Translator: Pablo Lezaeta \n" "Language-Team: LANGUAGE \n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Nombre del Juego" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Crear" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Cancelar" @@ -39,35 +39,35 @@ msgstr "Gamemgr: Imposible copiar el mod \"$1\" al juego \"$2\"" msgid "GAMES" msgstr "JUEGOS" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Juegos" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Modificaciónes:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "editar juego" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "juego nuevo" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "EDITAR JUEGO" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Eliminar mod seleccionado" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "Añadir modificación" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Aceptar" @@ -75,223 +75,231 @@ msgstr "Aceptar" msgid "World name" msgstr "Nombre del mundo" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Mapgen" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Juego" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Eliminar Mundo \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Sí" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "No" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Ya hay un mundo llamado \"$1\"" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "No se a dado un nombre al mundo o no se ha seleccionado uno" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Un jugador" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Cliente" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Servidor" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Configuración" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Paquete de texturas" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Mods" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Créditos" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENTE" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Favoritos:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Dirección/Puerto" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nombre/Clave" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Lista de Servidores Públicos" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Borrar" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Conectar" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nuevo" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Configurar" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Iniciar Juego" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Selecciona un mundo:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "INICIAR SERVIDOR" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Modo creativo" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Permitir daños" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Público" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Nombre" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Contraseña" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Puerto de Servidor" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "CONFIGURACION" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Árboles detallados" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Iluminación Suave" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Nubes 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Agua Opaca" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-Mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtrado Anisotrópico" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtrado Bi-Lineal" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtrado Tri-Lineal" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Sombreadores" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Precarga elementos visuales" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Habilitar partículas" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Líquidos Finitos" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Configurar Teclas" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Jugar" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "UN JUGADOR" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Seleccione paquete de texturas:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "PAQUETES DE TEXTURAS" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Sin informacion disponible" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Núcleo de desarrolladores" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Colaboradores activos" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Antiguos colaboradores" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Un jugador" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Cliente" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Servidor" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Configuración" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Paquete de texturas" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Mods" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Créditos" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODS" @@ -300,75 +308,100 @@ msgstr "MODS" msgid "Installed Mods:" msgstr "Mods instalados:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Instalar" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "Añadir modificación" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Descargar" +#, fuzzy +msgid "Local install" +msgstr "Instalar" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Sin informacion disponible" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Sin informacion disponible" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Renombrar" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Dependencias:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Eliminar mod seleccionado" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Renombrar paquete de mod:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Aceptar" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Mundo:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Ocultar Juego" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Esconder contenido mp" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Dependencias:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Guardar" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "Activar paquete" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "Desactivar paquete" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "Activado" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Activar todos" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Selecciona fichero mod:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Instalar mod: Archivo: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -376,33 +409,33 @@ msgstr "" "\n" "Instalar mod: Tipo de archivo sin soporte \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Fallo al instalar $1 en $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" "Instalar mod: Imposible encontrar un nombre de archivo adecuado para el " "Paquete de mod $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Instalar mod: imposible encontrar el nombre real del mod para: $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: Error al borrar \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: Dirección de mod \"$1\" inválida" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "¿Realmente desea borrar \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "¡No, por su puesto que no!" @@ -418,47 +451,51 @@ msgstr "Clasificación" msgid "re-Install" msgstr "Reinstalar" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Instalar" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Texturas de objetos..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Cargando..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Creando servidor..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Creando cliente..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Resolviendo dirección..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Conectando al servidor..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Definición de objetos..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Definiendo nodos..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Media..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Apagando cosas..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -474,13 +511,8 @@ msgstr "Has muerto." msgid "Respawn" msgstr "Revivir" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Click izquierdo: Mover todos los objetos. Click derecho: Mover un objeto." - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Continuar" @@ -498,99 +530,99 @@ msgstr "\"Usar\" = Descender" msgid "Double tap \"jump\" to toggle fly" msgstr "Pulsa dos veces \"saltar\" para volar" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "La tecla se está utilizando" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "Pulsa una tecla" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Adelante" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Atrás" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Izquierda" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Derecha" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Usar" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Saltar" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Caminar" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Tirar" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventario" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Chat" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Comando" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Consola" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Activar Volar" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Activar Modo Rápido" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Activar noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Seleccionar distancia" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Imprimir Pilas" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Contraseña anterior" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nueva contraseña" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Confirmar contraseña" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Cambiar" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "¡Las contraseñas no coinciden!" @@ -640,11 +672,11 @@ msgstr "" "- Rueda ratón: elegir objeto\n" "- T: conversar\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Volúmen del Sonido: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Salir" @@ -936,80 +968,44 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "needs_fallback_font" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menú Principal" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" -"No se seleccionó mundo y no se ha especificado una dirección. Nada que " -"hacer." +"No se seleccionó mundo y no se ha especificado una dirección. Nada que hacer." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "No se puede encontrar o cargar el juego \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Juego especificado no válido." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Error de conexión (¿tiempo agotado?)" -#~ msgid "is required by:" -#~ msgstr "es requerido por:" - -#~ msgid "Configuration saved. " -#~ msgstr "Configuración guardada. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "ADVERTENCIA: La configuración no corresponde. " - -#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " #~ msgstr "" -#~ "No se puede crear el mundo: El nombre contiene caracteres no válidos" +#~ "ADVERTENCIA: Algunos mods no están aún configurados.\n" +#~ "Se habilitarán de forma predeterminada al guardar la configuración. " -#~ msgid "Multiplayer" -#~ msgstr "Multijugador" - -#~ msgid "Advanced" -#~ msgstr "Avanzado" - -#~ msgid "Show Public" -#~ msgstr "Servidores Públicos" - -#~ msgid "Show Favorites" -#~ msgstr "Mostrar Favoritos" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Dejar la dirección en blanco para iniciar un servidor local." - -#~ msgid "Create world" -#~ msgstr "Crear Mundo" - -#~ msgid "Address required." -#~ msgstr "Requiere una dirección." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "No se puede eliminar el mundo: ninguno ha sido seleccionado" - -#~ msgid "Files to be deleted" -#~ msgstr "Archivos que se eliminarán" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "No se puede crear el mundo: No se encontraron juegos" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "No se puede configurar el mundo: Ninguno seleccionado" - -#~ msgid "Failed to delete all world files" -#~ msgstr "No se pudo eliminar todos los archivos del mundo" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "ADVERTENCIA: Algunos mods configurados faltan.\n" +#~ "Su ajuste se quitará al guardar la configuración. " #~ msgid "" #~ "Default Controls:\n" @@ -1036,16 +1032,58 @@ msgstr "Error de conexión (¿tiempo agotado?)" #~ "- ESC: Este Menu\n" #~ "- T: Conversar\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "ADVERTENCIA: Algunos mods configurados faltan.\n" -#~ "Su ajuste se quitará al guardar la configuración. " +#~ msgid "Failed to delete all world files" +#~ msgstr "No se pudo eliminar todos los archivos del mundo" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "No se puede configurar el mundo: Ninguno seleccionado" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "No se puede crear el mundo: No se encontraron juegos" + +#~ msgid "Files to be deleted" +#~ msgstr "Archivos que se eliminarán" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "No se puede eliminar el mundo: ninguno ha sido seleccionado" + +#~ msgid "Address required." +#~ msgstr "Requiere una dirección." + +#~ msgid "Create world" +#~ msgstr "Crear Mundo" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Dejar la dirección en blanco para iniciar un servidor local." + +#~ msgid "Show Favorites" +#~ msgstr "Mostrar Favoritos" + +#~ msgid "Show Public" +#~ msgstr "Servidores Públicos" + +#~ msgid "Advanced" +#~ msgstr "Avanzado" + +#~ msgid "Multiplayer" +#~ msgstr "Multijugador" + +#~ msgid "Cannot create world: Name contains invalid characters" #~ msgstr "" -#~ "ADVERTENCIA: Algunos mods no están aún configurados.\n" -#~ "Se habilitarán de forma predeterminada al guardar la configuración. " +#~ "No se puede crear el mundo: El nombre contiene caracteres no válidos" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "ADVERTENCIA: La configuración no corresponde. " + +#~ msgid "Configuration saved. " +#~ msgstr "Configuración guardada. " + +#~ msgid "is required by:" +#~ msgstr "es requerido por:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "" +#~ "Click izquierdo: Mover todos los objetos. Click derecho: Mover un objeto." + +#~ msgid "Download" +#~ msgstr "Descargar" diff --git a/po/et/minetest.po b/po/et/minetest.po index 8fd721466..4a3fda40b 100644 --- a/po/et/minetest.po +++ b/po/et/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-06-21 15:47+0200\n" "Last-Translator: sfan5 \n" "Language-Team: LANGUAGE \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Mäng" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Loo" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Tühista" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Mäng" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,230 +77,238 @@ msgstr "" msgid "World name" msgstr "Maailma nimi" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Mäng" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "Kustuta maailm" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Jah" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Ei" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 #, fuzzy msgid "A world named \"$1\" already exists" msgstr "Maailma loomine ebaõnnestus: Samanimeline maailm on juba olemas" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Üksikmäng" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Sätted" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Tänuavaldused" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Lemmikud:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "IP/Port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nimi/Parool" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 #, fuzzy msgid "Public Serverlist" msgstr "Avatud serverite nimekiri:" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Kustuta" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Liitu" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Uus" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Konfigureeri" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "Alusta mängu / Liitu" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Vali maailm:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Kujunduslik mängumood" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Lülita valu sisse" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Avalik" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "Vana parool" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Uhked puud" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Ilus valgustus" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D pilved" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "Läbipaistmatu vesi" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Väga hea kvaliteet" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Anisotroopne Filtreerimine" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Bi-lineaarsed Filtreerimine" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Tri-Linear Filtreerimine" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Varjutajad" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Lae asjade visuaale" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Lülita osakesed sisse" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 #, fuzzy msgid "Finite Liquid" msgstr "Löppev vedelik" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Vaheta nuppe" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Mängi" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Üksikmäng" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Sätted" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Tänuavaldused" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -309,114 +317,133 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Alla" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "Vajab:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Nõustu" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Vali maailm:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Mäng" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "Vajab:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Salvesta" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Lülita kõik sisse" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Lülita kõik välja" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "Sisse lülitatud" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Lülita kõik sisse" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "Vali maailm:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "Maailma initsialiseerimine ebaõnnestus" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -432,47 +459,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -488,13 +519,8 @@ msgstr "Sa surid." msgid "Respawn" msgstr "Ärka ellu" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Vasak hiireklõps: Liiguta kõiki asju, Parem hiireklõps: Liiguta üksikut asja" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Jätka" @@ -512,99 +538,99 @@ msgstr "\"Tegevus\" = Roni alla" msgid "Double tap \"jump\" to toggle fly" msgstr "Topeltklõpsa \"Hüppamist\" et sisse lülitada lendamine" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Nupp juba kasutuses" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "Vajuta nuppu" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Edasi" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Tagasi" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Vasakule" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Paremale" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Tegevus" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Hüppamine" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Hiilimine" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Viska maha" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Seljakott" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Jututuba" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Käsklus" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Konsool" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Lülita lendamine sisse" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Lülita kiirus sisse" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Lülita läbi seinte minek sisse" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Kauguse valik" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Prindi kogused" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Vana parool" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Uus parool" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Kinnita parooli" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Muuda" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Paroolid ei ole samad!" @@ -643,11 +669,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Hääle Volüüm: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Välju" @@ -939,77 +965,43 @@ msgstr "PA1" msgid "Zoom" msgstr "Suumi" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menüü" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Pole valitud ei maailma ega IP aadressi. Pole midagi teha." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Ei leia ega suuda jätkata mängu \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Vale mängu ID." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Ühenduse viga (Aeg otsas?)" -#~ msgid "is required by:" -#~ msgstr "Seda vajavad:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Hoiatus: Mõned modifikatsioonid pole sätitud veel.\n" +#~ "Need lülitatakse sisse kohe pärast sätete salvestamist." -#~ msgid "Configuration saved. " -#~ msgstr "Konfiguratsioon salvestatud. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Hoiatus: Konfiguratsioon pole kindel." - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Maailma loomine ebaõnnestus: Nimes esineb keelatud tähti" - -#~ msgid "Multiplayer" -#~ msgstr "Mitmikmäng" - -#~ msgid "Advanced" -#~ msgstr "Arenenud sätted" - -#~ msgid "Show Public" -#~ msgstr "Näita avalikke" - -#~ msgid "Show Favorites" -#~ msgstr "Näita lemmikuid" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Jäta IP lahter tühjaks et alustada LAN serverit." - -#~ msgid "Create world" -#~ msgstr "Loo maailm" - -#~ msgid "Address required." -#~ msgstr "IP on vajalkik." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Maailma kustutamine ebaõnnestus: Maailma pole valitud" - -#~ msgid "Files to be deleted" -#~ msgstr "Failid mida kustutada" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Maailma loomine ebaõnnestus: Mängu ei leitud" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Maailma konfigureerimine ebaõnnestus: Pole midagi valitud" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Kõigi maailma failide kustutamine ebaõnnestus" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Hoiatus: Mõned konfigureeritud modifikatsioonid on kaotsi läinud.\n" +#~ "Nende sätted kustutatakse kui salvestada konfiguratsioon." #~ msgid "" #~ "Default Controls:\n" @@ -1036,16 +1028,59 @@ msgstr "Ühenduse viga (Aeg otsas?)" #~ "- ESC: Menüü\n" #~ "- T: Jututupa\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Hoiatus: Mõned konfigureeritud modifikatsioonid on kaotsi läinud.\n" -#~ "Nende sätted kustutatakse kui salvestada konfiguratsioon." +#~ msgid "Failed to delete all world files" +#~ msgstr "Kõigi maailma failide kustutamine ebaõnnestus" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Maailma konfigureerimine ebaõnnestus: Pole midagi valitud" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Maailma loomine ebaõnnestus: Mängu ei leitud" + +#~ msgid "Files to be deleted" +#~ msgstr "Failid mida kustutada" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Maailma kustutamine ebaõnnestus: Maailma pole valitud" + +#~ msgid "Address required." +#~ msgstr "IP on vajalkik." + +#~ msgid "Create world" +#~ msgstr "Loo maailm" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Jäta IP lahter tühjaks et alustada LAN serverit." + +#~ msgid "Show Favorites" +#~ msgstr "Näita lemmikuid" + +#~ msgid "Show Public" +#~ msgstr "Näita avalikke" + +#~ msgid "Advanced" +#~ msgstr "Arenenud sätted" + +#~ msgid "Multiplayer" +#~ msgstr "Mitmikmäng" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Maailma loomine ebaõnnestus: Nimes esineb keelatud tähti" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Hoiatus: Konfiguratsioon pole kindel." + +#~ msgid "Configuration saved. " +#~ msgstr "Konfiguratsioon salvestatud. " + +#~ msgid "is required by:" +#~ msgstr "Seda vajavad:" + +#~ msgid "Left click: Move all items, Right click: Move single item" #~ msgstr "" -#~ "Hoiatus: Mõned modifikatsioonid pole sätitud veel.\n" -#~ "Need lülitatakse sisse kohe pärast sätete salvestamist." +#~ "Vasak hiireklõps: Liiguta kõiki asju, Parem hiireklõps: Liiguta üksikut " +#~ "asja" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Alla" diff --git a/po/fr/minetest.po b/po/fr/minetest.po index 4c14cad8e..649a75db2 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-09-09 22:32+0200\n" "Last-Translator: we prefer instagib metl3 \n" "Language-Team: Français <>\n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Nom du jeu" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Créer" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Annuler" @@ -39,35 +39,35 @@ msgstr "Gamemgr : Impossible de copier le mod \"$1\" dans le jeu \"$2\"" msgid "GAMES" msgstr "JEUX" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Jeux" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Mods :" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "éditer le jeu" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "nouveau jeu" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "ÉDITER LE JEU" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Supprimer le mod sélectionné" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Ajouter un mod" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -75,223 +75,231 @@ msgstr "Ok" msgid "World name" msgstr "Nom du monde" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Génération de carte" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Jeu" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Supprimer le monde \"$1\" ?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Oui" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Non" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Le monde \"$1\" existe déjà" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Nom du monde manquant ou aucun jeu sélectionné" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Solo" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Client" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Serveur" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Réglages" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Packs de textures" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Mods" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Crédits" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENT" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Favoris :" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Adresse / Port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nom / MdP" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Liste de serveurs publics" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Supprimer" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Rejoindre" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nouveau" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Configurer" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Démarrer" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Sélectionner un monde :" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "DÉMARRER LE SERVEUR" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Mode créatif" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Activer les dégats" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Public" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Nom" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Mot de passe" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Port" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "PARAMÈTRES" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Feuilles transparentes" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Lumière douce" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Nuages 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Eau opaque" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtrage anisotropique" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtrage bilinéaire" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtrage trilinéaire" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shaders" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Précharger les visuels d'objets" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Activer les particules" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Liquides limités" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Changer les touches" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Jouer" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "PARTIE SOLO" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Sélectionner un pack de textures :" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "PACKS DE TEXTURES" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Pas d'information disponible" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Développeurs principaux" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Contributeurs actifs" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Anciens contributeurs" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Solo" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Client" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Serveur" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Réglages" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Packs de textures" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Mods" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Crédits" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODS" @@ -300,75 +308,100 @@ msgstr "MODS" msgid "Installed Mods:" msgstr "Mods installés :" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Installer" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Ajouter un mod" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Télécharger" +#, fuzzy +msgid "Local install" +msgstr "Installer" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Pas d'information disponible" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Pas d'information disponible" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Renommer" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Dépend de :" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Supprimer le mod sélectionné" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Renommer le pack de mods :" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Accepter" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Sélectionner un monde :" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Cacher le jeu" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Cacher le contenu de packs de mods" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod :" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Dépend de :" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Enregistrer" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "Activer le pack de mods" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "Désactiver le pack de mods" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "activé" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Tout activer" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Sélectionner un fichier de mod :" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Installer un mod : fichier : \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -376,33 +409,33 @@ msgstr "" "\n" "Installer un mod : type de fichier non supporté \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "N'a pas pu installer $1 à $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" "Installer un mod : impossible de trouver un nom de dossier valide pour le " "pack de mods $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Installer un mod : impossible de trouver le vrai nom du mod pour : $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr : n'a pas pu supprimer \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr : chemin de mod invalide \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Êtes-vous sûr de supprimer \"$1\" ?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Non, bien sûr que non !" @@ -418,47 +451,51 @@ msgstr "Note" msgid "re-Install" msgstr "ré-Installer" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Installer" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Textures d'objets..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Chargement..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Création du serveur..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Création du client..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Résolution de l'adresse..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Connexion au serveur..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Définitions d'objets..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Définitions des blocs..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Média..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Quitter le jeu..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -474,13 +511,8 @@ msgstr "Vous êtes mort." msgid "Respawn" msgstr "Réapparaître" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Clic gauche : déplacer tous les objets -- Clic droit : déplacer un objet" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "OK" @@ -496,99 +528,99 @@ msgstr "\"Use\" = descendre (escalade)" msgid "Double tap \"jump\" to toggle fly" msgstr "Double appui sur \"saut\" pour voler" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Touche déjà utilisée" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "appuyez sur une touche" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Avancer" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Reculer" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Gauche" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Droite" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Utiliser" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Sauter" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Marcher" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Lâcher" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventaire" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Messagerie" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Commande" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Console" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Voler" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Mode rapide" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Mode noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Distance de rendu" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Imprimer stacks" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Ancien mot de passe" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nouveau mot de passe" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Confirmer mot de passe" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Changer" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Les mots de passe ne correspondent pas !" @@ -638,11 +670,11 @@ msgstr "" "- Molette souris : sélectionner objet\n" "- T : discuter\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Volume du son :" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Quitter" @@ -934,78 +966,46 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoomer" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "needs_fallback_font" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menu principal" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Pas de monde sélectionné et pas d'adresse fournie. Rien à faire." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "N'a pas pu trouver ou charger le jeu \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "gamespec invalide." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Erreur de connexion (perte de connexion ?)" -#~ msgid "is required by:" -#~ msgstr "est requis par :" - -#~ msgid "Configuration saved. " -#~ msgstr "Configuration enregistrée. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Attention : configuration incorrecte. " - -#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " #~ msgstr "" -#~ "Impossible de créer le monde : le nom contient des caractères invalides" +#~ "Attention : certains mods ne sont pas encore configurés.\n" +#~ "Ils seront activés par défaut quand vous enregistrerez la configuration. " -#~ msgid "Multiplayer" -#~ msgstr "Multijoueur" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Attention : certains mods configurés sont introuvables.\n" +#~ "Leurs réglages seront effacés quand vous enregistrerez la configuration. " -#~ msgid "Advanced" -#~ msgstr "Avancé" - -#~ msgid "Show Public" -#~ msgstr "Voir les serveurs publics" - -#~ msgid "Show Favorites" -#~ msgstr "Voir les serveurs favoris" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Laisser l'adresse vide pour lancer un serveur local." - -#~ msgid "Create world" -#~ msgstr "Créer un monde" - -#~ msgid "Address required." -#~ msgstr "Adresse requise." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Impossible de supprimer le monde : rien n'est sélectionné" - -#~ msgid "Files to be deleted" -#~ msgstr "Fichiers à supprimer" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Impossible de créer le monde : aucun jeu n'est présent" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Impossible de configurer ce monde : aucune sélection active" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Tous les fichiers du monde n'ont pu être supprimés" +#~ msgid "Delete map" +#~ msgstr "Supprimer carte" #~ msgid "" #~ "Default Controls:\n" @@ -1032,19 +1032,58 @@ msgstr "Erreur de connexion (perte de connexion ?)" #~ "- Échap : ce menu\n" #~ "- T : discuter\n" -#~ msgid "Delete map" -#~ msgstr "Supprimer carte" +#~ msgid "Failed to delete all world files" +#~ msgstr "Tous les fichiers du monde n'ont pu être supprimés" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Attention : certains mods configurés sont introuvables.\n" -#~ "Leurs réglages seront effacés quand vous enregistrerez la configuration. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Impossible de configurer ce monde : aucune sélection active" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Cannot create world: No games found" +#~ msgstr "Impossible de créer le monde : aucun jeu n'est présent" + +#~ msgid "Files to be deleted" +#~ msgstr "Fichiers à supprimer" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Impossible de supprimer le monde : rien n'est sélectionné" + +#~ msgid "Address required." +#~ msgstr "Adresse requise." + +#~ msgid "Create world" +#~ msgstr "Créer un monde" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Laisser l'adresse vide pour lancer un serveur local." + +#~ msgid "Show Favorites" +#~ msgstr "Voir les serveurs favoris" + +#~ msgid "Show Public" +#~ msgstr "Voir les serveurs publics" + +#~ msgid "Advanced" +#~ msgstr "Avancé" + +#~ msgid "Multiplayer" +#~ msgstr "Multijoueur" + +#~ msgid "Cannot create world: Name contains invalid characters" #~ msgstr "" -#~ "Attention : certains mods ne sont pas encore configurés.\n" -#~ "Ils seront activés par défaut quand vous enregistrerez la configuration. " +#~ "Impossible de créer le monde : le nom contient des caractères invalides" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Attention : configuration incorrecte. " + +#~ msgid "Configuration saved. " +#~ msgstr "Configuration enregistrée. " + +#~ msgid "is required by:" +#~ msgstr "est requis par :" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "" +#~ "Clic gauche : déplacer tous les objets -- Clic droit : déplacer un objet" + +#~ msgid "Download" +#~ msgstr "Télécharger" diff --git a/po/hu/minetest.po b/po/hu/minetest.po index e4594a9ac..4bf8f9fb8 100644 --- a/po/hu/minetest.po +++ b/po/hu/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-08-11 03:05+0200\n" "Last-Translator: Sasikaa Lacikaa \n" "Language-Team: LANGUAGE \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Játék" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Létrehozás" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Mégse" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Játék" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,230 +77,238 @@ msgstr "" msgid "World name" msgstr "Világ neve" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Játék" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "Világ törlése" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Igen" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nem" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 #, fuzzy msgid "A world named \"$1\" already exists" msgstr "Nem sikerült a viág létrehozása: A világ neve már használva van" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Egyjátékos mód" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Beállítások" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Stáblista" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Kedvencek:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Cím/Port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Név/jelszó" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 #, fuzzy msgid "Public Serverlist" msgstr "Publikus Szerver Lista:" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Törlés" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Csatlakozás" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Új" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Beállítás" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "Játék indítása / Csatlakozás" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Világ kiválasztása:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Kreatív mód" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Sérülés engedélyezése" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Publikus" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "Régi jelszó" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Szép fák" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Simított megvilágítás" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D Felhők" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "Átlátszó víz" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Anzisztrópikus szűrés" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Bi-Linear Szűrés" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Tri-Linear Szűrés" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shaderek" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Előretöltött tárgy láthatóság" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Részecskék engedélyezése" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 #, fuzzy msgid "Finite Liquid" msgstr "Végtelen folyadék" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Gomb választása" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Játék" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Egyjátékos mód" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Beállítások" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Stáblista" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -309,114 +317,133 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Le" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "Attól függ:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Elfogadva" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Világ kiválasztása:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Játék" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "Attól függ:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Mentés" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Összes engedélyezve" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Összes tiltva" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "Engedélyezve" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Összes engedélyezve" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "Világ kiválasztása:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "A világ betöltése közben hiba" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -432,47 +459,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Tárgy textúrák..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Betöltés..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Szerver létrehozása..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Kliens létrehozása..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Cím létrehozása..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Csatlakozás a szerverhez..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Dolog leállítása..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -486,12 +517,8 @@ msgstr "Meghaltál." msgid "Respawn" msgstr "Újra éledés" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "Ball gomb: Tárgyak mozgatása, Jobb gomb: egy tárgyat mozgat" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Elfogadva" @@ -509,99 +536,99 @@ msgstr "\"Használat\" = Lemászás" msgid "Double tap \"jump\" to toggle fly" msgstr "Duplán nyomd meg az \"ugrás\" gombot ahhoz hogy repülj" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "A gomb már használatban van" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "Nyomj meg egy gombot" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Vissza" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Előre" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Bal" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Jobb" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Használni" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Ugrás" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Lopakodás" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Dobás" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Invertory" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Beszélgetés" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Parancs" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Konzol" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Repülés bekapcsolása" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Gyorsaság bekapcsolása" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "váltás noclip-re" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Távolság választása" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Stacks nyomtatása" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Régi jelszó" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Új jelszó" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Jelszó visszaigazolás" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Változtat" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Nem eggyeznek a jelszavak!" @@ -651,11 +678,11 @@ msgstr "" "- Egér görgő: Tárgyak kiválasztása\n" "- T: Beszélgetés\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Hangerő: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Kilépés" @@ -947,74 +974,81 @@ msgstr "PA11" msgid "Zoom" msgstr "Nagyítás" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Fő menü" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Nincs kiválasztott világ, nincs cím. Nincs mit tenni." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Nem található, vagy nem betöltött játék \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Nem valós játék spec." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Csatlakozási hiba (Idő lejárt?)" -#~ msgid "is required by:" -#~ msgstr "kell neki:" - -#~ msgid "Configuration saved. " -#~ msgstr "Beállítások mentve. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Figyelem: A beállítások nem egyformák. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Nem sikerült a világ létrehozása: A névben nem jó karakterek vannak" - -#~ msgid "Multiplayer" -#~ msgstr "Többjátékos mód" - -#~ msgid "Advanced" -#~ msgstr "Haladó" - -#~ msgid "Show Public" -#~ msgstr "Publikus mutatása" - -#~ msgid "Show Favorites" -#~ msgstr "Kedvencek mutatása" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Hagyd el a nevét, hogy helyi szervert indíts." - -#~ msgid "Create world" -#~ msgstr "Világ létrehozása" - -#~ msgid "Address required." -#~ msgstr "Cím szükséges." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Nem törölhető a világ: Nincs kiválasztva" - -#~ msgid "Files to be deleted" -#~ msgstr "A fájl törölve lett" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Nem sikerült a világot létrehozni: Nem található a játék" +#~ msgid "Failed to delete all world files" +#~ msgstr "Hiba az összes világ törlése közben" #~ msgid "Cannot configure world: Nothing selected" #~ msgstr "Nem sikerült a világ beállítása: Nincs kiválasztva" -#~ msgid "Failed to delete all world files" -#~ msgstr "Hiba az összes világ törlése közben" +#~ msgid "Cannot create world: No games found" +#~ msgstr "Nem sikerült a világot létrehozni: Nem található a játék" + +#~ msgid "Files to be deleted" +#~ msgstr "A fájl törölve lett" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Nem törölhető a világ: Nincs kiválasztva" + +#~ msgid "Address required." +#~ msgstr "Cím szükséges." + +#~ msgid "Create world" +#~ msgstr "Világ létrehozása" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Hagyd el a nevét, hogy helyi szervert indíts." + +#~ msgid "Show Favorites" +#~ msgstr "Kedvencek mutatása" + +#~ msgid "Show Public" +#~ msgstr "Publikus mutatása" + +#~ msgid "Advanced" +#~ msgstr "Haladó" + +#~ msgid "Multiplayer" +#~ msgstr "Többjátékos mód" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Nem sikerült a világ létrehozása: A névben nem jó karakterek vannak" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Figyelem: A beállítások nem egyformák. " + +#~ msgid "Configuration saved. " +#~ msgstr "Beállítások mentve. " + +#~ msgid "is required by:" +#~ msgstr "kell neki:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "Ball gomb: Tárgyak mozgatása, Jobb gomb: egy tárgyat mozgat" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Le" diff --git a/po/it/minetest.po b/po/it/minetest.po index 85adb928d..1e2eddbb4 100644 --- a/po/it/minetest.po +++ b/po/it/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-03-30 20:50+0200\n" "Last-Translator: Fabio Luongo \n" "Language-Team: Italian\n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Gioco" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Crea" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Annulla" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Gioco" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,230 +77,238 @@ msgstr "" msgid "World name" msgstr "Nome mondo" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Gioco" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "Cancella il mondo" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Sì" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "No" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 #, fuzzy msgid "A world named \"$1\" already exists" msgstr "Impossibile creare il mondo: un mondo con questo nome già esiste" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Giocatore singolo" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Opzioni" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Crediti" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 #, fuzzy msgid "Favorites:" msgstr "Mostra preferiti" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Indirizzo/Porta" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nome/Password" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Cancella" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Connetti" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nuovo" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Configura" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "Avvia gioco/Connetti" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Seleziona mondo:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Modalità creativa" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Attiva danno" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 #, fuzzy msgid "Public" msgstr "Lista server pubblici" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "Vecchia password" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Alberi migliori" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Luce uniforme" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Nuvole 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "Acqua opaca" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mipmapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtro anisotropico" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtro bilineare" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtro trilineare" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shader" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Pre-carica le immagini degli oggetti" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Attiva particelle" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Modifica tasti" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Gioca" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Giocatore singolo" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Opzioni" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Crediti" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -309,114 +317,133 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Giù" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "dipende da:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Accetta" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Seleziona mondo:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Gioco" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "dipende da:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Salva" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Attiva tutto" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Disabilita tutto" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "attivato" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Attiva tutto" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "Seleziona mondo:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "Fallimento nell'inizializzare il mondo" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -432,47 +459,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -488,13 +519,8 @@ msgstr "Sei morto." msgid "Respawn" msgstr "Ricomincia" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Click sinistro: muovi tutti gli oggetti; click destro: muovi un solo oggetto" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Procedi" @@ -512,99 +538,99 @@ msgstr "\"Usa\" = scendi sotto" msgid "Double tap \"jump\" to toggle fly" msgstr "Premi due volte \"salto\" per volare" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Tasto già usato" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "premi il tasto" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Avanti" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Indietro" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Sinistra" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Destra" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Usa" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Salta" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Abbassati" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Lancia" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventario" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Parla" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Comando" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Console" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Attiva volo" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Aumenta velocità" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "(Non) attraversi blocchi" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Distanza di rendering" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Stampa stack" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Vecchia password" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nuova password" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Conferma password" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Modifica" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Le password non corrispondono!" @@ -643,11 +669,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "" @@ -939,77 +965,47 @@ msgstr "" msgid "Zoom" msgstr "" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menu principale" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Nessun mondo selezionato e nessun indirizzo fornito. Niente da fare." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Impossibile trovare o caricare il gioco \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Specifiche di gioco non valide." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Errore connessione (tempo scaduto?)" -#~ msgid "is required by:" -#~ msgstr "è richiesto da:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Attenzione: alcune mod non sono ancora configurate.\n" +#~ "Saranno abilitate di default quando salverai la configurazione. " -#~ msgid "Configuration saved. " -#~ msgstr "Configurazione salvata. " +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Attenzione: mancano alcune mod configurate.\n" +#~ "Le loro impostazioni saranno rimosse al salvataggio della " +#~ "configurazione. " -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Attenzione: configurazione non corretta. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Impossibile creare il mondo: il nome contiene caratteri non validi" - -#~ msgid "Multiplayer" -#~ msgstr "Multigiocatore" - -#~ msgid "Advanced" -#~ msgstr "Avanzato" - -#~ msgid "Show Public" -#~ msgstr "Lista server pubblici" - -#~ msgid "Show Favorites" -#~ msgstr "Mostra preferiti" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Lascia vuoto l'indirizzo per avviare un server locale." - -#~ msgid "Create world" -#~ msgstr "Crea mondo" - -#~ msgid "Address required." -#~ msgstr "Indirizzo necessario." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Impossibile eliminare il mondo: nessun mondo selezionato" - -#~ msgid "Files to be deleted" -#~ msgstr "File da eliminarsi" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Impossibile creare il mondo: nessun gioco trovato" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Impossibile configurare il mondo: nessun mondo selezionato" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Eliminazione di tutti i file del mondo fallita" +#~ msgid "Delete map" +#~ msgstr "Cancella mappa" #~ msgid "" #~ "Default Controls:\n" @@ -1036,20 +1032,59 @@ msgstr "Errore connessione (tempo scaduto?)" #~ "- ESC: questo menu\n" #~ "- T: chat\n" -#~ msgid "Delete map" -#~ msgstr "Cancella mappa" +#~ msgid "Failed to delete all world files" +#~ msgstr "Eliminazione di tutti i file del mondo fallita" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Attenzione: mancano alcune mod configurate.\n" -#~ "Le loro impostazioni saranno rimosse al salvataggio della " -#~ "configurazione. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Impossibile configurare il mondo: nessun mondo selezionato" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Cannot create world: No games found" +#~ msgstr "Impossibile creare il mondo: nessun gioco trovato" + +#~ msgid "Files to be deleted" +#~ msgstr "File da eliminarsi" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Impossibile eliminare il mondo: nessun mondo selezionato" + +#~ msgid "Address required." +#~ msgstr "Indirizzo necessario." + +#~ msgid "Create world" +#~ msgstr "Crea mondo" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Lascia vuoto l'indirizzo per avviare un server locale." + +#~ msgid "Show Favorites" +#~ msgstr "Mostra preferiti" + +#~ msgid "Show Public" +#~ msgstr "Lista server pubblici" + +#~ msgid "Advanced" +#~ msgstr "Avanzato" + +#~ msgid "Multiplayer" +#~ msgstr "Multigiocatore" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Impossibile creare il mondo: il nome contiene caratteri non validi" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Attenzione: configurazione non corretta. " + +#~ msgid "Configuration saved. " +#~ msgstr "Configurazione salvata. " + +#~ msgid "is required by:" +#~ msgstr "è richiesto da:" + +#~ msgid "Left click: Move all items, Right click: Move single item" #~ msgstr "" -#~ "Attenzione: alcune mod non sono ancora configurate.\n" -#~ "Saranno abilitate di default quando salverai la configurazione. " +#~ "Click sinistro: muovi tutti gli oggetti; click destro: muovi un solo " +#~ "oggetto" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Giù" diff --git a/po/ja/minetest.po b/po/ja/minetest.po index 5baa2528f..e403583ee 100644 --- a/po/ja/minetest.po +++ b/po/ja/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-03-07 23:06+0200\n" "Last-Translator: Mitori Itoshiki \n" "Language-Team: LANGUAGE \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "ゲーム" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "作成" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "キャンセル" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "ゲーム" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,231 +77,239 @@ msgstr "" msgid "World name" msgstr "ワールド名" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "ゲーム" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "ワールド削除" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "はい" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "いいえ" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 #, fuzzy msgid "A world named \"$1\" already exists" msgstr "ワールドを作成できません: 同名のワールドが既に存在しています" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "シングルプレイヤー" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "設定" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "クレジット" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 #, fuzzy msgid "Favorites:" msgstr "お気に入りを見せる" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "アドレス/ポート" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "名前/パスワード" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "削除" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "接続" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "新規作成" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "設定" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "ゲーム開始 / 接続" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "ワールド選択:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "クリエイティブモード" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "ダメージ有効" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 #, fuzzy msgid "Public" msgstr "公共を見せる" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "古いパスワード" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "きれいな木" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 #, fuzzy msgid "Smooth Lighting" msgstr "自然な光表現" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3Dの雲" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "不透明な水面" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "ミップマップ" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "異方性フィルタリング" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "バイリニアフィルタリング" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "トリリニアフィルタリング" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "シェーダー" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "アイテム外観のプリロード" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "破片表現の有効化" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "キー割当て変更" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "選択した世界に入る" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "シングルプレイヤー" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "設定" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "クレジット" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -310,115 +318,134 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Down" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "この改造ファイルが必要です:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 #, fuzzy msgid "Accept" msgstr "Accept" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "ワールド選択:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "ゲーム" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "この改造ファイルが必要です:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "保存" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "全部を有効にしました" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "全部を無効にしました" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "有効にしました" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "全部を有効にしました" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "ワールド選択:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "ワールドの初期化に失敗" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -434,47 +461,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -488,12 +519,8 @@ msgstr "死亡しました。" msgid "Respawn" msgstr "リスポーン" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "左クリックは全部のアイテムを動かす,右クリックは一つのアイテムを動かす" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "続く" @@ -509,99 +536,99 @@ msgstr "「使う」は下りる" msgid "Double tap \"jump\" to toggle fly" msgstr "「ジャンプ」を二回押すと飛べる" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "既に使われているキーです" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "キー入力待ち" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "前進" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "後退" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "左へ進む" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "右へ進む" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "使う" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "ジャンプ" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "こっそり進む" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "落とす" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "インベントリ" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "チャット" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "コマンド" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "コンソール" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "飛べるモードをトグル" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "ファストモードをトグル" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "ノクリップモードをトグル" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "範囲選択" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "スタックの表示" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "古いパスワード" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "新しいパスワード" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "パスワードの確認" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "変更" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "新しいパスワードが一致しません!" @@ -640,11 +667,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "" @@ -971,77 +998,36 @@ msgstr "PA1" msgid "Zoom" msgstr "ズーム" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "yes" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "メインメニュー" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "ゲームをロードか見つかるのに失敗" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "接続エラー (タイムアウトか?)" -#~ msgid "is required by:" -#~ msgstr "この改造に必要されます:" - -#~ msgid "Configuration saved. " -#~ msgstr "設定を保存しました. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "注意:設定が一定でわありません。" - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "ワールドを作成できません: 名前に無効な文字が含まれています" - -#~ msgid "Multiplayer" -#~ msgstr "マルチプレイヤー" - -#~ msgid "Advanced" -#~ msgstr "高度" - -#~ msgid "Show Public" -#~ msgstr "公共を見せる" - -#~ msgid "Show Favorites" -#~ msgstr "お気に入りを見せる" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "アドレスを入力しないかぎりロカルサーバーを開始。" - -#~ msgid "Create world" -#~ msgstr "ワールド作成" - -#~ msgid "Address required." -#~ msgstr "アドレスが必要です." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "ワールドを削除できません: 何も選択されていません" - -#~ msgid "Files to be deleted" -#~ msgstr "削除されるファイル" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "ワールドを作成できません: ゲームが見つかりませんでした" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "ワールドの設定ができません: 何も選択されていません" - -#~ msgid "Failed to delete all world files" -#~ msgstr "ワールドファイルの全ての削除に失敗" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "警告: マインテストの改造がいくつか設定されていません。\n" +#~ "これらを設定を保存すると自動で有効化されます。 " #~ msgid "" #~ "Warning: Some configured mods are missing.\n" @@ -1050,9 +1036,58 @@ msgstr "接続エラー (タイムアウトか?)" #~ "警告: いくつかの設定みの改造ファイルが見つかりません.\n" #~ "これらの情報は設定を保存すると削除されます. " -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Failed to delete all world files" +#~ msgstr "ワールドファイルの全ての削除に失敗" + +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "ワールドの設定ができません: 何も選択されていません" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "ワールドを作成できません: ゲームが見つかりませんでした" + +#~ msgid "Files to be deleted" +#~ msgstr "削除されるファイル" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "ワールドを削除できません: 何も選択されていません" + +#~ msgid "Address required." +#~ msgstr "アドレスが必要です." + +#~ msgid "Create world" +#~ msgstr "ワールド作成" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "アドレスを入力しないかぎりロカルサーバーを開始。" + +#~ msgid "Show Favorites" +#~ msgstr "お気に入りを見せる" + +#~ msgid "Show Public" +#~ msgstr "公共を見せる" + +#~ msgid "Advanced" +#~ msgstr "高度" + +#~ msgid "Multiplayer" +#~ msgstr "マルチプレイヤー" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "ワールドを作成できません: 名前に無効な文字が含まれています" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "注意:設定が一定でわありません。" + +#~ msgid "Configuration saved. " +#~ msgstr "設定を保存しました. " + +#~ msgid "is required by:" +#~ msgstr "この改造に必要されます:" + +#~ msgid "Left click: Move all items, Right click: Move single item" #~ msgstr "" -#~ "警告: マインテストの改造がいくつか設定されていません。\n" -#~ "これらを設定を保存すると自動で有効化されます。 " +#~ "左クリックは全部のアイテムを動かす,右クリックは一つのアイテムを動かす" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Down" diff --git a/po/ko/minetest.po b/po/ko/minetest.po index e8ed1da8f..e68494137 100644 --- a/po/ko/minetest.po +++ b/po/ko/minetest.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,12 +21,12 @@ msgstr "" msgid "Game Name" msgstr "" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "" @@ -38,35 +38,35 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -74,223 +74,231 @@ msgstr "" msgid "World name" msgstr "" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -299,105 +307,125 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -msgid "Download" +msgid "Local install" msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -413,47 +441,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -467,12 +499,8 @@ msgstr "" msgid "Respawn" msgstr "" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "" @@ -488,99 +516,99 @@ msgstr "" msgid "Double tap \"jump\" to toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "" @@ -619,11 +647,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "" @@ -915,26 +943,26 @@ msgstr "" msgid "Zoom" msgstr "" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "yes" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "" diff --git a/po/ky/minetest.po b/po/ky/minetest.po index a755038ec..2b6f75625 100644 --- a/po/ky/minetest.po +++ b/po/ky/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-06-01 18:09+0200\n" "Last-Translator: Chynggyz Jumaliev \n" "Language-Team: LANGUAGE \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Оюн" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Жаратуу" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Жокко чыгаруу" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Оюн" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,229 +77,237 @@ msgstr "" msgid "World name" msgstr "Дүйнө аты" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Оюн" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "Дүйнөнү өчүрүү" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Ооба" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Жок" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Бир кишилик" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Ырастоолор" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Алкыштар" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Тандалмалар:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Дареги/порту" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Аты/сырсөзү" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 #, fuzzy msgid "Public Serverlist" msgstr "Жалпылык серверлердин тизмеси:" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Өчүрүү" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Туташуу" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Жаңы" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Ырастоо" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "Оюнду баштоо/туташуу" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Дүйнөнү тандаңыз:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Жаратуу режими" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Убалды күйгүзүү" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Жалпылык" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "Эски сырсөз" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Кооз бактар" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Тегиз жарык" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D-булуттар" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "Күңүрт суу" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-текстуралоо" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Анизатропия чыпкалоосу" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Экисызык чыпкалоосу" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Үчсызык чыпкалоосу" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Көлөкөлөгүчтөр" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Бөлүкчөлөрдү күйгүзүү" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 #, fuzzy msgid "Finite Liquid" msgstr "Чектүү суюктук" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Баскычтарды өзгөртүү" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Ойноо" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Бир кишилик" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Ырастоолор" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Алкыштар" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -308,114 +316,133 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Ылдый" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "көз карандылыктары:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Кабыл алуу" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Дүйнөнү тандаңыз:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Оюн" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "көз карандылыктары:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Сактоо" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Баарын күйгүзүү" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Баарын өчүрүү" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "күйгүзүлгөн" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Баарын күйгүзүү" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "Дүйнөнү тандаңыз:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "Дүйнөнү инициалдаштыруу катасы" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -431,48 +458,52 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Буюм текстуралары..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Жүктөлүүдө..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Сервер жаратылууда...." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Клиент жаратылууда..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Дареги чечилүүдө..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Серверге туташтырылууда..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 #, fuzzy msgid "Item definitions..." msgstr "Буюм текстуралары..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Оюн өчүрүлүүдө..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -488,12 +519,8 @@ msgstr "Сиз өлдүңүз." msgid "Respawn" msgstr "Кайтадан жаралуу" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "Сол баскычы: Бардык буюмдарды ташуу, Оң баскычы: Бир буюмду ташуу" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Улантуу" @@ -509,99 +536,99 @@ msgstr "" msgid "Double tap \"jump\" to toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "баскычты басыңыз" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Алга" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Артка" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Солго" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Оңго" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Колдонуу" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Секирүү" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Уурданып басуу" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Ыргытуу" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Мүлк-шайман" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Маек" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Команда" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Консоль" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Учууга которуу" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Тез басууга которуу" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Эски сырсөз" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Жаңы сырсөз" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Сырсөздү аныктоо" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Өзгөртүү" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Сырсөздөр дал келген жок!" @@ -651,11 +678,11 @@ msgstr "" "- Чычкан дөңгөлөгү: буюмду тандоо\n" "- T: маек\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Үн көлөмү: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Чыгуу" @@ -947,75 +974,30 @@ msgstr "" msgid "Zoom" msgstr "Масштаб" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Башкы меню" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Дүйнө тандалган жок жана дареги киргизилген жок. Кылууга эч нерсе жок." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Оюнду табуу же жүктөө мүмкүн эмес \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Туташтыруу катасы (убактыңыз өтүп кеттиби?)" -#~ msgid "is required by:" -#~ msgstr "талап кылынганы:" - -#~ msgid "Configuration saved. " -#~ msgstr "Конфигурация сакталды. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Эскертүү: Туура эмес конфигурация. " - -#~ msgid "Multiplayer" -#~ msgstr "Көп кишилик" - -#~ msgid "Advanced" -#~ msgstr "Кошумча" - -#~ msgid "Show Public" -#~ msgstr "Жалпылыкты көрсөтүү" - -#~ msgid "Show Favorites" -#~ msgstr "Тандалмаларды көрсөтүү" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Жергиликтүү серверди жүргүзүү үчүн даректи бош калтырыңыз." - -#~ msgid "Create world" -#~ msgstr "Дүйнөнү жаратуу" - -#~ msgid "Address required." -#~ msgstr "Дареги талап кылынат." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Дүнөнү жаратуу мүмкүн эмес: Эч нерсе тандалган жок" - -#~ msgid "Files to be deleted" -#~ msgstr "Өчүрүлө турган файлдар" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Дүйнөнү жаратуу мүмкүн эмес: Оюндар табылган жок" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Дүйнөнү ырастоо мүмкүн эмес: Эч нерсе тандалган жок" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Бардык дүйнө файлдарын өчүрүү оңунан чыккан жок" - #~ msgid "" #~ "Default Controls:\n" #~ "- WASD: Walk\n" @@ -1040,3 +1022,55 @@ msgstr "Туташтыруу катасы (убактыңыз өтүп кетт #~ "- I: мүлк-шайман\n" #~ "- ESC: бул меню\n" #~ "- T: маек\n" + +#~ msgid "Failed to delete all world files" +#~ msgstr "Бардык дүйнө файлдарын өчүрүү оңунан чыккан жок" + +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Дүйнөнү ырастоо мүмкүн эмес: Эч нерсе тандалган жок" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Дүйнөнү жаратуу мүмкүн эмес: Оюндар табылган жок" + +#~ msgid "Files to be deleted" +#~ msgstr "Өчүрүлө турган файлдар" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Дүнөнү жаратуу мүмкүн эмес: Эч нерсе тандалган жок" + +#~ msgid "Address required." +#~ msgstr "Дареги талап кылынат." + +#~ msgid "Create world" +#~ msgstr "Дүйнөнү жаратуу" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Жергиликтүү серверди жүргүзүү үчүн даректи бош калтырыңыз." + +#~ msgid "Show Favorites" +#~ msgstr "Тандалмаларды көрсөтүү" + +#~ msgid "Show Public" +#~ msgstr "Жалпылыкты көрсөтүү" + +#~ msgid "Advanced" +#~ msgstr "Кошумча" + +#~ msgid "Multiplayer" +#~ msgstr "Көп кишилик" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Эскертүү: Туура эмес конфигурация. " + +#~ msgid "Configuration saved. " +#~ msgstr "Конфигурация сакталды. " + +#~ msgid "is required by:" +#~ msgstr "талап кылынганы:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "Сол баскычы: Бардык буюмдарды ташуу, Оң баскычы: Бир буюмду ташуу" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Ылдый" diff --git a/po/minetest.pot b/po/minetest.pot index f821542b6..dd8af86e0 100644 --- a/po/minetest.pot +++ b/po/minetest.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,12 +21,12 @@ msgstr "" msgid "Game Name" msgstr "" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "" @@ -38,35 +38,35 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -74,223 +74,231 @@ msgstr "" msgid "World name" msgstr "" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -299,105 +307,125 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -msgid "Download" +msgid "Local install" msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -413,47 +441,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -467,12 +499,8 @@ msgstr "" msgid "Respawn" msgstr "" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "" @@ -488,99 +516,99 @@ msgstr "" msgid "Double tap \"jump\" to toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "" @@ -619,11 +647,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "" @@ -915,26 +943,26 @@ msgstr "" msgid "Zoom" msgstr "" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "" diff --git a/po/nb/minetest.po b/po/nb/minetest.po index 12aba5c00..171e76958 100644 --- a/po/nb/minetest.po +++ b/po/nb/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-06-21 15:48+0200\n" "Last-Translator: sfan5 \n" "Language-Team: LANGUAGE \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Spill" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Opprett" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Avbryt" @@ -40,36 +40,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Spill" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -77,223 +77,231 @@ msgstr "" msgid "World name" msgstr "Navnet på verdenen" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Spill" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Ja" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nei" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -302,111 +310,131 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -msgid "Download" +msgid "Local install" msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "Avhenger av:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Navnet på verdenen" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Spill" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "Avhenger av:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Lagre" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Aktiver Alle" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Deaktiver Alle" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "aktivert" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Aktiver Alle" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -422,47 +450,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "" -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "" -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "" -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "" -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "" -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "" -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -476,12 +508,8 @@ msgstr "Du døde." msgid "Respawn" msgstr "" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "" @@ -497,99 +525,99 @@ msgstr "" msgid "Double tap \"jump\" to toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "" @@ -628,11 +656,11 @@ msgid "" "- T: chat\n" msgstr "" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "" -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "" @@ -924,35 +952,36 @@ msgstr "" msgid "Zoom" msgstr "" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "" -#~ msgid "is required by:" -#~ msgstr "trengs av:" - -#~ msgid "Configuration saved. " -#~ msgstr "Konfigurasjon lagret. " +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Advarsel: Noen modifikasjoner er ikke konfigurert enda. \n" +#~ "De vil bli aktivert som standard når du lagrer konfigurasjonen." #~ msgid "" #~ "Warning: Some configured mods are missing.\n" @@ -961,9 +990,8 @@ msgstr "" #~ "Advarsel: Noen konfigurerte modifikasjoner mangler. \n" #~ "Instillingene deres vil bli fjernet når du lagrer konfigurasjonen." -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "Advarsel: Noen modifikasjoner er ikke konfigurert enda. \n" -#~ "De vil bli aktivert som standard når du lagrer konfigurasjonen." +#~ msgid "Configuration saved. " +#~ msgstr "Konfigurasjon lagret. " + +#~ msgid "is required by:" +#~ msgstr "trengs av:" diff --git a/po/nl/minetest.po b/po/nl/minetest.po index bc10d4a7c..173600a57 100644 --- a/po/nl/minetest.po +++ b/po/nl/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-09-11 16:25+0200\n" "Last-Translator: Rutger NL \n" "Language-Team: \n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Spel" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Maak aan" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Annuleer" @@ -39,35 +39,35 @@ msgstr "Gamemgr: Kan mod \"$1\" niet naar spel \"$2\" kopiëren" msgid "GAMES" msgstr "SPELLEN" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Spellen" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Mods:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "spel aanpassen" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "nieuw spel" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "SPEL AANPASSEN" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Geselecteerde mod verwijderen" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Mod toevoegen" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -75,223 +75,231 @@ msgstr "Ok" msgid "World name" msgstr "Naam wereld" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Kaartgenerator" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Spel" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Verwijder wereld \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Ja" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nee" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Wereld \"$1\" bestaat al" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Geen wereldnaam opgegeven of geen spel geselecteerd" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Singleplayer" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Client" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Server" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Instellingen" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Texturen" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Mods" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Credits" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENT" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Favorieten:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "IP-Adres/Poort" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Naam/Wachtwoord" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Publieke Serverlijst" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Verwijderen" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Verbinden" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nieuw" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Instellingen" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Start Server" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Selecteer Wereld:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "START SERVER" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Creatieve Modus" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Schade inschakelen" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Publiek" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Naam" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Wachtwoord" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Serverpoort" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "INSTELLINGEN" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Mooie bomen" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Mooie verlichting" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D wolken" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Ondoorzichtig water" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-Mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Anisotrope Filtering" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Bi-Lineaire Filtering" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Tri-Lineare Filtering" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shaders" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Voorwerpen vooraf laden" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Deeltjes aanzetten" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Eindige vloeistoffen" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Toetsen" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Speel" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "SINGLEPLAYER" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Selecteer textuurverzameling:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "TEXTUREN" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Geen informatie aanwezig" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Hoofdontwikkelaars" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Actieve bijdragers" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Vroegere bijdragers" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Singleplayer" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Client" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Server" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Instellingen" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Texturen" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Mods" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Credits" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODS" @@ -300,75 +308,100 @@ msgstr "MODS" msgid "Installed Mods:" msgstr "Geïnstalleerde Mods:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Installeren" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Mod toevoegen" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Downloaden" +#, fuzzy +msgid "Local install" +msgstr "Installeren" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Geen informatie aanwezig" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Geen informatie aanwezig" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Hernoemen" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Afhankelijkheden:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Geselecteerde mod verwijderen" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Modverzameling hernoemen:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Accepteren" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Wereld:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Geen std" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Verberg mp mods" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Afhankelijkheden:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Bewaar" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "MP inschakelen" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "MP uitschakelen" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "ingeschakeld" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Alles aan" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Selecteer Modbestand:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Mod installeren: bestand: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -376,31 +409,31 @@ msgstr "" "\n" "Mod installeren: niet ondersteund bestandstype \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Installeren van $1 in $2 is mislukt" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "Mod installeren: kan geen geschikte map vinden voor modverzameling $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Mod installeren: kan geen echte modnaam vinden voor: $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: kan \"$1\" niet verwijderen" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: onjuist pad \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Weet je zeker dat je \"$1\" wilt verwijderen?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Natuurlijk niet!" @@ -416,47 +449,51 @@ msgstr "Rang" msgid "re-Install" msgstr "opnieuw installeren" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Installeren" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Voorwerp texturen..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Bezig met laden..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Bezig server te maken..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Bezig client te maken..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "IP-adres opzoeken..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Verbinding met de server maken..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Voorwerpdefinities..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Node definities..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Media..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Stopzetten..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -472,13 +509,8 @@ msgstr "Je bent gestorven." msgid "Respawn" msgstr "Herspawnen" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Linkermuisknop: Verplaats alle items. Rechtermuisknop: Verplaats één item" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Doorgaan" @@ -496,99 +528,99 @@ msgstr "\"Gebruiken\" = Omlaag" msgid "Double tap \"jump\" to toggle fly" msgstr "2x \"springen\" om te vliegen" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Toets is al in gebruik" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "druk op" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Vooruit" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Achteruit" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Links" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Rechts" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Gebruiken" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Springen" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Kruipen" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Weggooien" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Rugzak" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Chatten" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Opdracht" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Console" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Vliegen aan/uit" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Snel bewegen aan/uit" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Noclip aan/uit" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Range instellen" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Print stacks" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Huidig wachtwoord" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nieuw wachtwoord" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Herhaal wachtwoord" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Veranderen" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Wachtwoorden zijn niet gelijk!" @@ -638,11 +670,11 @@ msgstr "" "- Muiswiel: selecteer\n" "- T: chat\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Volume: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Terug" @@ -934,77 +966,44 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "needs_fallback_font" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Hoofdmenu" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Geen wereld en adres geselecteerd. Niks te doen." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Kan niet de game laden of vinden \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Onjuiste gamespec." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Fout bij verbinden (time out?)" -#~ msgid "is required by:" -#~ msgstr "is benodigd voor:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Let op: Nog niet alle mods zijn geconfigueerd. \n" +#~ "De mods zullen automatisch worden ingeschakeld als je de configuratie " +#~ "bewaard. " -#~ msgid "Configuration saved. " -#~ msgstr "Instellingen bewaard. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Waarschuwing: Instellingen niet consistent. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Kan geen nieuwe wereld aanmaken: de naam bevat onjuiste tekens" - -#~ msgid "Multiplayer" -#~ msgstr "Multiplayer" - -#~ msgid "Advanced" -#~ msgstr "Geavanceerd" - -#~ msgid "Show Public" -#~ msgstr "Publieke server" - -#~ msgid "Show Favorites" -#~ msgstr "Favourieten" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Laat het adres leeg om een lokale server te starten." - -#~ msgid "Create world" -#~ msgstr "Maak wereld aan" - -#~ msgid "Address required." -#~ msgstr "IP-adres nodig." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Kan niets verwijderen: Geen wereld geselecteerd" - -#~ msgid "Files to be deleted" -#~ msgstr "Deze bestanden worden verwijderd" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Kan geen wereld aanmaken: Geen games gevonden" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Kan instellingen niet aanpassen: Niets geselecteerd" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Niet alle bestanden zijn verwijderd" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "LEt op: Sommige ingestelde mods zijn vermist.\n" +#~ "Hun instellingen worden verwijderd als je de configuratie opslaat. " #~ msgid "" #~ "Default Controls:\n" @@ -1031,17 +1030,57 @@ msgstr "Fout bij verbinden (time out?)" #~ "- ESC: Menu\n" #~ "- T: Chat\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "LEt op: Sommige ingestelde mods zijn vermist.\n" -#~ "Hun instellingen worden verwijderd als je de configuratie opslaat. " +#~ msgid "Failed to delete all world files" +#~ msgstr "Niet alle bestanden zijn verwijderd" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Kan instellingen niet aanpassen: Niets geselecteerd" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Kan geen wereld aanmaken: Geen games gevonden" + +#~ msgid "Files to be deleted" +#~ msgstr "Deze bestanden worden verwijderd" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Kan niets verwijderen: Geen wereld geselecteerd" + +#~ msgid "Address required." +#~ msgstr "IP-adres nodig." + +#~ msgid "Create world" +#~ msgstr "Maak wereld aan" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Laat het adres leeg om een lokale server te starten." + +#~ msgid "Show Favorites" +#~ msgstr "Favourieten" + +#~ msgid "Show Public" +#~ msgstr "Publieke server" + +#~ msgid "Advanced" +#~ msgstr "Geavanceerd" + +#~ msgid "Multiplayer" +#~ msgstr "Multiplayer" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Kan geen nieuwe wereld aanmaken: de naam bevat onjuiste tekens" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Waarschuwing: Instellingen niet consistent. " + +#~ msgid "Configuration saved. " +#~ msgstr "Instellingen bewaard. " + +#~ msgid "is required by:" +#~ msgstr "is benodigd voor:" + +#~ msgid "Left click: Move all items, Right click: Move single item" #~ msgstr "" -#~ "Let op: Nog niet alle mods zijn geconfigueerd. \n" -#~ "De mods zullen automatisch worden ingeschakeld als je de configuratie " -#~ "bewaard. " +#~ "Linkermuisknop: Verplaats alle items. Rechtermuisknop: Verplaats één item" + +#~ msgid "Download" +#~ msgstr "Downloaden" diff --git a/po/pl/minetest.po b/po/pl/minetest.po index 95df51aef..760e914e1 100644 --- a/po/pl/minetest.po +++ b/po/pl/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-10-08 21:22+0200\n" "Last-Translator: Maciej Kasatkin \n" "Language-Team: Polish <>\n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Nazwa Gry" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Utwórz" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Anuluj" @@ -40,35 +40,35 @@ msgstr "Gamemgr: Kopiowanie moda \"$1\" do gry \"$2\" nie powiodło się" msgid "GAMES" msgstr "GRY" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Gry" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Mody:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "edytuj grę" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "nowa gra" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "EDYTUJ GRĘ" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Usuń zaznaczony mod" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<--Dodaj mod" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "OK" @@ -76,223 +76,231 @@ msgstr "OK" msgid "World name" msgstr "Nazwa świata" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Generator mapy" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Gra" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Usunąć świat \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Tak" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nie" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Istnieje już świat o nazwie \"$1\"" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Nie podano nazwy świata lub nie wybrano gry" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Pojedynczy gracz" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Klient" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Serwer" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Ustawienia" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Paczki tekstur" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Mody" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Autorzy" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "KLIENT" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Ulubione:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Adres/Port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nazwa gracza/Hasło" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Lista publicznych serwerów" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Usuń" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Połącz" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nowy" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Ustaw" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Rozpocznij grę/Połącz" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Wybierz świat:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "URUCHOM SERWER" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Tryb kreatywny" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Włącz obrażenia" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Publiczne" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Nazwa" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Hasło" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Port Serwera" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "USTAWIENIA" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Ozdobne drzewa" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Płynne oświetlenie" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Chmury 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Nieprzeźroczysta woda" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-Mappowanie" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtrowanie anizotropowe" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtrowanie dwuliniowe" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtrowanie trójliniowe" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Shadery" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Ładuj obrazy przedmiotów" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Włącz cząstki" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Realistyczne ciecze" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Zmień klawisze" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Graj" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "TRYB JEDNOOSOBOWY" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Wybierz paczkę tekstur:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "PACZKI TEKSTUR" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Brak informacjii" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Twórcy" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Aktywni współautorzy" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Byli współautorzy" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Pojedynczy gracz" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Klient" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Serwer" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Ustawienia" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Paczki tekstur" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Mody" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Autorzy" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODY" @@ -301,77 +309,102 @@ msgstr "MODY" msgid "Installed Mods:" msgstr "Zainstalowane Mody:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Instaluj" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<--Dodaj mod" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Ściągnij" +#, fuzzy +msgid "Local install" +msgstr "Instaluj" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Brak informacjii" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Brak informacjii" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Zmień nazwę" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Zależy od:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Usuń zaznaczony mod" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Zmień nazwe Paczki Modów:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Accept" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Świat:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Ukryj Grę" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Zależy od:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Zapisz" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Włącz wszystkie" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Wyłącz wszystkie" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "włączone" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Włącz wszystkie" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Wybierz plik moda:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Zainstaluj mod: plik: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -379,32 +412,32 @@ msgstr "" "\n" "Instalacja moda: nieznany typ pliku \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Instalacja $1 do $2 nie powiodła się" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" "Instalacja moda: nie można znaleźć odpowiedniego folderu dla paczki modów $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Instalacja moda: nie można znaleźć nazwy moda $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: nie można usunąć \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: nieprawidłowy katalog \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Na pewno usunąć \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Oczywiście, że nie!" @@ -420,47 +453,51 @@ msgstr "Ocena" msgid "re-Install" msgstr "Ponowna instalacja" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Instaluj" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Tekstury przedmiotów..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Ładowanie..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Tworzenie serwera...." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Tworzenie klienta..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Sprawdzanie adresu..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Łączenie z serwerem..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Definicje przedmiotów..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Definicje nod..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Media..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Wyłączanie..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -476,14 +513,8 @@ msgstr "Zginąłeś." msgid "Respawn" msgstr "Wróć do gry" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Lewy przycisk myszy: przenieś wszystkie przedmioty, Prawy przycisk myszy: " -"przenieś pojedynczy przedmiot" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Kontynuuj" @@ -501,99 +532,99 @@ msgstr "\"Użyj\" = wspinaj się" msgid "Double tap \"jump\" to toggle fly" msgstr "Wciśnij dwukrotnie \"Skok\" by włączyć tryb latania" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Klawisz już zdefiniowany" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "naciśnij klawisz" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Przód" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Tył" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Lewo" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Prawo" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Użyj" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Skok" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Skradanie" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Upuść" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Ekwipunek" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Czat" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Komenda" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Konsola" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Przełącz tryb latania" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Przełącz tryb szybki" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Przełącz tryb noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Zasięg widzenia" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Drukuj stosy" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Stare hasło" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nowe hasło" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Potwierdź hasło" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Zmień" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Hasła nie są jednakowe!" @@ -643,11 +674,11 @@ msgstr "" "- Rolka myszy: wybór przedmiotu↵\n" "- T: chat\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Głośność: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Wyjście" @@ -939,77 +970,43 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menu główne" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Nie wybrano świata ani adresu." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Nie można znaleźć lub wczytać trybu gry \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Nieprawidłowa specyfikacja trybu gry." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Błąd połączenia (brak odpowiedzi?)" -#~ msgid "is required by:" -#~ msgstr "wymagane przez:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Uwaga: Niektóre z modyfikacji nie zostały jeszcze skonfigurowane.\n" +#~ "Zostaną domyślnie włączone gdy zapiszesz konfigurację. " -#~ msgid "Configuration saved. " -#~ msgstr "Konfiguracja zapisana. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Ostrzeżenie: Plik konfiguracyjny niespójny. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Nie można stworzyć świata: Nazwa zawiera niedozwolone znaki" - -#~ msgid "Multiplayer" -#~ msgstr "Gra wieloosobowa" - -#~ msgid "Advanced" -#~ msgstr "Zaawansowane" - -#~ msgid "Show Public" -#~ msgstr "Pokaż publiczne" - -#~ msgid "Show Favorites" -#~ msgstr "Pokaż ulubione" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Pozostaw pole adresu puste, by uruchomić serwer lokalny." - -#~ msgid "Create world" -#~ msgstr "Stwórz świat" - -#~ msgid "Address required." -#~ msgstr "Wymagany adres." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Nie można skasować świata: nic nie zaznaczono" - -#~ msgid "Files to be deleted" -#~ msgstr "Pliki do skasowania" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Nie można utworzyć świata: Nie znaleziono żadnego trybu gry" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Nie można skonfigurować świata: Nic nie zaznaczono" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Nie udało się skasować wszystkich plików świata" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Ostrzeżenie: Niektóre z modyfikacji nie zostały znalezione.\n" +#~ "Ich ustawienia zostaną usunięte gdy zapiszesz konfigurację. " #~ msgid "" #~ "Default Controls:\n" @@ -1036,16 +1033,58 @@ msgstr "Błąd połączenia (brak odpowiedzi?)" #~ "- ESC: to menu\n" #~ "- T: czat\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Ostrzeżenie: Niektóre z modyfikacji nie zostały znalezione.\n" -#~ "Ich ustawienia zostaną usunięte gdy zapiszesz konfigurację. " +#~ msgid "Failed to delete all world files" +#~ msgstr "Nie udało się skasować wszystkich plików świata" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Nie można skonfigurować świata: Nic nie zaznaczono" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Nie można utworzyć świata: Nie znaleziono żadnego trybu gry" + +#~ msgid "Files to be deleted" +#~ msgstr "Pliki do skasowania" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Nie można skasować świata: nic nie zaznaczono" + +#~ msgid "Address required." +#~ msgstr "Wymagany adres." + +#~ msgid "Create world" +#~ msgstr "Stwórz świat" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Pozostaw pole adresu puste, by uruchomić serwer lokalny." + +#~ msgid "Show Favorites" +#~ msgstr "Pokaż ulubione" + +#~ msgid "Show Public" +#~ msgstr "Pokaż publiczne" + +#~ msgid "Advanced" +#~ msgstr "Zaawansowane" + +#~ msgid "Multiplayer" +#~ msgstr "Gra wieloosobowa" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Nie można stworzyć świata: Nazwa zawiera niedozwolone znaki" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Ostrzeżenie: Plik konfiguracyjny niespójny. " + +#~ msgid "Configuration saved. " +#~ msgstr "Konfiguracja zapisana. " + +#~ msgid "is required by:" +#~ msgstr "wymagane przez:" + +#~ msgid "Left click: Move all items, Right click: Move single item" #~ msgstr "" -#~ "Uwaga: Niektóre z modyfikacji nie zostały jeszcze skonfigurowane.\n" -#~ "Zostaną domyślnie włączone gdy zapiszesz konfigurację. " +#~ "Lewy przycisk myszy: przenieś wszystkie przedmioty, Prawy przycisk myszy: " +#~ "przenieś pojedynczy przedmiot" + +#~ msgid "Download" +#~ msgstr "Ściągnij" diff --git a/po/pt/minetest.po b/po/pt/minetest.po index 5c29c2ada..fc39f2545 100644 --- a/po/pt/minetest.po +++ b/po/pt/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-09-05 12:47+0200\n" "Last-Translator: Leonardo Costa \n" "Language-Team: LANGUAGE \n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Nome do Jogo" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Criar" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Cancelar" @@ -40,35 +40,35 @@ msgstr "" msgid "GAMES" msgstr "JOGOS" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Jogos" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Extras:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "editar jogo" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "novo jogo" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "EDITAR JOGO" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Remover extra selecionado" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Adicionar extra" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -76,223 +76,231 @@ msgstr "Ok" msgid "World name" msgstr "Nome do Mundo" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Geração de Mapa" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Jogo" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Eliminar Mundo \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Sim" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Não" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "O mundo com o nome \"$1\" já existe" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Mundo sem nome ou nenhum jogo selecionado" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Um Jogador" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Cliente" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Servidor" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Definições" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Pacotes de Texturas" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Extras" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Créditos" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENTE" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Favoritos:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Endereço/Porta" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nome/Senha" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Lista de Servidores Públicos" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Eliminar" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Ligar" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Novo" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Configurar" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Jogar" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Seleccionar Mundo:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "INICIAR SERVIDOR" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Modo Criativo" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Ativar Dano" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Público" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Nome" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Senha" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Porta" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "DEFINIÇÕES" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Árvores Melhoradas" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Iluminação Suave" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Nuvens 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Água Opaca" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-Mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtro Anisotrópico" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtro Bi-Linear" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtro Tri-Linear" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Sombras" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Pré-carregamento dos itens" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Ativar Partículas" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Líquido Finito" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Mudar teclas" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Jogar" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "Um Jogador" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Selecione um pacote de texturas:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "PACOTES DE TEXTURAS" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Sem informação" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Desenvolvedores Chave" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Contribuintes Ativos" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Antigos Contribuintes" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Um Jogador" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Cliente" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Servidor" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Definições" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Pacotes de Texturas" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Extras" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Créditos" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "EXTRAS" @@ -301,78 +309,103 @@ msgstr "EXTRAS" msgid "Installed Mods:" msgstr "Extras Instalados:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Instalar" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Adicionar extra" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Descarregar" +#, fuzzy +msgid "Local install" +msgstr "Instalar" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Sem informação" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Sem informação" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Renomear" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Depende de:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Remover extra selecionado" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Renomear Pacote de Extras:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Aceitar" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Mundo:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Esconder Jogo" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Extra:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Depende de:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Guardar" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Ativar Tudo" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Desativar Tudo" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "ativo" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Ativar Tudo" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Seleccionar ficheiro de Extra:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Instalar Extra: ficheiro: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -380,31 +413,31 @@ msgstr "" "\n" "Instalar Extra: tipo de ficheiro desconhecido \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Falha ao instalar de $1 ao $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Mensagem de Extra: falhou a eliminação de \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Mensagem de extra: caminho inválido \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Tem a certeza que pertende eliminar \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Não, é claro que não!" @@ -420,47 +453,51 @@ msgstr "Classificação" msgid "re-Install" msgstr "re-Instalar" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Instalar" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Texturas dos items..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "A carregar..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "A criar servidor..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "A criar cliente..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "A resolver endereço..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "A conectar ao servidor..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Definições dos Itens..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Dados..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "A desligar..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -476,12 +513,8 @@ msgstr "Morreste." msgid "Respawn" msgstr "Reaparecer" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "Botão esq: Mover todos os itens Botão dir: Mover um item" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Continuar" @@ -497,99 +530,99 @@ msgstr "\"Use\" = descer" msgid "Double tap \"jump\" to toggle fly" msgstr "Carregue duas vezes em \"saltar\" para ativar o vôo" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Tecla já em uso" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "pressione a tecla" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Avançar" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Recuar" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Esquerda" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Direita" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Usar" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Saltar" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Agachar" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Largar" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventário" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Conversa" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Comando" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Consola" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Ativar/Desativar vôo" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Ativar/Desativar correr" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Ativar/Desativar noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Seleccionar Distância" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Imprimir stacks" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Senha antiga" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Senha Nova" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Confirmar Senha" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Mudar" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Senhas não correspondem!" @@ -639,11 +672,11 @@ msgstr "" "- Roda do rato: seleccionar item\n" "- T: conversação\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Volume do som: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Sair" @@ -935,78 +968,44 @@ msgstr "PAL" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menu Principal" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" "Nenhum mundo seleccionado e nenhum endereço providenciado. Nada para fazer." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Não foi possível encontrar ou carregar jogo \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "gamespec inválido." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Erro de conexão (excedeu tempo?)" -#~ msgid "is required by:" -#~ msgstr "é necessário pelo:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Atenção: Alguns mods ainda não estão configurados.\n" +#~ "Eles vão ser ativados por predefinição quando guardar a configuração. " -#~ msgid "Configuration saved. " -#~ msgstr "Configuração gravada. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Atenção: Configuração não compatível. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Não foi possível criar mundo: Nome com caracteres inválidos" - -#~ msgid "Multiplayer" -#~ msgstr "Vários jogadores" - -#~ msgid "Advanced" -#~ msgstr "Avançado" - -#~ msgid "Show Public" -#~ msgstr "Mostrar Públicos" - -#~ msgid "Show Favorites" -#~ msgstr "Mostrar Favoritos" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Deixe endereço em branco para iniciar servidor local." - -#~ msgid "Create world" -#~ msgstr "Criar mundo" - -#~ msgid "Address required." -#~ msgstr "Endereço necessário." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Não foi possível eliminar mundo: Nada seleccionado" - -#~ msgid "Files to be deleted" -#~ msgstr "Ficheiros para eliminar" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Não foi possível criar mundo: Não foram detectados jogos" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Não foi possível configurar mundo: Nada seleccionado" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Falhou a remoção de todos os ficheiros dos mundos" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Atenção: Alguns mods configurados estão em falta.\n" +#~ "As suas definições vão ser removidas quando gravar a configuração. " #~ msgid "" #~ "Default Controls:\n" @@ -1033,16 +1032,56 @@ msgstr "Erro de conexão (excedeu tempo?)" #~ "- ESC: Este menu\n" #~ "- T: Chat\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Atenção: Alguns mods configurados estão em falta.\n" -#~ "As suas definições vão ser removidas quando gravar a configuração. " +#~ msgid "Failed to delete all world files" +#~ msgstr "Falhou a remoção de todos os ficheiros dos mundos" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "Atenção: Alguns mods ainda não estão configurados.\n" -#~ "Eles vão ser ativados por predefinição quando guardar a configuração. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Não foi possível configurar mundo: Nada seleccionado" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Não foi possível criar mundo: Não foram detectados jogos" + +#~ msgid "Files to be deleted" +#~ msgstr "Ficheiros para eliminar" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Não foi possível eliminar mundo: Nada seleccionado" + +#~ msgid "Address required." +#~ msgstr "Endereço necessário." + +#~ msgid "Create world" +#~ msgstr "Criar mundo" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Deixe endereço em branco para iniciar servidor local." + +#~ msgid "Show Favorites" +#~ msgstr "Mostrar Favoritos" + +#~ msgid "Show Public" +#~ msgstr "Mostrar Públicos" + +#~ msgid "Advanced" +#~ msgstr "Avançado" + +#~ msgid "Multiplayer" +#~ msgstr "Vários jogadores" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Não foi possível criar mundo: Nome com caracteres inválidos" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Atenção: Configuração não compatível. " + +#~ msgid "Configuration saved. " +#~ msgstr "Configuração gravada. " + +#~ msgid "is required by:" +#~ msgstr "é necessário pelo:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "Botão esq: Mover todos os itens Botão dir: Mover um item" + +#~ msgid "Download" +#~ msgstr "Descarregar" diff --git a/po/pt_BR/minetest.po b/po/pt_BR/minetest.po index 1aa8ff2e1..f25ee852f 100644 --- a/po/pt_BR/minetest.po +++ b/po/pt_BR/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-09-17 15:15+0200\n" "Last-Translator: Frederico Guimarães \n" "Language-Team: LANGUAGE \n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "Nome do jogo" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Criar" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Cancelar" @@ -39,35 +39,35 @@ msgstr "Gamemgr: Não foi possível copiar o mod \"$1\" para o jogo \"$2\"" msgid "GAMES" msgstr "JOGOS" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Jogos" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Módulos:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "editar o jogo" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "novo jogo" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "EDITAR JOGO" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Remover o módulo selecionado" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Adicionar módulo" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -75,225 +75,232 @@ msgstr "Ok" msgid "World name" msgstr "Nome do mundo" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Mapgen" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Jogo" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Excluir o mundo \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Sim" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Não" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Já existe um mundo com o nome \"$1\"" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -"Não foi fornecido nenhum nome para o mundo ou não foi selecionado nenhum " -"jogo" +"Não foi fornecido nenhum nome para o mundo ou não foi selecionado nenhum jogo" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Um jogador" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Cliente" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Servidor" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Configurações" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Texturas" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Módulos" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Créditos" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENTE" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Favoritos:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Endereço/Porta" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nome/Senha" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Servidores públicos" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Excluir" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Conectar" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Novo" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Configurar" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Iniciar o jogo" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Selecione um mundo:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "SERVIDOR" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Modo criativo" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Habilitar dano" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Público" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Nome" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Senha" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Porta do servidor" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "CONFIGURAÇÕES" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Árvores melhores" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Iluminação suave" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Nuvens 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Água opaca" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mipmapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtragem anisotrópica" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtragem bi-linear" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtragem tri-linear" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Sombreadores" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Precarga de elementos visuais" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Habilitar partículas" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Líquido finito" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Mudar teclas" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Jogar" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "UM JOGADOR" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Selecione o pacote de texturas:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "TEXTURAS" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Nenhuma informação disponível" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Desenvolvedores principais" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Colaboradores ativos" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Colaboradores anteriores" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Um jogador" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Cliente" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Servidor" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Configurações" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Texturas" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Módulos" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Créditos" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MÓDULOS" @@ -302,75 +309,100 @@ msgstr "MÓDULOS" msgid "Installed Mods:" msgstr "Módulos instalados:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Instalar" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Adicionar módulo" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Baixar" +#, fuzzy +msgid "Local install" +msgstr "Instalar" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Nenhuma informação disponível" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Nenhuma informação disponível" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Renomear" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Depende de:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Remover o módulo selecionado" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Renomear pacote de módulos:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Aceitar" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Mundo:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Ocultar jogos" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Ocultar conteúdo PMs" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Depende de:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Salvar" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "Habilitar PMs" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "Desabilitar PMs" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "habilitado" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Habilitar todos" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Selecione o arquivo do módulo:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Instalação de módulo: arquivo: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -378,34 +410,34 @@ msgstr "" "\n" "Instalação de módulo: o tipo de arquivo \"$1\" não é suportado" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Não foi possível instalar $1 em $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" "Instalação de módulo: não foi possível encontrar o nome adequado da pasta " "para o pacote de módulos $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" "Instalação de módulo: não foi possível encontrar o nome real do módulo: $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: não foi possível excluir \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: caminho inválido do módulo \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Tem certeza que deseja excluir \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Claro que não!" @@ -421,47 +453,51 @@ msgstr "Classificação" msgid "re-Install" msgstr "reinstalar" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Instalar" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Texturas dos itens..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Carregando..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Criando o servidor..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Criando o cliente..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Resolvendo os endereços..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Conectando ao servidor..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Definições dos itens..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Definições dos nós..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Mídia..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Desligando tudo..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -477,20 +513,16 @@ msgstr "Você morreu." msgid "Respawn" msgstr "Reviver" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "Botão esquerdo: Move todos os itens. Botão direito: Move um item" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Continuar" #: src/guiKeyChangeMenu.cpp:121 msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" msgstr "" -"Teclas (se este menu estiver com problema, remova itens do arquivo " -"minetest.conf)" +"Teclas (se este menu estiver com problema, remova itens do arquivo minetest." +"conf)" #: src/guiKeyChangeMenu.cpp:161 msgid "\"Use\" = climb down" @@ -500,99 +532,99 @@ msgstr "\"Usar\" = descer" msgid "Double tap \"jump\" to toggle fly" msgstr "\"Pular\" duas vezes ativa o voo" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Essa tecla já está em uso" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "press. uma tecla" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Avançar" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Voltar" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Esquerda" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Direita" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Usar" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Pular" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Esgueirar" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Soltar" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventário" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Bate-papo" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Comando" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Console" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Alternar voo" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Alternar corrida" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Alternar noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Sel. distância" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Impr. pilha (log)" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Senha antiga" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Nova senha" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Confirmar a senha" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Alterar" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "As senhas não correspondem!" @@ -642,11 +674,11 @@ msgstr "" "- Roda: selecionar item\n" "- T: bate-papo\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Volume do som: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Sair" @@ -938,79 +970,45 @@ msgstr "PA1" msgid "Zoom" msgstr "Zoom" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "needs_fallback_font" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Menu principal" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "" "Nenhum mundo foi selecionado e nenhum endereço fornecido. Não existe nada a " "ser feito." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Não foi possível localizar ou carregar jogo \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Especificação do jogo inválida." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Erro de conexão (tempo excedido?)" -#~ msgid "is required by:" -#~ msgstr "é necessário para:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Atenção: Alguns mods ainda não foram configurados.\n" +#~ "E eles serão ativados por padrão, quando você salvar a configuração." -#~ msgid "Configuration saved. " -#~ msgstr "A configuração foi salva. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Atenção: A configuração não está consistente." - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Não foi possível criar o mundo: O nome contém caracteres inválidos" - -#~ msgid "Multiplayer" -#~ msgstr "Vários jogadores" - -#~ msgid "Advanced" -#~ msgstr "Avançado" - -#~ msgid "Show Public" -#~ msgstr "Exibir públicos" - -#~ msgid "Show Favorites" -#~ msgstr "Exibir favoritos" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Deixe o endereço em branco para iniciar um servidor local." - -#~ msgid "Create world" -#~ msgstr "Criar o mundo" - -#~ msgid "Address required." -#~ msgstr "É necessário um endereço." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Não foi possível excluir o mundo: Nenhum foi selecionado" - -#~ msgid "Files to be deleted" -#~ msgstr "Arquivos a serem excluídos" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Não foi possivel criar o mundo: Não foi encontrado nenhum jogo" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Não foi possível configurar o mundo: Nada foi selecionado" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Não foi possível excluir todos os arquivos do mundo" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Atenção: Alguns mods configurados não foram encontrados.\n" +#~ "Suas definições serão removidas quando você salvar a configuração." #~ msgid "" #~ "Default Controls:\n" @@ -1037,16 +1035,56 @@ msgstr "Erro de conexão (tempo excedido?)" #~ "- ESC: este menu\n" #~ "- T: bate-papo\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Atenção: Alguns mods configurados não foram encontrados.\n" -#~ "Suas definições serão removidas quando você salvar a configuração." +#~ msgid "Failed to delete all world files" +#~ msgstr "Não foi possível excluir todos os arquivos do mundo" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "Atenção: Alguns mods ainda não foram configurados.\n" -#~ "E eles serão ativados por padrão, quando você salvar a configuração." +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Não foi possível configurar o mundo: Nada foi selecionado" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Não foi possivel criar o mundo: Não foi encontrado nenhum jogo" + +#~ msgid "Files to be deleted" +#~ msgstr "Arquivos a serem excluídos" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Não foi possível excluir o mundo: Nenhum foi selecionado" + +#~ msgid "Address required." +#~ msgstr "É necessário um endereço." + +#~ msgid "Create world" +#~ msgstr "Criar o mundo" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Deixe o endereço em branco para iniciar um servidor local." + +#~ msgid "Show Favorites" +#~ msgstr "Exibir favoritos" + +#~ msgid "Show Public" +#~ msgstr "Exibir públicos" + +#~ msgid "Advanced" +#~ msgstr "Avançado" + +#~ msgid "Multiplayer" +#~ msgstr "Vários jogadores" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Não foi possível criar o mundo: O nome contém caracteres inválidos" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Atenção: A configuração não está consistente." + +#~ msgid "Configuration saved. " +#~ msgstr "A configuração foi salva. " + +#~ msgid "is required by:" +#~ msgstr "é necessário para:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "Botão esquerdo: Move todos os itens. Botão direito: Move um item" + +#~ msgid "Download" +#~ msgstr "Baixar" diff --git a/po/ro/minetest.po b/po/ro/minetest.po index eeedcdd48..1dc22e583 100644 --- a/po/ro/minetest.po +++ b/po/ro/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-11-16 20:43+0200\n" "Last-Translator: King Artur \n" "Language-Team: LANGUAGE \n" @@ -23,12 +23,12 @@ msgstr "" msgid "Game Name" msgstr "Numele jocului" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Creează" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Anulează" @@ -40,35 +40,35 @@ msgstr "Gamemgr: Nu se poate copia modul \"$1\" în jocul \"$2\"" msgid "GAMES" msgstr "JOCURI" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Jocuri" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Moduri:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "modifică jocul" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "joc nou" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "MODIFICĂ JOCUL" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Șterge modul selectat" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Adaugă modul" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -76,223 +76,231 @@ msgstr "Ok" msgid "World name" msgstr "Numele lumii" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Mapgen" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Joc" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Ștergi lumea \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Da" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Nu" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "O lume cu numele \"$1\" deja există" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Jocul nu are nume, sau nu ai selectat un joc" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Singleplayer" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Client" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Server" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Setări" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Pachete de tetură" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Moduri" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Credits" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "CLIENT" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Preferate:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Adresă/Port" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Nume/Parolă" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Listă de servere publică" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Șterge" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Conectează" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Nou" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Configurează" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Începe jocul" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Selectează lumea:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "DESCHIDE SERVERUL" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Modul Creativ" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Activează Daune" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Public" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Nume" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Parolă" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Port server" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "SETĂRI" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Copaci fantezici" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Lumină mai bună" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "Nori 3D" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Apă opacă" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip Mapping" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Filtru Anizotropic" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Filtrare Biliniară" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Filtrare Triliniară" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Umbră" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Pre-încarcă imaginile obiectelor" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Activează particulele" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Lichid finit" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Modifică tastele" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Joacă" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "SINGLE PLAYER" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Selectează pachetul de textură:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "PACHETE DE TEXTURĂ" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Nici o informație disponibilă" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Dezvoltatori de bază" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Contribuitori activi" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "Foști contribuitori" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Singleplayer" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Client" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Server" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Setări" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Pachete de tetură" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Moduri" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Credits" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODURI" @@ -301,75 +309,100 @@ msgstr "MODURI" msgid "Installed Mods:" msgstr "Moduri Instalate:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Instalează" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Adaugă modul" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Descarcă" +#, fuzzy +msgid "Local install" +msgstr "Instalează" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Nici o informație disponibilă" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Nici o informație disponibilă" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Redenumește" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Dependințe:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Șterge modul selectat" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Redenumește Pachetul de mod:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Acceptă" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Lume:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Ascunde Joc" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Ascunde conținutul mp" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Mod:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Dependințe:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Salvează" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "Activează MP" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "Dezactivează MP" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "activat" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Activează tot" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Selectează Fișierul Modului:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Instalare Mod: fișier: \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -377,33 +410,33 @@ msgstr "" "\n" "Instalare Mod: tip de fișier neacceptat \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Eșuare la instalarea $1 în $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" "Instalare Mod: nu se poate găsi nume de folder potrivit pentru pachetul de " "mod $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Instalare mod: nu se poate găsi numele real pentru: $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: Eroare la ștergerea \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: Pacht de mod invalid \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Ești sigur că vrei să ștergi \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Nu, sigur că nu!" @@ -419,47 +452,51 @@ msgstr "Notă" msgid "re-Install" msgstr "Reinstalează" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Instalează" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Texturi..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Se încarcă..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Se crează serverul..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Se creează clientul..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Se rezolvă adresa..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Se conectează la server..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Definițiile obiectelor..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Definițiile Blocurilor..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Media..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Se închide..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -475,13 +512,8 @@ msgstr "Ai murit." msgid "Respawn" msgstr "Reînviere" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Click stânga: Mută toate obiectele, Click dreapta: Mută un singur obiect" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Continuă" @@ -498,99 +530,99 @@ msgstr "\"Aleargă\" = coboară" msgid "Double tap \"jump\" to toggle fly" msgstr "Apasă de 2 ori \"sari\" pentru a zbura" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Tastă deja folosită" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "apasă o tastă" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Înainte" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Înapoi" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Stânga" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Dreapta" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Aleargă" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Sari" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Furișează" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Aruncă" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Inventar" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Chat" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Comandă" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Consloă" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Intră pe zbor" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Intră pe rapid" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Intră pe noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Selectare distanță" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Salvează logurile" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Vechea parolă" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Noua parolă" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Confirmarea parolei" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Schimbă" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Parolele nu se potrivesc!" @@ -640,11 +672,11 @@ msgstr "" "- Rotiță mouse: selectează obiect\n" "- T: chat\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Volum sunet: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Ieșire" @@ -936,26 +968,33 @@ msgstr "PA1" msgid "Zoom" msgstr "Mărire" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "lipsă_tip_font" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Meniul Principal" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Nici un cuvânt selectat și nici o adresă scrisă. Nimic de făcut." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Nu se poate găsi sau încărca jocul \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Specificare invalidă" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Eroare de conexiune (timeout?)" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "" +#~ "Click stânga: Mută toate obiectele, Click dreapta: Mută un singur obiect" + +#~ msgid "Download" +#~ msgstr "Descarcă" diff --git a/po/ru/minetest.po b/po/ru/minetest.po index cb6c8d7a2..7462c9d64 100644 --- a/po/ru/minetest.po +++ b/po/ru/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-11-22 11:45+0200\n" "Last-Translator: Anton Tsyganenko \n" "Language-Team: Russian\n" @@ -15,20 +15,20 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 1.7-dev\n" #: builtin/gamemgr.lua:23 msgid "Game Name" msgstr "Название" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Создать" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Отменить" @@ -40,35 +40,35 @@ msgstr "Gamemgr: Не могу скопировать мод \"$1\" в игру msgid "GAMES" msgstr "ИГРЫ" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "Игры" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "Моды:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "Редактировать" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "Создать игру" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "РЕДАКТИРОВАНИЕ" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "Удалить мод" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- Добавить мод" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "Ok" @@ -76,223 +76,231 @@ msgstr "Ok" msgid "World name" msgstr "Название мира" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "Генератор карты" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Игра" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "Удалить мир \"$1\"?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Да" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Нет" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "Мир под названием \"$1\" уже существует" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "Не задано имя мира или не выбрана игра" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Одиночная игра" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "Клиент" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "Сервер" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Настройки" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "Пакеты текстур" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "Моды" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Благодарности" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "КЛИЕНТ" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Избранное:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Адрес/Порт" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Имя/Пароль" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "Список публичных серверов" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Удалить" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Подключиться" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Новый" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Настроить" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "Начать игру" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Выберите мир:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "СЕРВЕР" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Режим создания" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Включить урон" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Публичные" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "Имя" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "Пароль" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "Порт" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "НАСТРОЙКИ" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Красивые деревья" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Мягкое освещение" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D облака" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "Непрозрачная вода" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "Mip-текстурирование" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Анизотропная фильтрация" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Билинейная фильтрация" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Трилинейная фильтрация" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Шейдеры" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Предзагрузка изображений" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Включить частицы" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "Конечные жидкости" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Смена управления" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Играть" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "ОДИНОЧНАЯ ИГРА" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "Выберите пакет текстур:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "ПАКЕТЫ ТЕКСТУР" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "Описание отсутствует" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "Основные разработчики" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "Активные контрибьюторы" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "В отставке" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Одиночная игра" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "Клиент" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "Сервер" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Настройки" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "Пакеты текстур" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "Моды" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Благодарности" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "МОДЫ" @@ -301,77 +309,102 @@ msgstr "МОДЫ" msgid "Installed Mods:" msgstr "Установленные моды:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "Установить" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- Добавить мод" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "Загрузить" +#, fuzzy +msgid "Local install" +msgstr "Установить" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "Описание отсутствует" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "Описание отсутствует" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "Переименовать" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "Зависит от:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "Удалить мод" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "Переименовать модпак:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "Принять" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "Мир:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "Скрыть игру" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "Скрыть содержимое модпака" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "Мод:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "Зависит от:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Сохранить" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Включить Всё" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Отключить Всё" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "включено" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "Включить всё" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "Выберите файл с модом:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "Установка мода: файл \"$1\"" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -379,32 +412,32 @@ msgstr "" "\n" "Установка мода: неподдерживаемый тип \"$1\"" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "Ошибка при установке $1 в $2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" "Установка мода: невозможно найти подходящее имя директории для модпака $1" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "Установка мода: невозможно определить название мода для $1" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "Modmgr: невозможно удалить \"$1\"" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "Modmgr: неправильный путь \"$1\"" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "Уверены, что хотите удалить \"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "Никак нет!" @@ -420,47 +453,51 @@ msgstr "Рейтинг" msgid "re-Install" msgstr "Переустановить" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "Установить" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Текстуры предметов..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Загрузка..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Создание сервера..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Создание клиента..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Получение адреса..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Подключение к серверу..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "Описания предметов..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "Описания нод..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "Медиафайлы..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "Завершение работы..." -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -476,12 +513,8 @@ msgstr "Вы умерли." msgid "Respawn" msgstr "Возродиться" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "ЛКМ: Переместить все предметы, ПКМ: Переместить один предмет" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Продолжить" @@ -499,99 +532,99 @@ msgstr "\"Использовать\" = вниз" msgid "Double tap \"jump\" to toggle fly" msgstr "Двойной прыжок = летать" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Клавиша уже используется" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "нажмите клавишу" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Вперед" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Назад" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Влево" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Вправо" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Использовать" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Прыжок" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Красться" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Бросить" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Инвентарь" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Чат" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Команда" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Консоль" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Полёт" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Ускорение" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Включить noclip" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Зона видимости" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Печать стеков" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Старый пароль" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Новый пароль" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Подтверждение пароля" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Изменить" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Пароли не совпадают!" @@ -641,11 +674,11 @@ msgstr "" "- Колесико мыши: выбор предмета\n" "- T: чат\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Громкость звука: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Выход" @@ -937,77 +970,44 @@ msgstr "PA1" msgid "Zoom" msgstr "Масштаб" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Главное меню" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Не выбран мир и не введен адрес." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Невозможно найти или загрузить игру \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Неправильная конфигурация игры." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Ошибка соединения (таймаут?)" -#~ msgid "is required by:" -#~ msgstr "требуется для:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "Предупреждение: Некоторые моды еще не настроены.\n" +#~ "Их стандартные настройки будут установлены, когда вы сохраните " +#~ "конфигурацию. " -#~ msgid "Configuration saved. " -#~ msgstr "Настройки сохранены. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Предупреждение: Неверная конфигурация. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Невозможно создать мир: Имя содержит недопустимые символы" - -#~ msgid "Multiplayer" -#~ msgstr "Сетевая игра" - -#~ msgid "Advanced" -#~ msgstr "Дополнительно" - -#~ msgid "Show Public" -#~ msgstr "Публичные" - -#~ msgid "Show Favorites" -#~ msgstr "Избранные" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Оставьте адрес пустым для запуска локального сервера." - -#~ msgid "Create world" -#~ msgstr "Создать мир" - -#~ msgid "Address required." -#~ msgstr "Нужно ввести адрес." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Невозможно удалить мир: Ничего не выбрано" - -#~ msgid "Files to be deleted" -#~ msgstr "Следующие файлы будут удалены" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Невозможно создать мир: Ни одной игры не найдено" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "Невозможно настроить мир: ничего не выбрано" - -#~ msgid "Failed to delete all world files" -#~ msgstr "Ошибка при удалении файлов мира" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "Предупреждение: Некоторые моды не найдены.\n" +#~ "Их настройки будут удалены, когда вы сохраните конфигурацию. " #~ msgid "" #~ "Default Controls:\n" @@ -1034,17 +1034,56 @@ msgstr "Ошибка соединения (таймаут?)" #~ "- ESC: это меню\n" #~ "- T: чат\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "Предупреждение: Некоторые моды не найдены.\n" -#~ "Их настройки будут удалены, когда вы сохраните конфигурацию. " +#~ msgid "Failed to delete all world files" +#~ msgstr "Ошибка при удалении файлов мира" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "Предупреждение: Некоторые моды еще не настроены.\n" -#~ "Их стандартные настройки будут установлены, когда вы сохраните " -#~ "конфигурацию. " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "Невозможно настроить мир: ничего не выбрано" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "Невозможно создать мир: Ни одной игры не найдено" + +#~ msgid "Files to be deleted" +#~ msgstr "Следующие файлы будут удалены" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Невозможно удалить мир: Ничего не выбрано" + +#~ msgid "Address required." +#~ msgstr "Нужно ввести адрес." + +#~ msgid "Create world" +#~ msgstr "Создать мир" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Оставьте адрес пустым для запуска локального сервера." + +#~ msgid "Show Favorites" +#~ msgstr "Избранные" + +#~ msgid "Show Public" +#~ msgstr "Публичные" + +#~ msgid "Advanced" +#~ msgstr "Дополнительно" + +#~ msgid "Multiplayer" +#~ msgstr "Сетевая игра" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Невозможно создать мир: Имя содержит недопустимые символы" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Предупреждение: Неверная конфигурация. " + +#~ msgid "Configuration saved. " +#~ msgstr "Настройки сохранены. " + +#~ msgid "is required by:" +#~ msgstr "требуется для:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "ЛКМ: Переместить все предметы, ПКМ: Переместить один предмет" + +#~ msgid "Download" +#~ msgstr "Загрузить" diff --git a/po/uk/minetest.po b/po/uk/minetest.po index 30760cfa0..11d463c6b 100644 --- a/po/uk/minetest.po +++ b/po/uk/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-06-27 01:22+0200\n" "Last-Translator: Vladimir a \n" "Language-Team: LANGUAGE \n" @@ -24,12 +24,12 @@ msgstr "" msgid "Game Name" msgstr "Гра" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "Створити" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "Відміна" @@ -41,36 +41,36 @@ msgstr "" msgid "GAMES" msgstr "" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 #, fuzzy msgid "Games" msgstr "Гра" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "" @@ -78,230 +78,238 @@ msgstr "" msgid "World name" msgstr "Назва Світу" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "Гра" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 #, fuzzy msgid "Delete World \"$1\"?" msgstr "Видалити світ" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "Так" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "Ні" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 #, fuzzy msgid "A world named \"$1\" already exists" msgstr "Неможливо створити світ: Світ з таким ім'ям вже існує" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "Одиночна гра" - -#: builtin/mainmenu.lua:853 -msgid "Client" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." msgstr "" -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "Налаштування" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "Подяка" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "Улюблені:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "Адреса/Порт" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "Ім'я/Пароль" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 #, fuzzy msgid "Public Serverlist" msgstr "Список публічних серверів:" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "Видалити" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "Підключитися" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "Новий" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "Налаштувати" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 #, fuzzy msgid "Start Game" msgstr "Почати гру / Підключитися" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "Виберіть світ:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "Режим Створення" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "Ввімкнути урон" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "Публичний" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 #, fuzzy msgid "Password" msgstr "Старий Пароль" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "Гарні дерева" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "Рівне освітлення" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D Хмари" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 #, fuzzy msgid "Opaque Water" msgstr "Непрозора вода" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "MIP-текстурування" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "Анізотропна фільтрація" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "Білінійна фільтрація" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "Трилінійна фільтрація" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "Шейдери" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "Попереднє завантаження зображень" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "Ввімкнути частки" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 #, fuzzy msgid "Finite Liquid" msgstr "Кінцеві рідини" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "Змінити клавіши" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "Грати" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "Одиночна гра" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "Налаштування" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "Подяка" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "" @@ -310,115 +318,134 @@ msgstr "" msgid "Installed Mods:" msgstr "" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" +#: builtin/modmgr.lua:243 +msgid "Add mod:" msgstr "" #: builtin/modmgr.lua:244 -#, fuzzy -msgid "Download" -msgstr "Вниз" +msgid "Local install" +msgstr "" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -#, fuzzy -msgid "Depends:" -msgstr "залежить від:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 #, fuzzy msgid "Accept" msgstr "Підтвердити" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 #, fuzzy msgid "World:" msgstr "Виберіть світ:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 #, fuzzy msgid "Hide Game" msgstr "Гра" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +#, fuzzy +msgid "Depends:" +msgstr "залежить від:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "Зберегти" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 #, fuzzy msgid "Enable MP" msgstr "Увімкнути Все" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 #, fuzzy msgid "Disable MP" msgstr "Вимкнути Усе" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "Увімкнено" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 #, fuzzy msgid "Enable all" msgstr "Увімкнути Все" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 #, fuzzy msgid "Select Mod File:" msgstr "Виберіть світ:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" msgstr "" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 #, fuzzy msgid "Failed to install $1 to $2" msgstr "Не вдалося ініціалізувати світ" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "" @@ -434,47 +461,51 @@ msgstr "" msgid "re-Install" msgstr "" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "Текстура предметів..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "Завантаження..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "Створення сервера..." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "Створення клієнта..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "Отримання адреси..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "Підключення до сервера..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "" -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "" -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "" -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -490,14 +521,8 @@ msgstr "Ви загинули." msgid "Respawn" msgstr "Народитися" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "" -"Ліва кнопка миші: Перемістити усі предмети, Права кнопка миші: Перемістити " -"один предмет" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "Далі" @@ -516,99 +541,99 @@ msgstr "\"Використовувати\" = підніматися в гору" msgid "Double tap \"jump\" to toggle fly" msgstr "Подвійний \"Стрибок\" щоб полетіти" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "Клавіша вже використовується" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "Натисніть клавішу" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "Уперед" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "Назад" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "Ліворуч" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "Праворуч" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "Використовувати" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "Стрибок" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "Крастися" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "Викинути" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "Інвентар" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "Чат" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "Комманда" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "Консоль" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "Переключити режим польоту" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "Переключити швидкий режим" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "Переключити режим проходження скрізь стін" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "Вибір діапазону" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "Надрукувати стек" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "Старий Пароль" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "Новий Пароль" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "Підтвердження нового пароля" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Змінити" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Паролі не збігаються!" @@ -659,11 +684,11 @@ msgstr "" "- Колесо миші: вибір предмета\n" "- T: чат\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "Гучність Звуку: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "Вихід" @@ -972,74 +997,83 @@ msgstr "PA1" msgid "Zoom" msgstr "Збільшити" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "Головне Меню" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "Жоден світ не вибрано та не надано адреси. Нічого не робити." -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "Неможливо знайти, або завантажити гру \"" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "Помилкова конфігурація гри." -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "Помилка з'єднання (час вийшов?)" -#~ msgid "is required by:" -#~ msgstr "необхідний для:" - -#~ msgid "Configuration saved. " -#~ msgstr "Налаштування Збережено. " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "Попередження: Помилкова конфігурація. " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "Неможливо створити світ: Ім'я містить недопустимі символи" - -#~ msgid "Multiplayer" -#~ msgstr "Мережева гра" - -#~ msgid "Advanced" -#~ msgstr "Додатково" - -#~ msgid "Show Public" -#~ msgstr "Показати Публічні" - -#~ msgid "Show Favorites" -#~ msgstr "Показати Улюблені" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "Залишіть адресу незаповненою для створення локального серверу." - -#~ msgid "Create world" -#~ msgstr "Створити світ" - -#~ msgid "Address required." -#~ msgstr "Адреса необхідна." - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "Неможливо видалити світ: Нічого не вибрано" - -#~ msgid "Files to be deleted" -#~ msgstr "Файлів, що підлягають видаленню" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "Неможливо створити світ: Не знайдено жодної гри" +#~ msgid "Failed to delete all world files" +#~ msgstr "Помилка при видаленні файлів світу" #~ msgid "Cannot configure world: Nothing selected" #~ msgstr "Неможливо налаштувати світ: Нічого не вибрано" -#~ msgid "Failed to delete all world files" -#~ msgstr "Помилка при видаленні файлів світу" +#~ msgid "Cannot create world: No games found" +#~ msgstr "Неможливо створити світ: Не знайдено жодної гри" + +#~ msgid "Files to be deleted" +#~ msgstr "Файлів, що підлягають видаленню" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "Неможливо видалити світ: Нічого не вибрано" + +#~ msgid "Address required." +#~ msgstr "Адреса необхідна." + +#~ msgid "Create world" +#~ msgstr "Створити світ" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "Залишіть адресу незаповненою для створення локального серверу." + +#~ msgid "Show Favorites" +#~ msgstr "Показати Улюблені" + +#~ msgid "Show Public" +#~ msgstr "Показати Публічні" + +#~ msgid "Advanced" +#~ msgstr "Додатково" + +#~ msgid "Multiplayer" +#~ msgstr "Мережева гра" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "Неможливо створити світ: Ім'я містить недопустимі символи" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "Попередження: Помилкова конфігурація. " + +#~ msgid "Configuration saved. " +#~ msgstr "Налаштування Збережено. " + +#~ msgid "is required by:" +#~ msgstr "необхідний для:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "" +#~ "Ліва кнопка миші: Перемістити усі предмети, Права кнопка миші: " +#~ "Перемістити один предмет" + +#, fuzzy +#~ msgid "Download" +#~ msgstr "Вниз" diff --git a/po/zh_CN/minetest.po b/po/zh_CN/minetest.po index 594888ca5..a40e18b4c 100644 --- a/po/zh_CN/minetest.po +++ b/po/zh_CN/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-07 22:01+0400\n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" "PO-Revision-Date: 2013-09-14 12:52+0200\n" "Last-Translator: Shen Zheyu \n" "Language-Team: LANGUAGE \n" @@ -22,12 +22,12 @@ msgstr "" msgid "Game Name" msgstr "游戏名" -#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:301 +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 msgid "Create" msgstr "创建" -#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:302 builtin/modmgr.lua:289 -#: builtin/modmgr.lua:406 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 msgid "Cancel" msgstr "取消" @@ -39,35 +39,35 @@ msgstr "Gamemgr: 无法复制MOD“$1”到游戏“$2”" msgid "GAMES" msgstr "游戏" -#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:859 +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 msgid "Games" msgstr "游戏" -#: builtin/gamemgr.lua:233 +#: builtin/gamemgr.lua:234 msgid "Mods:" msgstr "MODS:" -#: builtin/gamemgr.lua:234 +#: builtin/gamemgr.lua:235 msgid "edit game" msgstr "编辑游戏" -#: builtin/gamemgr.lua:237 +#: builtin/gamemgr.lua:238 msgid "new game" msgstr "新建游戏" -#: builtin/gamemgr.lua:247 +#: builtin/gamemgr.lua:248 msgid "EDIT GAME" msgstr "编辑游戏" -#: builtin/gamemgr.lua:267 +#: builtin/gamemgr.lua:269 msgid "Remove selected mod" msgstr "删除选中MOD" -#: builtin/gamemgr.lua:270 +#: builtin/gamemgr.lua:272 msgid "<<-- Add mod" msgstr "<<-- 添加MOD" -#: builtin/mainmenu.lua:159 +#: builtin/mainmenu.lua:158 msgid "Ok" msgstr "OK" @@ -75,223 +75,231 @@ msgstr "OK" msgid "World name" msgstr "世界名称" -#: builtin/mainmenu.lua:298 +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 msgid "Mapgen" msgstr "地图生成器" -#: builtin/mainmenu.lua:300 +#: builtin/mainmenu.lua:306 msgid "Game" msgstr "游戏" -#: builtin/mainmenu.lua:314 +#: builtin/mainmenu.lua:319 msgid "Delete World \"$1\"?" msgstr "删除世界“$1”?" -#: builtin/mainmenu.lua:315 builtin/modmgr.lua:846 +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 msgid "Yes" msgstr "是" -#: builtin/mainmenu.lua:316 +#: builtin/mainmenu.lua:321 msgid "No" msgstr "否" -#: builtin/mainmenu.lua:384 +#: builtin/mainmenu.lua:364 msgid "A world named \"$1\" already exists" msgstr "名为 \"$1\" 的世界已经存在" -#: builtin/mainmenu.lua:399 +#: builtin/mainmenu.lua:381 msgid "No worldname given or no game selected" msgstr "未给定世界名或未选择游戏" -#: builtin/mainmenu.lua:852 -msgid "Singleplayer" -msgstr "单人游戏" +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" -#: builtin/mainmenu.lua:853 -msgid "Client" -msgstr "客户端" - -#: builtin/mainmenu.lua:854 -msgid "Server" -msgstr "服务器" - -#: builtin/mainmenu.lua:855 -msgid "Settings" -msgstr "设置" - -#: builtin/mainmenu.lua:856 -msgid "Texture Packs" -msgstr "材质包" - -#: builtin/mainmenu.lua:863 -msgid "Mods" -msgstr "MODS" - -#: builtin/mainmenu.lua:865 -msgid "Credits" -msgstr "关于" - -#: builtin/mainmenu.lua:885 +#: builtin/mainmenu.lua:818 msgid "CLIENT" msgstr "客户端" -#: builtin/mainmenu.lua:886 +#: builtin/mainmenu.lua:819 msgid "Favorites:" msgstr "最爱的服务器:" -#: builtin/mainmenu.lua:887 +#: builtin/mainmenu.lua:820 msgid "Address/Port" msgstr "地址/端口" -#: builtin/mainmenu.lua:888 +#: builtin/mainmenu.lua:821 msgid "Name/Password" msgstr "名字/密码" -#: builtin/mainmenu.lua:891 +#: builtin/mainmenu.lua:824 msgid "Public Serverlist" msgstr "公共服务器列表" -#: builtin/mainmenu.lua:896 builtin/mainmenu.lua:941 builtin/mainmenu.lua:1004 -#: builtin/modmgr.lua:271 src/keycode.cpp:229 +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 msgid "Delete" msgstr "删除" -#: builtin/mainmenu.lua:900 +#: builtin/mainmenu.lua:833 msgid "Connect" msgstr "连接" -#: builtin/mainmenu.lua:942 builtin/mainmenu.lua:1005 +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 msgid "New" msgstr "新建" -#: builtin/mainmenu.lua:943 builtin/mainmenu.lua:1006 +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 msgid "Configure" msgstr "配置" -#: builtin/mainmenu.lua:944 +#: builtin/mainmenu.lua:877 msgid "Start Game" msgstr "启动游戏" -#: builtin/mainmenu.lua:945 builtin/mainmenu.lua:1008 +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 msgid "Select World:" msgstr "选择世界:" -#: builtin/mainmenu.lua:946 +#: builtin/mainmenu.lua:879 msgid "START SERVER" msgstr "启动服务器" -#: builtin/mainmenu.lua:947 builtin/mainmenu.lua:1010 +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 msgid "Creative Mode" msgstr "创造模式" -#: builtin/mainmenu.lua:949 builtin/mainmenu.lua:1012 +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 msgid "Enable Damage" msgstr "开启伤害" -#: builtin/mainmenu.lua:951 +#: builtin/mainmenu.lua:884 msgid "Public" msgstr "公共服务器" -#: builtin/mainmenu.lua:953 +#: builtin/mainmenu.lua:886 msgid "Name" msgstr "名字" -#: builtin/mainmenu.lua:955 +#: builtin/mainmenu.lua:888 msgid "Password" msgstr "密码" -#: builtin/mainmenu.lua:956 +#: builtin/mainmenu.lua:889 msgid "Server Port" msgstr "服务器端口" -#: builtin/mainmenu.lua:966 +#: builtin/mainmenu.lua:899 msgid "SETTINGS" msgstr "设置" -#: builtin/mainmenu.lua:967 +#: builtin/mainmenu.lua:900 msgid "Fancy trees" msgstr "更漂亮的树" -#: builtin/mainmenu.lua:969 +#: builtin/mainmenu.lua:902 msgid "Smooth Lighting" msgstr "平滑光照" -#: builtin/mainmenu.lua:971 +#: builtin/mainmenu.lua:904 msgid "3D Clouds" msgstr "3D云彩" -#: builtin/mainmenu.lua:973 +#: builtin/mainmenu.lua:906 msgid "Opaque Water" msgstr "不透明的水" -#: builtin/mainmenu.lua:976 +#: builtin/mainmenu.lua:909 msgid "Mip-Mapping" msgstr "贴图处理" -#: builtin/mainmenu.lua:978 +#: builtin/mainmenu.lua:911 msgid "Anisotropic Filtering" msgstr "各向异性过滤" -#: builtin/mainmenu.lua:980 +#: builtin/mainmenu.lua:913 msgid "Bi-Linear Filtering" msgstr "双线性过滤" -#: builtin/mainmenu.lua:982 +#: builtin/mainmenu.lua:915 msgid "Tri-Linear Filtering" msgstr "三线性过滤" -#: builtin/mainmenu.lua:985 +#: builtin/mainmenu.lua:918 msgid "Shaders" msgstr "着色器" -#: builtin/mainmenu.lua:987 +#: builtin/mainmenu.lua:920 msgid "Preload item visuals" msgstr "预先加载物品图像" -#: builtin/mainmenu.lua:989 +#: builtin/mainmenu.lua:922 msgid "Enable Particles" msgstr "启用粒子效果" -#: builtin/mainmenu.lua:991 +#: builtin/mainmenu.lua:924 msgid "Finite Liquid" msgstr "液体有限延伸" -#: builtin/mainmenu.lua:994 +#: builtin/mainmenu.lua:927 msgid "Change keys" msgstr "改变键位设置" -#: builtin/mainmenu.lua:1007 src/keycode.cpp:248 +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 msgid "Play" msgstr "开始游戏" -#: builtin/mainmenu.lua:1009 +#: builtin/mainmenu.lua:942 msgid "SINGLE PLAYER" msgstr "单人游戏" -#: builtin/mainmenu.lua:1022 +#: builtin/mainmenu.lua:955 msgid "Select texture pack:" msgstr "选择材质包:" -#: builtin/mainmenu.lua:1023 +#: builtin/mainmenu.lua:956 msgid "TEXTURE PACKS" msgstr "材质包" -#: builtin/mainmenu.lua:1043 +#: builtin/mainmenu.lua:976 msgid "No information available" msgstr "无可用信息" -#: builtin/mainmenu.lua:1071 +#: builtin/mainmenu.lua:1005 msgid "Core Developers" msgstr "核心开发人员" -#: builtin/mainmenu.lua:1082 +#: builtin/mainmenu.lua:1020 msgid "Active Contributors" msgstr "活跃的贡献者" -#: builtin/mainmenu.lua:1092 +#: builtin/mainmenu.lua:1028 msgid "Previous Contributors" msgstr "以往的贡献者" +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "单人游戏" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "客户端" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "服务器" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "设置" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "材质包" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "MODS" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "关于" + #: builtin/modmgr.lua:236 msgid "MODS" msgstr "MODS" @@ -300,75 +308,100 @@ msgstr "MODS" msgid "Installed Mods:" msgstr "已安装的MOD:" -#: builtin/modmgr.lua:243 builtin/modstore.lua:253 -msgid "Install" -msgstr "安装" +#: builtin/modmgr.lua:243 +#, fuzzy +msgid "Add mod:" +msgstr "<<-- 添加MOD" #: builtin/modmgr.lua:244 -msgid "Download" -msgstr "下载" +#, fuzzy +msgid "Local install" +msgstr "安装" -#: builtin/modmgr.lua:256 +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +#, fuzzy +msgid "No mod description available" +msgstr "无可用信息" + +#: builtin/modmgr.lua:288 +#, fuzzy +msgid "Mod information:" +msgstr "无可用信息" + +#: builtin/modmgr.lua:299 msgid "Rename" msgstr "重命名" -#: builtin/modmgr.lua:260 builtin/modmgr.lua:402 -msgid "Depends:" -msgstr "依赖于:" +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" -#: builtin/modmgr.lua:282 +#: builtin/modmgr.lua:312 +#, fuzzy +msgid "Uninstall selected mod" +msgstr "删除选中MOD" + +#: builtin/modmgr.lua:324 msgid "Rename Modpack:" msgstr "重命名MOD包:" -#: builtin/modmgr.lua:287 src/keycode.cpp:227 +#: builtin/modmgr.lua:329 src/keycode.cpp:227 msgid "Accept" msgstr "接受" -#: builtin/modmgr.lua:381 +#: builtin/modmgr.lua:423 msgid "World:" msgstr "世界:" -#: builtin/modmgr.lua:385 builtin/modmgr.lua:387 +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 msgid "Hide Game" msgstr "隐藏游戏" -#: builtin/modmgr.lua:391 builtin/modmgr.lua:393 +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 msgid "Hide mp content" msgstr "隐藏MOD包内容" -#: builtin/modmgr.lua:400 +#: builtin/modmgr.lua:442 msgid "Mod:" msgstr "MOD:" -#: builtin/modmgr.lua:405 src/guiKeyChangeMenu.cpp:187 +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "依赖于:" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 msgid "Save" msgstr "保存" -#: builtin/modmgr.lua:422 +#: builtin/modmgr.lua:464 msgid "Enable MP" msgstr "启用MOD包" -#: builtin/modmgr.lua:424 +#: builtin/modmgr.lua:466 msgid "Disable MP" msgstr "禁用MOD包" -#: builtin/modmgr.lua:428 builtin/modmgr.lua:430 +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 msgid "enabled" msgstr "启用" -#: builtin/modmgr.lua:436 +#: builtin/modmgr.lua:478 msgid "Enable all" msgstr "全部启用" -#: builtin/modmgr.lua:551 +#: builtin/modmgr.lua:577 msgid "Select Mod File:" msgstr "选择MOD文件:" -#: builtin/modmgr.lua:590 +#: builtin/modmgr.lua:616 msgid "Install Mod: file: \"$1\"" msgstr "安装MOD:文件:”$1“" -#: builtin/modmgr.lua:591 +#: builtin/modmgr.lua:617 msgid "" "\n" "Install Mod: unsupported filetype \"$1\"" @@ -376,31 +409,31 @@ msgstr "" "\n" "安装MOD:不支持的文件类型“$1“" -#: builtin/modmgr.lua:612 +#: builtin/modmgr.lua:638 msgid "Failed to install $1 to $2" msgstr "无法安装$1到$2" -#: builtin/modmgr.lua:615 +#: builtin/modmgr.lua:641 msgid "Install Mod: unable to find suitable foldername for modpack $1" msgstr "安装MOD:找不到MOD包$1的合适文件夹名" -#: builtin/modmgr.lua:635 +#: builtin/modmgr.lua:661 msgid "Install Mod: unable to find real modname for: $1" msgstr "安装MOD:找不到$1的真正MOD名" -#: builtin/modmgr.lua:824 +#: builtin/modmgr.lua:855 msgid "Modmgr: failed to delete \"$1\"" msgstr "MOD管理器:无法删除“$1“" -#: builtin/modmgr.lua:828 +#: builtin/modmgr.lua:859 msgid "Modmgr: invalid modpath \"$1\"" msgstr "MOD管理器:MOD“$1“路径非法" -#: builtin/modmgr.lua:845 +#: builtin/modmgr.lua:876 msgid "Are you sure you want to delete \"$1\"?" msgstr "你确认要删除\"$1\"?" -#: builtin/modmgr.lua:847 +#: builtin/modmgr.lua:878 msgid "No of course not!" msgstr "当然不!" @@ -416,47 +449,51 @@ msgstr "评级" msgid "re-Install" msgstr "重新安装" -#: src/client.cpp:2915 +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "安装" + +#: src/client.cpp:2917 msgid "Item textures..." msgstr "物品材质..." -#: src/game.cpp:939 +#: src/game.cpp:940 msgid "Loading..." msgstr "载入中..." -#: src/game.cpp:999 +#: src/game.cpp:1000 msgid "Creating server...." msgstr "正在建立服务器...." -#: src/game.cpp:1015 +#: src/game.cpp:1016 msgid "Creating client..." msgstr "正在建立客户端..." -#: src/game.cpp:1024 +#: src/game.cpp:1025 msgid "Resolving address..." msgstr "正在解析地址..." -#: src/game.cpp:1121 +#: src/game.cpp:1122 msgid "Connecting to server..." msgstr "正在连接服务器..." -#: src/game.cpp:1218 +#: src/game.cpp:1219 msgid "Item definitions..." msgstr "物品定义..." -#: src/game.cpp:1225 +#: src/game.cpp:1226 msgid "Node definitions..." msgstr "方块定义..." -#: src/game.cpp:1232 +#: src/game.cpp:1233 msgid "Media..." msgstr "媒体..." -#: src/game.cpp:3405 +#: src/game.cpp:3409 msgid "Shutting down stuff..." msgstr "关闭中......" -#: src/game.cpp:3435 +#: src/game.cpp:3439 msgid "" "\n" "Check debug.txt for details." @@ -472,12 +509,8 @@ msgstr "你死了。" msgid "Respawn" msgstr "重生" -#: src/guiFormSpecMenu.cpp:1569 -msgid "Left click: Move all items, Right click: Move single item" -msgstr "左键:移动所有物品,右键:移动单个物品" - -#: src/guiFormSpecMenu.cpp:1595 src/guiMessageMenu.cpp:107 -#: src/guiTextInputMenu.cpp:140 +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 msgid "Proceed" msgstr "继续游戏" @@ -493,99 +526,99 @@ msgstr "“使用” = 向下爬" msgid "Double tap \"jump\" to toggle fly" msgstr "连按两次“跳”切换飞行状态" -#: src/guiKeyChangeMenu.cpp:290 +#: src/guiKeyChangeMenu.cpp:288 msgid "Key already in use" msgstr "按键已被占用" -#: src/guiKeyChangeMenu.cpp:372 +#: src/guiKeyChangeMenu.cpp:363 msgid "press key" msgstr "按键" -#: src/guiKeyChangeMenu.cpp:400 +#: src/guiKeyChangeMenu.cpp:389 msgid "Forward" msgstr "向前" -#: src/guiKeyChangeMenu.cpp:401 +#: src/guiKeyChangeMenu.cpp:390 msgid "Backward" msgstr "向后" -#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 msgid "Left" msgstr "向左" -#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228 +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 msgid "Right" msgstr "向右" -#: src/guiKeyChangeMenu.cpp:404 +#: src/guiKeyChangeMenu.cpp:393 msgid "Use" msgstr "使用" -#: src/guiKeyChangeMenu.cpp:405 +#: src/guiKeyChangeMenu.cpp:394 msgid "Jump" msgstr "跳" -#: src/guiKeyChangeMenu.cpp:406 +#: src/guiKeyChangeMenu.cpp:395 msgid "Sneak" msgstr "潜行" -#: src/guiKeyChangeMenu.cpp:407 +#: src/guiKeyChangeMenu.cpp:396 msgid "Drop" msgstr "丢出" -#: src/guiKeyChangeMenu.cpp:408 +#: src/guiKeyChangeMenu.cpp:397 msgid "Inventory" msgstr "物品栏" -#: src/guiKeyChangeMenu.cpp:409 +#: src/guiKeyChangeMenu.cpp:398 msgid "Chat" msgstr "聊天" -#: src/guiKeyChangeMenu.cpp:410 +#: src/guiKeyChangeMenu.cpp:399 msgid "Command" msgstr "命令" -#: src/guiKeyChangeMenu.cpp:411 +#: src/guiKeyChangeMenu.cpp:400 msgid "Console" msgstr "控制台" -#: src/guiKeyChangeMenu.cpp:412 +#: src/guiKeyChangeMenu.cpp:401 msgid "Toggle fly" msgstr "切换飞行状态" -#: src/guiKeyChangeMenu.cpp:413 +#: src/guiKeyChangeMenu.cpp:402 msgid "Toggle fast" msgstr "切换快速移动状态" -#: src/guiKeyChangeMenu.cpp:414 +#: src/guiKeyChangeMenu.cpp:403 msgid "Toggle noclip" msgstr "切换穿墙模式" -#: src/guiKeyChangeMenu.cpp:415 +#: src/guiKeyChangeMenu.cpp:404 msgid "Range select" msgstr "选择范围" -#: src/guiKeyChangeMenu.cpp:416 +#: src/guiKeyChangeMenu.cpp:405 msgid "Print stacks" msgstr "打印栈" -#: src/guiPasswordChange.cpp:107 +#: src/guiPasswordChange.cpp:106 msgid "Old Password" msgstr "旧密码" -#: src/guiPasswordChange.cpp:125 +#: src/guiPasswordChange.cpp:122 msgid "New Password" msgstr "新密码" -#: src/guiPasswordChange.cpp:142 +#: src/guiPasswordChange.cpp:137 msgid "Confirm Password" msgstr "确认密码" -#: src/guiPasswordChange.cpp:160 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "更改" -#: src/guiPasswordChange.cpp:169 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "密码不匹配!" @@ -635,11 +668,11 @@ msgstr "" "鼠标滚轮: 选择物品\n" "T: 聊天\n" -#: src/guiVolumeChange.cpp:108 +#: src/guiVolumeChange.cpp:107 msgid "Sound Volume: " msgstr "音量: " -#: src/guiVolumeChange.cpp:122 +#: src/guiVolumeChange.cpp:121 msgid "Exit" msgstr "退出" @@ -931,77 +964,43 @@ msgstr "PA1键" msgid "Zoom" msgstr "缩放" -#: src/main.cpp:1411 +#: src/main.cpp:1472 msgid "needs_fallback_font" msgstr "yes" -#: src/main.cpp:1486 +#: src/main.cpp:1547 msgid "Main Menu" msgstr "主菜单" -#: src/main.cpp:1662 +#: src/main.cpp:1723 msgid "No world selected and no address provided. Nothing to do." msgstr "没有选择世界或提供地址。未执行操作。" -#: src/main.cpp:1670 +#: src/main.cpp:1731 msgid "Could not find or load game \"" msgstr "无法找到或载入游戏模式“" -#: src/main.cpp:1684 +#: src/main.cpp:1745 msgid "Invalid gamespec." msgstr "非法游戏模式规格。" -#: src/main.cpp:1729 +#: src/main.cpp:1790 msgid "Connection error (timed out?)" msgstr "连接出错(超时?)" -#~ msgid "is required by:" -#~ msgstr "被需要:" +#~ msgid "" +#~ "Warning: Some mods are not configured yet.\n" +#~ "They will be enabled by default when you save the configuration. " +#~ msgstr "" +#~ "警告:一些MOD仍未设定。\n" +#~ "它们会在你保存配置的时候自动启用。 " -#~ msgid "Configuration saved. " -#~ msgstr "配置已保存。 " - -#~ msgid "Warning: Configuration not consistent. " -#~ msgstr "警告:配置不一致。 " - -#~ msgid "Cannot create world: Name contains invalid characters" -#~ msgstr "无法创建世界:名字包含非法字符" - -#~ msgid "Multiplayer" -#~ msgstr "多人游戏" - -#~ msgid "Advanced" -#~ msgstr "高级联机设置" - -#~ msgid "Show Public" -#~ msgstr "显示公共" - -#~ msgid "Show Favorites" -#~ msgstr "显示最爱" - -#~ msgid "Leave address blank to start a local server." -#~ msgstr "地址栏留空可启动本地服务器。" - -#~ msgid "Create world" -#~ msgstr "创造世界" - -#~ msgid "Address required." -#~ msgstr "需要地址。" - -#~ msgid "Cannot delete world: Nothing selected" -#~ msgstr "无法删除世界:没有选择世界" - -#~ msgid "Files to be deleted" -#~ msgstr "将被删除的文件" - -#~ msgid "Cannot create world: No games found" -#~ msgstr "无法创造世界:未找到游戏模式" - -#~ msgid "Cannot configure world: Nothing selected" -#~ msgstr "无法配置世界:没有选择世界" - -#~ msgid "Failed to delete all world files" -#~ msgstr "无法删除所有该世界的文件" +#~ msgid "" +#~ "Warning: Some configured mods are missing.\n" +#~ "Their setting will be removed when you save the configuration. " +#~ msgstr "" +#~ "警告:缺少一些设定了的MOD。\n" +#~ "它们的设置会在你保存配置的时候被移除。 " #~ msgid "" #~ "Default Controls:\n" @@ -1029,16 +1028,56 @@ msgstr "连接出错(超时?)" #~ "ESC:菜单\n" #~ "T:聊天\n" -#~ msgid "" -#~ "Warning: Some configured mods are missing.\n" -#~ "Their setting will be removed when you save the configuration. " -#~ msgstr "" -#~ "警告:缺少一些设定了的MOD。\n" -#~ "它们的设置会在你保存配置的时候被移除。 " +#~ msgid "Failed to delete all world files" +#~ msgstr "无法删除所有该世界的文件" -#~ msgid "" -#~ "Warning: Some mods are not configured yet.\n" -#~ "They will be enabled by default when you save the configuration. " -#~ msgstr "" -#~ "警告:一些MOD仍未设定。\n" -#~ "它们会在你保存配置的时候自动启用。 " +#~ msgid "Cannot configure world: Nothing selected" +#~ msgstr "无法配置世界:没有选择世界" + +#~ msgid "Cannot create world: No games found" +#~ msgstr "无法创造世界:未找到游戏模式" + +#~ msgid "Files to be deleted" +#~ msgstr "将被删除的文件" + +#~ msgid "Cannot delete world: Nothing selected" +#~ msgstr "无法删除世界:没有选择世界" + +#~ msgid "Address required." +#~ msgstr "需要地址。" + +#~ msgid "Create world" +#~ msgstr "创造世界" + +#~ msgid "Leave address blank to start a local server." +#~ msgstr "地址栏留空可启动本地服务器。" + +#~ msgid "Show Favorites" +#~ msgstr "显示最爱" + +#~ msgid "Show Public" +#~ msgstr "显示公共" + +#~ msgid "Advanced" +#~ msgstr "高级联机设置" + +#~ msgid "Multiplayer" +#~ msgstr "多人游戏" + +#~ msgid "Cannot create world: Name contains invalid characters" +#~ msgstr "无法创建世界:名字包含非法字符" + +#~ msgid "Warning: Configuration not consistent. " +#~ msgstr "警告:配置不一致。 " + +#~ msgid "Configuration saved. " +#~ msgstr "配置已保存。 " + +#~ msgid "is required by:" +#~ msgstr "被需要:" + +#~ msgid "Left click: Move all items, Right click: Move single item" +#~ msgstr "左键:移动所有物品,右键:移动单个物品" + +#~ msgid "Download" +#~ msgstr "下载" From 374e68d205cac28df7321020feb348511932ac30 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sat, 23 Nov 2013 18:47:54 +0100 Subject: [PATCH 120/198] Fix rename modpack button not working, fixes #1019 --- builtin/modmgr.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index 7b50f0882..7eb324b61 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -318,7 +318,7 @@ end -------------------------------------------------------------------------------- function modmgr.dialog_rename_modpack() - local mod = filterlist.get_list(modmgr.modlist)[modmgr.selected_mod] + local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] local retval = "label[1.75,1;".. fgettext("Rename Modpack:") .. "]".. @@ -672,10 +672,13 @@ end function modmgr.handle_rename_modpack_buttons(fields) if fields["dlg_rename_modpack_confirm"] ~= nil then - local mod = filterlist.get_list(modmgr.modlist)[modmgr.selected_mod] + local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] local oldpath = engine.get_modpath() .. DIR_DELIM .. mod.name local targetpath = engine.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"] engine.copy_dir(oldpath,targetpath,false) + modmgr.refresh_globals() + modmgr.selected_mod = filterlist.get_current_index(modmgr.global_mods, + filterlist.raw_index_by_uid(modmgr.global_mods, fields["te_modpack_name"])) end return { From 83f1d9ae6b859684057a6728d0b6fb96539d13c1 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 23 Nov 2013 20:05:07 +0100 Subject: [PATCH 121/198] Fix my name (doesn't display correctly because of utf8 characters) --- builtin/mainmenu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index a8adca54f..c09b9cbcd 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -1014,7 +1014,7 @@ function tabbuilder.tab_credits() "kahrl ,".. "sapier,".. "ShadowNinja ,".. - "Nathanaël Courant (Nore/Novatux) ,".. + "Nathanael Courant (Nore/Novatux) ,".. "BlockMen,".. ",".. "#FFFF00" .. fgettext("Active Contributors") .. "," .. From 16bd3683747e6ab86d6874b90d00a02285d68bdd Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 24 Nov 2013 02:15:25 +0100 Subject: [PATCH 122/198] Temporary disable local install button due to irrlicht dialog breaking localization --- builtin/modmgr.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index 7eb324b61..1f19ac673 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -241,7 +241,8 @@ function modmgr.tab() retval = retval .. "label[0.8,4.2;" .. fgettext("Add mod:") .. "]" .. - "button[0.75,4.85;1.8,0.5;btn_mod_mgr_install_local;".. fgettext("Local install") .. "]" .. +-- TODO Disabled due to upcoming release 0.4.8 and irrlicht messing up localization +-- "button[0.75,4.85;1.8,0.5;btn_mod_mgr_install_local;".. fgettext("Local install") .. "]" .. "button[2.45,4.85;3.05,0.5;btn_mod_mgr_download;".. fgettext("Online mod repository") .. "]" local selected_mod = nil From 068dd796f51e59953d1aff9f05510847e2bfe872 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 24 Nov 2013 02:10:15 -0500 Subject: [PATCH 123/198] Don't continue trying to deserialize blank block data --- src/database-leveldb.cpp | 1 + src/database-sqlite3.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index ec28198b5..2a8f59c20 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -104,6 +104,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos) } else { throw SerializationError("Blank block data in database"); } + return NULL; } if (s.ok()) { diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index 44eb86f54..38fb2ca19 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -237,6 +237,7 @@ MapBlock* Database_SQLite3::loadBlock(v3s16 blockpos) } else { throw SerializationError("Blank block data in database"); } + return NULL; } std::string datastr(data, len); From 122875c30cc2553a4db41308e597e928c8e6e7ad Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 24 Nov 2013 02:12:20 -0500 Subject: [PATCH 124/198] Bump version to 0.4.8 --- CMakeLists.txt | 4 ++-- doc/lua_api.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9fff75db..df59c0fbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,12 +12,12 @@ set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string") # Also remember to set PROTOCOL_VERSION in clientserver.h when releasing set(VERSION_MAJOR 0) set(VERSION_MINOR 4) -set(VERSION_PATCH 7) +set(VERSION_PATCH 8) if(VERSION_EXTRA) set(VERSION_PATCH ${VERSION_PATCH}-${VERSION_EXTRA}) else() # Comment the following line during release - set(VERSION_PATCH ${VERSION_PATCH}-dev) + #set(VERSION_PATCH ${VERSION_PATCH}-dev) endif() set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 7da978672..d0090a89c 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1,4 +1,4 @@ -Minetest Lua Modding API Reference 0.4.7 +Minetest Lua Modding API Reference 0.4.8 ======================================== More information at http://www.minetest.net/ Developer Wiki: http://dev.minetest.net/ From f87c1c2410d80ae42171bc32d04d55906a7aa1c4 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 24 Nov 2013 19:01:25 +0100 Subject: [PATCH 125/198] Reenable -dev suffix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df59c0fbc..153e1c190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ if(VERSION_EXTRA) set(VERSION_PATCH ${VERSION_PATCH}-${VERSION_EXTRA}) else() # Comment the following line during release - #set(VERSION_PATCH ${VERSION_PATCH}-dev) + set(VERSION_PATCH ${VERSION_PATCH}-dev) endif() set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") From 4f246f0e2278aa677a74c631b25e760e8a197a3f Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 25 Nov 2013 00:03:03 +0100 Subject: [PATCH 126/198] Fix line_of_sight (AGAIN) --- src/script/lua_api/l_env.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 9bed23d47..76e8c6907 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -39,7 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define GET_ENV_PTR ServerEnvironment* env = \ dynamic_cast(getEnv(L)); \ if( env == NULL) return 0 - + /////////////////////////////////////////////////////////////////////////////// @@ -632,7 +632,7 @@ int ModApiEnvMod::l_get_voxel_manip(lua_State *L) Map *map = &(env->getMap()); LuaVoxelManip *o = new LuaVoxelManip(map); - + *(void **)(lua_newuserdata(L, sizeof(void *))) = o; luaL_getmetatable(L, "VoxelManip"); lua_setmetatable(L, -2); @@ -660,10 +660,12 @@ int ModApiEnvMod::l_line_of_sight(lua_State *L) { // read position 2 from lua v3f pos2 = checkFloatPos(L, 2); //read step size from lua - if (lua_isnumber(L, 3)) + if (lua_isnumber(L, 3)) { stepsize = lua_tonumber(L, 3); + } - return (env->line_of_sight(pos1,pos2,stepsize)); + lua_pushboolean(L, env->line_of_sight(pos1,pos2,stepsize)); + return 1; } // minetest.find_path(pos1, pos2, searchdistance, From 1fd9a11e302566d207c046bd5145e4e05a3c58ea Mon Sep 17 00:00:00 2001 From: Mario Barrera Date: Sun, 13 Oct 2013 13:35:10 -0300 Subject: [PATCH 127/198] SQLite rollback --- src/rollback.cpp | 1168 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 977 insertions(+), 191 deletions(-) diff --git a/src/rollback.cpp b/src/rollback.cpp index e11006826..b95cc7bf3 100644 --- a/src/rollback.cpp +++ b/src/rollback.cpp @@ -29,11 +29,876 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/string.h" #include "util/numeric.h" #include "inventorymanager.h" // deserializing InventoryLocations +#include "sqlite3.h" +#include "filesys.h" #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" #define POINTS_PER_NODE (16.0) +std::string dbp; +sqlite3* dbh; +sqlite3_stmt* dbs_insert; +sqlite3_stmt* dbs_replace; +sqlite3_stmt* dbs_select; +sqlite3_stmt* dbs_select_range; +sqlite3_stmt* dbs_select_withActor; +sqlite3_stmt* dbs_knownActor_select; +sqlite3_stmt* dbs_knownActor_insert; +sqlite3_stmt* dbs_knownNode_select; +sqlite3_stmt* dbs_knownNode_insert; + +struct Stack +{ + int node; + int quantity; +}; +struct ActionRow +{ + int id; + int actor; + int timestamp; + int type; + std::string location, list; + int index, add; + Stack stack; + int nodeMeta; + int x, y, z; + int oldNode; + int oldParam1, oldParam2; + std::string oldMeta; + int newNode; + int newParam1, newParam2; + std::string newMeta; + int guessed; +}; +struct Entity +{ + int id; + std::string name; +}; +typedef std::vector Entities; + +Entities KnownActors; +Entities KnownNodes; + +void registerNewActor (int id, std::string name) +{ + Entity newActor; + + newActor.id = id; + newActor.name = name; + + KnownActors.push_back(newActor); + + //std::cout << "New actor registered: " << id << " | " << name << std::endl; +} +void registerNewNode (int id, std::string name) +{ + Entity newNode; + + newNode.id = id; + newNode.name = name; + + KnownNodes.push_back(newNode); + + //std::cout << "New node registered: " << id << " | " << name << std::endl; +} +int getActorId (std::string name) +{ + Entities::const_iterator iter; + + for (iter = KnownActors.begin(); iter != KnownActors.end(); ++iter) + if (iter->name == name) + return iter->id; + + sqlite3_reset (dbs_knownActor_insert); + sqlite3_bind_text (dbs_knownActor_insert, 1, name.c_str(), -1, NULL); + sqlite3_step (dbs_knownActor_insert); + + int id = sqlite3_last_insert_rowid(dbh); + + //std::cout << "Actor ID insert returns " << insert << std::endl; + + registerNewActor(id, name); + + return id; +} +int getNodeId (std::string name) +{ + Entities::const_iterator iter; + + for (iter = KnownNodes.begin(); iter != KnownNodes.end(); ++iter) + if (iter->name == name) + return iter->id; + + sqlite3_reset (dbs_knownNode_insert); + sqlite3_bind_text (dbs_knownNode_insert, 1, name.c_str(), -1, NULL); + sqlite3_step (dbs_knownNode_insert); + + int id = sqlite3_last_insert_rowid(dbh); + + registerNewNode(id, name); + + return id; +} +const char * getActorName (int id) +{ + Entities::const_iterator iter; + + //std::cout << "getActorName of id " << id << std::endl; + + for (iter = KnownActors.begin(); iter != KnownActors.end(); ++iter) + if (iter->id == id) + return iter->name.c_str(); + + return ""; +} +const char * getNodeName (int id) +{ + Entities::const_iterator iter; + + //std::cout << "getNodeName of id " << id << std::endl; + + for (iter = KnownNodes.begin(); iter != KnownNodes.end(); ++iter) + if (iter->id == id) + return iter->name.c_str(); + + return ""; +} +Stack getStackFromString (std::string text) +{ + Stack stack; + + size_t off = text.find_last_of(" "); + + stack.node = getNodeId(text.substr(0, off)); + stack.quantity = atoi(text.substr(off + 1).c_str()); + + return stack; +} +std::string getStringFromStack (Stack stack) +{ + std::string text; + + text.append(getNodeName(stack.node)); + text.append(" "); + text.append(itos(stack.quantity)); + + return text; +} +bool SQL_createDatabase (void) +{ + infostream << "CreateDB:" << dbp << std::endl; + + int dbs = sqlite3_exec( + dbh + , "CREATE TABLE IF NOT EXISTS `actor` (" + "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + "`name` TEXT NOT NULL);" + "CREATE TABLE IF NOT EXISTS `node` (" + "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + "`name` TEXT NOT NULL);" + "CREATE TABLE IF NOT EXISTS `action` (" + "`id` INTEGER PRIMARY KEY AUTOINCREMENT," + "`actor` INTEGER NOT NULL," + "`timestamp` INTEGER NOT NULL," + "`type` INTEGER NOT NULL," + "`list` TEXT," + "`index` INTEGER," + "`add` INTEGER," + "`stackNode` INTEGER," + "`stackQuantity` INTEGER," + "`nodeMeta` INTEGER," + "`x` INT," + "`y` INT," + "`z` INT," + "`oldNode` INTEGER," + "`oldParam1` INTEGER," + "`oldParam2` INTEGER," + "`oldMeta` TEXT," + "`newNode` INTEGER," + "`newParam1` INTEGER," + "`newParam2` INTEGER," + "`newMeta` TEXT," + "`guessedActor` INTEGER," + "FOREIGN KEY (`actor`) REFERENCES `actor`(`id`)," + "FOREIGN KEY (`oldNode`) REFERENCES `node`(`id`)," + "FOREIGN KEY (`newNode`) REFERENCES `node`(`id`));" + "CREATE INDEX IF NOT EXISTS `actionActor` ON `action`(`actor`);" + "CREATE INDEX IF NOT EXISTS `actionTimestamp` ON `action`(`timestamp`);" + , NULL, NULL, NULL + ); + if (dbs == SQLITE_ABORT) + throw FileNotGoodException("Could not create sqlite3 database structure"); + else + if (dbs != 0) + throw FileNotGoodException("SQL Rollback: Exec statement to create table structure returned a non-zero value"); + else + infostream << "SQL Rollback: SQLite3 database structure was created" << std::endl; + + return true; +} +void SQL_databaseCheck (void) +{ + if (dbh) return; + + infostream << "Database connection setup" << std::endl; + + bool needsCreate = !fs::PathExists(dbp); + int dbo = sqlite3_open_v2(dbp.c_str(), &dbh, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); + + if (dbo != SQLITE_OK) + { + infostream + << "SQLROLLBACK: SQLite3 database failed to open: " + << sqlite3_errmsg(dbh) + << std::endl; + throw FileNotGoodException("Cannot open database file"); + } + + if (needsCreate) SQL_createDatabase(); + + int dbr; + + dbr = sqlite3_prepare_v2( + dbh + , "INSERT INTO `action`" + " ( `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodeMeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`" + " )" + "VALUES" + " ( ?, ?, ?," + " ?, ?, ?, ?, ?, ?," + " ?, ?, ?," + " ?, ?, ?, ?," + " ?, ?, ?, ?," + " ?" + " );" + , -1, &dbs_insert, NULL + ); + + if (dbr != SQLITE_OK) + throw FileNotGoodException(sqlite3_errmsg(dbh)); + + dbr = sqlite3_prepare_v2( + dbh + , "REPLACE INTO `action`" + " ( `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodeMeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`, `id`" + " )" + "VALUES" + " ( ?, ?, ?," + " ?, ?, ?, ?, ?, ?," + " ?, ?, ?," + " ?, ?, ?, ?," + " ?, ?, ?, ?," + " ?, ?" + " );" + , -1, &dbs_replace, NULL + ); + + if (dbr != SQLITE_OK) + throw FileNotGoodException(sqlite3_errmsg(dbh)); + + dbr = sqlite3_prepare_v2(dbh + , "SELECT " + " `actor`, `timestamp`, `type`" + " , `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`" + " , `x`, `y`, `z`" + " , `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`" + " , `newNode`, `newParam1`, `newParam2`, `newMeta`" + " , `guessedActor`" + " FROM `action`" + " WHERE `timestamp` >= ?" + " ORDER BY `timestamp` DESC, `id` DESC" + , -1, &dbs_select, NULL + ); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + dbr = sqlite3_prepare_v2(dbh + , "SELECT " + " `actor`, `timestamp`, `type`" + " , `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`" + " , `x`, `y`, `z`" + " , `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`" + " , `newNode`, `newParam1`, `newParam2`, `newMeta`" + " , `guessedActor`" + " FROM `action`" + " WHERE `timestamp` >= ?" + " AND `x` IS NOT NULL" + " AND `y` IS NOT NULL" + " AND `z` IS NOT NULL" + " AND (ABS(`x`) - ABS(?)) <= ?" + " AND (ABS(`y`) - ABS(?)) <= ?" + " AND (ABS(`z`) - ABS(?)) <= ?" + " ORDER BY `timestamp` DESC, `id` DESC" + " LIMIT 0,5" + , -1, &dbs_select_range, NULL + ); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + dbr = sqlite3_prepare_v2(dbh + , "SELECT " + " `actor`, `timestamp`, `type`" + " , `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`" + " , `x`, `y`, `z`" + " , `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`" + " , `newNode`, `newParam1`, `newParam2`, `newMeta`" + " , `guessedActor`" + " FROM `action`" + " WHERE `timestamp` >= ?" + " AND `actor` = ?" + " ORDER BY `timestamp` DESC, `id` DESC" + , -1, &dbs_select_withActor, NULL + ); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + dbr = sqlite3_prepare_v2(dbh, "SELECT `id`, `name` FROM `actor`", -1, &dbs_knownActor_select, NULL); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + dbr = sqlite3_prepare_v2(dbh, "INSERT INTO `actor` (`name`) VALUES (?)", -1, &dbs_knownActor_insert, NULL); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + dbr = sqlite3_prepare_v2(dbh, "SELECT `id`, `name` FROM `node`", -1, &dbs_knownNode_select, NULL); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + dbr = sqlite3_prepare_v2(dbh, "INSERT INTO `node` (`name`) VALUES (?)", -1, &dbs_knownNode_insert, NULL); + if (dbr != SQLITE_OK) + throw FileNotGoodException(itos(dbr).c_str()); + + infostream << "SQL prepared statements setup correctly" << std::endl; + + int select; + + sqlite3_reset(dbs_knownActor_select); + while (SQLITE_ROW == (select = sqlite3_step(dbs_knownActor_select))) + registerNewActor( + sqlite3_column_int (dbs_knownActor_select, 0), + reinterpret_cast(sqlite3_column_text (dbs_knownActor_select, 1)) + ); + + sqlite3_reset(dbs_knownNode_select); + while (SQLITE_ROW == (select = sqlite3_step(dbs_knownNode_select))) + registerNewNode( + sqlite3_column_int (dbs_knownNode_select, 0), + reinterpret_cast(sqlite3_column_text (dbs_knownNode_select, 1)) + ); + + return; +} +bool SQL_registerRow (ActionRow row) +{ + SQL_databaseCheck(); + + sqlite3_stmt * dbs_do = (row.id)? dbs_replace: dbs_insert; + + /* + std::cout + << (row.id? "Replacing": "Inserting") + << " ActionRow" << std::endl; + */ + sqlite3_reset(dbs_do); + + int bind [20 + (((bool) row.id)? 1: 0)], ii = 0; + bool nodeMeta = false; + + bind[ii++] = sqlite3_bind_int (dbs_do, 1, row.actor); + bind[ii++] = sqlite3_bind_int (dbs_do, 2, row.timestamp); + bind[ii++] = sqlite3_bind_int (dbs_do, 3, row.type); + + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + std::string loc = row.location; + std::string locType = loc.substr(0, loc.find(":")); + nodeMeta = (locType == "nodemeta"); + + bind[ii++] = sqlite3_bind_text (dbs_do, 4, row.list.c_str(), row.list.size(), NULL); + bind[ii++] = sqlite3_bind_int (dbs_do, 5, row.index); + bind[ii++] = sqlite3_bind_int (dbs_do, 6, row.add); + bind[ii++] = sqlite3_bind_int (dbs_do, 7, row.stack.node); + bind[ii++] = sqlite3_bind_int (dbs_do, 8, row.stack.quantity); + bind[ii++] = sqlite3_bind_int (dbs_do, 9, (int) nodeMeta); + + if (nodeMeta) + { + std::string x, y, z; + int l, r; + l = loc.find(':') + 1; + r = loc.find(','); + x = loc.substr(l, r - l); + l = r + 1; + r = loc.find(',', l); + y = loc.substr(l, r - l); + z = loc.substr(r +1); + bind[ii++] = sqlite3_bind_int (dbs_do, 10, atoi(x.c_str())); + bind[ii++] = sqlite3_bind_int (dbs_do, 11, atoi(y.c_str())); + bind[ii++] = sqlite3_bind_int (dbs_do, 12, atoi(z.c_str())); + } + } + else + { + bind[ii++] = sqlite3_bind_null (dbs_do, 4); + bind[ii++] = sqlite3_bind_null (dbs_do, 5); + bind[ii++] = sqlite3_bind_null (dbs_do, 6); + bind[ii++] = sqlite3_bind_null (dbs_do, 7); + bind[ii++] = sqlite3_bind_null (dbs_do, 8); + bind[ii++] = sqlite3_bind_null (dbs_do, 9); + } + + if (row.type == RollbackAction::TYPE_SET_NODE) + { + bind[ii++] = sqlite3_bind_int (dbs_do, 10, row.x); + bind[ii++] = sqlite3_bind_int (dbs_do, 11, row.y); + bind[ii++] = sqlite3_bind_int (dbs_do, 12, row.z); + bind[ii++] = sqlite3_bind_int (dbs_do, 13, row.oldNode); + bind[ii++] = sqlite3_bind_int (dbs_do, 14, row.oldParam1); + bind[ii++] = sqlite3_bind_int (dbs_do, 15, row.oldParam2); + bind[ii++] = sqlite3_bind_text (dbs_do, 16, row.oldMeta.c_str(), row.oldMeta.size(), NULL); + bind[ii++] = sqlite3_bind_int (dbs_do, 17, row.newNode); + bind[ii++] = sqlite3_bind_int (dbs_do, 18, row.newParam1); + bind[ii++] = sqlite3_bind_int (dbs_do, 19, row.newParam2); + bind[ii++] = sqlite3_bind_text (dbs_do, 20, row.newMeta.c_str(), row.newMeta.size(), NULL); + bind[ii++] = sqlite3_bind_int (dbs_do, 21, row.guessed? 1: 0); + } + else + { + if (!nodeMeta) + { + bind[ii++] = sqlite3_bind_null (dbs_do, 10); + bind[ii++] = sqlite3_bind_null (dbs_do, 11); + bind[ii++] = sqlite3_bind_null (dbs_do, 12); + } + bind[ii++] = sqlite3_bind_null (dbs_do, 13); + bind[ii++] = sqlite3_bind_null (dbs_do, 14); + bind[ii++] = sqlite3_bind_null (dbs_do, 15); + bind[ii++] = sqlite3_bind_null (dbs_do, 16); + bind[ii++] = sqlite3_bind_null (dbs_do, 17); + bind[ii++] = sqlite3_bind_null (dbs_do, 18); + bind[ii++] = sqlite3_bind_null (dbs_do, 19); + bind[ii++] = sqlite3_bind_null (dbs_do, 20); + bind[ii++] = sqlite3_bind_null (dbs_do, 21); + } + + if (row.id) + bind[ii++] = sqlite3_bind_int (dbs_do, 22, row.id); + + for (ii = 0; ii < 20; ++ii) + if (bind[ii] != SQLITE_OK) + infostream + << "WARNING: failed to bind param " << ii + 1 + << " when inserting an entry in table setnode" << std::endl; + + /* + std::cout << "========DB-WRITTEN==========" << std::endl; + std::cout << "id: " << row.id << std::endl; + std::cout << "actor: " << row.actor << std::endl; + std::cout << "time: " << row.timestamp << std::endl; + std::cout << "type: " << row.type << std::endl; + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + std::cout << "Location: " << row.location << std::endl; + std::cout << "List: " << row.list << std::endl; + std::cout << "Index: " << row.index << std::endl; + std::cout << "Add: " << row.add << std::endl; + std::cout << "Stack: " << row.stack << std::endl; + } + if (row.type == RollbackAction::TYPE_SET_NODE) + { + std::cout << "x: " << row.x << std::endl; + std::cout << "y: " << row.y << std::endl; + std::cout << "z: " << row.z << std::endl; + std::cout << "oldNode: " << row.oldNode << std::endl; + std::cout << "oldParam1: " << row.oldParam1 << std::endl; + std::cout << "oldParam2: " << row.oldParam2 << std::endl; + std::cout << "oldMeta: " << row.oldMeta << std::endl; + std::cout << "newNode: " << row.newNode << std::endl; + std::cout << "newParam1: " << row.newParam1 << std::endl; + std::cout << "newParam2: " << row.newParam2 << std::endl; + std::cout << "newMeta: " << row.newMeta << std::endl; + std::cout << "DESERIALIZE" << row.newMeta.c_str() << std::endl; + std::cout << "guessed: " << row.guessed << std::endl; + } + */ + + int written = sqlite3_step(dbs_do); + + return written == SQLITE_DONE; + + //if (written != SQLITE_DONE) + // std::cout << "WARNING: rollback action not written: " << sqlite3_errmsg(dbh) << std::endl; + //else std::cout << "Action correctly inserted via SQL" << std::endl; +} +std::list actionRowsFromSelect (sqlite3_stmt* stmt) +{ + std::list rows; + const unsigned char * text; + size_t size; + + while (SQLITE_ROW == sqlite3_step(stmt)) + { + ActionRow row; + + row.actor = sqlite3_column_int (stmt, 0); + row.timestamp = sqlite3_column_int (stmt, 1); + row.type = sqlite3_column_int (stmt, 2); + + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + text = sqlite3_column_text (stmt, 3); + size = sqlite3_column_bytes(stmt, 3); + row.list = std::string(reinterpret_cast(text), size); + row.index = sqlite3_column_int (stmt, 4); + row.add = sqlite3_column_int (stmt, 5); + row.stack.node = sqlite3_column_int (stmt, 6); + row.stack.quantity = sqlite3_column_int (stmt, 7); + row.nodeMeta = sqlite3_column_int (stmt, 8); + } + + if (row.type == RollbackAction::TYPE_SET_NODE || row.nodeMeta) + { + row.x = sqlite3_column_int (stmt, 9); + row.y = sqlite3_column_int (stmt, 10); + row.z = sqlite3_column_int (stmt, 11); + } + + if (row.type == RollbackAction::TYPE_SET_NODE) + { + row.oldNode = sqlite3_column_int (stmt, 12); + row.oldParam1 = sqlite3_column_int (stmt, 13); + row.oldParam2 = sqlite3_column_int (stmt, 14); + text = sqlite3_column_text (stmt, 15); + size = sqlite3_column_bytes(stmt, 15); + row.oldMeta = std::string(reinterpret_cast(text), size); + row.newNode = sqlite3_column_int (stmt, 16); + row.newParam1 = sqlite3_column_int (stmt, 17); + row.newParam2 = sqlite3_column_int (stmt, 18); + text = sqlite3_column_text (stmt, 19); + size = sqlite3_column_bytes(stmt, 19); + row.newMeta = std::string(reinterpret_cast(text), size); + row.guessed = sqlite3_column_int (stmt, 20); + } + + row.location = row.nodeMeta? "nodemeta:": getActorName(row.actor); + + if (row.nodeMeta) + { + row.location.append(itos(row.x)); + row.location.append(","); + row.location.append(itos(row.y)); + row.location.append(","); + row.location.append(itos(row.z)); + } + + /* + std::cout << "=======SELECTED==========" << "\n"; + std::cout << "Actor: " << row.actor << "\n"; + std::cout << "Timestamp: " << row.timestamp << "\n"; + + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + std::cout << "list: " << row.list << "\n"; + std::cout << "index: " << row.index << "\n"; + std::cout << "add: " << row.add << "\n"; + std::cout << "stackNode: " << row.stack.node << "\n"; + std::cout << "stackQuantity: " << row.stack.quantity << "\n"; + if (row.nodeMeta) + { + std::cout << "X: " << row.x << "\n"; + std::cout << "Y: " << row.y << "\n"; + std::cout << "Z: " << row.z << "\n"; + } + std::cout << "Location: " << row.location << "\n"; + } + else + { + std::cout << "X: " << row.x << "\n"; + std::cout << "Y: " << row.y << "\n"; + std::cout << "Z: " << row.z << "\n"; + std::cout << "oldNode: " << row.oldNode << "\n"; + std::cout << "oldParam1: " << row.oldParam1 << "\n"; + std::cout << "oldParam2: " << row.oldParam2 << "\n"; + std::cout << "oldMeta: " << row.oldMeta << "\n"; + std::cout << "newNode: " << row.newNode << "\n"; + std::cout << "newParam1: " << row.newParam1 << "\n"; + std::cout << "newParam2: " << row.newParam2 << "\n"; + std::cout << "newMeta: " << row.newMeta << "\n"; + std::cout << "guessed: " << row.guessed << "\n"; + } + */ + + rows.push_back(row); + } + + return rows; +} +ActionRow actionRowFromRollbackAction (RollbackAction action) +{ + ActionRow row; + + row.id = 0; + row.actor = getActorId(action.actor); + row.timestamp = action.unix_time; + row.type = action.type; + + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + row.location = action.inventory_location; + row.list = action.inventory_list; + row.index = action.inventory_index; + row.add = action.inventory_add; + row.stack = getStackFromString(action.inventory_stack); + } + else + { + row.x = action.p.X; + row.y = action.p.Y; + row.z = action.p.Z; + row.oldNode = getNodeId(action.n_old.name); + row.oldParam1 = action.n_old.param1; + row.oldParam2 = action.n_old.param2; + row.oldMeta = action.n_old.meta; + row.newNode = getNodeId(action.n_new.name); + row.newParam1 = action.n_new.param1; + row.newParam2 = action.n_new.param2; + row.newMeta = action.n_new.meta; + row.guessed = action.actor_is_guess; + } + + return row; +} +std::list rollbackActionsFromActionRows (std::list rows) +{ + std::list actions; + std::list::const_iterator it; + + for (it = rows.begin(); it != rows.end(); ++it) + { + RollbackAction action; + action.actor = (it->actor)? getActorName(it->actor): ""; + action.unix_time = it->timestamp; + action.type = static_cast(it->type); + + switch (action.type) + { + case RollbackAction::TYPE_MODIFY_INVENTORY_STACK: + + action.inventory_location = it->location.c_str(); + action.inventory_list = it->list; + action.inventory_index = it->index; + action.inventory_add = it->add; + action.inventory_stack = getStringFromStack(it->stack); + break; + + case RollbackAction::TYPE_SET_NODE: + + action.p = v3s16(it->x, it->y, it->z); + action.n_old.name = getNodeName(it->oldNode); + action.n_old.param1 = it->oldParam1; + action.n_old.param2 = it->oldParam2; + action.n_old.meta = it->oldMeta; + action.n_new.name = getNodeName(it->newNode); + action.n_new.param1 = it->newParam1; + action.n_new.param2 = it->newParam2; + action.n_new.meta = it->newMeta; + break; + + default: + + throw("W.T.F."); + break; + } + + actions.push_back(action); + } + + return actions; +} +std::list SQL_getRowsSince (int firstTime, std::string actor = "") +{ + sqlite3_stmt * dbs_stmt = (!actor.length())? dbs_select: dbs_select_withActor; + sqlite3_reset (dbs_stmt); + sqlite3_bind_int (dbs_stmt, 1, firstTime); + + if (actor.length()) + sqlite3_bind_int (dbs_stmt, 2, getActorId(actor)); + + return actionRowsFromSelect(dbs_stmt); +} +std::list SQL_getRowsSince_range (int firstTime, v3s16 p, int range) +{ + sqlite3_stmt * stmt = dbs_select_range; + sqlite3_reset(stmt); + + sqlite3_bind_int(stmt, 1, firstTime); + sqlite3_bind_int(stmt, 2, (int) p.X); + sqlite3_bind_int(stmt, 3, range); + sqlite3_bind_int(stmt, 4, (int) p.Y); + sqlite3_bind_int(stmt, 5, range); + sqlite3_bind_int(stmt, 6, (int) p.Z); + sqlite3_bind_int(stmt, 7, range); + + return actionRowsFromSelect(stmt); +} +std::list SQL_getActionsSince_range (int firstTime, v3s16 p, int range) +{ + std::list rows = SQL_getRowsSince_range(firstTime, p, range); + + return rollbackActionsFromActionRows(rows); +} +std::list SQL_getActionsSince (int firstTime, std::string actor = "") +{ + std::list rows = SQL_getRowsSince(firstTime, actor); + return rollbackActionsFromActionRows(rows); +} +void TXT_migrate (std::string filepath) +{ + std::cout << "Migrating from rollback.txt to rollback.sqlite" << std::endl; + SQL_databaseCheck(); + + std::ifstream fh (filepath.c_str(), std::ios::in | std::ios::ate); + if (!fh.good()) throw("DIE"); + + int filesize = fh.tellg(); + + if (filesize > 10) + { + fh.seekg(0); + + std::string bit; + int i = 0; + int id = 1; + int t = 0; + do + { + ActionRow row; + + row.id = id; + + // Get the timestamp + std::getline(fh, bit, ' '); bit = trim(bit); if (!atoi(trim(bit).c_str())) { std::getline(fh, bit); continue; } + row.timestamp = atoi(bit.c_str()); + + // Get the actor + row.actor = getActorId(trim(deSerializeJsonString(fh))); + + // Get the action type + std::getline(fh, bit, '['); + std::getline(fh, bit, ' '); + + if (bit == "modify_inventory_stack") + row.type = RollbackAction::TYPE_MODIFY_INVENTORY_STACK; + + if (bit == "set_node") + row.type = RollbackAction::TYPE_SET_NODE; + + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + row.location = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); row.list = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); + row.index = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); row.add = (int) ( trim(bit) == "add" ); + row.stack = getStackFromString(trim(deSerializeJsonString(fh))); + std::getline(fh, bit); + + } + else + if (row.type == RollbackAction::TYPE_SET_NODE) + { + std::getline(fh, bit, '('); + std::getline(fh, bit, ','); row.x = atoi(trim(bit).c_str()); + std::getline(fh, bit, ','); row.y = atoi(trim(bit).c_str()); + std::getline(fh, bit, ')'); row.z = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); row.oldNode = getNodeId(trim(deSerializeJsonString(fh))); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); row.oldParam1 = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); row.oldParam2 = atoi(trim(bit).c_str()); + row.oldMeta = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); row.newNode = getNodeId(trim(deSerializeJsonString(fh))); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); row.newParam1 = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); row.newParam2 = atoi(trim(bit).c_str()); + row.newMeta = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); + std::getline(fh, bit); row.guessed = (int) ( trim(bit) == "actor_is_guess" ); + } + + /* + std::cout << "==========READ===========" << std::endl; + std::cout << "time: " << row.timestamp << std::endl; + std::cout << "actor: " << row.actor << std::endl; + std::cout << "type: " << row.type << std::endl; + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) + { + std::cout << "Location: " << row.location << std::endl; + std::cout << "List: " << row.list << std::endl; + std::cout << "Index: " << row.index << std::endl; + std::cout << "Add: " << row.add << std::endl; + std::cout << "Stack: " << row.stack << std::endl; + } + if (row.type == RollbackAction::TYPE_SET_NODE) + { + std::cout << "x: " << row.x << std::endl; + std::cout << "y: " << row.y << std::endl; + std::cout << "z: " << row.z << std::endl; + std::cout << "oldNode: " << row.oldNode << std::endl; + std::cout << "oldParam1: " << row.oldParam1 << std::endl; + std::cout << "oldParam2: " << row.oldParam2 << std::endl; + std::cout << "oldMeta: " << row.oldMeta << std::endl; + std::cout << "newNode: " << row.newNode << std::endl; + std::cout << "newParam1: " << row.newParam1 << std::endl; + std::cout << "newParam2: " << row.newParam2 << std::endl; + std::cout << "newMeta: " << row.newMeta << std::endl; + std::cout << "guessed: " << row.guessed << std::endl; + } + */ + + if (i == 0) + { + t = time(0); + sqlite3_exec(dbh, "BEGIN", NULL, NULL, NULL); + } + + SQL_registerRow(row); ++i; + + if (time(0) - t) + { + sqlite3_exec(dbh, "COMMIT", NULL, NULL, NULL); + t = time(0) - t; + std::cout + << " Done: " << (int)(((float) fh.tellg() / (float) filesize) * 100) << "%" + << "\tSpeed: " << i / t << " actions inserted per second " + << "\r"; + std::cout.flush(); + i = 0; + } + + ++id; + } + while (!fh.eof() && fh.good()); + } + + std::cout + << " Done: 100%" << std::endl + << " Now you can delete the old rollback.txt file." << std::endl; +} // Get nearness factor for subject's action for this action // Return value: 0 = impossible, >0 = factor static float getSuspectNearness(bool is_guess, v3s16 suspect_p, int suspect_t, @@ -56,38 +921,43 @@ static float getSuspectNearness(bool is_guess, v3s16 suspect_p, int suspect_t, f = 0; return f; } - class RollbackManager: public IRollbackManager { public: // IRollbackManager interface - void reportAction(const RollbackAction &action_) { // Ignore if not important - if(!action_.isImportant(m_gamedef)) + if (!action_.isImportant(m_gamedef)) return; + RollbackAction action = action_; action.unix_time = time(0); + // Figure out actor action.actor = m_current_actor; action.actor_is_guess = m_current_actor_is_guess; - // If actor is not known, find out suspect or cancel - if(action.actor.empty()){ + + if (action.actor.empty()) // If actor is not known, find out suspect or cancel + { v3s16 p; - if(!action.getPosition(&p)) + if (!action.getPosition(&p)) return; + action.actor = getSuspect(p, 83, 1); - if(action.actor.empty()) + if (action.actor.empty()) return; + action.actor_is_guess = true; } - infostream<<"RollbackManager::reportAction():" - <<" time="<::const_iterator - i = m_action_todisk_buffer.begin(); - i != m_action_todisk_buffer.end(); i++) + infostream << "RollbackManager::flush()" << std::endl; + + sqlite3_exec(dbh, "BEGIN", NULL, NULL, NULL); + + std::list::const_iterator iter; + + for (iter = m_action_todisk_buffer.begin(); + iter != m_action_todisk_buffer.end(); + iter++) { - // Do not save stuff that does not have an actor - if(i->actor == "") + if (iter->actor == "") continue; - of<unix_time; - of<<" "; - of<actor); - of<<" "; - of<toString(); - if(i->actor_is_guess){ - of<<" "; - of<<"actor_is_guess"; - } - of<= 100) + if(m_action_todisk_buffer.size() >= 500) flush(); } - - bool readFile(std::list &dst) - { - // Load whole file to memory - std::ifstream f(m_filepath.c_str(), std::ios::in); - if(!f.good()){ - errorstream<<"RollbackManager::readFile(): Could not open " - <<"file for reading: \""< getEntriesSince(int first_time) { - infostream<<"RollbackManager::getEntriesSince("< action_buffer; - // Use the latest buffer if it is long enough - if(!m_action_latest_buffer.empty() && - m_action_latest_buffer.begin()->unix_time <= first_time){ - action_buffer = m_action_latest_buffer; - } - else - { - // Save all remaining stuff - flush(); - // Load whole file to memory - bool good = readFile(action_buffer); - if(!good){ - errorstream<<"RollbackManager::getEntriesSince(): Failed to" - <<" open file; using data in memory."< action_buffer = getEntriesSince(first_time); + flush(); - std::list result; - - for(std::list::const_reverse_iterator - i = action_buffer.rbegin(); - i != action_buffer.rend(); i++) - { - if(i->unix_time < first_time) - break; - - // Find position of action or continue - v3s16 action_p; - if(!i->getPosition(&action_p)) - continue; - - if(range == 0){ - if(action_p != p) - continue; - } else { - if(abs(action_p.X - p.X) > range || - abs(action_p.Y - p.Y) > range || - abs(action_p.Z - p.Z) > range) - continue; - } - - if(act_p) - *act_p = action_p; - if(act_seconds) - *act_seconds = cur_time - i->unix_time; - return i->actor; - } - return ""; - } - - std::list getRevertActions(const std::string &actor_filter, - int seconds) - { - infostream<<"RollbackManager::getRevertActions("< action_buffer = getEntriesSince(first_time); - - std::list result; - - for(std::list::const_reverse_iterator - i = action_buffer.rbegin(); - i != action_buffer.rend(); i++) - { - if(i->unix_time < first_time) - break; - if(i->actor != actor_filter) - continue; - const RollbackAction &action = *i; - /*infostream<<"RollbackManager::revertAction(): Should revert" - <<" time="< getRevertActions(const std::string &actor_filter, int seconds) + { + infostream + << "RollbackManager::getRevertActions(" << actor_filter + << ", " << seconds << ")" + << std::endl; + + // Figure out time + int cur_time = time(0); + int first_time = cur_time - seconds; + + flush(); + + std::list result = SQL_getActionsSince(first_time, actor_filter); + + return result; + } private: std::string m_filepath; IGameDef *m_gamedef; @@ -360,5 +1148,3 @@ IRollbackManager *createRollbackManager(const std::string &filepath, IGameDef *g { return new RollbackManager(filepath, gamedef); } - - From 7433d65d3e383cd3d2f5ced38d9109e9fd7c72c0 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Tue, 12 Nov 2013 16:13:00 -0500 Subject: [PATCH 128/198] Rollback fixes and get_node_actions --- builtin/chatcommands.lua | 53 +- builtin/deprecated.lua | 5 + doc/lua_api.txt | 4 +- src/rollback.cpp | 1023 +++++++++++++++-------------- src/rollback.h | 12 +- src/rollback_interface.h | 2 +- src/script/lua_api/l_rollback.cpp | 80 ++- src/script/lua_api/l_rollback.h | 7 +- 8 files changed, 618 insertions(+), 568 deletions(-) diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua index 831d3a7b4..b9661a888 100644 --- a/builtin/chatcommands.lua +++ b/builtin/chatcommands.lua @@ -515,34 +515,45 @@ minetest.register_on_punchnode(function(pos, node, puncher) end) minetest.register_chatcommand("rollback_check", { - params = "[] []", + params = "[] [] [limit]", description = "check who has last touched a node or near it, ".. - "max. ago (default range=0, seconds=86400=24h)", + "max. ago (default range=0, seconds=86400=24h, limit=5)", privs = {rollback=true}, func = function(name, param) - local range, seconds = string.match(param, "(%d+) *(%d*)") + local range, seconds, limit = + param:match("(%d+) *(%d*) *(%d*)") range = tonumber(range) or 0 seconds = tonumber(seconds) or 86400 - minetest.chat_send_player(name, "Punch a node (limits set: range=".. - dump(range).." seconds="..dump(seconds).."s)") + limit = tonumber(limit) or 5 + if limit > 100 then + minetest.chat_send_player(name, "That limit is too high!") + return + end + minetest.chat_send_player(name, "Punch a node (range=".. + range..", seconds="..seconds.."s, limit="..limit..")") + minetest.rollback_punch_callbacks[name] = function(pos, node, puncher) local name = puncher:get_player_name() - minetest.chat_send_player(name, "Checking...") - local actor, act_p, act_seconds = - minetest.rollback_get_last_node_actor(pos, range, seconds) - if actor == "" then + minetest.chat_send_player(name, "Checking "..minetest.pos_to_string(pos).."...") + local actions = minetest.rollback_get_node_actions(pos, range, seconds, limit) + local num_actions = #actions + if num_actions == 0 then minetest.chat_send_player(name, "Nobody has touched the ".. - "specified location in "..dump(seconds).." seconds") + "specified location in "..seconds.." seconds") return end - local nodedesc = "this node" - if act_p.x ~= pos.x or act_p.y ~= pos.y or act_p.z ~= pos.z then - nodedesc = minetest.pos_to_string(act_p) + local time = os.time() + for i = num_actions, 1, -1 do + local action = actions[i] + minetest.chat_send_player(name, + ("%s %s %s -> %s %d seconds ago.") + :format( + minetest.pos_to_string(action.pos), + action.actor, + action.oldnode.name, + action.newnode.name, + time - action.time)) end - local nodename = minetest.get_node(act_p).name - minetest.chat_send_player(name, "Last actor on "..nodedesc.. - " was "..actor..", "..dump(act_seconds).. - "s ago (node is now "..nodename..")") end end, }) @@ -554,7 +565,7 @@ minetest.register_chatcommand("rollback", { func = function(name, param) local target_name, seconds = string.match(param, ":([^ ]+) *(%d*)") if not target_name then - local player_name = nil; + local player_name = nil player_name, seconds = string.match(param, "([^ ]+) *(%d*)") if not player_name then minetest.chat_send_player(name, "Invalid parameters. See /help rollback and /help rollback_check") @@ -564,13 +575,13 @@ minetest.register_chatcommand("rollback", { end seconds = tonumber(seconds) or 60 minetest.chat_send_player(name, "Reverting actions of ".. - dump(target_name).." since "..dump(seconds).." seconds.") + target_name.." since "..seconds.." seconds.") local success, log = minetest.rollback_revert_actions_by( target_name, seconds) - if #log > 10 then + if #log > 100 then minetest.chat_send_player(name, "(log is too long to show)") else - for _,line in ipairs(log) do + for _, line in pairs(log) do minetest.chat_send_player(name, line) end end diff --git a/builtin/deprecated.lua b/builtin/deprecated.lua index 333f64cdc..d8b578d48 100644 --- a/builtin/deprecated.lua +++ b/builtin/deprecated.lua @@ -46,3 +46,8 @@ setmetatable(minetest.env, { return rawget(table, key) end }) + +function minetest.rollback_get_last_node_actor(pos, range, seconds) + return minetest.rollback_get_node_actions(pos, range, seconds, 1)[1] +end + diff --git a/doc/lua_api.txt b/doc/lua_api.txt index d0090a89c..cd9e27b7a 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1402,8 +1402,8 @@ minetest.handle_node_drops(pos, drops, digger) ^ Can be overridden to get different functionality (eg. dropping items on ground) -Rollbacks: -minetest.rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds +Rollback: +minetest.rollback_get_node_actions(pos, range, seconds, limit) -> {{actor, pos, time, oldnode, newnode}, ...} ^ Find who has done something to a node, or near a node ^ actor: "player:", also "liquid". minetest.rollback_revert_actions_by(actor, seconds) -> bool, log messages diff --git a/src/rollback.cpp b/src/rollback.cpp index b95cc7bf3..4dc462af6 100644 --- a/src/rollback.cpp +++ b/src/rollback.cpp @@ -48,41 +48,40 @@ sqlite3_stmt* dbs_knownActor_insert; sqlite3_stmt* dbs_knownNode_select; sqlite3_stmt* dbs_knownNode_insert; -struct Stack -{ +struct Stack { int node; int quantity; }; -struct ActionRow -{ - int id; - int actor; - int timestamp; - int type; - std::string location, list; - int index, add; - Stack stack; - int nodeMeta; - int x, y, z; - int oldNode; - int oldParam1, oldParam2; - std::string oldMeta; - int newNode; - int newParam1, newParam2; - std::string newMeta; - int guessed; +struct ActionRow { + int id; + int actor; + time_t timestamp; + int type; + std::string location, list; + int index, add; + Stack stack; + int nodeMeta; + int x, y, z; + int oldNode; + int oldParam1, oldParam2; + std::string oldMeta; + int newNode; + int newParam1, newParam2; + std::string newMeta; + int guessed; }; -struct Entity -{ - int id; - std::string name; + +struct Entity { + int id; + std::string name; }; + typedef std::vector Entities; Entities KnownActors; Entities KnownNodes; -void registerNewActor (int id, std::string name) +void registerNewActor(int id, std::string name) { Entity newActor; @@ -93,7 +92,8 @@ void registerNewActor (int id, std::string name) //std::cout << "New actor registered: " << id << " | " << name << std::endl; } -void registerNewNode (int id, std::string name) + +void registerNewNode(int id, std::string name) { Entity newNode; @@ -104,17 +104,19 @@ void registerNewNode (int id, std::string name) //std::cout << "New node registered: " << id << " | " << name << std::endl; } -int getActorId (std::string name) + +int getActorId(std::string name) { Entities::const_iterator iter; for (iter = KnownActors.begin(); iter != KnownActors.end(); ++iter) - if (iter->name == name) + if (iter->name == name) { return iter->id; + } - sqlite3_reset (dbs_knownActor_insert); - sqlite3_bind_text (dbs_knownActor_insert, 1, name.c_str(), -1, NULL); - sqlite3_step (dbs_knownActor_insert); + sqlite3_reset(dbs_knownActor_insert); + sqlite3_bind_text(dbs_knownActor_insert, 1, name.c_str(), -1, NULL); + sqlite3_step(dbs_knownActor_insert); int id = sqlite3_last_insert_rowid(dbh); @@ -124,17 +126,19 @@ int getActorId (std::string name) return id; } -int getNodeId (std::string name) + +int getNodeId(std::string name) { Entities::const_iterator iter; for (iter = KnownNodes.begin(); iter != KnownNodes.end(); ++iter) - if (iter->name == name) + if (iter->name == name) { return iter->id; + } - sqlite3_reset (dbs_knownNode_insert); - sqlite3_bind_text (dbs_knownNode_insert, 1, name.c_str(), -1, NULL); - sqlite3_step (dbs_knownNode_insert); + sqlite3_reset(dbs_knownNode_insert); + sqlite3_bind_text(dbs_knownNode_insert, 1, name.c_str(), -1, NULL); + sqlite3_step(dbs_knownNode_insert); int id = sqlite3_last_insert_rowid(dbh); @@ -142,31 +146,36 @@ int getNodeId (std::string name) return id; } -const char * getActorName (int id) + +const char * getActorName(int id) { Entities::const_iterator iter; //std::cout << "getActorName of id " << id << std::endl; for (iter = KnownActors.begin(); iter != KnownActors.end(); ++iter) - if (iter->id == id) + if (iter->id == id) { return iter->name.c_str(); + } return ""; } -const char * getNodeName (int id) + +const char * getNodeName(int id) { Entities::const_iterator iter; //std::cout << "getNodeName of id " << id << std::endl; for (iter = KnownNodes.begin(); iter != KnownNodes.end(); ++iter) - if (iter->id == id) + if (iter->id == id) { return iter->name.c_str(); + } return ""; } -Stack getStackFromString (std::string text) + +Stack getStackFromString(std::string text) { Stack stack; @@ -177,7 +186,8 @@ Stack getStackFromString (std::string text) return stack; } -std::string getStringFromStack (Stack stack) + +std::string getStringFromStack(Stack stack) { std::string text; @@ -187,199 +197,204 @@ std::string getStringFromStack (Stack stack) return text; } -bool SQL_createDatabase (void) + +bool SQL_createDatabase(void) { infostream << "CreateDB:" << dbp << std::endl; - int dbs = sqlite3_exec( - dbh - , "CREATE TABLE IF NOT EXISTS `actor` (" - "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," - "`name` TEXT NOT NULL);" - "CREATE TABLE IF NOT EXISTS `node` (" - "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," - "`name` TEXT NOT NULL);" + int dbs = sqlite3_exec(dbh, + "CREATE TABLE IF NOT EXISTS `actor` (" + "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + "`name` TEXT NOT NULL);" + "CREATE TABLE IF NOT EXISTS `node` (" + "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + "`name` TEXT NOT NULL);" "CREATE TABLE IF NOT EXISTS `action` (" - "`id` INTEGER PRIMARY KEY AUTOINCREMENT," - "`actor` INTEGER NOT NULL," - "`timestamp` INTEGER NOT NULL," - "`type` INTEGER NOT NULL," - "`list` TEXT," - "`index` INTEGER," - "`add` INTEGER," - "`stackNode` INTEGER," - "`stackQuantity` INTEGER," - "`nodeMeta` INTEGER," - "`x` INT," - "`y` INT," - "`z` INT," - "`oldNode` INTEGER," - "`oldParam1` INTEGER," - "`oldParam2` INTEGER," - "`oldMeta` TEXT," - "`newNode` INTEGER," - "`newParam1` INTEGER," - "`newParam2` INTEGER," - "`newMeta` TEXT," - "`guessedActor` INTEGER," - "FOREIGN KEY (`actor`) REFERENCES `actor`(`id`)," - "FOREIGN KEY (`oldNode`) REFERENCES `node`(`id`)," - "FOREIGN KEY (`newNode`) REFERENCES `node`(`id`));" + "`id` INTEGER PRIMARY KEY AUTOINCREMENT," + "`actor` INTEGER NOT NULL," + "`timestamp` TIMESTAMP NOT NULL," + "`type` INTEGER NOT NULL," + "`list` TEXT," + "`index` INTEGER," + "`add` INTEGER," + "`stackNode` INTEGER," + "`stackQuantity` INTEGER," + "`nodeMeta` INTEGER," + "`x` INT," + "`y` INT," + "`z` INT," + "`oldNode` INTEGER," + "`oldParam1` INTEGER," + "`oldParam2` INTEGER," + "`oldMeta` TEXT," + "`newNode` INTEGER," + "`newParam1` INTEGER," + "`newParam2` INTEGER," + "`newMeta` TEXT," + "`guessedActor` INTEGER," + "FOREIGN KEY (`actor`) REFERENCES `actor`(`id`)," + "FOREIGN KEY (`oldNode`) REFERENCES `node`(`id`)," + "FOREIGN KEY (`newNode`) REFERENCES `node`(`id`));" "CREATE INDEX IF NOT EXISTS `actionActor` ON `action`(`actor`);" - "CREATE INDEX IF NOT EXISTS `actionTimestamp` ON `action`(`timestamp`);" - , NULL, NULL, NULL - ); - if (dbs == SQLITE_ABORT) + "CREATE INDEX IF NOT EXISTS `actionTimestamp` ON `action`(`timestamp`);", + NULL, NULL, NULL); + if (dbs == SQLITE_ABORT) { throw FileNotGoodException("Could not create sqlite3 database structure"); - else - if (dbs != 0) + } else if (dbs != 0) { throw FileNotGoodException("SQL Rollback: Exec statement to create table structure returned a non-zero value"); - else + } else { infostream << "SQL Rollback: SQLite3 database structure was created" << std::endl; + } return true; } -void SQL_databaseCheck (void) +void SQL_databaseCheck(void) { - if (dbh) return; + if (dbh) { + return; + } infostream << "Database connection setup" << std::endl; bool needsCreate = !fs::PathExists(dbp); - int dbo = sqlite3_open_v2(dbp.c_str(), &dbh, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); + int dbo = sqlite3_open_v2(dbp.c_str(), &dbh, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, + NULL); - if (dbo != SQLITE_OK) - { - infostream - << "SQLROLLBACK: SQLite3 database failed to open: " - << sqlite3_errmsg(dbh) - << std::endl; + if (dbo != SQLITE_OK) { + infostream << "SQLROLLBACK: SQLite3 database failed to open: " + << sqlite3_errmsg(dbh) << std::endl; throw FileNotGoodException("Cannot open database file"); } - if (needsCreate) SQL_createDatabase(); + if (needsCreate) { + SQL_createDatabase(); + } int dbr; - dbr = sqlite3_prepare_v2( - dbh - , "INSERT INTO `action`" - " ( `actor`, `timestamp`, `type`," - " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodeMeta`," - " `x`, `y`, `z`," - " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," - " `newNode`, `newParam1`, `newParam2`, `newMeta`," - " `guessedActor`" - " )" - "VALUES" - " ( ?, ?, ?," - " ?, ?, ?, ?, ?, ?," - " ?, ?, ?," - " ?, ?, ?, ?," - " ?, ?, ?, ?," - " ?" - " );" - , -1, &dbs_insert, NULL - ); + dbr = sqlite3_prepare_v2(dbh, + "INSERT INTO `action` (" + " `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodeMeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`" + ") VALUES (" + " ?, ?, ?," + " ?, ?, ?, ?, ?, ?," + " ?, ?, ?," + " ?, ?, ?, ?," + " ?, ?, ?, ?," + " ?" + ");", + -1, &dbs_insert, NULL); - if (dbr != SQLITE_OK) + if (dbr != SQLITE_OK) { throw FileNotGoodException(sqlite3_errmsg(dbh)); + } - dbr = sqlite3_prepare_v2( - dbh - , "REPLACE INTO `action`" - " ( `actor`, `timestamp`, `type`," - " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodeMeta`," - " `x`, `y`, `z`," - " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," - " `newNode`, `newParam1`, `newParam2`, `newMeta`," - " `guessedActor`, `id`" - " )" - "VALUES" - " ( ?, ?, ?," - " ?, ?, ?, ?, ?, ?," - " ?, ?, ?," - " ?, ?, ?, ?," - " ?, ?, ?, ?," - " ?, ?" - " );" - , -1, &dbs_replace, NULL - ); + dbr = sqlite3_prepare_v2(dbh, + "REPLACE INTO `action` (" + " `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodeMeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`, `id`" + ") VALUES (" + " ?, ?, ?," + " ?, ?, ?, ?, ?, ?," + " ?, ?, ?," + " ?, ?, ?, ?," + " ?, ?, ?, ?," + " ?, ?" + ");", + -1, &dbs_replace, NULL); - if (dbr != SQLITE_OK) + if (dbr != SQLITE_OK) { throw FileNotGoodException(sqlite3_errmsg(dbh)); + } - dbr = sqlite3_prepare_v2(dbh - , "SELECT " - " `actor`, `timestamp`, `type`" - " , `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`" - " , `x`, `y`, `z`" - " , `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`" - " , `newNode`, `newParam1`, `newParam2`, `newMeta`" - " , `guessedActor`" + dbr = sqlite3_prepare_v2(dbh, + "SELECT" + " `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`" " FROM `action`" " WHERE `timestamp` >= ?" - " ORDER BY `timestamp` DESC, `id` DESC" - , -1, &dbs_select, NULL - ); - if (dbr != SQLITE_OK) + " ORDER BY `timestamp` DESC, `id` DESC", + -1, &dbs_select, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } - dbr = sqlite3_prepare_v2(dbh - , "SELECT " - " `actor`, `timestamp`, `type`" - " , `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`" - " , `x`, `y`, `z`" - " , `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`" - " , `newNode`, `newParam1`, `newParam2`, `newMeta`" - " , `guessedActor`" + dbr = sqlite3_prepare_v2(dbh, + "SELECT" + " `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`" " FROM `action`" " WHERE `timestamp` >= ?" " AND `x` IS NOT NULL" " AND `y` IS NOT NULL" " AND `z` IS NOT NULL" - " AND (ABS(`x`) - ABS(?)) <= ?" - " AND (ABS(`y`) - ABS(?)) <= ?" - " AND (ABS(`z`) - ABS(?)) <= ?" + " AND ABS(`x` - ?) <= ?" + " AND ABS(`y` - ?) <= ?" + " AND ABS(`z` - ?) <= ?" " ORDER BY `timestamp` DESC, `id` DESC" - " LIMIT 0,5" - , -1, &dbs_select_range, NULL - ); - if (dbr != SQLITE_OK) + " LIMIT 0,?", + -1, &dbs_select_range, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } - dbr = sqlite3_prepare_v2(dbh - , "SELECT " - " `actor`, `timestamp`, `type`" - " , `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`" - " , `x`, `y`, `z`" - " , `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`" - " , `newNode`, `newParam1`, `newParam2`, `newMeta`" - " , `guessedActor`" + dbr = sqlite3_prepare_v2(dbh, + "SELECT" + " `actor`, `timestamp`, `type`," + " `list`, `index`, `add`, `stackNode`, `stackQuantity`, `nodemeta`," + " `x`, `y`, `z`," + " `oldNode`, `oldParam1`, `oldParam2`, `oldMeta`," + " `newNode`, `newParam1`, `newParam2`, `newMeta`," + " `guessedActor`" " FROM `action`" " WHERE `timestamp` >= ?" " AND `actor` = ?" - " ORDER BY `timestamp` DESC, `id` DESC" - , -1, &dbs_select_withActor, NULL - ); - if (dbr != SQLITE_OK) + " ORDER BY `timestamp` DESC, `id` DESC", + -1, &dbs_select_withActor, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } - dbr = sqlite3_prepare_v2(dbh, "SELECT `id`, `name` FROM `actor`", -1, &dbs_knownActor_select, NULL); - if (dbr != SQLITE_OK) + dbr = sqlite3_prepare_v2(dbh, "SELECT `id`, `name` FROM `actor`", -1, + &dbs_knownActor_select, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } - dbr = sqlite3_prepare_v2(dbh, "INSERT INTO `actor` (`name`) VALUES (?)", -1, &dbs_knownActor_insert, NULL); - if (dbr != SQLITE_OK) + dbr = sqlite3_prepare_v2(dbh, "INSERT INTO `actor` (`name`) VALUES (?)", -1, + &dbs_knownActor_insert, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } - dbr = sqlite3_prepare_v2(dbh, "SELECT `id`, `name` FROM `node`", -1, &dbs_knownNode_select, NULL); - if (dbr != SQLITE_OK) + dbr = sqlite3_prepare_v2(dbh, "SELECT `id`, `name` FROM `node`", -1, + &dbs_knownNode_select, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } - dbr = sqlite3_prepare_v2(dbh, "INSERT INTO `node` (`name`) VALUES (?)", -1, &dbs_knownNode_insert, NULL); - if (dbr != SQLITE_OK) + dbr = sqlite3_prepare_v2(dbh, "INSERT INTO `node` (`name`) VALUES (?)", -1, + &dbs_knownNode_insert, NULL); + if (dbr != SQLITE_OK) { throw FileNotGoodException(itos(dbr).c_str()); + } infostream << "SQL prepared statements setup correctly" << std::endl; @@ -388,54 +403,52 @@ void SQL_databaseCheck (void) sqlite3_reset(dbs_knownActor_select); while (SQLITE_ROW == (select = sqlite3_step(dbs_knownActor_select))) registerNewActor( - sqlite3_column_int (dbs_knownActor_select, 0), - reinterpret_cast(sqlite3_column_text (dbs_knownActor_select, 1)) + sqlite3_column_int(dbs_knownActor_select, 0), + reinterpret_cast(sqlite3_column_text(dbs_knownActor_select, 1)) ); sqlite3_reset(dbs_knownNode_select); while (SQLITE_ROW == (select = sqlite3_step(dbs_knownNode_select))) registerNewNode( - sqlite3_column_int (dbs_knownNode_select, 0), - reinterpret_cast(sqlite3_column_text (dbs_knownNode_select, 1)) + sqlite3_column_int(dbs_knownNode_select, 0), + reinterpret_cast(sqlite3_column_text(dbs_knownNode_select, 1)) ); return; } -bool SQL_registerRow (ActionRow row) +bool SQL_registerRow(ActionRow row) { SQL_databaseCheck(); - sqlite3_stmt * dbs_do = (row.id)? dbs_replace: dbs_insert; + sqlite3_stmt * dbs_do = (row.id) ? dbs_replace : dbs_insert; /* std::cout - << (row.id? "Replacing": "Inserting") + << (row.id? "Replacing": "Inserting") << " ActionRow" << std::endl; */ sqlite3_reset(dbs_do); - int bind [20 + (((bool) row.id)? 1: 0)], ii = 0; + int bind [20 + (((bool) row.id) ? 1 : 0)], ii = 0; bool nodeMeta = false; - bind[ii++] = sqlite3_bind_int (dbs_do, 1, row.actor); - bind[ii++] = sqlite3_bind_int (dbs_do, 2, row.timestamp); - bind[ii++] = sqlite3_bind_int (dbs_do, 3, row.type); + bind[ii++] = sqlite3_bind_int(dbs_do, 1, row.actor); + bind[ii++] = sqlite3_bind_int64(dbs_do, 2, row.timestamp); + bind[ii++] = sqlite3_bind_int(dbs_do, 3, row.type); - if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) - { + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) { std::string loc = row.location; std::string locType = loc.substr(0, loc.find(":")); nodeMeta = (locType == "nodemeta"); - bind[ii++] = sqlite3_bind_text (dbs_do, 4, row.list.c_str(), row.list.size(), NULL); - bind[ii++] = sqlite3_bind_int (dbs_do, 5, row.index); - bind[ii++] = sqlite3_bind_int (dbs_do, 6, row.add); - bind[ii++] = sqlite3_bind_int (dbs_do, 7, row.stack.node); - bind[ii++] = sqlite3_bind_int (dbs_do, 8, row.stack.quantity); - bind[ii++] = sqlite3_bind_int (dbs_do, 9, (int) nodeMeta); + bind[ii++] = sqlite3_bind_text(dbs_do, 4, row.list.c_str(), row.list.size(), NULL); + bind[ii++] = sqlite3_bind_int(dbs_do, 5, row.index); + bind[ii++] = sqlite3_bind_int(dbs_do, 6, row.add); + bind[ii++] = sqlite3_bind_int(dbs_do, 7, row.stack.node); + bind[ii++] = sqlite3_bind_int(dbs_do, 8, row.stack.quantity); + bind[ii++] = sqlite3_bind_int(dbs_do, 9, (int) nodeMeta); - if (nodeMeta) - { + if (nodeMeta) { std::string x, y, z; int l, r; l = loc.find(':') + 1; @@ -444,64 +457,59 @@ bool SQL_registerRow (ActionRow row) l = r + 1; r = loc.find(',', l); y = loc.substr(l, r - l); - z = loc.substr(r +1); - bind[ii++] = sqlite3_bind_int (dbs_do, 10, atoi(x.c_str())); - bind[ii++] = sqlite3_bind_int (dbs_do, 11, atoi(y.c_str())); - bind[ii++] = sqlite3_bind_int (dbs_do, 12, atoi(z.c_str())); + z = loc.substr(r + 1); + bind[ii++] = sqlite3_bind_int(dbs_do, 10, atoi(x.c_str())); + bind[ii++] = sqlite3_bind_int(dbs_do, 11, atoi(y.c_str())); + bind[ii++] = sqlite3_bind_int(dbs_do, 12, atoi(z.c_str())); } - } - else - { - bind[ii++] = sqlite3_bind_null (dbs_do, 4); - bind[ii++] = sqlite3_bind_null (dbs_do, 5); - bind[ii++] = sqlite3_bind_null (dbs_do, 6); - bind[ii++] = sqlite3_bind_null (dbs_do, 7); - bind[ii++] = sqlite3_bind_null (dbs_do, 8); - bind[ii++] = sqlite3_bind_null (dbs_do, 9); + } else { + bind[ii++] = sqlite3_bind_null(dbs_do, 4); + bind[ii++] = sqlite3_bind_null(dbs_do, 5); + bind[ii++] = sqlite3_bind_null(dbs_do, 6); + bind[ii++] = sqlite3_bind_null(dbs_do, 7); + bind[ii++] = sqlite3_bind_null(dbs_do, 8); + bind[ii++] = sqlite3_bind_null(dbs_do, 9); } - if (row.type == RollbackAction::TYPE_SET_NODE) - { - bind[ii++] = sqlite3_bind_int (dbs_do, 10, row.x); - bind[ii++] = sqlite3_bind_int (dbs_do, 11, row.y); - bind[ii++] = sqlite3_bind_int (dbs_do, 12, row.z); - bind[ii++] = sqlite3_bind_int (dbs_do, 13, row.oldNode); - bind[ii++] = sqlite3_bind_int (dbs_do, 14, row.oldParam1); - bind[ii++] = sqlite3_bind_int (dbs_do, 15, row.oldParam2); - bind[ii++] = sqlite3_bind_text (dbs_do, 16, row.oldMeta.c_str(), row.oldMeta.size(), NULL); - bind[ii++] = sqlite3_bind_int (dbs_do, 17, row.newNode); - bind[ii++] = sqlite3_bind_int (dbs_do, 18, row.newParam1); - bind[ii++] = sqlite3_bind_int (dbs_do, 19, row.newParam2); - bind[ii++] = sqlite3_bind_text (dbs_do, 20, row.newMeta.c_str(), row.newMeta.size(), NULL); - bind[ii++] = sqlite3_bind_int (dbs_do, 21, row.guessed? 1: 0); - } - else - { - if (!nodeMeta) - { - bind[ii++] = sqlite3_bind_null (dbs_do, 10); - bind[ii++] = sqlite3_bind_null (dbs_do, 11); - bind[ii++] = sqlite3_bind_null (dbs_do, 12); + if (row.type == RollbackAction::TYPE_SET_NODE) { + bind[ii++] = sqlite3_bind_int(dbs_do, 10, row.x); + bind[ii++] = sqlite3_bind_int(dbs_do, 11, row.y); + bind[ii++] = sqlite3_bind_int(dbs_do, 12, row.z); + bind[ii++] = sqlite3_bind_int(dbs_do, 13, row.oldNode); + bind[ii++] = sqlite3_bind_int(dbs_do, 14, row.oldParam1); + bind[ii++] = sqlite3_bind_int(dbs_do, 15, row.oldParam2); + bind[ii++] = sqlite3_bind_text(dbs_do, 16, row.oldMeta.c_str(), row.oldMeta.size(), NULL); + bind[ii++] = sqlite3_bind_int(dbs_do, 17, row.newNode); + bind[ii++] = sqlite3_bind_int(dbs_do, 18, row.newParam1); + bind[ii++] = sqlite3_bind_int(dbs_do, 19, row.newParam2); + bind[ii++] = sqlite3_bind_text(dbs_do, 20, row.newMeta.c_str(), row.newMeta.size(), NULL); + bind[ii++] = sqlite3_bind_int(dbs_do, 21, row.guessed ? 1 : 0); + } else { + if (!nodeMeta) { + bind[ii++] = sqlite3_bind_null(dbs_do, 10); + bind[ii++] = sqlite3_bind_null(dbs_do, 11); + bind[ii++] = sqlite3_bind_null(dbs_do, 12); } - bind[ii++] = sqlite3_bind_null (dbs_do, 13); - bind[ii++] = sqlite3_bind_null (dbs_do, 14); - bind[ii++] = sqlite3_bind_null (dbs_do, 15); - bind[ii++] = sqlite3_bind_null (dbs_do, 16); - bind[ii++] = sqlite3_bind_null (dbs_do, 17); - bind[ii++] = sqlite3_bind_null (dbs_do, 18); - bind[ii++] = sqlite3_bind_null (dbs_do, 19); - bind[ii++] = sqlite3_bind_null (dbs_do, 20); - bind[ii++] = sqlite3_bind_null (dbs_do, 21); + bind[ii++] = sqlite3_bind_null(dbs_do, 13); + bind[ii++] = sqlite3_bind_null(dbs_do, 14); + bind[ii++] = sqlite3_bind_null(dbs_do, 15); + bind[ii++] = sqlite3_bind_null(dbs_do, 16); + bind[ii++] = sqlite3_bind_null(dbs_do, 17); + bind[ii++] = sqlite3_bind_null(dbs_do, 18); + bind[ii++] = sqlite3_bind_null(dbs_do, 19); + bind[ii++] = sqlite3_bind_null(dbs_do, 20); + bind[ii++] = sqlite3_bind_null(dbs_do, 21); } - if (row.id) - bind[ii++] = sqlite3_bind_int (dbs_do, 22, row.id); + if (row.id) { + bind[ii++] = sqlite3_bind_int(dbs_do, 22, row.id); + } for (ii = 0; ii < 20; ++ii) - if (bind[ii] != SQLITE_OK) - infostream - << "WARNING: failed to bind param " << ii + 1 - << " when inserting an entry in table setnode" << std::endl; + if (bind[ii] != SQLITE_OK) + infostream + << "WARNING: failed to bind param " << ii + 1 + << " when inserting an entry in table setnode" << std::endl; /* std::cout << "========DB-WRITTEN==========" << std::endl; @@ -543,60 +551,55 @@ bool SQL_registerRow (ActionRow row) // std::cout << "WARNING: rollback action not written: " << sqlite3_errmsg(dbh) << std::endl; //else std::cout << "Action correctly inserted via SQL" << std::endl; } -std::list actionRowsFromSelect (sqlite3_stmt* stmt) +std::list actionRowsFromSelect(sqlite3_stmt* stmt) { std::list rows; const unsigned char * text; size_t size; - while (SQLITE_ROW == sqlite3_step(stmt)) - { + while (SQLITE_ROW == sqlite3_step(stmt)) { ActionRow row; - row.actor = sqlite3_column_int (stmt, 0); - row.timestamp = sqlite3_column_int (stmt, 1); - row.type = sqlite3_column_int (stmt, 2); + row.actor = sqlite3_column_int(stmt, 0); + row.timestamp = sqlite3_column_int64(stmt, 1); + row.type = sqlite3_column_int(stmt, 2); - if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) - { - text = sqlite3_column_text (stmt, 3); - size = sqlite3_column_bytes(stmt, 3); - row.list = std::string(reinterpret_cast(text), size); - row.index = sqlite3_column_int (stmt, 4); - row.add = sqlite3_column_int (stmt, 5); - row.stack.node = sqlite3_column_int (stmt, 6); - row.stack.quantity = sqlite3_column_int (stmt, 7); - row.nodeMeta = sqlite3_column_int (stmt, 8); + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) { + text = sqlite3_column_text(stmt, 3); + size = sqlite3_column_bytes(stmt, 3); + row.list = std::string(reinterpret_cast(text), size); + row.index = sqlite3_column_int(stmt, 4); + row.add = sqlite3_column_int(stmt, 5); + row.stack.node = sqlite3_column_int(stmt, 6); + row.stack.quantity = sqlite3_column_int(stmt, 7); + row.nodeMeta = sqlite3_column_int(stmt, 8); } - if (row.type == RollbackAction::TYPE_SET_NODE || row.nodeMeta) - { - row.x = sqlite3_column_int (stmt, 9); - row.y = sqlite3_column_int (stmt, 10); - row.z = sqlite3_column_int (stmt, 11); - } - - if (row.type == RollbackAction::TYPE_SET_NODE) - { - row.oldNode = sqlite3_column_int (stmt, 12); - row.oldParam1 = sqlite3_column_int (stmt, 13); - row.oldParam2 = sqlite3_column_int (stmt, 14); - text = sqlite3_column_text (stmt, 15); - size = sqlite3_column_bytes(stmt, 15); - row.oldMeta = std::string(reinterpret_cast(text), size); - row.newNode = sqlite3_column_int (stmt, 16); - row.newParam1 = sqlite3_column_int (stmt, 17); - row.newParam2 = sqlite3_column_int (stmt, 18); - text = sqlite3_column_text (stmt, 19); - size = sqlite3_column_bytes(stmt, 19); - row.newMeta = std::string(reinterpret_cast(text), size); - row.guessed = sqlite3_column_int (stmt, 20); + if (row.type == RollbackAction::TYPE_SET_NODE || row.nodeMeta) { + row.x = sqlite3_column_int(stmt, 9); + row.y = sqlite3_column_int(stmt, 10); + row.z = sqlite3_column_int(stmt, 11); } - row.location = row.nodeMeta? "nodemeta:": getActorName(row.actor); + if (row.type == RollbackAction::TYPE_SET_NODE) { + row.oldNode = sqlite3_column_int(stmt, 12); + row.oldParam1 = sqlite3_column_int(stmt, 13); + row.oldParam2 = sqlite3_column_int(stmt, 14); + text = sqlite3_column_text(stmt, 15); + size = sqlite3_column_bytes(stmt, 15); + row.oldMeta = std::string(reinterpret_cast(text), size); + row.newNode = sqlite3_column_int(stmt, 16); + row.newParam1 = sqlite3_column_int(stmt, 17); + row.newParam2 = sqlite3_column_int(stmt, 18); + text = sqlite3_column_text(stmt, 19); + size = sqlite3_column_bytes(stmt, 19); + row.newMeta = std::string(reinterpret_cast(text), size); + row.guessed = sqlite3_column_int(stmt, 20); + } - if (row.nodeMeta) - { + row.location = row.nodeMeta ? "nodemeta:" : getActorName(row.actor); + + if (row.nodeMeta) { row.location.append(itos(row.x)); row.location.append(","); row.location.append(itos(row.y)); @@ -646,25 +649,22 @@ std::list actionRowsFromSelect (sqlite3_stmt* stmt) return rows; } -ActionRow actionRowFromRollbackAction (RollbackAction action) +ActionRow actionRowFromRollbackAction(RollbackAction action) { ActionRow row; - row.id = 0; - row.actor = getActorId(action.actor); - row.timestamp = action.unix_time; - row.type = action.type; + row.id = 0; + row.actor = getActorId(action.actor); + row.timestamp = action.unix_time; + row.type = action.type; - if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) - { + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) { row.location = action.inventory_location; row.list = action.inventory_list; row.index = action.inventory_index; row.add = action.inventory_add; row.stack = getStackFromString(action.inventory_stack); - } - else - { + } else { row.x = action.p.X; row.y = action.p.Y; row.z = action.p.Z; @@ -681,46 +681,44 @@ ActionRow actionRowFromRollbackAction (RollbackAction action) return row; } -std::list rollbackActionsFromActionRows (std::list rows) +std::list rollbackActionsFromActionRows(std::list rows) { std::list actions; std::list::const_iterator it; - for (it = rows.begin(); it != rows.end(); ++it) - { + for (it = rows.begin(); it != rows.end(); ++it) { RollbackAction action; - action.actor = (it->actor)? getActorName(it->actor): ""; - action.unix_time = it->timestamp; - action.type = static_cast(it->type); + action.actor = (it->actor) ? getActorName(it->actor) : ""; + action.unix_time = it->timestamp; + action.type = static_cast(it->type); - switch (action.type) - { - case RollbackAction::TYPE_MODIFY_INVENTORY_STACK: + switch (action.type) { + case RollbackAction::TYPE_MODIFY_INVENTORY_STACK: - action.inventory_location = it->location.c_str(); - action.inventory_list = it->list; - action.inventory_index = it->index; - action.inventory_add = it->add; - action.inventory_stack = getStringFromStack(it->stack); - break; - - case RollbackAction::TYPE_SET_NODE: + action.inventory_location = it->location.c_str(); + action.inventory_list = it->list; + action.inventory_index = it->index; + action.inventory_add = it->add; + action.inventory_stack = getStringFromStack(it->stack); + break; - action.p = v3s16(it->x, it->y, it->z); - action.n_old.name = getNodeName(it->oldNode); - action.n_old.param1 = it->oldParam1; - action.n_old.param2 = it->oldParam2; - action.n_old.meta = it->oldMeta; - action.n_new.name = getNodeName(it->newNode); - action.n_new.param1 = it->newParam1; - action.n_new.param2 = it->newParam2; - action.n_new.meta = it->newMeta; - break; + case RollbackAction::TYPE_SET_NODE: - default: + action.p = v3s16(it->x, it->y, it->z); + action.n_old.name = getNodeName(it->oldNode); + action.n_old.param1 = it->oldParam1; + action.n_old.param2 = it->oldParam2; + action.n_old.meta = it->oldMeta; + action.n_new.name = getNodeName(it->newNode); + action.n_new.param1 = it->newParam1; + action.n_new.param2 = it->newParam2; + action.n_new.meta = it->newMeta; + break; - throw("W.T.F."); - break; + default: + + throw ("W.T.F."); + break; } actions.push_back(action); @@ -728,69 +726,83 @@ std::list rollbackActionsFromActionRows (std::list ro return actions; } -std::list SQL_getRowsSince (int firstTime, std::string actor = "") -{ - sqlite3_stmt * dbs_stmt = (!actor.length())? dbs_select: dbs_select_withActor; - sqlite3_reset (dbs_stmt); - sqlite3_bind_int (dbs_stmt, 1, firstTime); - if (actor.length()) - sqlite3_bind_int (dbs_stmt, 2, getActorId(actor)); +std::list SQL_getRowsSince(time_t firstTime, std::string actor = "") +{ + sqlite3_stmt *dbs_stmt = (!actor.length()) ? dbs_select : dbs_select_withActor; + sqlite3_reset(dbs_stmt); + sqlite3_bind_int64(dbs_stmt, 1, firstTime); + + if (actor.length()) { + sqlite3_bind_int(dbs_stmt, 2, getActorId(actor)); + } return actionRowsFromSelect(dbs_stmt); } -std::list SQL_getRowsSince_range (int firstTime, v3s16 p, int range) + +std::list SQL_getRowsSince_range(time_t firstTime, v3s16 p, int range, + int limit) { - sqlite3_stmt * stmt = dbs_select_range; + sqlite3_stmt *stmt = dbs_select_range; sqlite3_reset(stmt); - sqlite3_bind_int(stmt, 1, firstTime); + sqlite3_bind_int64(stmt, 1, firstTime); sqlite3_bind_int(stmt, 2, (int) p.X); sqlite3_bind_int(stmt, 3, range); sqlite3_bind_int(stmt, 4, (int) p.Y); sqlite3_bind_int(stmt, 5, range); sqlite3_bind_int(stmt, 6, (int) p.Z); sqlite3_bind_int(stmt, 7, range); + sqlite3_bind_int(stmt, 8, limit); return actionRowsFromSelect(stmt); } -std::list SQL_getActionsSince_range (int firstTime, v3s16 p, int range) + +std::list SQL_getActionsSince_range(time_t firstTime, v3s16 p, int range, + int limit) { - std::list rows = SQL_getRowsSince_range(firstTime, p, range); + std::list rows = SQL_getRowsSince_range(firstTime, p, range, limit); return rollbackActionsFromActionRows(rows); } -std::list SQL_getActionsSince (int firstTime, std::string actor = "") + +std::list SQL_getActionsSince(time_t firstTime, std::string actor = "") { std::list rows = SQL_getRowsSince(firstTime, actor); return rollbackActionsFromActionRows(rows); } -void TXT_migrate (std::string filepath) + +void TXT_migrate(std::string filepath) { std::cout << "Migrating from rollback.txt to rollback.sqlite" << std::endl; SQL_databaseCheck(); - std::ifstream fh (filepath.c_str(), std::ios::in | std::ios::ate); - if (!fh.good()) throw("DIE"); + std::ifstream fh(filepath.c_str(), std::ios::in | std::ios::ate); + if (!fh.good()) { + throw ("DIE"); + } - int filesize = fh.tellg(); + std::streampos filesize = fh.tellg(); - if (filesize > 10) - { + if (filesize > 10) { fh.seekg(0); std::string bit; int i = 0; int id = 1; - int t = 0; - do - { + time_t t = 0; + do { ActionRow row; row.id = id; // Get the timestamp - std::getline(fh, bit, ' '); bit = trim(bit); if (!atoi(trim(bit).c_str())) { std::getline(fh, bit); continue; } + std::getline(fh, bit, ' '); + bit = trim(bit); + if (!atoi(trim(bit).c_str())) { + std::getline(fh, bit); + continue; + } row.timestamp = atoi(bit.c_str()); // Get the actor @@ -800,44 +812,53 @@ void TXT_migrate (std::string filepath) std::getline(fh, bit, '['); std::getline(fh, bit, ' '); - if (bit == "modify_inventory_stack") + if (bit == "modify_inventory_stack") { row.type = RollbackAction::TYPE_MODIFY_INVENTORY_STACK; - - if (bit == "set_node") - row.type = RollbackAction::TYPE_SET_NODE; - - if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) - { - row.location = trim(deSerializeJsonString(fh)); - std::getline(fh, bit, ' '); row.list = trim(deSerializeJsonString(fh)); - std::getline(fh, bit, ' '); - std::getline(fh, bit, ' '); - row.index = atoi(trim(bit).c_str()); - std::getline(fh, bit, ' '); row.add = (int) ( trim(bit) == "add" ); - row.stack = getStackFromString(trim(deSerializeJsonString(fh))); - std::getline(fh, bit); - } - else - if (row.type == RollbackAction::TYPE_SET_NODE) - { + + if (bit == "set_node") { + row.type = RollbackAction::TYPE_SET_NODE; + } + + if (row.type == RollbackAction::TYPE_MODIFY_INVENTORY_STACK) { + row.location = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); + row.list = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); + row.index = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); + row.add = (int)(trim(bit) == "add"); + row.stack = getStackFromString(trim(deSerializeJsonString(fh))); + std::getline(fh, bit); + } else if (row.type == RollbackAction::TYPE_SET_NODE) { std::getline(fh, bit, '('); - std::getline(fh, bit, ','); row.x = atoi(trim(bit).c_str()); - std::getline(fh, bit, ','); row.y = atoi(trim(bit).c_str()); - std::getline(fh, bit, ')'); row.z = atoi(trim(bit).c_str()); - std::getline(fh, bit, ' '); row.oldNode = getNodeId(trim(deSerializeJsonString(fh))); + std::getline(fh, bit, ','); + row.x = atoi(trim(bit).c_str()); + std::getline(fh, bit, ','); + row.y = atoi(trim(bit).c_str()); + std::getline(fh, bit, ')'); + row.z = atoi(trim(bit).c_str()); std::getline(fh, bit, ' '); - std::getline(fh, bit, ' '); row.oldParam1 = atoi(trim(bit).c_str()); - std::getline(fh, bit, ' '); row.oldParam2 = atoi(trim(bit).c_str()); - row.oldMeta = trim(deSerializeJsonString(fh)); - std::getline(fh, bit, ' '); row.newNode = getNodeId(trim(deSerializeJsonString(fh))); - std::getline(fh, bit, ' '); - std::getline(fh, bit, ' '); row.newParam1 = atoi(trim(bit).c_str()); - std::getline(fh, bit, ' '); row.newParam2 = atoi(trim(bit).c_str()); - row.newMeta = trim(deSerializeJsonString(fh)); + row.oldNode = getNodeId(trim(deSerializeJsonString(fh))); std::getline(fh, bit, ' '); std::getline(fh, bit, ' '); - std::getline(fh, bit); row.guessed = (int) ( trim(bit) == "actor_is_guess" ); + row.oldParam1 = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); + row.oldParam2 = atoi(trim(bit).c_str()); + row.oldMeta = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); + row.newNode = getNodeId(trim(deSerializeJsonString(fh))); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); + row.newParam1 = atoi(trim(bit).c_str()); + std::getline(fh, bit, ' '); + row.newParam2 = atoi(trim(bit).c_str()); + row.newMeta = trim(deSerializeJsonString(fh)); + std::getline(fh, bit, ' '); + std::getline(fh, bit, ' '); + std::getline(fh, bit); + row.guessed = (int)(trim(bit) == "actor_is_guess"); } /* @@ -870,43 +891,43 @@ void TXT_migrate (std::string filepath) } */ - if (i == 0) - { + if (i == 0) { t = time(0); sqlite3_exec(dbh, "BEGIN", NULL, NULL, NULL); } - SQL_registerRow(row); ++i; + SQL_registerRow(row); + ++i; - if (time(0) - t) - { + if (time(0) - t) { sqlite3_exec(dbh, "COMMIT", NULL, NULL, NULL); t = time(0) - t; std::cout - << " Done: " << (int)(((float) fh.tellg() / (float) filesize) * 100) << "%" - << "\tSpeed: " << i / t << " actions inserted per second " - << "\r"; - std::cout.flush(); + << " Done: " << (int)(((float) fh.tellg() / (float) filesize) * 100) << "%" + << " Speed: " << i / t << "/second \r" << std::flush; i = 0; } ++id; - } - while (!fh.eof() && fh.good()); + } while (!fh.eof() && fh.good()); + } else { + errorstream << "Empty rollback log" << std::endl; } std::cout - << " Done: 100%" << std::endl - << " Now you can delete the old rollback.txt file." << std::endl; + << " Done: 100% " << std::endl + << " Now you can delete the old rollback.txt file." << std::endl; } + // Get nearness factor for subject's action for this action // Return value: 0 = impossible, >0 = factor -static float getSuspectNearness(bool is_guess, v3s16 suspect_p, int suspect_t, - v3s16 action_p, int action_t) +static float getSuspectNearness(bool is_guess, v3s16 suspect_p, time_t suspect_t, + v3s16 action_p, time_t action_t) { // Suspect cannot cause things in the past - if(action_t < suspect_t) - return 0; // 0 = cannot be + if (action_t < suspect_t) { + return 0; // 0 = cannot be + } // Start from 100 int f = 100; // Distance (1 node = -x points) @@ -914,22 +935,24 @@ static float getSuspectNearness(bool is_guess, v3s16 suspect_p, int suspect_t, // Time (1 second = -x points) f -= 1 * (action_t - suspect_t); // If is a guess, halve the points - if(is_guess) + if (is_guess) { f *= 0.5; + } // Limit to 0 - if(f < 0) + if (f < 0) { f = 0; + } return f; } class RollbackManager: public IRollbackManager { public: // IRollbackManager interface - void reportAction(const RollbackAction &action_) - { + void reportAction(const RollbackAction &action_) { // Ignore if not important - if (!action_.isImportant(m_gamedef)) + if (!action_.isImportant(m_gamedef)) { return; + } RollbackAction action = action_; action.unix_time = time(0); @@ -938,90 +961,96 @@ public: action.actor = m_current_actor; action.actor_is_guess = m_current_actor_is_guess; - if (action.actor.empty()) // If actor is not known, find out suspect or cancel - { + if (action.actor.empty()) { // If actor is not known, find out suspect or cancel v3s16 p; - if (!action.getPosition(&p)) + if (!action.getPosition(&p)) { return; + } action.actor = getSuspect(p, 83, 1); - if (action.actor.empty()) + if (action.actor.empty()) { return; + } action.actor_is_guess = true; } infostream - << "RollbackManager::reportAction():" - << " time=" << action.unix_time - << " actor=\"" << action.actor << "\"" - << (action.actor_is_guess? " (guess)": "") - << " action=" << action.toString() - << std::endl; + << "RollbackManager::reportAction():" + << " time=" << action.unix_time + << " actor=\"" << action.actor << "\"" + << (action.actor_is_guess ? " (guess)" : "") + << " action=" << action.toString() + << std::endl; addAction(action); } - std::string getActor() - { + + std::string getActor() { return m_current_actor; } - bool isActorGuess() - { + + bool isActorGuess() { return m_current_actor_is_guess; } - void setActor(const std::string &actor, bool is_guess) - { + + void setActor(const std::string &actor, bool is_guess) { m_current_actor = actor; m_current_actor_is_guess = is_guess; } - std::string getSuspect(v3s16 p, float nearness_shortcut, float min_nearness) - { - if(m_current_actor != "") + + std::string getSuspect(v3s16 p, float nearness_shortcut, float min_nearness) { + if (m_current_actor != "") { return m_current_actor; + } int cur_time = time(0); - int first_time = cur_time - (100-min_nearness); + time_t first_time = cur_time - (100 - min_nearness); RollbackAction likely_suspect; float likely_suspect_nearness = 0; - for(std::list::const_reverse_iterator - i = m_action_latest_buffer.rbegin(); - i != m_action_latest_buffer.rend(); i++) - { - if(i->unix_time < first_time) + for (std::list::const_reverse_iterator + i = m_action_latest_buffer.rbegin(); + i != m_action_latest_buffer.rend(); i++) { + if (i->unix_time < first_time) { break; - if(i->actor == "") + } + if (i->actor == "") { continue; + } // Find position of suspect or continue v3s16 suspect_p; - if(!i->getPosition(&suspect_p)) + if (!i->getPosition(&suspect_p)) { continue; + } float f = getSuspectNearness(i->actor_is_guess, suspect_p, - i->unix_time, p, cur_time); - if(f >= min_nearness && f > likely_suspect_nearness){ + i->unix_time, p, cur_time); + if (f >= min_nearness && f > likely_suspect_nearness) { likely_suspect_nearness = f; likely_suspect = *i; - if(likely_suspect_nearness >= nearness_shortcut) + if (likely_suspect_nearness >= nearness_shortcut) { break; + } } } // No likely suspect was found - if(likely_suspect_nearness == 0) + if (likely_suspect_nearness == 0) { return ""; + } // Likely suspect was found return likely_suspect.actor; } - void flush() - { + + void flush() { infostream << "RollbackManager::flush()" << std::endl; sqlite3_exec(dbh, "BEGIN", NULL, NULL, NULL); std::list::const_iterator iter; - for (iter = m_action_todisk_buffer.begin(); - iter != m_action_todisk_buffer.end(); - iter++) - { - if (iter->actor == "") + for (iter = m_action_todisk_buffer.begin(); + iter != m_action_todisk_buffer.end(); + iter++) { + if (iter->actor == "") { continue; + } SQL_registerRow(actionRowFromRollbackAction(*iter)); } @@ -1029,33 +1058,32 @@ public: sqlite3_exec(dbh, "COMMIT", NULL, NULL, NULL); m_action_todisk_buffer.clear(); } + RollbackManager(const std::string &filepath, IGameDef *gamedef): m_filepath(filepath), m_gamedef(gamedef), - m_current_actor_is_guess(false) - { + m_current_actor_is_guess(false) { infostream - << "RollbackManager::RollbackManager(" << filepath << ")" - << std::endl; - + << "RollbackManager::RollbackManager(" << filepath << ")" + << std::endl; + // Operate correctly in case of still being given rollback.txt as filepath std::string directory = filepath.substr(0, filepath.rfind(DIR_DELIM) + 1); - std::string filenameOld = filepath.substr(1+ filepath.rfind(DIR_DELIM)); - std::string filenameNew = (filenameOld == "rollback.txt")? "rollback.sqlite": filenameOld; + std::string filenameOld = filepath.substr(filepath.rfind(DIR_DELIM) + 1); + std::string filenameNew = (filenameOld == "rollback.txt") ? "rollback.sqlite" : + filenameOld; std::string filenameTXT = directory + "rollback.txt"; - std::string migratingFlag = filepath; - migratingFlag.append(".migrating"); + std::string migratingFlag = filepath + ".migrating"; infostream << "Directory: " << directory << std::endl; infostream << "CheckFor: " << filenameTXT << std::endl; infostream << "FileOld: " << filenameOld << std::endl; infostream << "FileNew: " << filenameNew << std::endl; - + dbp = directory + filenameNew; - if ((fs::PathExists(filenameTXT) && fs::PathExists(migratingFlag)) - || (fs::PathExists(filenameTXT) && !fs::PathExists(dbp))) - { + if ((fs::PathExists(filenameTXT) && fs::PathExists(migratingFlag)) || + (fs::PathExists(filenameTXT) && !fs::PathExists(dbp))) { std::ofstream of(migratingFlag.c_str()); TXT_migrate(filenameTXT); fs::DeleteSingleFileOrEmptyDirectory(migratingFlag); @@ -1063,74 +1091,54 @@ public: SQL_databaseCheck(); } - ~RollbackManager() - { + + ~RollbackManager() { infostream << "RollbackManager::~RollbackManager()" << std::endl; flush(); } - void addAction(const RollbackAction &action) - { + + void addAction(const RollbackAction &action) { m_action_todisk_buffer.push_back(action); m_action_latest_buffer.push_back(action); // Flush to disk sometimes - if(m_action_todisk_buffer.size() >= 500) + if (m_action_todisk_buffer.size() >= 500) { flush(); + } } - std::list getEntriesSince(int first_time) - { + + std::list getEntriesSince(time_t first_time) { infostream - << "RollbackManager::getEntriesSince(" << first_time << ")" - << std::endl; + << "RollbackManager::getEntriesSince(" << first_time << ")" + << std::endl; flush(); - + std::list result = SQL_getActionsSince(first_time); return result; } - std::string getLastNodeActor(v3s16 p, int range, int seconds, v3s16 *act_p, int *act_seconds) - { - int cur_time = time(0); - int first_time = cur_time - seconds; - std::list action_buffer = SQL_getActionsSince_range(first_time, p, range); - std::list::const_reverse_iterator iter; + std::list getNodeActors(v3s16 pos, int range, time_t seconds, int limit) { + time_t cur_time = time(0); + time_t first_time = cur_time - seconds; - for (iter = action_buffer.rbegin(); - iter != action_buffer.rend(); - iter++) - { - v3s16 action_p; - - action_p.X = iter->p.X; - action_p.Y = iter->p.Y; - action_p.Z = iter->p.Z; - - if (act_p) - *act_p = action_p; - - if (act_seconds) - *act_seconds = cur_time - iter->unix_time; - - return iter->actor; - } - - return ""; + return SQL_getActionsSince_range(first_time, pos, range, limit); } - std::list getRevertActions(const std::string &actor_filter, int seconds) - { + + std::list getRevertActions(const std::string &actor_filter, + time_t seconds) { infostream - << "RollbackManager::getRevertActions(" << actor_filter - << ", " << seconds << ")" - << std::endl; + << "RollbackManager::getRevertActions(" << actor_filter + << ", " << seconds << ")" + << std::endl; // Figure out time - int cur_time = time(0); - int first_time = cur_time - seconds; - + time_t cur_time = time(0); + time_t first_time = cur_time - seconds; + flush(); - + std::list result = SQL_getActionsSince(first_time, actor_filter); return result; @@ -1148,3 +1156,4 @@ IRollbackManager *createRollbackManager(const std::string &filepath, IGameDef *g { return new RollbackManager(filepath, gamedef); } + diff --git a/src/rollback.h b/src/rollback.h index 46a76f583..eea7c59f2 100644 --- a/src/rollback.h +++ b/src/rollback.h @@ -36,17 +36,17 @@ public: virtual bool isActorGuess() = 0; virtual void setActor(const std::string &actor, bool is_guess) = 0; virtual std::string getSuspect(v3s16 p, float nearness_shortcut, - float min_nearness) = 0; + float min_nearness) = 0; - virtual ~IRollbackManager(){} + virtual ~IRollbackManager() {} virtual void flush() = 0; - // Get last actor that did something to position p, but not further than + // Get all actors that did something to position p, but not further than // in history - virtual std::string getLastNodeActor(v3s16 p, int range, int seconds, - v3s16 *act_p, int *act_seconds) = 0; + virtual std::list getNodeActors(v3s16 pos, int range, + time_t seconds, int limit) = 0; // Get actions to revert of history made by virtual std::list getRevertActions(const std::string &actor, - int seconds) = 0; + time_t seconds) = 0; }; IRollbackManager *createRollbackManager(const std::string &filepath, IGameDef *gamedef); diff --git a/src/rollback_interface.h b/src/rollback_interface.h index b2e8f3428..f16f82b40 100644 --- a/src/rollback_interface.h +++ b/src/rollback_interface.h @@ -63,7 +63,7 @@ struct RollbackAction TYPE_MODIFY_INVENTORY_STACK, } type; - int unix_time; + time_t unix_time; std::string actor; bool actor_is_guess; diff --git a/src/script/lua_api/l_rollback.cpp b/src/script/lua_api/l_rollback.cpp index d5abe176e..e7185b00b 100644 --- a/src/script/lua_api/l_rollback.cpp +++ b/src/script/lua_api/l_rollback.cpp @@ -24,21 +24,54 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "rollback.h" -// rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds -int ModApiRollback::l_rollback_get_last_node_actor(lua_State *L) +void push_RollbackNode(lua_State *L, RollbackNode &node) { - v3s16 p = read_v3s16(L, 1); + lua_createtable(L, 0, 3); + lua_pushstring(L, node.name.c_str()); + lua_setfield(L, -2, "name"); + lua_pushnumber(L, node.param1); + lua_setfield(L, -2, "param1"); + lua_pushnumber(L, node.param2); + lua_setfield(L, -2, "param2"); +} + +// rollback_get_node_actions(pos, range, seconds, limit) -> {{actor, pos, time, oldnode, newnode}, ...} +int ModApiRollback::l_rollback_get_node_actions(lua_State *L) +{ + v3s16 pos = read_v3s16(L, 1); int range = luaL_checknumber(L, 2); - int seconds = luaL_checknumber(L, 3); + time_t seconds = (time_t) luaL_checknumber(L, 3); + int limit = luaL_checknumber(L, 4); Server *server = getServer(L); IRollbackManager *rollback = server->getRollbackManager(); - v3s16 act_p; - int act_seconds = 0; - std::string actor = rollback->getLastNodeActor(p, range, seconds, &act_p, &act_seconds); - lua_pushstring(L, actor.c_str()); - push_v3s16(L, act_p); - lua_pushnumber(L, act_seconds); - return 3; + + std::list actions = rollback->getNodeActors(pos, range, seconds, limit); + std::list::iterator iter = actions.begin(); + + lua_createtable(L, actions.size(), 0); + for (unsigned int i = 1; iter != actions.end(); ++iter, ++i) { + lua_pushnumber(L, i); // Push index + lua_createtable(L, 0, 5); // Make a table with enough space pre-allocated + + lua_pushstring(L, iter->actor.c_str()); + lua_setfield(L, -2, "actor"); + + push_v3s16(L, iter->p); + lua_setfield(L, -2, "pos"); + + lua_pushnumber(L, iter->unix_time); + lua_setfield(L, -2, "time"); + + push_RollbackNode(L, iter->n_old); + lua_setfield(L, -2, "oldnode"); + + push_RollbackNode(L, iter->n_new); + lua_setfield(L, -2, "newnode"); + + lua_settable(L, -3); // Add action table to main table + } + + return 1; } // rollback_revert_actions_by(actor, seconds) -> bool, log messages @@ -53,28 +86,19 @@ int ModApiRollback::l_rollback_revert_actions_by(lua_State *L) bool success = server->rollbackRevertActions(actions, &log); // Push boolean result lua_pushboolean(L, success); - // Get the table insert function and push the log table - lua_getglobal(L, "table"); - lua_getfield(L, -1, "insert"); - int table_insert = lua_gettop(L); - lua_newtable(L); - int table = lua_gettop(L); - for(std::list::const_iterator i = log.begin(); - i != log.end(); i++) - { - lua_pushvalue(L, table_insert); - lua_pushvalue(L, table); - lua_pushstring(L, i->c_str()); - if(lua_pcall(L, 2, 0, 0)) - script_error(L); + lua_createtable(L, log.size(), 0); + unsigned long i = 0; + for(std::list::const_iterator iter = log.begin(); + iter != log.end(); ++i, ++iter) { + lua_pushnumber(L, i); + lua_pushstring(L, iter->c_str()); + lua_settable(L, -3); } - lua_remove(L, -2); // Remove table - lua_remove(L, -2); // Remove insert return 2; } void ModApiRollback::Initialize(lua_State *L, int top) { - API_FCT(rollback_get_last_node_actor); + API_FCT(rollback_get_node_actions); API_FCT(rollback_revert_actions_by); } diff --git a/src/script/lua_api/l_rollback.h b/src/script/lua_api/l_rollback.h index 86992a47e..3b01c0d8b 100644 --- a/src/script/lua_api/l_rollback.h +++ b/src/script/lua_api/l_rollback.h @@ -22,10 +22,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_base.h" -class ModApiRollback : public ModApiBase { +class ModApiRollback : public ModApiBase +{ private: - // rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds - static int l_rollback_get_last_node_actor(lua_State *L); + // rollback_get_node_actions(pos, range, seconds) -> {{actor, pos, time, oldnode, newnode}, ...} + static int l_rollback_get_node_actions(lua_State *L); // rollback_revert_actions_by(actor, seconds) -> bool, log messages static int l_rollback_revert_actions_by(lua_State *L); From ff25218374bd1bfc65433543ceee336924a06925 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 28 Nov 2013 11:09:51 -0500 Subject: [PATCH 129/198] Don't use variable length arrays --- src/rollback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rollback.cpp b/src/rollback.cpp index 4dc462af6..bae81ddb0 100644 --- a/src/rollback.cpp +++ b/src/rollback.cpp @@ -429,7 +429,7 @@ bool SQL_registerRow(ActionRow row) */ sqlite3_reset(dbs_do); - int bind [20 + (((bool) row.id) ? 1 : 0)], ii = 0; + int bind [22], ii = 0; bool nodeMeta = false; bind[ii++] = sqlite3_bind_int(dbs_do, 1, row.actor); From b08d7558de53325d184b3ddf0476cb84fc08d0ad Mon Sep 17 00:00:00 2001 From: sapier Date: Thu, 28 Nov 2013 21:43:06 +0100 Subject: [PATCH 130/198] Split server/client port setting to avoid port number clashes in mainmenu --- builtin/mainmenu.lua | 76 +++++++++++++++++++++++------------------ minetest.conf.example | 8 +++-- src/defaultsettings.cpp | 4 +-- src/main.cpp | 2 -- 4 files changed, 50 insertions(+), 40 deletions(-) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index c09b9cbcd..0032017ac 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -421,37 +421,42 @@ function tabbuilder.handle_multiplayer_buttons(fields) if fields["favourites"] ~= nil then local event = explode_textlist_event(fields["favourites"]) if event.typ == "DCL" then - gamedata.address = menu.favorites[event.index].address - gamedata.port = menu.favorites[event.index].port - gamedata.playername = fields["te_name"] - if fields["te_pwd"] ~= nil then - gamedata.password = fields["te_pwd"] - end - gamedata.selected_world = 0 - - if menu.favorites ~= nil then - gamedata.servername = menu.favorites[event.index].name - gamedata.serverdescription = menu.favorites[event.index].description - end - - if gamedata.address ~= nil and - gamedata.port ~= nil then + if event.index <= #menu.favorites then + gamedata.address = menu.favorites[event.index].address + gamedata.port = menu.favorites[event.index].port + gamedata.playername = fields["te_name"] + if fields["te_pwd"] ~= nil then + gamedata.password = fields["te_pwd"] + end + gamedata.selected_world = 0 - engine.start() + if menu.favorites ~= nil then + gamedata.servername = menu.favorites[event.index].name + gamedata.serverdescription = menu.favorites[event.index].description + end + + if gamedata.address ~= nil and + gamedata.port ~= nil then + engine.setting_set("address",gamedata.address) + engine.setting_set("remote_port",gamedata.port) + engine.start() + end end end if event.typ == "CHG" then - local address = menu.favorites[event.index].address - local port = menu.favorites[event.index].port - - if address ~= nil and - port ~= nil then - engine.setting_set("address",address) - engine.setting_set("port",port) + if event.index <= #menu.favorites then + local address = menu.favorites[event.index].address + local port = menu.favorites[event.index].port + + if address ~= nil and + port ~= nil then + engine.setting_set("address",address) + engine.setting_set("remote_port",port) + end + + menu.fav_selected = event.index end - - menu.fav_selected = event.index end return end @@ -473,7 +478,7 @@ function tabbuilder.handle_multiplayer_buttons(fields) if address ~= nil and port ~= nil then engine.setting_set("address",address) - engine.setting_set("port",port) + engine.setting_set("remote_port",port) end menu.fav_selected = fav_idx @@ -499,13 +504,13 @@ function tabbuilder.handle_multiplayer_buttons(fields) menu.fav_selected = nil engine.setting_set("address","") - engine.setting_get("port","") + engine.setting_set("remote_port","30000") return end if fields["btn_mp_connect"] ~= nil or - fields["key_enter"] then + fields["key_enter"] ~= nil then gamedata.playername = fields["te_name"] gamedata.password = fields["te_pwd"] @@ -516,17 +521,20 @@ function tabbuilder.handle_multiplayer_buttons(fields) if fav_idx > 0 and fav_idx <= #menu.favorites and menu.favorites[fav_idx].address == fields["te_address"] and - menu.favorites[fav_idx].port == fields["te_port"] then + menu.favorites[fav_idx].port == fields["te_port"] then gamedata.servername = menu.favorites[fav_idx].name gamedata.serverdescription = menu.favorites[fav_idx].description else - gamedata.servername = "" - gamedata.serverdescription = "" + gamedata.servername = "" + gamedata.serverdescription = "" end gamedata.selected_world = 0 + engine.setting_set("address",fields["te_address"]) + engine.setting_set("remote_port",fields["te_port"]) + engine.start() return end @@ -574,6 +582,7 @@ function tabbuilder.handle_server_buttons(fields) gamedata.address = "" gamedata.selected_world = filterlist.get_raw_index(worldlist,selected) + engine.setting_set("port",gamedata.port) menu.update_last_game(gamedata.selected_world) engine.start() end @@ -820,7 +829,7 @@ function tabbuilder.tab_multiplayer() "label[1,4.25;".. fgettext("Address/Port") .. "]".. "label[9,2.75;".. fgettext("Name/Password") .. "]" .. "field[1.25,5.25;5.5,0.5;te_address;;" ..engine.setting_get("address") .."]" .. - "field[6.75,5.25;2.25,0.5;te_port;;" ..engine.setting_get("port") .."]" .. + "field[6.75,5.25;2.25,0.5;te_port;;" ..engine.setting_get("remote_port") .."]" .. "checkbox[1,3.6;cb_public_serverlist;".. fgettext("Public Serverlist") .. ";" .. dump(engine.setting_getbool("public_serverlist")) .. "]" @@ -886,7 +895,8 @@ function tabbuilder.tab_server() "field[0.8,3.2;3,0.5;te_playername;".. fgettext("Name") .. ";" .. engine.setting_get("name") .. "]" .. "pwdfield[0.8,4.2;3,0.5;te_passwd;".. fgettext("Password") .. "]" .. - "field[0.8,5.2;3,0.5;te_serverport;".. fgettext("Server Port") .. ";30000]" .. + "field[0.8,5.2;3,0.5;te_serverport;".. fgettext("Server Port") .. ";" .. + engine.setting_get("port") .."]" .. "textlist[4,0.25;7.5,3.7;srv_worlds;" .. menu.render_world_list() .. ";" .. index .. "]" diff --git a/minetest.conf.example b/minetest.conf.example index ee22e9f04..69ed31a64 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -22,8 +22,7 @@ # Client and server # -# Network port (UDP) -#port = + # Name of player; on a server this is the main admin #name = @@ -31,6 +30,8 @@ # Client stuff # +# Port to connect to (UDP) +#remote_port = # Key mappings # See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3 #keymap_forward = KEY_KEY_W @@ -198,7 +199,8 @@ # # Server stuff # - +# Network port to listen (UDP) +#port = # Name of server #server_name = Minetest server # Description of server diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 9df9b3aa5..df7570b33 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -25,11 +25,10 @@ void set_default_settings(Settings *settings) { // Client and server - settings->setDefault("port", ""); settings->setDefault("name", ""); // Client stuff - + settings->setDefault("remote_port", "30000"); settings->setDefault("keymap_forward", "KEY_KEY_W"); settings->setDefault("keymap_backward", "KEY_KEY_S"); settings->setDefault("keymap_left", "KEY_KEY_A"); @@ -157,6 +156,7 @@ void set_default_settings(Settings *settings) // Server stuff // "map-dir" doesn't exist by default. + settings->setDefault("port", "30000"); settings->setDefault("default_game", "minetest"); settings->setDefault("motd", ""); settings->setDefault("max_users", "15"); diff --git a/src/main.cpp b/src/main.cpp index 9ffab816e..373e1ca96 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1674,8 +1674,6 @@ int main(int argc, char *argv[]) // Save settings g_settings->set("name", playername); - g_settings->set("address", address); - g_settings->set("port", itos(port)); if((menudata.selected_world >= 0) && (menudata.selected_world < (int)worldspecs.size())) From 2e66aca35722e7fee786027d545fe371786fc01f Mon Sep 17 00:00:00 2001 From: sapier Date: Tue, 26 Nov 2013 18:15:31 +0100 Subject: [PATCH 131/198] Fix modstore/favourites hang by adding asynchronous lua job support --- builtin/async_env.lua | 19 + builtin/async_event.lua | 59 +++ builtin/mainmenu.lua | 331 +++++++++------- builtin/modmgr.lua | 332 ++++++++-------- builtin/modstore.lua | 345 +++++++++++----- doc/menu_lua_api.txt | 57 ++- src/guiEngine.cpp | 8 + src/guiEngine.h | 5 +- src/jthread/CMakeLists.txt | 2 + src/jthread/jsemaphore.h | 50 +++ src/jthread/jthread.h | 5 +- src/jthread/pthread/jsemaphore.cpp | 48 +++ src/jthread/pthread/jthread.cpp | 42 +- src/jthread/win32/jsemaphore.cpp | 64 +++ src/jthread/win32/jthread.cpp | 38 +- src/main.cpp | 111 +++--- src/script/lua_api/CMakeLists.txt | 2 + src/script/lua_api/l_async_events.cpp | 396 ++++++++++++++++++ src/script/lua_api/l_async_events.h | 228 +++++++++++ src/script/lua_api/l_internal.h | 6 +- src/script/lua_api/l_mainmenu.cpp | 72 ++-- src/script/lua_api/l_mainmenu.h | 6 + src/script/lua_api/l_util.cpp | 16 + src/script/lua_api/l_util.h | 4 + src/script/lua_api/marshall.c | 551 ++++++++++++++++++++++++++ src/script/scripting_mainmenu.cpp | 24 +- src/script/scripting_mainmenu.h | 9 + 27 files changed, 2271 insertions(+), 559 deletions(-) create mode 100644 builtin/async_env.lua create mode 100644 builtin/async_event.lua create mode 100644 src/jthread/jsemaphore.h create mode 100644 src/jthread/pthread/jsemaphore.cpp create mode 100644 src/jthread/win32/jsemaphore.cpp create mode 100644 src/script/lua_api/l_async_events.cpp create mode 100644 src/script/lua_api/l_async_events.h create mode 100644 src/script/lua_api/marshall.c diff --git a/builtin/async_env.lua b/builtin/async_env.lua new file mode 100644 index 000000000..afc69219c --- /dev/null +++ b/builtin/async_env.lua @@ -0,0 +1,19 @@ +engine.log("info","Initializing Asynchronous environment") + +dofile(SCRIPTDIR .. DIR_DELIM .. "misc_helpers.lua") + +function engine.job_processor(serialized_function, serialized_data) + + local fct = marshal.decode(serialized_function) + local params = marshal.decode(serialized_data) + local retval = marshal.encode(nil) + + if fct ~= nil and type(fct) == "function" then + local result = fct(params) + retval = marshal.encode(result) + else + engine.log("error","ASYNC WORKER: unable to deserialize function") + end + + return retval,retval:len() +end diff --git a/builtin/async_event.lua b/builtin/async_event.lua new file mode 100644 index 000000000..f4c7d2449 --- /dev/null +++ b/builtin/async_event.lua @@ -0,0 +1,59 @@ +local tbl = engine or minetest + +tbl.async_jobs = {} + +if engine ~= nil then + function tbl.async_event_handler(jobid, serialized_retval) + local retval = nil + if serialized_retval ~= "ERROR" then + retval= marshal.decode(serialized_retval) + else + tbl.log("error","Error fetching async result") + end + + assert(type(tbl.async_jobs[jobid]) == "function") + tbl.async_jobs[jobid](retval) + tbl.async_jobs[jobid] = nil + end +else + + minetest.register_globalstep( + function(dtime) + local list = tbl.get_finished_jobs() + + for i=1,#list,1 do + local retval = marshal.decode(list[i].retval) + + assert(type(tbl.async_jobs[jobid]) == "function") + tbl.async_jobs[list[i].jobid](retval) + tbl.async_jobs[list[i].jobid] = nil + end + end) +end + +function tbl.handle_async(fct, parameters, callback) + + --serialize fct + local serialized_fct = marshal.encode(fct) + + assert(marshal.decode(serialized_fct) ~= nil) + + --serialize parameters + local serialized_params = marshal.encode(parameters) + + if serialized_fct == nil or + serialized_params == nil or + serialized_fct:len() == 0 or + serialized_params:len() == 0 then + return false + end + + local jobid = tbl.do_async_callback( serialized_fct, + serialized_fct:len(), + serialized_params, + serialized_params:len()) + + tbl.async_jobs[jobid] = callback + + return true +end diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 0032017ac..6c0aaf252 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -24,6 +24,7 @@ dofile(scriptpath .. DIR_DELIM .. "modstore.lua") dofile(scriptpath .. DIR_DELIM .. "gamemgr.lua") dofile(scriptpath .. DIR_DELIM .. "mm_textures.lua") dofile(scriptpath .. DIR_DELIM .. "mm_menubar.lua") +dofile(scriptpath .. DIR_DELIM .. "async_event.lua") menu = {} local tabbuilder = {} @@ -43,10 +44,10 @@ end -------------------------------------------------------------------------------- function menu.render_favorite(spec,render_details) local text = "" - + if spec.name ~= nil then text = text .. engine.formspec_escape(spec.name:trim()) - + -- if spec.description ~= nil and -- engine.formspec_escape(spec.description):trim() ~= "" then -- text = text .. " (" .. engine.formspec_escape(spec.description) .. ")" @@ -54,51 +55,51 @@ function menu.render_favorite(spec,render_details) else if spec.address ~= nil then text = text .. spec.address:trim() - + if spec.port ~= nil then text = text .. ":" .. spec.port end end end - + if not render_details then return text end - + local details = "" if spec.password == true then details = details .. "*" else details = details .. "_" end - + if spec.creative then details = details .. "C" else details = details .. "_" end - + if spec.damage then details = details .. "D" else details = details .. "_" end - + if spec.pvp then details = details .. "P" else details = details .. "_" end details = details .. " " - + local playercount = "" - + if spec.clients ~= nil and spec.clients_max ~= nil then playercount = string.format("%03d",spec.clients) .. "/" .. string.format("%03d",spec.clients_max) .. " " end - + return playercount .. engine.formspec_escape(details) .. text end @@ -106,7 +107,7 @@ end os.tempfolder = function() local filetocheck = os.tmpname() os.remove(filetocheck) - + local randname = "MTTempModFolder_" .. math.random(0,10000) if DIR_DELIM == "\\" then local tempfolder = os.getenv("TEMP") @@ -122,7 +123,7 @@ end function init_globals() --init gamedata gamedata.worldindex = 0 - + worldlist = filterlist.create( engine.get_worlds, compare_worlds, @@ -139,7 +140,7 @@ function init_globals() return false end --filter fct ) - + filterlist.add_sort_mechanism(worldlist,"alphabetic",sort_worlds_alphabetic) filterlist.set_sortmode(worldlist,"alphabetic") end @@ -148,12 +149,12 @@ end function update_menu() local formspec - + -- handle errors if gamedata.errormessage ~= nil then formspec = "size[12,5.2]" .. "field[1,2;10,2;;ERROR: " .. - gamedata.errormessage .. + gamedata.errormessage .. ";]".. "button[4.5,4.2;3,0.5;btn_error_confirm;" .. fgettext("Ok") .. "]" else @@ -166,14 +167,14 @@ end -------------------------------------------------------------------------------- function menu.render_world_list() local retval = "" - + local current_worldlist = filterlist.get_list(worldlist) - + for i,v in ipairs(current_worldlist) do if retval ~= "" then retval = retval .."," end - + retval = retval .. engine.formspec_escape(v.name) .. " \\[" .. engine.formspec_escape(v.gameid) .. "\\]" end @@ -196,24 +197,39 @@ function menu.render_texture_pack_list(list) return retval end +-------------------------------------------------------------------------------- +function menu.asyncOnlineFavourites() + menu.favorites = {} + engine.handle_async( + function(param) + return engine.get_favorites("online") + end, + nil, + function(result) + menu.favorites = result + engine.event_handler("Refresh") + end + ) +end + -------------------------------------------------------------------------------- function menu.init() --init menu data gamemgr.update_gamelist() - + menu.last_game = tonumber(engine.setting_get("main_menu_last_game_idx")) - + if type(menu.last_game) ~= "number" then menu.last_game = 1 end if engine.setting_getbool("public_serverlist") then - menu.favorites = engine.get_favorites("online") + menu.asyncOnlineFavourites() else menu.favorites = engine.get_favorites("local") end - - menu.defaulttexturedir = engine.get_texturepath() .. DIR_DELIM .. "base" .. + + menu.defaulttexturedir = engine.get_texturepath() .. DIR_DELIM .. "base" .. DIR_DELIM .. "pack" .. DIR_DELIM end @@ -222,12 +238,12 @@ function menu.lastgame() if menu.last_game > 0 and menu.last_game <= #gamemgr.games then return gamemgr.games[menu.last_game] end - + if #gamemgr.games >= 1 then menu.last_game = 1 return gamemgr.games[menu.last_game] end - + --error case!! return nil end @@ -238,11 +254,11 @@ function menu.update_last_game() local current_world = filterlist.get_raw_element(worldlist, engine.setting_get("mainmenu_last_selected_world") ) - + if current_world == nil then return end - + local gamespec, i = gamemgr.find_by_gameid(current_world.gameid) if i ~= nil then menu.last_game = i @@ -255,17 +271,17 @@ function menu.handle_key_up_down(fields,textlist,settingname) if fields["key_up"] then local oldidx = engine.get_textlist_index(textlist) - + if oldidx > 1 then local newidx = oldidx -1 engine.setting_set(settingname, filterlist.get_raw_index(worldlist,newidx)) end end - + if fields["key_down"] then local oldidx = engine.get_textlist_index(textlist) - + if oldidx < filterlist.size(worldlist) then local newidx = oldidx + 1 engine.setting_set(settingname, @@ -293,7 +309,7 @@ function tabbuilder.dialog_create_world() end mglist = mglist:sub(1, -2) - local retval = + local retval = "label[2,0;" .. fgettext("World name") .. "]".. "field[4.5,0.4;6,0.5;te_world_name;;]" .. @@ -335,7 +351,7 @@ function tabbuilder.gettab() if buildfunc ~= nil then retval = retval .. buildfunc() end - + retval = retval .. modmgr.gettab(tabbuilder.current_tab) retval = retval .. gamemgr.gettab(tabbuilder.current_tab) retval = retval .. modstore.gettab(tabbuilder.current_tab) @@ -345,18 +361,18 @@ end -------------------------------------------------------------------------------- function tabbuilder.handle_create_world_buttons(fields) - + if fields["world_create_confirm"] or fields["key_enter"] then - + local worldname = fields["te_world_name"] local gameindex = engine.get_textlist_index("games") - + if gameindex > 0 and worldname ~= "" then - + local message = nil - + if not filterlist.uid_exists_raw(worldlist,worldname) then engine.setting_set("mg_name",fields["dd_mapgen"]) message = engine.create_world(worldname,gameindex) @@ -365,28 +381,28 @@ function tabbuilder.handle_create_world_buttons(fields) end engine.setting_set("fixed_map_seed", fields["te_seed"]) - + if message ~= nil then gamedata.errormessage = message else menu.last_game = gameindex engine.setting_set("main_menu_last_game_idx",gameindex) - + filterlist.refresh(worldlist) engine.setting_set("mainmenu_last_selected_world", filterlist.raw_index_by_uid(worldlist,worldname)) end else - gamedata.errormessage = + gamedata.errormessage = fgettext("No worldname given or no game selected") end end - + if fields["games"] then tabbuilder.skipformupdate = true return end - + --close dialog tabbuilder.is_dialog = false tabbuilder.show_buttons = true @@ -395,16 +411,16 @@ end -------------------------------------------------------------------------------- function tabbuilder.handle_delete_world_buttons(fields) - + if fields["world_delete_confirm"] then - if menu.world_to_del > 0 and + if menu.world_to_del > 0 and menu.world_to_del <= #filterlist.get_raw_list(worldlist) then engine.delete_world(menu.world_to_del) menu.world_to_del = 0 filterlist.refresh(worldlist) end end - + tabbuilder.is_dialog = false tabbuilder.show_buttons = true tabbuilder.current_tab = engine.setting_get("main_menu_tab") @@ -412,12 +428,12 @@ end -------------------------------------------------------------------------------- function tabbuilder.handle_multiplayer_buttons(fields) - + if fields["te_name"] ~= nil then gamedata.playername = fields["te_name"] engine.setting_set("name", fields["te_name"]) end - + if fields["favourites"] ~= nil then local event = explode_textlist_event(fields["favourites"]) if event.typ == "DCL" then @@ -429,12 +445,12 @@ function tabbuilder.handle_multiplayer_buttons(fields) gamedata.password = fields["te_pwd"] end gamedata.selected_world = 0 - + if menu.favorites ~= nil then gamedata.servername = menu.favorites[event.index].name gamedata.serverdescription = menu.favorites[event.index].description end - + if gamedata.address ~= nil and gamedata.port ~= nil then engine.setting_set("address",gamedata.address) @@ -443,53 +459,53 @@ function tabbuilder.handle_multiplayer_buttons(fields) end end end - + if event.typ == "CHG" then if event.index <= #menu.favorites then local address = menu.favorites[event.index].address local port = menu.favorites[event.index].port - + if address ~= nil and port ~= nil then engine.setting_set("address",address) engine.setting_set("remote_port",port) end - + menu.fav_selected = event.index end end return end - + if fields["key_up"] ~= nil or fields["key_down"] ~= nil then - + local fav_idx = engine.get_textlist_index("favourites") - + if fields["key_up"] ~= nil and fav_idx > 1 then fav_idx = fav_idx -1 else if fields["key_down"] and fav_idx < #menu.favorites then fav_idx = fav_idx +1 end end - + local address = menu.favorites[fav_idx].address local port = menu.favorites[fav_idx].port - + if address ~= nil and port ~= nil then engine.setting_set("address",address) engine.setting_set("remote_port",port) end - + menu.fav_selected = fav_idx return end - + if fields["cb_public_serverlist"] ~= nil then engine.setting_set("public_serverlist", fields["cb_public_serverlist"]) - + if engine.setting_getbool("public_serverlist") then - menu.favorites = engine.get_favorites("online") + menu.asyncOnlineFavourites() else menu.favorites = engine.get_favorites("local") end @@ -502,27 +518,27 @@ function tabbuilder.handle_multiplayer_buttons(fields) engine.delete_favorite(current_favourite) menu.favorites = engine.get_favorites() menu.fav_selected = nil - + engine.setting_set("address","") engine.setting_set("remote_port","30000") - + return end if fields["btn_mp_connect"] ~= nil or fields["key_enter"] ~= nil then - + gamedata.playername = fields["te_name"] gamedata.password = fields["te_pwd"] gamedata.address = fields["te_address"] gamedata.port = fields["te_port"] - + local fav_idx = engine.get_textlist_index("favourites") - + if fav_idx > 0 and fav_idx <= #menu.favorites and menu.favorites[fav_idx].address == fields["te_address"] and menu.favorites[fav_idx].port == fields["te_port"] then - + gamedata.servername = menu.favorites[fav_idx].name gamedata.serverdescription = menu.favorites[fav_idx].description else @@ -531,10 +547,10 @@ function tabbuilder.handle_multiplayer_buttons(fields) end gamedata.selected_world = 0 - + engine.setting_set("address",fields["te_address"]) engine.setting_set("remote_port",fields["te_port"]) - + engine.start() return end @@ -547,7 +563,7 @@ function tabbuilder.handle_server_buttons(fields) if fields["srv_worlds"] ~= nil then local event = explode_textlist_event(fields["srv_worlds"]) - + if event.typ == "DCL" then world_doubleclick = true end @@ -556,13 +572,13 @@ function tabbuilder.handle_server_buttons(fields) filterlist.get_raw_index(worldlist,engine.get_textlist_index("srv_worlds"))) end end - + menu.handle_key_up_down(fields,"srv_worlds","mainmenu_last_selected_world") - + if fields["cb_creative_mode"] then engine.setting_set("creative_mode", fields["cb_creative_mode"]) end - + if fields["cb_enable_damage"] then engine.setting_set("enable_damage", fields["cb_enable_damage"]) end @@ -570,7 +586,7 @@ function tabbuilder.handle_server_buttons(fields) if fields["cb_server_announce"] then engine.setting_set("server_announce", fields["cb_server_announce"]) end - + if fields["start_server"] ~= nil or world_doubleclick or fields["key_enter"] then @@ -581,19 +597,20 @@ function tabbuilder.handle_server_buttons(fields) gamedata.port = fields["te_serverport"] gamedata.address = "" gamedata.selected_world = filterlist.get_raw_index(worldlist,selected) - + engine.setting_set("port",gamedata.port) + menu.update_last_game(gamedata.selected_world) engine.start() end end - + if fields["world_create"] ~= nil then tabbuilder.current_tab = "dialog_create_world" tabbuilder.is_dialog = true tabbuilder.show_buttons = false end - + if fields["world_delete"] ~= nil then local selected = engine.get_textlist_index("srv_worlds") if selected > 0 and @@ -611,7 +628,7 @@ function tabbuilder.handle_server_buttons(fields) end end end - + if fields["world_configure"] ~= nil then selected = engine.get_textlist_index("srv_worlds") if selected > 0 then @@ -639,7 +656,7 @@ function tabbuilder.handle_settings_buttons(fields) if fields["cb_opaque_water"] then engine.setting_set("opaque_water", fields["cb_opaque_water"]) end - + if fields["cb_mipmapping"] then engine.setting_set("mip_map", fields["cb_mipmapping"]) end @@ -652,7 +669,7 @@ function tabbuilder.handle_settings_buttons(fields) if fields["cb_trilinear"] then engine.setting_set("trilinear_filter", fields["cb_trilinear"]) end - + if fields["cb_shaders"] then if (engine.setting_get("video_driver") == "direct3d8" or engine.setting_get("video_driver") == "direct3d9") then engine.setting_set("enable_shaders", "false") @@ -683,23 +700,23 @@ function tabbuilder.handle_singleplayer_buttons(fields) if fields["sp_worlds"] ~= nil then local event = explode_textlist_event(fields["sp_worlds"]) - + if event.typ == "DCL" then world_doubleclick = true end - + if event.typ == "CHG" then engine.setting_set("mainmenu_last_selected_world", filterlist.get_raw_index(worldlist,engine.get_textlist_index("sp_worlds"))) end end - + menu.handle_key_up_down(fields,"sp_worlds","mainmenu_last_selected_world") - + if fields["cb_creative_mode"] then engine.setting_set("creative_mode", fields["cb_creative_mode"]) end - + if fields["cb_enable_damage"] then engine.setting_set("enable_damage", fields["cb_enable_damage"]) end @@ -711,19 +728,19 @@ function tabbuilder.handle_singleplayer_buttons(fields) if selected > 0 then gamedata.selected_world = filterlist.get_raw_index(worldlist,selected) gamedata.singleplayer = true - + menu.update_last_game(gamedata.selected_world) - + engine.start() end end - + if fields["world_create"] ~= nil then tabbuilder.current_tab = "dialog_create_world" tabbuilder.is_dialog = true tabbuilder.show_buttons = false end - + if fields["world_delete"] ~= nil then local selected = engine.get_textlist_index("sp_worlds") if selected > 0 and @@ -741,7 +758,7 @@ function tabbuilder.handle_singleplayer_buttons(fields) end end end - + if fields["world_configure"] ~= nil then selected = engine.get_textlist_index("sp_worlds") if selected > 0 then @@ -768,7 +785,7 @@ function tabbuilder.handle_texture_pack_buttons(fields) if #list >= current_index then local new_path = engine.get_texturepath()..DIR_DELIM..list[current_index] if list[current_index] == "None" then new_path = "" end - + engine.setting_set("texture_path", new_path) end end @@ -781,15 +798,15 @@ function tabbuilder.tab_header() if tabbuilder.last_tab_index == nil then tabbuilder.last_tab_index = 1 end - + local toadd = "" - + for i=1,#tabbuilder.current_buttons,1 do - + if toadd ~= "" then toadd = toadd .. "," end - + toadd = toadd .. tabbuilder.current_buttons[i].caption end return "tabheader[-0.3,-0.99;main_tab;" .. toadd ..";" .. tabbuilder.last_tab_index .. ";true;false]" @@ -802,21 +819,21 @@ function tabbuilder.handle_tab_buttons(fields) local index = tonumber(fields["main_tab"]) tabbuilder.last_tab_index = index tabbuilder.current_tab = tabbuilder.current_buttons[index].name - + engine.setting_set("main_menu_tab",tabbuilder.current_tab) end - + --handle tab changes if tabbuilder.current_tab ~= tabbuilder.old_tab then if tabbuilder.current_tab ~= "singleplayer" and not tabbuilder.is_dialog then menu.update_gametype(true) end end - + if tabbuilder.current_tab == "singleplayer" then menu.update_gametype() end - + tabbuilder.old_tab = tabbuilder.current_tab end @@ -832,24 +849,24 @@ function tabbuilder.tab_multiplayer() "field[6.75,5.25;2.25,0.5;te_port;;" ..engine.setting_get("remote_port") .."]" .. "checkbox[1,3.6;cb_public_serverlist;".. fgettext("Public Serverlist") .. ";" .. dump(engine.setting_getbool("public_serverlist")) .. "]" - + if not engine.setting_getbool("public_serverlist") then - retval = retval .. + retval = retval .. "button[6.45,3.95;2.25,0.5;btn_delete_favorite;".. fgettext("Delete") .. "]" end - + retval = retval .. "button[9,4.95;2.5,0.5;btn_mp_connect;".. fgettext("Connect") .. "]" .. "field[9.3,3.75;2.5,0.5;te_name;;" ..engine.setting_get("name") .."]" .. "pwdfield[9.3,4.5;2.5,0.5;te_pwd;]" .. "textarea[9.3,0.25;2.5,2.75;;" - if menu.fav_selected ~= nil and + if menu.fav_selected ~= nil and menu.favorites[menu.fav_selected].description ~= nil then - retval = retval .. + retval = retval .. engine.formspec_escape(menu.favorites[menu.fav_selected].description,true) end - - retval = retval .. + + retval = retval .. ";]" .. "textlist[1,0.35;7.5,3.35;favourites;" @@ -857,7 +874,7 @@ function tabbuilder.tab_multiplayer() if #menu.favorites > 0 then retval = retval .. menu.render_favorite(menu.favorites[1],render_details) - + for i=2,#menu.favorites,1 do retval = retval .. "," .. menu.render_favorite(menu.favorites[i],render_details) end @@ -878,8 +895,8 @@ function tabbuilder.tab_server() local index = filterlist.get_current_index(worldlist, tonumber(engine.setting_get("mainmenu_last_selected_world")) ) - - local retval = + + local retval = "button[4,4.15;2.6,0.5;world_delete;".. fgettext("Delete") .. "]" .. "button[6.5,4.15;2.8,0.5;world_create;".. fgettext("New") .. "]" .. "button[9.2,4.15;2.55,0.5;world_configure;".. fgettext("Configure") .. "]" .. @@ -895,27 +912,27 @@ function tabbuilder.tab_server() "field[0.8,3.2;3,0.5;te_playername;".. fgettext("Name") .. ";" .. engine.setting_get("name") .. "]" .. "pwdfield[0.8,4.2;3,0.5;te_passwd;".. fgettext("Password") .. "]" .. - "field[0.8,5.2;3,0.5;te_serverport;".. fgettext("Server Port") .. ";" .. + "field[0.8,5.2;3,0.5;te_serverport;".. fgettext("Server Port") .. ";" .. engine.setting_get("port") .."]" .. "textlist[4,0.25;7.5,3.7;srv_worlds;" .. menu.render_world_list() .. ";" .. index .. "]" - + return retval end -------------------------------------------------------------------------------- function tabbuilder.tab_settings() return "vertlabel[0,0;" .. fgettext("SETTINGS") .. "]" .. - "checkbox[1,0.75;cb_fancy_trees;".. fgettext("Fancy trees") .. ";" + "checkbox[1,0.75;cb_fancy_trees;".. fgettext("Fancy trees") .. ";" .. dump(engine.setting_getbool("new_style_leaves")) .. "]".. - "checkbox[1,1.25;cb_smooth_lighting;".. fgettext("Smooth Lighting") + "checkbox[1,1.25;cb_smooth_lighting;".. fgettext("Smooth Lighting") .. ";".. dump(engine.setting_getbool("smooth_lighting")) .. "]".. "checkbox[1,1.75;cb_3d_clouds;".. fgettext("3D Clouds") .. ";" .. dump(engine.setting_getbool("enable_3d_clouds")) .. "]".. "checkbox[1,2.25;cb_opaque_water;".. fgettext("Opaque Water") .. ";" .. dump(engine.setting_getbool("opaque_water")) .. "]".. - + "checkbox[4,0.75;cb_mipmapping;".. fgettext("Mip-Mapping") .. ";" .. dump(engine.setting_getbool("mip_map")) .. "]".. "checkbox[4,1.25;cb_anisotrophic;".. fgettext("Anisotropic Filtering") .. ";" @@ -924,7 +941,7 @@ function tabbuilder.tab_settings() .. dump(engine.setting_getbool("bilinear_filter")) .. "]".. "checkbox[4,2.25;cb_trilinear;".. fgettext("Tri-Linear Filtering") .. ";" .. dump(engine.setting_getbool("trilinear_filter")) .. "]".. - + "checkbox[7.5,0.75;cb_shaders;".. fgettext("Shaders") .. ";" .. dump(engine.setting_getbool("enable_shaders")) .. "]".. "checkbox[7.5,1.25;cb_pre_ivis;".. fgettext("Preload item visuals") .. ";" @@ -933,13 +950,13 @@ function tabbuilder.tab_settings() .. dump(engine.setting_getbool("enable_particles")) .. "]".. "checkbox[7.5,2.25;cb_finite_liquid;".. fgettext("Finite Liquid") .. ";" .. dump(engine.setting_getbool("liquid_finite")) .. "]".. - + "button[1,4.25;2.25,0.5;btn_change_keys;".. fgettext("Change keys") .. "]" end -------------------------------------------------------------------------------- function tabbuilder.tab_singleplayer() - + local index = filterlist.get_current_index(worldlist, tonumber(engine.setting_get("mainmenu_last_selected_world")) ) @@ -966,19 +983,19 @@ function tabbuilder.tab_texture_packs() "vertlabel[0,-0.25;".. fgettext("TEXTURE PACKS") .. "]" .. "textlist[4,0.25;7.5,5.0;TPs;" - local current_texture_path = engine.setting_get("texture_path") - local list = filter_texture_pack_list(engine.get_dirlist(engine.get_texturepath(), true)) + local current_texture_path = engine.setting_get("texture_path") + local list = filter_texture_pack_list(engine.get_dirlist(engine.get_texturepath(), true)) local index = tonumber(engine.setting_get("mainmenu_last_selected_TP")) - + if index == nil then index = 1 end - + if current_texture_path == "" then retval = retval .. menu.render_texture_pack_list(list) .. ";" .. index .. "]" return retval end - + local infofile = current_texture_path ..DIR_DELIM.."info.txt" local infotext = "" local f = io.open(infofile, "r") @@ -988,7 +1005,7 @@ function tabbuilder.tab_texture_packs() infotext = f:read("*all") f:close() end - + local screenfile = current_texture_path..DIR_DELIM.."screenshot.png" local no_screenshot = nil if not file_exists(screenfile) then @@ -1009,7 +1026,7 @@ function tabbuilder.tab_credits() local logofile = menu.defaulttexturedir .. "logo.png" return "vertlabel[0,-0.5;CREDITS]" .. "label[0.5,3;Minetest " .. engine.get_version() .. "]" .. - "label[0.5,3.3;http://minetest.net]" .. + "label[0.5,3.3;http://minetest.net]" .. "image[0.5,1;" .. engine.formspec_escape(logofile) .. "]" .. "textlist[3.5,-0.25;8.5,5.8;list_credits;" .. "#FFFF00" .. fgettext("Core Developers") .."," .. @@ -1064,40 +1081,40 @@ function tabbuilder.init() } tabbuilder.current_tab = engine.setting_get("main_menu_tab") - + if tabbuilder.current_tab == nil or tabbuilder.current_tab == "" then tabbuilder.current_tab = "singleplayer" engine.setting_set("main_menu_tab",tabbuilder.current_tab) end - + --initialize tab buttons tabbuilder.last_tab = nil tabbuilder.show_buttons = true - + tabbuilder.current_buttons = {} table.insert(tabbuilder.current_buttons,{name="singleplayer", caption=fgettext("Singleplayer")}) table.insert(tabbuilder.current_buttons,{name="multiplayer", caption=fgettext("Client")}) table.insert(tabbuilder.current_buttons,{name="server", caption=fgettext("Server")}) table.insert(tabbuilder.current_buttons,{name="settings", caption=fgettext("Settings")}) table.insert(tabbuilder.current_buttons,{name="texture_packs", caption=fgettext("Texture Packs")}) - + if engine.setting_getbool("main_menu_game_mgr") then table.insert(tabbuilder.current_buttons,{name="game_mgr", caption=fgettext("Games")}) end - + if engine.setting_getbool("main_menu_mod_mgr") then table.insert(tabbuilder.current_buttons,{name="mod_mgr", caption=fgettext("Mods")}) end table.insert(tabbuilder.current_buttons,{name="credits", caption=fgettext("Credits")}) - - + + for i=1,#tabbuilder.current_buttons,1 do if tabbuilder.current_buttons[i].name == tabbuilder.current_tab then tabbuilder.last_tab_index = i end end - + if tabbuilder.current_tab ~= "singleplayer" then menu.update_gametype(true) else @@ -1112,18 +1129,24 @@ function tabbuilder.checkretval(retval) if retval.current_tab ~= nil then tabbuilder.current_tab = retval.current_tab end - + if retval.is_dialog ~= nil then tabbuilder.is_dialog = retval.is_dialog end - + if retval.show_buttons ~= nil then tabbuilder.show_buttons = retval.show_buttons end - + if retval.skipformupdate ~= nil then tabbuilder.skipformupdate = retval.skipformupdate end + + if retval.ignore_menu_quit == true then + tabbuilder.ignore_menu_quit = true + else + tabbuilder.ignore_menu_quit = false + end end end @@ -1134,54 +1157,54 @@ end -------------------------------------------------------------------------------- engine.button_handler = function(fields) --print("Buttonhandler: tab: " .. tabbuilder.current_tab .. " fields: " .. dump(fields)) - + if fields["btn_error_confirm"] then gamedata.errormessage = nil end - + local retval = modmgr.handle_buttons(tabbuilder.current_tab,fields) tabbuilder.checkretval(retval) - + retval = gamemgr.handle_buttons(tabbuilder.current_tab,fields) tabbuilder.checkretval(retval) - + retval = modstore.handle_buttons(tabbuilder.current_tab,fields) tabbuilder.checkretval(retval) - + if tabbuilder.current_tab == "dialog_create_world" then tabbuilder.handle_create_world_buttons(fields) end - + if tabbuilder.current_tab == "dialog_delete_world" then tabbuilder.handle_delete_world_buttons(fields) end - + if tabbuilder.current_tab == "singleplayer" then tabbuilder.handle_singleplayer_buttons(fields) end - + if tabbuilder.current_tab == "texture_packs" then tabbuilder.handle_texture_pack_buttons(fields) end - + if tabbuilder.current_tab == "multiplayer" then tabbuilder.handle_multiplayer_buttons(fields) end - + if tabbuilder.current_tab == "settings" then tabbuilder.handle_settings_buttons(fields) end - + if tabbuilder.current_tab == "server" then tabbuilder.handle_server_buttons(fields) end - + --tab buttons tabbuilder.handle_tab_buttons(fields) - + --menubar buttons menubar.handle_buttons(fields) - + if not tabbuilder.skipformupdate then --update menu update_menu() @@ -1194,6 +1217,10 @@ end engine.event_handler = function(event) if event == "MenuQuit" then if tabbuilder.is_dialog then + if tabbuilder.ignore_menu_quit then + return + end + tabbuilder.is_dialog = false tabbuilder.show_buttons = true tabbuilder.current_tab = engine.setting_get("main_menu_tab") @@ -1203,6 +1230,10 @@ engine.event_handler = function(event) engine.close() end end + + if event == "Refresh" then + update_menu() + end end -------------------------------------------------------------------------------- diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index 1f19ac673..cc5e09513 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -22,7 +22,7 @@ function get_mods(path,retval,modpack) for i=1,#mods,1 do local toadd = {} local modpackfile = nil - + toadd.name = mods[i] toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM if modpack ~= nil and @@ -33,7 +33,7 @@ function get_mods(path,retval,modpack) local error = nil modpackfile,error = io.open(filename,"r") end - + if modpackfile ~= nil then modpackfile:close() toadd.is_modpack = true @@ -52,9 +52,9 @@ modmgr = {} function modmgr.extract(modfile) if modfile.type == "zip" then local tempfolder = os.tempfolder() - + if tempfolder ~= nil and - tempfodler ~= "" then + tempfolder ~= "" then engine.create_dir(tempfolder) engine.extract_zip(modfile.name,tempfolder) return tempfolder @@ -80,7 +80,7 @@ function modmgr.getbasefolder(temppath) path=temppath } end - + testfile = io.open(temppath .. DIR_DELIM .. "modpack.txt","r") if testfile ~= nil then testfile:close() @@ -89,9 +89,9 @@ function modmgr.getbasefolder(temppath) path=temppath } end - + local subdirs = engine.get_dirlist(temppath,true) - + --only single mod or modpack allowed if #subdirs ~= 1 then return { @@ -100,7 +100,7 @@ function modmgr.getbasefolder(temppath) } end - testfile = + testfile = io.open(temppath .. DIR_DELIM .. subdirs[1] ..DIR_DELIM .."init.lua","r") if testfile ~= nil then testfile:close() @@ -109,8 +109,8 @@ function modmgr.getbasefolder(temppath) path= temppath .. DIR_DELIM .. subdirs[1] } end - - testfile = + + testfile = io.open(temppath .. DIR_DELIM .. subdirs[1] ..DIR_DELIM .."modpack.txt","r") if testfile ~= nil then testfile:close() @@ -131,7 +131,7 @@ function modmgr.isValidModname(modpath) if modpath:find("-") ~= nil then return false end - + return true end @@ -142,20 +142,20 @@ function modmgr.parse_register_line(line) if pos1 ~= nil then pos2 = line:find("\"",pos1+1) end - + if pos1 ~= nil and pos2 ~= nil then local item = line:sub(pos1+1,pos2-1) - + if item ~= nil and item ~= "" then local pos3 = item:find(":") - + if pos3 ~= nil then local retval = item:sub(1,pos3-1) if retval ~= nil and retval ~= "" then return retval - end + end end end end @@ -169,10 +169,10 @@ function modmgr.parse_dofile_line(modpath,line) if pos1 ~= nil then pos2 = line:find("\"",pos1+1) end - + if pos1 ~= nil and pos2 ~= nil then local filename = line:sub(pos1+1,pos2-1) - + if filename ~= nil and filename ~= "" and filename:find(".lua") then @@ -187,37 +187,37 @@ function modmgr.identify_modname(modpath,filename) local testfile = io.open(modpath .. DIR_DELIM .. filename,"r") if testfile ~= nil then local line = testfile:read() - + while line~= nil do local modname = nil - + if line:find("minetest.register_tool") then modname = modmgr.parse_register_line(line) end - + if line:find("minetest.register_craftitem") then modname = modmgr.parse_register_line(line) end - - + + if line:find("minetest.register_node") then modname = modmgr.parse_register_line(line) end - + if line:find("dofile") then modname = modmgr.parse_dofile_line(modpath,line) end - + if modname ~= nil then testfile:close() return modname end - + line = testfile:read() end testfile:close() end - + return nil end @@ -231,29 +231,29 @@ function modmgr.tab() if modmgr.selected_mod == nil then modmgr.selected_mod = 1 end - - local retval = + + local retval = "vertlabel[0,-0.25;".. fgettext("MODS") .. "]" .. "label[0.8,-0.25;".. fgettext("Installed Mods:") .. "]" .. "textlist[0.75,0.25;4.5,4;modlist;" .. - modmgr.render_modlist(modmgr.global_mods) .. + modmgr.render_modlist(modmgr.global_mods) .. ";" .. modmgr.selected_mod .. "]" retval = retval .. - "label[0.8,4.2;" .. fgettext("Add mod:") .. "]" .. + "label[0.8,4.2;" .. fgettext("Add mod:") .. "]" .. -- TODO Disabled due to upcoming release 0.4.8 and irrlicht messing up localization -- "button[0.75,4.85;1.8,0.5;btn_mod_mgr_install_local;".. fgettext("Local install") .. "]" .. "button[2.45,4.85;3.05,0.5;btn_mod_mgr_download;".. fgettext("Online mod repository") .. "]" - + local selected_mod = nil - + if filterlist.size(modmgr.global_mods) >= modmgr.selected_mod then selected_mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] end - + if selected_mod ~= nil then local modscreenshot = nil - + --check for screenshot beeing available local screenshotfilename = selected_mod.path .. DIR_DELIM .. "screenshot.png" local error = nil @@ -262,40 +262,40 @@ function modmgr.tab() screenshotfile:close() modscreenshot = screenshotfilename end - + if modscreenshot == nil then modscreenshot = modstore.basetexturedir .. "no_screenshot.png" end - - retval = retval + + retval = retval .. "image[5.5,0;3,2;" .. engine.formspec_escape(modscreenshot) .. "]" .. "label[8.25,0.6;" .. selected_mod.name .. "]" - + local descriptionlines = nil error = nil local descriptionfilename = selected_mod.path .. "description.txt" descriptionfile,error = io.open(descriptionfilename,"r") if error == nil then descriptiontext = descriptionfile:read("*all") - + descriptionlines = engine.splittext(descriptiontext,42) descriptionfile:close() else descriptionlines = {} table.insert(descriptionlines,fgettext("No mod description available")) end - - retval = retval .. + + retval = retval .. "label[5.5,1.7;".. fgettext("Mod information:") .. "]" .. "textlist[5.5,2.2;6.2,2.4;description;" - + for i=1,#descriptionlines,1 do retval = retval .. engine.formspec_escape(descriptionlines[i]) .. "," end - - + + if selected_mod.is_modpack then - retval = retval .. ";0]" .. + retval = retval .. ";0]" .. "button[10,4.85;2,0.5;btn_mod_mgr_rename_modpack;" .. fgettext("Rename") .. "]" retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;" @@ -304,11 +304,11 @@ function modmgr.tab() --show dependencies retval = retval .. ",Depends:," - + toadd = modmgr.get_dependencies(selected_mod.path) - + retval = retval .. toadd .. ";0]" - + retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;" .. fgettext("Uninstall selected mod") .. "]" end @@ -320,15 +320,15 @@ end function modmgr.dialog_rename_modpack() local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] - - local retval = + + local retval = "label[1.75,1;".. fgettext("Rename Modpack:") .. "]".. "field[4.5,1.4;6,0.5;te_modpack_name;;" .. mod.name .. "]" .. - "button[5,4.2;2.6,0.5;dlg_rename_modpack_confirm;".. + "button[5,4.2;2.6,0.5;dlg_rename_modpack_confirm;".. fgettext("Accept") .. "]" .. - "button[7.5,4.2;2.8,0.5;dlg_rename_modpack_cancel;".. + "button[7.5,4.2;2.8,0.5;dlg_rename_modpack_cancel;".. fgettext("Cancel") .. "]" return retval @@ -340,15 +340,15 @@ function modmgr.precheck() if modmgr.world_config_selected_world == nil then modmgr.world_config_selected_world = 1 end - + if modmgr.world_config_selected_mod == nil then modmgr.world_config_selected_mod = 1 end - + if modmgr.hide_gamemods == nil then modmgr.hide_gamemods = true end - + if modmgr.hide_modpackcontents == nil then modmgr.hide_modpackcontents = true end @@ -357,27 +357,27 @@ end -------------------------------------------------------------------------------- function modmgr.render_modlist(render_list) local retval = "" - + if render_list == nil then if modmgr.global_mods == nil then modmgr.refresh_globals() end render_list = modmgr.global_mods end - + local list = filterlist.get_list(render_list) local last_modpack = nil - + for i,v in ipairs(list) do if retval ~= "" then retval = retval .."," end local color = "" - + if v.is_modpack then local rawlist = filterlist.get_raw_list(render_list) - + local all_enabled = true for j=1,#rawlist,1 do if rawlist[j].modpack == list[i].name and @@ -386,14 +386,14 @@ function modmgr.render_modlist(render_list) break end end - + if all_enabled == false then color = mt_color_grey else color = mt_color_dark_green end end - + if v.typ == "game_mod" then color = mt_color_blue else @@ -408,34 +408,34 @@ function modmgr.render_modlist(render_list) end retval = retval .. v.name end - + return retval end -------------------------------------------------------------------------------- function modmgr.dialog_configure_world() modmgr.precheck() - + local worldspec = engine.get_worlds()[modmgr.world_config_selected_world] local mod = filterlist.get_list(modmgr.modlist)[modmgr.world_config_selected_mod] - + local retval = "size[11,6.5]" .. "label[0.5,-0.25;" .. fgettext("World:") .. "]" .. "label[1.75,-0.25;" .. worldspec.name .. "]" - + if modmgr.hide_gamemods then retval = retval .. "checkbox[0,5.75;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";true]" else retval = retval .. "checkbox[0,5.75;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";false]" end - + if modmgr.hide_modpackcontents then retval = retval .. "checkbox[2,5.75;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";true]" else retval = retval .. "checkbox[2,5.75;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";false]" end - + if mod == nil then mod = {name=""} end @@ -447,11 +447,11 @@ function modmgr.dialog_configure_world() modmgr.get_dependencies(mod.path) .. ";0]" .. "button[9.25,6.35;2,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" .. "button[7.4,6.35;2,0.5;btn_config_world_cancel;" .. fgettext("Cancel") .. "]" - + if mod ~= nil and mod.name ~= "" and mod.typ ~= "game_mod" then if mod.is_modpack then local rawlist = filterlist.get_raw_list(modmgr.modlist) - + local all_enabled = true for j=1,#rawlist,1 do if rawlist[j].modpack == mod.name and @@ -460,7 +460,7 @@ function modmgr.dialog_configure_world() break end end - + if all_enabled == false then retval = retval .. "button[5.5,-0.125;2,0.5;btn_mp_enable;" .. fgettext("Enable MP") .. "]" else @@ -474,15 +474,15 @@ function modmgr.dialog_configure_world() end end end - + retval = retval .. "button[8.5,-0.125;2.5,0.5;btn_all_mods;" .. fgettext("Enable all") .. "]" .. "textlist[5.5,0.5;5.5,5.75;world_config_modlist;" - + retval = retval .. modmgr.render_modlist(modmgr.modlist) - + retval = retval .. ";" .. modmgr.world_config_selected_mod .."]" - + return retval end @@ -490,23 +490,23 @@ end function modmgr.handle_buttons(tab,fields) local retval = nil - + if tab == "mod_mgr" then retval = modmgr.handle_modmgr_buttons(fields) end - + if tab == "dialog_rename_modpack" then retval = modmgr.handle_rename_modpack_buttons(fields) end - + if tab == "dialog_delete_mod" then retval = modmgr.handle_delete_mod_buttons(fields) end - + if tab == "dialog_configure_world" then retval = modmgr.handle_configure_world_buttons(fields) end - + return retval end @@ -516,13 +516,13 @@ function modmgr.get_dependencies(modfolder) if modfolder ~= nil then local filename = modfolder .. DIR_DELIM .. "depends.txt" - + local dependencyfile = io.open(filename,"r") - + if dependencyfile then local dependency = dependencyfile:read("*l") while dependency do - if toadd ~= "" then + if toadd ~= "" then toadd = toadd .. "," end toadd = toadd .. dependency @@ -542,11 +542,11 @@ function modmgr.get_worldconfig(worldpath) DIR_DELIM .. "world.mt" local worldfile = Settings(filename) - + local worldconfig = {} worldconfig.global_mods = {} worldconfig.game_mods = {} - + for key,value in pairs(worldfile:to_table()) do if key == "gameid" then worldconfig.id = value @@ -554,7 +554,7 @@ function modmgr.get_worldconfig(worldpath) worldconfig.global_mods[key] = engine.is_yes(value) end end - + --read gamemods local gamespec = gamemgr.find_by_gameid(worldconfig.id) gamemgr.get_game_mods(gamespec, worldconfig.game_mods) @@ -573,11 +573,11 @@ function modmgr.handle_modmgr_buttons(fields) local event = explode_textlist_event(fields["modlist"]) modmgr.selected_mod = event.index end - + if fields["btn_mod_mgr_install_local"] ~= nil then engine.show_file_open_dialog("mod_mgt_open_dlg",fgettext("Select Mod File:")) end - + if fields["btn_mod_mgr_download"] ~= nil then modstore.update_modlist() retval.current_tab = "dialog_modstore_unsorted" @@ -585,26 +585,26 @@ function modmgr.handle_modmgr_buttons(fields) retval.show_buttons = false return retval end - + if fields["btn_mod_mgr_rename_modpack"] ~= nil then retval.current_tab = "dialog_rename_modpack" retval.is_dialog = true retval.show_buttons = false return retval end - + if fields["btn_mod_mgr_delete_mod"] ~= nil then retval.current_tab = "dialog_delete_mod" retval.is_dialog = true retval.show_buttons = false return retval end - + if fields["mod_mgt_open_dlg_accepted"] ~= nil and fields["mod_mgt_open_dlg_accepted"] ~= "" then modmgr.installmod(fields["mod_mgt_open_dlg_accepted"],nil) end - + return nil; end @@ -612,27 +612,27 @@ end function modmgr.installmod(modfilename,basename) local modfile = modmgr.identify_filetype(modfilename) local modpath = modmgr.extract(modfile) - + if modpath == nil then gamedata.errormessage = fgettext("Install Mod: file: \"$1\"", modfile.name) .. fgettext("\nInstall Mod: unsupported filetype \"$1\"", modfile.type) return end - - + + local basefolder = modmgr.getbasefolder(modpath) - + if basefolder.type == "modpack" then local clean_path = nil - + if basename ~= nil then clean_path = "mp_" .. basename end - + if clean_path == nil then clean_path = get_last_folder(cleanup_path(basefolder.path)) end - + if clean_path ~= nil then local targetpath = engine.get_modpath() .. DIR_DELIM .. clean_path if not engine.copy_dir(basefolder.path,targetpath) then @@ -642,19 +642,19 @@ function modmgr.installmod(modfilename,basename) gamedata.errormessage = fgettext("Install Mod: unable to find suitable foldername for modpack $1", modfilename) end end - + if basefolder.type == "mod" then local targetfolder = basename - + if targetfolder == nil then targetfolder = modmgr.identify_modname(basefolder.path,"init.lua") end - + --if heuristic failed try to use current foldername if targetfolder == nil then targetfolder = get_last_folder(basefolder.path) - end - + end + if targetfolder ~= nil and modmgr.isValidModname(targetfolder) then local targetpath = engine.get_modpath() .. DIR_DELIM .. targetfolder engine.copy_dir(basefolder.path,targetpath) @@ -662,7 +662,7 @@ function modmgr.installmod(modfilename,basename) gamedata.errormessage = fgettext("Install Mod: unable to find real modname for: $1", modfilename) end end - + engine.delete_dir(modpath) modmgr.refresh_globals() @@ -671,7 +671,7 @@ end -------------------------------------------------------------------------------- function modmgr.handle_rename_modpack_buttons(fields) - + if fields["dlg_rename_modpack_confirm"] ~= nil then local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] local oldpath = engine.get_modpath() .. DIR_DELIM .. mod.name @@ -681,7 +681,7 @@ function modmgr.handle_rename_modpack_buttons(fields) modmgr.selected_mod = filterlist.get_current_index(modmgr.global_mods, filterlist.raw_index_by_uid(modmgr.global_mods, fields["te_modpack_name"])) end - + return { is_dialog = false, show_buttons = true, @@ -698,25 +698,25 @@ function modmgr.handle_configure_world_buttons(fields) modmgr.world_config_enable_mod(nil) end end - + if fields["key_enter"] ~= nil then modmgr.world_config_enable_mod(nil) end - + if fields["cb_mod_enable"] ~= nil then local toset = engine.is_yes(fields["cb_mod_enable"]) modmgr.world_config_enable_mod(toset) end - + if fields["btn_mp_enable"] ~= nil or fields["btn_mp_disable"] then local toset = (fields["btn_mp_enable"] ~= nil) modmgr.world_config_enable_mod(toset) end - + if fields["cb_hide_gamemods"] ~= nil then local current = filterlist.get_filtercriteria(modmgr.modlist) - + if current == nil then current = {} end @@ -728,13 +728,13 @@ function modmgr.handle_configure_world_buttons(fields) current.hide_game = false modmgr.hide_gamemods = false end - + filterlist.set_filtercriteria(modmgr.modlist,current) end - + if fields["cb_hide_mpcontent"] ~= nil then local current = filterlist.get_filtercriteria(modmgr.modlist) - + if current == nil then current = {} end @@ -746,21 +746,21 @@ function modmgr.handle_configure_world_buttons(fields) current.hide_modpackcontents = false modmgr.hide_modpackcontents = false end - + filterlist.set_filtercriteria(modmgr.modlist,current) end - + if fields["btn_config_world_save"] then local worldspec = engine.get_worlds()[modmgr.world_config_selected_world] - + local filename = worldspec.path .. DIR_DELIM .. "world.mt" - + local worldfile = Settings(filename) local mods = worldfile:to_table() - + local rawlist = filterlist.get_raw_list(modmgr.modlist) - + local i,mod for i,mod in ipairs(rawlist) do if not mod.is_modpack and @@ -773,42 +773,42 @@ function modmgr.handle_configure_world_buttons(fields) mods["load_mod_"..mod.name] = nil end end - + -- Remove mods that are not present anymore for key,value in pairs(mods) do if key:sub(1,9) == "load_mod_" then worldfile:remove(key) end end - + if not worldfile:write() then engine.log("error", "Failed to write world config file") end - + modmgr.modlist = nil modmgr.worldconfig = nil - + return { is_dialog = false, show_buttons = true, current_tab = engine.setting_get("main_menu_tab") } end - + if fields["btn_config_world_cancel"] then - + modmgr.worldconfig = nil - + return { is_dialog = false, show_buttons = true, current_tab = engine.setting_get("main_menu_tab") } end - + if fields["btn_all_mods"] then local list = filterlist.get_raw_list(modmgr.modlist) - + for i=1,#list,1 do if list[i].typ ~= "game_mod" and not list[i].is_modpack then @@ -816,9 +816,9 @@ function modmgr.handle_configure_world_buttons(fields) end end end - - + + return nil end -------------------------------------------------------------------------------- @@ -849,9 +849,9 @@ end -------------------------------------------------------------------------------- function modmgr.handle_delete_mod_buttons(fields) local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] - + if fields["dlg_delete_mod_confirm"] ~= nil then - + if mod.path ~= nil and mod.path ~= "" and mod.path ~= engine.get_modpath() then @@ -863,7 +863,7 @@ function modmgr.handle_delete_mod_buttons(fields) gamedata.errormessage = fgettext("Modmgr: invalid modpath \"$1\"", mod.path) end end - + return { is_dialog = false, show_buttons = true, @@ -875,8 +875,8 @@ end function modmgr.dialog_delete_mod() local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod] - - local retval = + + local retval = "field[1.75,1;10,3;;" .. fgettext("Are you sure you want to delete \"$1\"?", mod.name) .. ";]".. "button[4,4.2;1,0.5;dlg_delete_mod_confirm;" .. fgettext("Yes") .. "]" .. "button[6.5,4.2;3,0.5;dlg_delete_mod_cancel;" .. fgettext("No of course not!") .. "]" @@ -887,10 +887,10 @@ end -------------------------------------------------------------------------------- function modmgr.preparemodlist(data) local retval = {} - + local global_mods = {} local game_mods = {} - + --read global mods local modpath = engine.get_modpath() @@ -898,31 +898,31 @@ function modmgr.preparemodlist(data) modpath ~= "" then get_mods(modpath,global_mods) end - + for i=1,#global_mods,1 do global_mods[i].typ = "global_mod" table.insert(retval,global_mods[i]) end - + --read game mods local gamespec = gamemgr.find_by_gameid(data.gameid) gamemgr.get_game_mods(gamespec, game_mods) - + for i=1,#game_mods,1 do game_mods[i].typ = "game_mod" table.insert(retval,game_mods[i]) end - + if data.worldpath == nil then return retval end - + --read world mod configuration local filename = data.worldpath .. DIR_DELIM .. "world.mt" local worldfile = Settings(filename) - + for key,value in pairs(worldfile:to_table()) do if key:sub(1, 9) == "load_mod_" then key = key:sub(10) @@ -948,17 +948,17 @@ end function modmgr.init_worldconfig() modmgr.precheck() local worldspec = engine.get_worlds()[modmgr.world_config_selected_world] - + if worldspec ~= nil then --read worldconfig modmgr.worldconfig = modmgr.get_worldconfig(worldspec.path) - + if modmgr.worldconfig.id == nil or modmgr.worldconfig.id == "" then modmgr.worldconfig = nil return false end - + modmgr.modlist = filterlist.create( modmgr.preparemodlist, --refresh modmgr.comparemod, --compare @@ -966,13 +966,13 @@ function modmgr.init_worldconfig() if element.name == uid then return true end - end, + end, function(element,criteria) if criteria.hide_game and element.typ == "game_mod" then return false end - + if criteria.hide_modpackcontents and element.modpack ~= nil then return false @@ -982,15 +982,15 @@ function modmgr.init_worldconfig() { worldpath= worldspec.path, gameid = worldspec.gameid } ) - + filterlist.set_filtercriteria(modmgr.modlist, { hide_game=modmgr.hide_gamemods, hide_modpackcontents= modmgr.hide_modpackcontents }) filterlist.add_sort_mechanism(modmgr.modlist, "alphabetic", sort_mod_list) filterlist.set_sortmode(modmgr.modlist, "alphabetic") - - return true + + return true end return false @@ -1013,34 +1013,34 @@ function modmgr.comparemod(elem1,elem2) if elem1.modpack ~= elem2.modpack then return false end - + if elem1.path ~= elem2.path then return false end - + return true end -------------------------------------------------------------------------------- function modmgr.gettab(name) local retval = "" - + if name == "mod_mgr" then retval = retval .. modmgr.tab() end - + if name == "dialog_rename_modpack" then retval = retval .. modmgr.dialog_rename_modpack() end - + if name == "dialog_delete_mod" then retval = retval .. modmgr.dialog_delete_mod() end - + if name == "dialog_configure_world" then retval = retval .. modmgr.dialog_configure_world() end - + return retval end @@ -1054,7 +1054,7 @@ function modmgr.mod_exists(basename) if filterlist.raw_index_by_uid(modmgr.global_mods,basename) > 0 then return true end - + return false end @@ -1064,7 +1064,7 @@ function modmgr.get_global_mod(idx) if modmgr.global_mods == nil then return nil end - + if idx < 1 or idx > filterlist.size(modmgr.global_mods) then return nil end @@ -1081,7 +1081,7 @@ function modmgr.refresh_globals() if element.name == uid then return true end - end, + end, nil, --filter {} ) @@ -1098,7 +1098,7 @@ function modmgr.identify_filetype(name) type = "zip" } end - + if name:sub(-6):lower() == "tar.gz" or name:sub(-3):lower() == "tgz"then return { @@ -1106,14 +1106,14 @@ function modmgr.identify_filetype(name) type = "tgz" } end - + if name:sub(-6):lower() == "tar.bz2" then return { name = name, type = "tbz" } end - + if name:sub(-2):lower() == "7z" then return { name = name, diff --git a/builtin/modstore.lua b/builtin/modstore.lua index b364ce6bd..acaff871b 100644 --- a/builtin/modstore.lua +++ b/builtin/modstore.lua @@ -23,19 +23,20 @@ modstore = {} -------------------------------------------------------------------------------- function modstore.init() modstore.tabnames = {} - + table.insert(modstore.tabnames,"dialog_modstore_unsorted") table.insert(modstore.tabnames,"dialog_modstore_search") - + modstore.modsperpage = 5 - - modstore.basetexturedir = engine.get_texturepath() .. DIR_DELIM .. "base" .. + + modstore.basetexturedir = engine.get_texturepath() .. DIR_DELIM .. "base" .. DIR_DELIM .. "pack" .. DIR_DELIM - + + modstore.lastmodtitle = "" + modstore.current_list = nil - - modstore.details_cache = {} end + -------------------------------------------------------------------------------- function modstore.nametoindex(name) @@ -51,30 +52,34 @@ end -------------------------------------------------------------------------------- function modstore.gettab(tabname) local retval = "" - + local is_modstore_tab = false - + if tabname == "dialog_modstore_unsorted" then retval = modstore.getmodlist(modstore.modlist_unsorted) is_modstore_tab = true end - + if tabname == "dialog_modstore_search" then - - + retval = modstore.getsearchpage() is_modstore_tab = true end - + if is_modstore_tab then return modstore.tabheader(tabname) .. retval end - + if tabname == "modstore_mod_installed" then - return "size[6,2]label[0.25,0.25;Mod: " .. modstore.lastmodtitle .. + return "size[6,2]label[0.25,0.25;Mod(s): " .. modstore.lastmodtitle .. " installed successfully]" .. "button[2.5,1.5;1,0.5;btn_confirm_mod_successfull;ok]" end - + + if tabname == "modstore_downloading" then + return "size[6,2]label[0.25,0.25;Dowloading " .. modstore.lastmodtitle .. + " please wait]" + end + return "" end @@ -84,18 +89,16 @@ function modstore.tabheader(tabname) retval = retval .. "tabheader[-0.3,-0.99;modstore_tab;" .. "Unsorted,Search;" .. modstore.nametoindex(tabname) .. ";true;false]" - + return retval end -------------------------------------------------------------------------------- function modstore.handle_buttons(current_tab,fields) - modstore.lastmodtitle = "" - if fields["modstore_tab"] then local index = tonumber(fields["modstore_tab"]) - + if index > 0 and index <= #modstore.tabnames then return { @@ -104,59 +107,102 @@ function modstore.handle_buttons(current_tab,fields) show_buttons = false } end - + modstore.modlist_page = 0 end - + if fields["btn_modstore_page_up"] then if modstore.current_list ~= nil and modstore.current_list.page > 0 then modstore.current_list.page = modstore.current_list.page - 1 end end - + if fields["btn_modstore_page_down"] then - if modstore.current_list ~= nil and + if modstore.current_list ~= nil and modstore.current_list.page #list.data) then endmod = #list.data end for i=(list.page * modstore.modsperpage) +1, endmod, 1 do --getmoddetails - local details = modstore.get_details(list.data[i].id) - + local details = list.data[i].details + +-- if details == nil then +-- details = modstore.get_details(list.data[i].id) +-- end + + if details == nil then + details = {} + details.title = list.data[i].title + details.author = "" + details.rating = -1 + details.description = "" + end + if details ~= nil then local screenshot_ypos = (i-1 - (list.page * modstore.modsperpage))*1.9 +0.2 - + retval = retval .. "box[0," .. screenshot_ypos .. ";11.4,1.75;#FFFFFF]" - - --screenshot - if details.screenshot_url ~= nil and - details.screenshot_url ~= "" then - if list.data[i].texturename == nil then - local fullurl = engine.setting_get("modstore_download_url") .. - details.screenshot_url - local filename = os.tempfolder() - - if engine.download_file(fullurl,filename) then - list.data[i].texturename = filename + + if details.basename then + --screenshot + if details.screenshot_url ~= nil and + details.screenshot_url ~= "" then + if list.data[i].texturename == nil then + local fullurl = engine.setting_get("modstore_download_url") .. + details.screenshot_url + local filename = os.tempfolder() .. "_MID_" .. list.data[i].id + list.data[i].texturename = "in progress" + engine.handle_async( + function(param) + param.successfull = engine.download_file(param.fullurl,param.filename) + return param + end, + { + fullurl = fullurl, + filename = filename, + listindex = i, + modid = list.data[i].id + }, + function(result) + if modstore.modlist_unsorted and + modstore.modlist_unsorted.data and + #modstore.modlist_unsorted.data >= result.listindex and + modstore.modlist_unsorted.data[result.listindex].id == result.modid then + if result.successfull then + modstore.modlist_unsorted.data[result.listindex].texturename = result.filename + else + modstore.modlist_unsorted.data[result.listindex].texturename = modstore.basetexturedir .. "no_screenshot.png" + end + engine.event_handler("Refresh") + end + end + ) + end + else + if list.data[i].texturename == nil then + list.data[i].texturename = modstore.basetexturedir .. "no_screenshot.png" end end + + if list.data[i].texturename ~= nil and + list.data[i].texturename ~= "in progress" then + retval = retval .. "image[0,".. screenshot_ypos .. ";3,2;" .. + engine.formspec_escape(list.data[i].texturename) .. "]" + end end - - if list.data[i].texturename == nil then - list.data[i].texturename = modstore.basetexturedir .. "no_screenshot.png" - end - - retval = retval .. "image[0,".. screenshot_ypos .. ";3,2;" .. - engine.formspec_escape(list.data[i].texturename) .. "]" - + --title + author - retval = retval .."label[2.75," .. screenshot_ypos .. ";" .. + retval = retval .."label[2.75," .. screenshot_ypos .. ";" .. engine.formspec_escape(details.title) .. " (" .. details.author .. ")]" - + --description local descriptiony = screenshot_ypos + 0.5 - retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.55;;" .. + retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.55;;" .. engine.formspec_escape(details.description) .. ";]" --rating local ratingy = screenshot_ypos + 0.6 - retval = retval .."label[10.1," .. ratingy .. ";" .. - fgettext("Rating") .. ": " .. details.rating .."]" - - --install button - local buttony = screenshot_ypos + 1.2 - local buttonnumber = (i - (list.page * modstore.modsperpage)) - retval = retval .."button[9.6," .. buttony .. ";2,0.5;btn_install_mod_" .. buttonnumber .. ";" - - if modmgr.mod_exists(details.basename) then - retval = retval .. fgettext("re-Install") .."]" - else - retval = retval .. fgettext("Install") .."]" + retval = retval .."label[9.1," .. ratingy .. ";" .. + fgettext("Rating") .. ":]" + retval = retval .. "label[11.1," .. ratingy .. ";" .. details.rating .."]" + + if details.basename then + --install button + local buttony = screenshot_ypos + 1.2 + local buttonnumber = (i - (list.page * modstore.modsperpage)) + retval = retval .."button[9.1," .. buttony .. ";2.5,0.5;btn_install_mod_" .. buttonnumber .. ";" + + if modmgr.mod_exists(details.basename) then + retval = retval .. fgettext("re-Install") .."]" + else + retval = retval .. fgettext("Install") .."]" + end end end end - + modstore.current_list = list - + return retval end -------------------------------------------------------------------------------- -function modstore.get_details(modid) +function modstore.getsearchpage() + local retval = "" - if modstore.details_cache[modid] ~= nil then - return modstore.details_cache[modid] - end - - local retval = engine.get_modstore_details(tostring(modid)) - modstore.details_cache[modid] = retval - return retval + --TODO implement search! + + return retval; end diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt index ca815862e..90b2d01fd 100644 --- a/doc/menu_lua_api.txt +++ b/doc/menu_lua_api.txt @@ -33,9 +33,9 @@ engine.close() Filesystem: engine.get_scriptdir() ^ returns directory of script -engine.get_modpath() +engine.get_modpath() (possible in async calls) ^ returns path to global modpath -engine.get_modstore_details(modid) +engine.get_modstore_details(modid) (possible in async calls) ^ modid numeric id of mod in modstore ^ returns { id = , @@ -47,7 +47,7 @@ engine.get_modstore_details(modid) license = , rating = } -engine.get_modstore_list() +engine.get_modstore_list() (possible in async calls) ^ returns { [1] = { id = , @@ -55,19 +55,21 @@ engine.get_modstore_list() basename = } } -engine.get_gamepath() +engine.get_gamepath() (possible in async calls) ^ returns path to global gamepath -engine.get_dirlist(path,onlydirs) +engine.get_texturepath() (possible in async calls) +^ returns path to default textures +engine.get_dirlist(path,onlydirs) (possible in async calls) ^ path to get subdirs from ^ onlydirs should result contain only dirs? ^ returns list of folders within path -engine.create_dir(absolute_path) +engine.create_dir(absolute_path) (possible in async calls) ^ absolute_path to directory to create (needs to be absolute) ^ returns true/false -engine.delete_dir(absolute_path) +engine.delete_dir(absolute_path) (possible in async calls) ^ absolute_path to directory to delete (needs to be absolute) ^ returns true/false -engine.copy_dir(source,destination,keep_soure) +engine.copy_dir(source,destination,keep_soure) (possible in async calls) ^ source folder ^ destination folder ^ keep_source DEFAULT true --> if set to false source is deleted after copying @@ -76,11 +78,11 @@ engine.extract_zip(zipfile,destination) [unzip within path required] ^ zipfile to extract ^ destination folder to extract to ^ returns true/false -engine.download_file(url,target) +engine.download_file(url,target) (possible in async calls) ^ url to download ^ target to store to ^ returns true/false -engine.get_version() +engine.get_version() (possible in async calls) ^ returns current minetest version engine.sound_play(spec, looped) -> handle ^ spec = SimpleSoundSpec (see lua-api.txt) @@ -105,10 +107,10 @@ engine.get_game(index) DEPRECATED: addon_mods_paths = {[1] = ,}, } -engine.get_games() -> table of all games in upper format +engine.get_games() -> table of all games in upper format (possible in async calls) Favorites: -engine.get_favorites(location) -> list of favorites +engine.get_favorites(location) -> list of favorites (possible in async calls) ^ location: "local" or "online" ^ returns { [1] = { @@ -128,21 +130,21 @@ engine.get_favorites(location) -> list of favorites engine.delete_favorite(id, location) -> success Logging: -engine.debug(line) +engine.debug(line) (possible in async calls) ^ Always printed to stderr and logfile (print() is redirected here) -engine.log(line) -engine.log(loglevel, line) +engine.log(line) (possible in async calls) +engine.log(loglevel, line) (possible in async calls) ^ loglevel one of "error", "action", "info", "verbose" Settings: engine.setting_set(name, value) -engine.setting_get(name) -> string or nil +engine.setting_get(name) -> string or nil (possible in async calls) engine.setting_setbool(name, value) -engine.setting_getbool(name) -> bool or nil +engine.setting_getbool(name) -> bool or nil (possible in async calls) engine.setting_save() -> nil, save all settings to config file Worlds: -engine.get_worlds() -> list of worlds +engine.get_worlds() -> list of worlds (possible in async calls) ^ returns { [1] = { path = , @@ -174,7 +176,7 @@ engine.gettext(string) -> string fgettext(string, ...) -> string ^ call engine.gettext(string), replace "$1"..."$9" with the given ^ extra arguments, call engine.formspec_escape and return the result -engine.parse_json(string[, nullvalue]) -> something +engine.parse_json(string[, nullvalue]) -> something (possible in async calls) ^ see minetest.parse_json (lua_api.txt) dump(obj, dumped={}) ^ Return object serialized as a string @@ -182,9 +184,24 @@ string:split(separator) ^ eg. string:split("a,b", ",") == {"a","b"} string:trim() ^ eg. string.trim("\n \t\tfoo bar\t ") == "foo bar" -minetest.is_yes(arg) +minetest.is_yes(arg) (possible in async calls) ^ returns whether arg can be interpreted as yes +Async: +engine.handle_async(async_job,parameters,finished) +^ execute a function asynchronously +^ async_job is a function receiving one parameter and returning one parameter +^ parameters parameter table passed to async_job +^ finished function to be called once async_job has finished +^ the result of async_job is passed to this function + +Limitations of Async operations + -No access to global lua variables, don't even try + -Limited set of available functions + e.g. No access to functions modifying menu like engine.start,engine.close, + engine.file_open_dialog + + Class reference ---------------- Settings: see lua_api.txt diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index d5f528f3b..7acc00ef1 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -286,6 +286,8 @@ void GUIEngine::run() cloudPostProcess(); else sleep_ms(25); + + m_script->Step(); } } @@ -576,3 +578,9 @@ void GUIEngine::stopSound(s32 handle) { m_sound_manager->stopSound(handle); } + +/******************************************************************************/ +unsigned int GUIEngine::DoAsync(std::string serialized_fct, + std::string serialized_params) { + return m_script->DoAsync(serialized_fct,serialized_params); +} diff --git a/src/guiEngine.h b/src/guiEngine.h index 484459395..6b1281546 100644 --- a/src/guiEngine.h +++ b/src/guiEngine.h @@ -166,6 +166,9 @@ public: return m_scriptdir; } + /** pass async callback to scriptengine **/ + unsigned int DoAsync(std::string serialized_fct,std::string serialized_params); + private: /** find and run the main menu script */ @@ -244,7 +247,7 @@ private: * @param url url to download * @param target file to store to */ - bool downloadFile(std::string url,std::string target); + static bool downloadFile(std::string url,std::string target); /** array containing pointers to current specified texture layers */ video::ITexture* m_textures[TEX_LAYER_MAX]; diff --git a/src/jthread/CMakeLists.txt b/src/jthread/CMakeLists.txt index aa438eaaf..6c29671e6 100644 --- a/src/jthread/CMakeLists.txt +++ b/src/jthread/CMakeLists.txt @@ -2,10 +2,12 @@ if( UNIX ) set(JTHREAD_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jmutex.cpp ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jthread.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jsemaphore.cpp PARENT_SCOPE) else( UNIX ) set(JTHREAD_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/win32/jmutex.cpp ${CMAKE_CURRENT_SOURCE_DIR}/win32/jthread.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/win32/jsemaphore.cpp PARENT_SCOPE) endif( UNIX ) diff --git a/src/jthread/jsemaphore.h b/src/jthread/jsemaphore.h new file mode 100644 index 000000000..70318d5da --- /dev/null +++ b/src/jthread/jsemaphore.h @@ -0,0 +1,50 @@ +/* +Minetest +Copyright (C) 2013 sapier, < sapier AT gmx DOT net > + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef JSEMAPHORE_H_ +#define JSEMAPHORE_H_ + +#if defined(WIN32) +#include +#define MAX_SEMAPHORE_COUNT 1024 +#else +#include +#include +#endif + +class JSemaphore { +public: + JSemaphore(); + ~JSemaphore(); + JSemaphore(int initval); + + void Post(); + void Wait(); + + int GetValue(); + +private: +#if defined(WIN32) + HANDLE m_hSemaphore; +#else + sem_t m_semaphore; +#endif +}; + +#endif /* JSEMAPHORE_H_ */ diff --git a/src/jthread/jthread.h b/src/jthread/jthread.h index ec1eafaeb..92b05f1c5 100644 --- a/src/jthread/jthread.h +++ b/src/jthread/jthread.h @@ -43,6 +43,7 @@ public: JThread(); virtual ~JThread(); int Start(); + void Stop(); int Kill(); virtual void *Thread() = 0; bool IsRunning(); @@ -63,12 +64,12 @@ private: HANDLE threadhandle; #else // pthread type threads static void *TheThread(void *param); - + pthread_t threadid; #endif // WIN32 void *retval; bool running; - + JMutex runningmutex; JMutex continuemutex,continuemutex2; bool mutexinit; diff --git a/src/jthread/pthread/jsemaphore.cpp b/src/jthread/pthread/jsemaphore.cpp new file mode 100644 index 000000000..963ac83cf --- /dev/null +++ b/src/jthread/pthread/jsemaphore.cpp @@ -0,0 +1,48 @@ +/* +Minetest +Copyright (C) 2013 sapier, < sapier AT gmx DOT net > + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include "jthread/jsemaphore.h" + +JSemaphore::JSemaphore() { + sem_init(&m_semaphore,0,0); +} + +JSemaphore::~JSemaphore() { + sem_destroy(&m_semaphore); +} + +JSemaphore::JSemaphore(int initval) { + sem_init(&m_semaphore,0,initval); +} + +void JSemaphore::Post() { + sem_post(&m_semaphore); +} + +void JSemaphore::Wait() { + sem_wait(&m_semaphore); +} + +int JSemaphore::GetValue() { + + int retval = 0; + sem_getvalue(&m_semaphore,&retval); + + return retval; +} + diff --git a/src/jthread/pthread/jthread.cpp b/src/jthread/pthread/jthread.cpp index 0ef250825..2980e26b1 100644 --- a/src/jthread/pthread/jthread.cpp +++ b/src/jthread/pthread/jthread.cpp @@ -42,6 +42,12 @@ JThread::~JThread() Kill(); } +void JThread::Stop() { + runningmutex.Lock(); + running = false; + runningmutex.Unlock(); +} + int JThread::Start() { int status; @@ -65,7 +71,7 @@ int JThread::Start() } mutexinit = true; } - + runningmutex.Lock(); if (running) { @@ -73,27 +79,27 @@ int JThread::Start() return ERR_JTHREAD_ALREADYRUNNING; } runningmutex.Unlock(); - + pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); - + continuemutex.Lock(); - status = pthread_create(&threadid,&attr,TheThread,this); + status = pthread_create(&threadid,&attr,TheThread,this); pthread_attr_destroy(&attr); if (status != 0) { continuemutex.Unlock(); return ERR_JTHREAD_CANTSTARTTHREAD; } - + /* Wait until 'running' is set */ - - runningmutex.Lock(); + + runningmutex.Lock(); while (!running) { runningmutex.Unlock(); - + struct timespec req,rem; req.tv_sec = 0; @@ -103,9 +109,9 @@ int JThread::Start() runningmutex.Lock(); } runningmutex.Unlock(); - + continuemutex.Unlock(); - + continuemutex2.Lock(); continuemutex2.Unlock(); return 0; @@ -113,7 +119,7 @@ int JThread::Start() int JThread::Kill() { - runningmutex.Lock(); + runningmutex.Lock(); if (!running) { runningmutex.Unlock(); @@ -128,8 +134,8 @@ int JThread::Kill() bool JThread::IsRunning() { bool r; - - runningmutex.Lock(); + + runningmutex.Lock(); r = running; runningmutex.Unlock(); return r; @@ -138,7 +144,7 @@ bool JThread::IsRunning() void *JThread::GetReturnValue() { void *val; - + runningmutex.Lock(); if (running) val = NULL; @@ -157,17 +163,17 @@ void *JThread::TheThread(void *param) { JThread *jthread; void *ret; - + jthread = (JThread *)param; - + jthread->continuemutex2.Lock(); jthread->runningmutex.Lock(); jthread->running = true; jthread->runningmutex.Unlock(); - + jthread->continuemutex.Lock(); jthread->continuemutex.Unlock(); - + ret = jthread->Thread(); jthread->runningmutex.Lock(); diff --git a/src/jthread/win32/jsemaphore.cpp b/src/jthread/win32/jsemaphore.cpp new file mode 100644 index 000000000..8eca6d247 --- /dev/null +++ b/src/jthread/win32/jsemaphore.cpp @@ -0,0 +1,64 @@ +/* +Minetest +Copyright (C) 2013 sapier, < sapier AT gmx DOT net > + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include "jthread/jsemaphore.h" + +JSemaphore::JSemaphore() { + m_hSemaphore = CreateSemaphore( + 0, + 0, + MAX_SEMAPHORE_COUNT, + 0); +} + +JSemaphore::~JSemaphore() { + CloseHandle(&m_hSemaphore); +} + +JSemaphore::JSemaphore(int initval) { + m_hSemaphore = CreateSemaphore( + 0, + initval, + MAX_SEMAPHORE_COUNT, + 0); +} + +void JSemaphore::Post() { + ReleaseSemaphore( + m_hSemaphore, + 1, + 0); +} + +void JSemaphore::Wait() { + WaitForSingleObject( + m_hSemaphore, + INFINITE); +} + +int JSemaphore::GetValue() { + + long int retval = 0; + ReleaseSemaphore( + m_hSemaphore, + 0, + &retval); + + return retval; +} + diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index 48b83b894..1cf4f93a3 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -43,6 +43,12 @@ JThread::~JThread() Kill(); } +void JThread::Stop() { + runningmutex.Lock(); + running = false; + runningmutex.Unlock(); +} + int JThread::Start() { if (!mutexinit) @@ -63,7 +69,7 @@ int JThread::Start() return ERR_JTHREAD_CANTINITMUTEX; } mutexinit = true; } - + runningmutex.Lock(); if (running) { @@ -71,7 +77,7 @@ int JThread::Start() return ERR_JTHREAD_ALREADYRUNNING; } runningmutex.Unlock(); - + continuemutex.Lock(); #ifndef _WIN32_WCE threadhandle = (HANDLE)_beginthreadex(NULL,0,TheThread,this,0,&threadid); @@ -83,10 +89,10 @@ int JThread::Start() continuemutex.Unlock(); return ERR_JTHREAD_CANTSTARTTHREAD; } - + /* Wait until 'running' is set */ - runningmutex.Lock(); + runningmutex.Lock(); while (!running) { runningmutex.Unlock(); @@ -94,18 +100,18 @@ int JThread::Start() runningmutex.Lock(); } runningmutex.Unlock(); - + continuemutex.Unlock(); - + continuemutex2.Lock(); continuemutex2.Unlock(); - + return 0; } int JThread::Kill() { - runningmutex.Lock(); + runningmutex.Lock(); if (!running) { runningmutex.Unlock(); @@ -121,8 +127,8 @@ int JThread::Kill() bool JThread::IsRunning() { bool r; - - runningmutex.Lock(); + + runningmutex.Lock(); r = running; runningmutex.Unlock(); return r; @@ -131,7 +137,7 @@ bool JThread::IsRunning() void *JThread::GetReturnValue() { void *val; - + runningmutex.Lock(); if (running) val = NULL; @@ -156,23 +162,23 @@ DWORD WINAPI JThread::TheThread(void *param) void *ret; jthread = (JThread *)param; - + jthread->continuemutex2.Lock(); jthread->runningmutex.Lock(); jthread->running = true; jthread->runningmutex.Unlock(); - + jthread->continuemutex.Lock(); jthread->continuemutex.Unlock(); - + ret = jthread->Thread(); - + jthread->runningmutex.Lock(); jthread->running = false; jthread->retval = ret; CloseHandle(jthread->threadhandle); jthread->runningmutex.Unlock(); - return 0; + return 0; } void JThread::ThreadStarted() diff --git a/src/main.cpp b/src/main.cpp index 373e1ca96..2833bdcf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -85,6 +85,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "database-leveldb.h" #endif +#if USE_CURL +#include "curl.h" +#endif + /* Settings. These are loaded from the config file. @@ -309,7 +313,7 @@ public: { return keyIsDown[keyCode]; } - + // Checks whether a key was down and resets the state bool WasKeyDown(const KeyPress &keyCode) { @@ -361,7 +365,7 @@ public: private: IrrlichtDevice *m_device; - + // The current state of keys KeyList keyIsDown; // Whether a key has been pressed or not @@ -405,7 +409,7 @@ public: { return m_receiver->right_active; } - + virtual bool getLeftClicked() { return m_receiver->leftclicked; @@ -656,7 +660,7 @@ void SpeedTests() } } } - + infostream<<"All of the following tests should take around 100ms each." < map1; tempf = -324; const s16 ii=300; @@ -702,7 +706,7 @@ void SpeedTests() { infostream<<"Around 5000/ms should do well here."< allowed_options; allowed_options.insert(std::make_pair("help", ValueSpec(VALUETYPE_FLAG, @@ -806,7 +810,7 @@ int main(int argc, char *argv[]) #endif Settings cmd_args; - + bool ret = cmd_args.parseCommandLine(argc, argv, allowed_options); if(ret == false || cmd_args.getFlag("help") || cmd_args.exists("nonopt1")) @@ -843,11 +847,11 @@ int main(int argc, char *argv[]) dstream<<"Build info: "<readConfigFile(cmd_args.get("config").c_str()); @@ -958,12 +962,12 @@ int main(int argc, char *argv[]) break; } } - + // If no path found, use the first one (menu creates the file) if(g_settings_path == "") g_settings_path = filenames[0]; } - + // Initialize debug streams #define DEBUGFILE "debug.txt" #if RUN_IN_PLACE @@ -973,7 +977,7 @@ int main(int argc, char *argv[]) #endif if(cmd_args.exists("logfile")) logfile = cmd_args.get("logfile"); - + log_remove_output(&main_dstream_no_stderr_log_out); int loglevel = g_settings->getS32("debug_log_level"); @@ -986,13 +990,18 @@ int main(int argc, char *argv[]) debugstreams_init(false, logfile.c_str()); else debugstreams_init(false, NULL); - + infostream<<"logfile = "<getU16("port"); if(port == 0) port = 30000; - + // World directory std::string commanded_world = ""; if(cmd_args.exists("world")) @@ -1031,12 +1040,12 @@ int main(int argc, char *argv[]) commanded_world = cmd_args.get("nonopt0"); else if(g_settings->exists("map-dir")) commanded_world = g_settings->get("map-dir"); - + // World name std::string commanded_worldname = ""; if(cmd_args.exists("worldname")) commanded_worldname = cmd_args.get("worldname"); - + // Strip world.mt from commanded_world { std::string worldmt = "world.mt"; @@ -1048,7 +1057,7 @@ int main(int argc, char *argv[]) 0, commanded_world.size()-worldmt.size()); } } - + // If a world name was specified, convert it to a path if(commanded_worldname != ""){ // Get information about available worlds @@ -1268,7 +1277,7 @@ int main(int argc, char *argv[]) } server.start(port); - + // Run server dedicated_server_loop(server, kill); @@ -1280,17 +1289,17 @@ int main(int argc, char *argv[]) /* More parameters */ - + std::string address = g_settings->get("address"); if(commanded_world != "") address = ""; else if(cmd_args.exists("address")) address = cmd_args.get("address"); - + std::string playername = g_settings->get("name"); if(cmd_args.exists("name")) playername = cmd_args.get("name"); - + bool skip_main_menu = cmd_args.getFlag("go"); /* @@ -1298,7 +1307,7 @@ int main(int argc, char *argv[]) */ // Resolution selection - + bool fullscreen = g_settings->getBool("fullscreen"); u16 screenW = g_settings->getU16("screenW"); u16 screenH = g_settings->getU16("screenH"); @@ -1312,7 +1321,7 @@ int main(int argc, char *argv[]) // Determine driver video::E_DRIVER_TYPE driverType; - + std::string driverstring = g_settings->get("video_driver"); if(driverstring == "null") @@ -1419,7 +1428,7 @@ int main(int argc, char *argv[]) if (device == 0) return 1; // could not create selected driver. - + /* Continue initialization */ @@ -1434,10 +1443,10 @@ int main(int argc, char *argv[]) // Create time getter g_timegetter = new IrrlichtTimeGetter(device); - + // Create game callback for menus g_gamecallback = new MainGameCallback(device); - + /* Speed tests (done after irrlicht is loaded to get timer) */ @@ -1448,7 +1457,7 @@ int main(int argc, char *argv[]) device->drop(); return 0; } - + device->setResizable(true); bool random_input = g_settings->getBool("random_input") @@ -1458,7 +1467,7 @@ int main(int argc, char *argv[]) input = new RandomInputHandler(); else input = new RealInputHandler(device, &receiver); - + scene::ISceneManager* smgr = device->getSceneManager(); guienv = device->getGUIEnvironment(); @@ -1488,7 +1497,7 @@ int main(int argc, char *argv[]) // If font was not found, this will get us one font = skin->getFont(); assert(font); - + u32 text_height = font->getDimension(L"Hello, world!").Height; infostream<<"text_height="<clear(); - + /* We need some kind of a root node to be able to add custom gui elements directly on the screen. @@ -1564,7 +1573,7 @@ int main(int argc, char *argv[]) */ guiroot = guienv->addStaticText(L"", core::rect(0, 0, 10000, 10000)); - + SubgameSpec gamespec; WorldSpec worldspec; bool simple_singleplayer_mode = false; @@ -1588,13 +1597,13 @@ int main(int argc, char *argv[]) break; } first_loop = false; - + // Cursor can be non-visible when coming from the game device->getCursorControl()->setVisible(true); // Some stuff are left to scene manager when coming from the game // (map at least?) smgr->clear(); - + // Initialize menu data MainMenuData menudata; menudata.address = address; @@ -1643,7 +1652,7 @@ int main(int argc, char *argv[]) infostream<<"Waited for other menus"<clear(); @@ -1683,7 +1692,7 @@ int main(int argc, char *argv[]) // Break out of menu-game loop to shut down cleanly if(device->run() == false || kill == true) break; - + current_playername = playername; current_password = password; current_address = address; @@ -1705,7 +1714,7 @@ int main(int argc, char *argv[]) server["description"] = menudata.serverdescription; ServerList::insert(server); } - + // Set world path to selected one if ((menudata.selected_world >= 0) && (menudata.selected_world < (int)worldspecs.size())) { @@ -1713,7 +1722,7 @@ int main(int argc, char *argv[]) infostream<<"Selected world: "<updateConfigFile(g_settings_path.c_str()); - + // Print modified quicktune values { bool header_printed = false; @@ -1850,9 +1859,9 @@ int main(int argc, char *argv[]) } END_DEBUG_EXCEPTION_HANDLER(errorstream) - + debugstreams_deinit(); - + return retval; } diff --git a/src/script/lua_api/CMakeLists.txt b/src/script/lua_api/CMakeLists.txt index 08960d2ad..0b89df6a3 100644 --- a/src/script/lua_api/CMakeLists.txt +++ b/src/script/lua_api/CMakeLists.txt @@ -16,6 +16,8 @@ set(common_SCRIPT_LUA_API_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/l_util.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l_vmanip.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l_settings.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/l_async_events.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/marshall.c PARENT_SCOPE) # Used by client only diff --git a/src/script/lua_api/l_async_events.cpp b/src/script/lua_api/l_async_events.cpp new file mode 100644 index 000000000..cc4644cdf --- /dev/null +++ b/src/script/lua_api/l_async_events.cpp @@ -0,0 +1,396 @@ +/* +Minetest +Copyright (C) 2013 sapier, + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +extern "C" { +#include "lua.h" +#include "lauxlib.h" +#include "lualib.h" +int luaopen_marshal(lua_State *L); +} +#include + +#include "l_async_events.h" +#include "log.h" +#include "filesys.h" +#include "porting.h" + +//TODO replace by ShadowNinja version not yet merged to master +static int script_error_handler(lua_State *L) { + lua_getfield(L, LUA_GLOBALSINDEX, "debug"); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + return 1; + } + lua_getfield(L, -1, "traceback"); + if (!lua_isfunction(L, -1)) { + lua_pop(L, 2); + return 1; + } + lua_pushvalue(L, 1); + lua_pushinteger(L, 2); + lua_call(L, 2, 1); + return 1; +} + +/******************************************************************************/ +static void scriptError(const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + char buf[10000]; + vsnprintf(buf, 10000, fmt, argp); + va_end(argp); + errorstream<<"ERROR: "<::iterator i= m_WorkerThreads.begin(); + i != m_WorkerThreads.end();i++) { + (*i)->Stop(); + } + + + /** wakeup all threads **/ + for (std::vector::iterator i= m_WorkerThreads.begin(); + i != m_WorkerThreads.end();i++) { + m_JobQueueCounter.Post(); + } + + /** wait for threads to finish **/ + for (std::vector::iterator i= m_WorkerThreads.begin(); + i != m_WorkerThreads.end();i++) { + (*i)->Wait(); + } + + /** force kill all threads **/ + for (std::vector::iterator i= m_WorkerThreads.begin(); + i != m_WorkerThreads.end();i++) { + (*i)->Kill(); + delete *i; + } + + m_JobQueueMutex.Lock(); + m_JobQueue.clear(); + m_JobQueueMutex.Unlock(); + m_WorkerThreads.clear(); +} + +/******************************************************************************/ +bool AsyncEngine::registerFunction(const char* name, lua_CFunction fct) { + + if (m_initDone) return false; + m_FunctionList[name] = fct; + return true; +} + +/******************************************************************************/ +void AsyncEngine::Initialize(unsigned int numengines) { + m_initDone = true; + + for (unsigned int i=0; i < numengines; i ++) { + + AsyncWorkerThread* toadd = new AsyncWorkerThread(this,i); + m_WorkerThreads.push_back(toadd); + toadd->Start(); + } +} + +/******************************************************************************/ +unsigned int AsyncEngine::doAsyncJob(std::string fct, std::string params) { + + m_JobQueueMutex.Lock(); + LuaJobInfo toadd; + toadd.JobId = m_JobIdCounter++; + toadd.serializedFunction = fct; + toadd.serializedParams = params; + + m_JobQueue.push_back(toadd); + + m_JobQueueCounter.Post(); + + m_JobQueueMutex.Unlock(); + + return toadd.JobId; +} + +/******************************************************************************/ +LuaJobInfo AsyncEngine::getJob() { + + m_JobQueueCounter.Wait(); + m_JobQueueMutex.Lock(); + + LuaJobInfo retval; + + if (m_JobQueue.size() != 0) { + retval = m_JobQueue.front(); + m_JobQueue.erase((m_JobQueue.begin())); + } + m_JobQueueMutex.Unlock(); + + return retval; +} + +/******************************************************************************/ +void AsyncEngine::putJobResult(LuaJobInfo result) { + m_ResultQueueMutex.Lock(); + m_ResultQueue.push_back(result); + m_ResultQueueMutex.Unlock(); +} + +/******************************************************************************/ +void AsyncEngine::Step(lua_State *L) { + m_ResultQueueMutex.Lock(); + while(!m_ResultQueue.empty()) { + + LuaJobInfo jobdone = m_ResultQueue.front(); + m_ResultQueue.erase(m_ResultQueue.begin()); + lua_getglobal(L, "engine"); + + lua_getfield(L, -1, "async_event_handler"); + + if(lua_isnil(L, -1)) + assert("Someone managed to destroy a async callback in engine!" == 0); + + luaL_checktype(L, -1, LUA_TFUNCTION); + + lua_pushinteger(L, jobdone.JobId); + lua_pushlstring(L, jobdone.serializedResult.c_str(), + jobdone.serializedResult.length()); + + if(lua_pcall(L, 2, 0, 0)) { + scriptError("Async ENGINE step: %s", lua_tostring(L, -1)); + } + + lua_pop(L,1); + } + m_ResultQueueMutex.Unlock(); +} + +/******************************************************************************/ +void AsyncEngine::PushFinishedJobs(lua_State* L) { + //Result Table + m_ResultQueueMutex.Lock(); + + unsigned int index=1; + lua_newtable(L); + int top = lua_gettop(L); + + while(!m_ResultQueue.empty()) { + + LuaJobInfo jobdone = m_ResultQueue.front(); + m_ResultQueue.erase(m_ResultQueue.begin()); + + lua_pushnumber(L,index); + + lua_newtable(L); + int top_lvl2 = lua_gettop(L); + + lua_pushstring(L,"jobid"); + lua_pushnumber(L,jobdone.JobId); + lua_settable(L, top_lvl2); + + lua_pushstring(L,"retval"); + lua_pushstring(L, jobdone.serializedResult.c_str()); + lua_settable(L, top_lvl2); + + lua_settable(L, top); + index++; + } + + m_ResultQueueMutex.Unlock(); + +} +/******************************************************************************/ +void AsyncEngine::PrepareEnvironment(lua_State* L, int top) { + for(std::map::iterator i = m_FunctionList.begin(); + i != m_FunctionList.end(); i++) { + + lua_pushstring(L,i->first.c_str()); + lua_pushcfunction(L,i->second); + lua_settable(L, top); + + } +} + +/******************************************************************************/ +int async_worker_ErrorHandler(lua_State *L) { + lua_getfield(L, LUA_GLOBALSINDEX, "debug"); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + return 1; + } + lua_getfield(L, -1, "traceback"); + if (!lua_isfunction(L, -1)) { + lua_pop(L, 2); + return 1; + } + lua_pushvalue(L, 1); + lua_pushinteger(L, 2); + lua_call(L, 2, 1); + return 1; +} + +/******************************************************************************/ +AsyncWorkerThread::AsyncWorkerThread(AsyncEngine* jobdispatcher, + unsigned int numthreadnumber) : + m_JobDispatcher(jobdispatcher), + m_luaerrorhandler(-1), + m_threadnum(numthreadnumber) +{ + // create luastack + m_LuaStack = luaL_newstate(); + + // load basic lua modules + luaL_openlibs(m_LuaStack); + + // load serialization functions + luaopen_marshal(m_LuaStack); +} + +/******************************************************************************/ +AsyncWorkerThread::~AsyncWorkerThread() { + + assert(IsRunning() == false); + lua_close(m_LuaStack); +} + +/******************************************************************************/ +void* AsyncWorkerThread::worker_thread_main() { + + //register thread for error logging + char number[21]; + snprintf(number,sizeof(number),"%d",m_threadnum); + log_register_thread(std::string("AsyncWorkerThread_") + number); + + /** prepare job lua environment **/ + lua_newtable(m_LuaStack); + lua_setglobal(m_LuaStack, "engine"); + + lua_getglobal(m_LuaStack, "engine"); + int top = lua_gettop(m_LuaStack); + + lua_pushstring(m_LuaStack, DIR_DELIM); + lua_setglobal(m_LuaStack, "DIR_DELIM"); + + lua_pushstring(m_LuaStack, + std::string(porting::path_share + DIR_DELIM + "builtin").c_str()); + lua_setglobal(m_LuaStack, "SCRIPTDIR"); + + + m_JobDispatcher->PrepareEnvironment(m_LuaStack,top); + + std::string asyncscript = + porting::path_share + DIR_DELIM + "builtin" + + DIR_DELIM + "async_env.lua"; + + lua_pushcfunction(m_LuaStack, async_worker_ErrorHandler); + m_luaerrorhandler = lua_gettop(m_LuaStack); + + if(!runScript(asyncscript)) { + infostream + << "AsyncWorkderThread::worker_thread_main execution of async base environment failed!" + << std::endl; + assert("no future with broken builtin async environment scripts" == 0); + } + /** main loop **/ + while(IsRunning()) { + //wait for job + LuaJobInfo toprocess = m_JobDispatcher->getJob(); + + if (!IsRunning()) { continue; } + + //first push error handler + lua_pushcfunction(m_LuaStack, script_error_handler); + int errorhandler = lua_gettop(m_LuaStack); + + lua_getglobal(m_LuaStack, "engine"); + if(lua_isnil(m_LuaStack, -1)) + assert("unable to find engine within async environment" == 0); + + lua_getfield(m_LuaStack, -1, "job_processor"); + if(lua_isnil(m_LuaStack, -1)) + assert("Someone managed to destroy a async worker engine!" == 0); + + luaL_checktype(m_LuaStack, -1, LUA_TFUNCTION); + + //call it + lua_pushlstring(m_LuaStack, + toprocess.serializedFunction.c_str(), + toprocess.serializedFunction.length()); + lua_pushlstring(m_LuaStack, + toprocess.serializedParams.c_str(), + toprocess.serializedParams.length()); + + if (!IsRunning()) { continue; } + if(lua_pcall(m_LuaStack, 2, 2, errorhandler)) { + scriptError("Async WORKER thread: %s\n", lua_tostring(m_LuaStack, -1)); + toprocess.serializedResult="ERROR"; + } + else { + //fetch result + const char *retval = lua_tostring(m_LuaStack, -2); + unsigned int lenght = lua_tointeger(m_LuaStack,-1); + toprocess.serializedResult = std::string(retval,lenght); + } + + if (!IsRunning()) { continue; } + //put job result + m_JobDispatcher->putJobResult(toprocess); + } + log_deregister_thread(); + return 0; +} + +/******************************************************************************/ +bool AsyncWorkerThread::runScript(std::string script) { + + int ret = luaL_loadfile(m_LuaStack, script.c_str()) || + lua_pcall(m_LuaStack, 0, 0, m_luaerrorhandler); + if(ret){ + errorstream<<"==== ERROR FROM LUA WHILE INITIALIZING ASYNC ENVIRONMENT ====="<worker_thread_main(); +} diff --git a/src/script/lua_api/l_async_events.h b/src/script/lua_api/l_async_events.h new file mode 100644 index 000000000..4aaf3bdfe --- /dev/null +++ b/src/script/lua_api/l_async_events.h @@ -0,0 +1,228 @@ +/* +Minetest +Copyright (C) 2013 sapier, + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef C_ASYNC_EVENTS_H_ +#define C_ASYNC_EVENTS_H_ + +#include +#include +#include + +/******************************************************************************/ +/* Includes */ +/******************************************************************************/ +#include "jthread/jthread.h" +#include "jthread/jmutex.h" +#include "jthread/jsemaphore.h" +#include "debug.h" +#include "lua.h" + +/******************************************************************************/ +/* Typedefs and macros */ +/******************************************************************************/ +#define MAINMENU_NUMBER_OF_ASYNC_THREADS 4 + +/******************************************************************************/ +/* forward declarations */ +/******************************************************************************/ +class AsyncEngine; + +/******************************************************************************/ +/* declarations */ +/******************************************************************************/ + +/** a struct to encapsulate data required to queue a job **/ +struct LuaJobInfo { + /** function to be called in async environment **/ + std::string serializedFunction; + /** parameter table to be passed to function **/ + std::string serializedParams; + /** result of function call **/ + std::string serializedResult; + /** jobid used to identify a job and match it to callback **/ + unsigned int JobId; +}; + +/** class encapsulating a asynchronous working environment **/ +class AsyncWorkerThread : public JThread { +public: + /** + * default constructor + * @param pointer to job dispatcher + */ + AsyncWorkerThread(AsyncEngine* jobdispatcher, unsigned int threadnumber); + + /** + * default destructor + */ + virtual ~AsyncWorkerThread(); + + /** + * thread function + */ + void* Thread() { + ThreadStarted(); + return worker_thread_wrapper(this); + } + + /** + * wait for thread to stop + */ + void Wait() { + while(IsRunning()) { + sleep(1); + } + } + +private: + /** + * helper function to run a lua script + * @param path of script + */ + bool runScript(std::string script); + + /** + * main function of thread + */ + void* worker_thread_main(); + + /** + * static wrapper for thread creation + * @param this pointer to the thread to be created + */ + static void* worker_thread_wrapper(void* thread); + + /** + * pointer to job dispatcher + */ + AsyncEngine* m_JobDispatcher; + + /** + * the lua stack to run at + */ + lua_State* m_LuaStack; + + /** + * lua internal stack number of error handler + */ + int m_luaerrorhandler; + + /** + * thread number used for debug output + */ + unsigned int m_threadnum; + +}; + +/** asynchornous thread and job management **/ +class AsyncEngine { + friend AsyncWorkerThread; +public: + /** + * default constructor + */ + AsyncEngine(); + /** + * default destructor + */ + ~AsyncEngine(); + + /** + * register function to be used within engines + * @param name function name to be used within lua environment + * @param fct c-function to be called + */ + bool registerFunction(const char* name, lua_CFunction fct); + + /** + * create async engine tasks and lock function registration + * @param numengines number of async threads to be started + */ + void Initialize(unsigned int numengines); + + /** + * queue/run a async job + * @param fct serialized lua function + * @param params serialized parameters + * @return jobid the job is queued + */ + unsigned int doAsyncJob(std::string fct, std::string params); + + /** + * engine step to process finished jobs + * the engine step is one way to pass events back, PushFinishedJobs another + * @param L the lua environment to do the step in + */ + void Step(lua_State *L); + + + void PushFinishedJobs(lua_State* L); + +protected: + /** + * Get a Job from queue to be processed + * this function blocks until a job is ready + * @return a job to be processed + */ + LuaJobInfo getJob(); + + /** + * put a Job result back to result queue + * @param result result of completed job + */ + void putJobResult(LuaJobInfo result); + + /** + * initialize environment with current registred functions + * this function adds all functions registred by registerFunction to the + * passed lua stack + * @param L lua stack to initialize + * @param top stack position + */ + void PrepareEnvironment(lua_State* L, int top); + +private: + + /** variable locking the engine against further modification **/ + bool m_initDone; + + /** internal store for registred functions **/ + std::map m_FunctionList; + + /** internal counter to create job id's **/ + unsigned int m_JobIdCounter; + + /** mutex to protect job queue **/ + JMutex m_JobQueueMutex; + /** job queue **/ + std::vector m_JobQueue; + + /** mutext to protect result queue **/ + JMutex m_ResultQueueMutex; + /** result queue **/ + std::vector m_ResultQueue; + + /** list of current worker threads **/ + std::vector m_WorkerThreads; + + /** counter semaphore for job dispatching **/ + JSemaphore m_JobQueueCounter; +}; + +#endif /* C_ASYNC_EVENTS_H_ */ diff --git a/src/script/lua_api/l_internal.h b/src/script/lua_api/l_internal.h index 14215ee5d..5936ac046 100644 --- a/src/script/lua_api/l_internal.h +++ b/src/script/lua_api/l_internal.h @@ -30,14 +30,16 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common/c_internal.h" #define luamethod(class, name) {#name, class::l_##name} -#define API_FCT(name) registerFunction(L,#name,l_##name,top) +#define API_FCT(name) registerFunction(L, #name, l_##name,top) +#define ASYNC_API_FCT(name) engine.registerFunction(#name, l_##name) #if (defined(WIN32) || defined(_WIN32_WCE)) #define NO_MAP_LOCK_REQUIRED #else #include "main.h" #include "profiler.h" -#define NO_MAP_LOCK_REQUIRED ScopeProfiler nolocktime(g_profiler,"Scriptapi: unlockable time",SPT_ADD) +#define NO_MAP_LOCK_REQUIRED \ + ScopeProfiler nolocktime(g_profiler,"Scriptapi: unlockable time",SPT_ADD) #endif #endif /* L_INTERNAL_H_ */ diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 498ac0383..42ddd0b14 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_mainmenu.h" #include "lua_api/l_internal.h" #include "common/c_content.h" +#include "lua_api/l_async_events.h" #include "guiEngine.h" #include "guiMainMenu.h" #include "guiKeyChangeMenu.h" @@ -200,9 +201,6 @@ int ModApiMainMenu::l_get_textlist_index(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_get_worlds(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - std::vector worlds = getAvailableWorlds(); lua_newtable(L); @@ -237,9 +235,6 @@ int ModApiMainMenu::l_get_worlds(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_get_games(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - std::vector games = getAvailableGames(); lua_newtable(L); @@ -365,9 +360,6 @@ int ModApiMainMenu::l_get_modstore_details(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_get_modstore_list(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - std::string listtype = "local"; if (!lua_isnone(L,1)) { @@ -421,9 +413,6 @@ int ModApiMainMenu::l_get_modstore_list(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_get_favorites(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - std::string listtype = "local"; if (!lua_isnone(L,1)) { @@ -545,9 +534,6 @@ int ModApiMainMenu::l_get_favorites(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_delete_favorite(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - std::vector servers; std::string listtype = "local"; @@ -599,9 +585,6 @@ int ModApiMainMenu::l_show_keys_menu(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_create_world(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - const char *name = luaL_checkstring(L, 1); int gameidx = luaL_checkinteger(L,2) -1; @@ -632,9 +615,6 @@ int ModApiMainMenu::l_create_world(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_delete_world(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - int worldidx = luaL_checkinteger(L,1) -1; std::vector worlds = getAvailableWorlds(); @@ -962,9 +942,6 @@ int ModApiMainMenu::l_sound_stop(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_download_file(lua_State *L) { - GUIEngine* engine = getGuiEngine(L); - assert(engine != 0); - const char *url = luaL_checkstring(L, 1); const char *target = luaL_checkstring(L, 2); @@ -972,7 +949,7 @@ int ModApiMainMenu::l_download_file(lua_State *L) std::string absolute_destination = fs::RemoveRelativePathComponents(target); if (ModApiMainMenu::isMinetestPath(absolute_destination)) { - if (engine->downloadFile(url,absolute_destination)) { + if (GUIEngine::downloadFile(url,absolute_destination)) { lua_pushboolean(L,true); return 1; } @@ -990,6 +967,28 @@ int ModApiMainMenu::l_gettext(lua_State *L) return 1; } +/******************************************************************************/ +int ModApiMainMenu::l_do_async_callback(lua_State *L) +{ + GUIEngine* engine = getGuiEngine(L); + + const char* serialized_fct_raw = luaL_checkstring(L, 1); + unsigned int lenght_fct = luaL_checkint(L, 2); + + const char* serialized_params_raw = luaL_checkstring(L, 3); + unsigned int lenght_params = luaL_checkint(L, 4); + + assert(serialized_fct_raw != 0); + assert(serialized_params_raw != 0); + + std::string serialized_fct = std::string(serialized_fct_raw,lenght_fct); + std::string serialized_params = std::string(serialized_params_raw,lenght_params); + + lua_pushinteger(L,engine->DoAsync(serialized_fct,serialized_params)); + + return 1; +} + /******************************************************************************/ void ModApiMainMenu::Initialize(lua_State *L, int top) { @@ -1024,4 +1023,27 @@ void ModApiMainMenu::Initialize(lua_State *L, int top) API_FCT(sound_play); API_FCT(sound_stop); API_FCT(gettext); + API_FCT(do_async_callback); +} + +/******************************************************************************/ +void ModApiMainMenu::InitializeAsync(AsyncEngine& engine) +{ + + ASYNC_API_FCT(get_worlds); + ASYNC_API_FCT(get_games); + ASYNC_API_FCT(get_favorites); + ASYNC_API_FCT(get_modpath); + ASYNC_API_FCT(get_gamepath); + ASYNC_API_FCT(get_texturepath); + ASYNC_API_FCT(get_dirlist); + ASYNC_API_FCT(create_dir); + ASYNC_API_FCT(delete_dir); + ASYNC_API_FCT(copy_dir); + //ASYNC_API_FCT(extract_zip); //TODO remove dependency to GuiEngine + ASYNC_API_FCT(get_version); + ASYNC_API_FCT(download_file); + ASYNC_API_FCT(get_modstore_details); + ASYNC_API_FCT(get_modstore_list); + //ASYNC_API_FCT(gettext); (gettext lib isn't threadsafe) } diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index d0f3d6f72..e185f0a37 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.h @@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_base.h" +class AsyncEngine; + /** Implementation of lua api support for mainmenu */ class ModApiMainMenu : public ModApiBase { @@ -125,6 +127,8 @@ private: static int l_download_file(lua_State *L); + // async + static int l_do_async_callback(lua_State *L); public: /** @@ -134,6 +138,8 @@ public: */ static void Initialize(lua_State *L, int top); + static void InitializeAsync(AsyncEngine& engine); + }; #endif /* L_MAINMENU_H_ */ diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index af9c19210..fe10e4f57 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_internal.h" #include "common/c_converter.h" #include "common/c_content.h" +#include "lua_api/l_async_events.h" #include "debug.h" #include "log.h" #include "tool.h" @@ -257,3 +258,18 @@ void ModApiUtil::Initialize(lua_State *L, int top) API_FCT(is_yes); } +void ModApiUtil::InitializeAsync(AsyncEngine& engine) +{ + ASYNC_API_FCT(debug); + ASYNC_API_FCT(log); + + //ASYNC_API_FCT(setting_set); + ASYNC_API_FCT(setting_get); + //ASYNC_API_FCT(setting_setbool); + ASYNC_API_FCT(setting_getbool); + //ASYNC_API_FCT(setting_save); + + ASYNC_API_FCT(parse_json); + + ASYNC_API_FCT(is_yes); +} diff --git a/src/script/lua_api/l_util.h b/src/script/lua_api/l_util.h index bb99e1562..d91c880cf 100644 --- a/src/script/lua_api/l_util.h +++ b/src/script/lua_api/l_util.h @@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_base.h" +class AsyncEngine; + class ModApiUtil : public ModApiBase { private: /* @@ -77,6 +79,8 @@ private: public: static void Initialize(lua_State *L, int top); + static void InitializeAsync(AsyncEngine& engine); + }; #endif /* L_UTIL_H_ */ diff --git a/src/script/lua_api/marshall.c b/src/script/lua_api/marshall.c new file mode 100644 index 000000000..ef70566cb --- /dev/null +++ b/src/script/lua_api/marshall.c @@ -0,0 +1,551 @@ +/* +* lmarshal.c +* A Lua library for serializing and deserializing Lua values +* Richard Hundt +* +* License: MIT +* +* Copyright (c) 2010 Richard Hundt +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include + +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" + + +#define MAR_TREF 1 +#define MAR_TVAL 2 +#define MAR_TUSR 3 + +#define MAR_CHR 1 +#define MAR_I32 4 +#define MAR_I64 8 + +#define MAR_MAGIC 0x8e +#define SEEN_IDX 3 + +typedef struct mar_Buffer { + size_t size; + size_t seek; + size_t head; + char* data; +} mar_Buffer; + +static int mar_encode_table(lua_State *L, mar_Buffer *buf, size_t *idx); +static int mar_decode_table(lua_State *L, const char* buf, size_t len, size_t *idx); + +static void buf_init(lua_State *L, mar_Buffer *buf) +{ + buf->size = 128; + buf->seek = 0; + buf->head = 0; + if (!(buf->data = malloc(buf->size))) luaL_error(L, "Out of memory!"); +} + +static void buf_done(lua_State* L, mar_Buffer *buf) +{ + free(buf->data); +} + +static int buf_write(lua_State* L, const char* str, size_t len, mar_Buffer *buf) +{ + if (len > UINT32_MAX) luaL_error(L, "buffer too long"); + if (buf->size - buf->head < len) { + size_t new_size = buf->size << 1; + size_t cur_head = buf->head; + while (new_size - cur_head <= len) { + new_size = new_size << 1; + } + if (!(buf->data = realloc(buf->data, new_size))) { + luaL_error(L, "Out of memory!"); + } + buf->size = new_size; + } + memcpy(&buf->data[buf->head], str, len); + buf->head += len; + return 0; +} + +static const char* buf_read(lua_State *L, mar_Buffer *buf, size_t *len) +{ + if (buf->seek < buf->head) { + buf->seek = buf->head; + *len = buf->seek; + return buf->data; + } + *len = 0; + return NULL; +} + +static void mar_encode_value(lua_State *L, mar_Buffer *buf, int val, size_t *idx) +{ + size_t l; + int val_type = lua_type(L, val); + lua_pushvalue(L, val); + + buf_write(L, (void*)&val_type, MAR_CHR, buf); + switch (val_type) { + case LUA_TBOOLEAN: { + int int_val = lua_toboolean(L, -1); + buf_write(L, (void*)&int_val, MAR_CHR, buf); + break; + } + case LUA_TSTRING: { + const char *str_val = lua_tolstring(L, -1, &l); + buf_write(L, (void*)&l, MAR_I32, buf); + buf_write(L, str_val, l, buf); + break; + } + case LUA_TNUMBER: { + lua_Number num_val = lua_tonumber(L, -1); + buf_write(L, (void*)&num_val, MAR_I64, buf); + break; + } + case LUA_TTABLE: { + int tag, ref; + lua_pushvalue(L, -1); + lua_rawget(L, SEEN_IDX); + if (!lua_isnil(L, -1)) { + ref = lua_tointeger(L, -1); + tag = MAR_TREF; + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&ref, MAR_I32, buf); + lua_pop(L, 1); + } + else { + mar_Buffer rec_buf; + lua_pop(L, 1); /* pop nil */ + if (luaL_getmetafield(L, -1, "__persist")) { + tag = MAR_TUSR; + + lua_pushvalue(L, -2); /* self */ + lua_call(L, 1, 1); + if (!lua_isfunction(L, -1)) { + luaL_error(L, "__persist must return a function"); + } + + lua_remove(L, -2); /* __persist */ + + lua_newtable(L); + lua_pushvalue(L, -2); /* callback */ + lua_rawseti(L, -2, 1); + + buf_init(L, &rec_buf); + mar_encode_table(L, &rec_buf, idx); + + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&rec_buf.head, MAR_I32, buf); + buf_write(L, rec_buf.data, rec_buf.head, buf); + buf_done(L, &rec_buf); + lua_pop(L, 1); + } + else { + tag = MAR_TVAL; + + lua_pushvalue(L, -1); + lua_pushinteger(L, (*idx)++); + lua_rawset(L, SEEN_IDX); + + lua_pushvalue(L, -1); + buf_init(L, &rec_buf); + mar_encode_table(L, &rec_buf, idx); + lua_pop(L, 1); + + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&rec_buf.head, MAR_I32, buf); + buf_write(L, rec_buf.data,rec_buf.head, buf); + buf_done(L, &rec_buf); + } + } + break; + } + case LUA_TFUNCTION: { + int tag, ref; + lua_pushvalue(L, -1); + lua_rawget(L, SEEN_IDX); + if (!lua_isnil(L, -1)) { + ref = lua_tointeger(L, -1); + tag = MAR_TREF; + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&ref, MAR_I32, buf); + lua_pop(L, 1); + } + else { + mar_Buffer rec_buf; + int i; + lua_Debug ar; + lua_pop(L, 1); /* pop nil */ + + lua_pushvalue(L, -1); + lua_getinfo(L, ">nuS", &ar); + if (ar.what[0] != 'L') { + luaL_error(L, "attempt to persist a C function '%s'", ar.name); + } + tag = MAR_TVAL; + lua_pushvalue(L, -1); + lua_pushinteger(L, (*idx)++); + lua_rawset(L, SEEN_IDX); + + lua_pushvalue(L, -1); + buf_init(L, &rec_buf); + lua_dump(L, (lua_Writer)buf_write, &rec_buf); + + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&rec_buf.head, MAR_I32, buf); + buf_write(L, rec_buf.data, rec_buf.head, buf); + buf_done(L, &rec_buf); + lua_pop(L, 1); + + lua_newtable(L); + for (i=1; i <= ar.nups; i++) { + lua_getupvalue(L, -2, i); + lua_rawseti(L, -2, i); + } + + buf_init(L, &rec_buf); + mar_encode_table(L, &rec_buf, idx); + + buf_write(L, (void*)&rec_buf.head, MAR_I32, buf); + buf_write(L, rec_buf.data, rec_buf.head, buf); + buf_done(L, &rec_buf); + lua_pop(L, 1); + } + + break; + } + case LUA_TUSERDATA: { + int tag, ref; + lua_pushvalue(L, -1); + lua_rawget(L, SEEN_IDX); + if (!lua_isnil(L, -1)) { + ref = lua_tointeger(L, -1); + tag = MAR_TREF; + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&ref, MAR_I32, buf); + lua_pop(L, 1); + } + else { + mar_Buffer rec_buf; + lua_pop(L, 1); /* pop nil */ + if (luaL_getmetafield(L, -1, "__persist")) { + tag = MAR_TUSR; + + lua_pushvalue(L, -2); + lua_pushinteger(L, (*idx)++); + lua_rawset(L, SEEN_IDX); + + lua_pushvalue(L, -2); + lua_call(L, 1, 1); + if (!lua_isfunction(L, -1)) { + luaL_error(L, "__persist must return a function"); + } + lua_newtable(L); + lua_pushvalue(L, -2); + lua_rawseti(L, -2, 1); + lua_remove(L, -2); + + buf_init(L, &rec_buf); + mar_encode_table(L, &rec_buf, idx); + + buf_write(L, (void*)&tag, MAR_CHR, buf); + buf_write(L, (void*)&rec_buf.head, MAR_I32, buf); + buf_write(L, rec_buf.data, rec_buf.head, buf); + buf_done(L, &rec_buf); + } + else { + luaL_error(L, "attempt to encode userdata (no __persist hook)"); + } + lua_pop(L, 1); + } + break; + } + case LUA_TNIL: break; + default: + luaL_error(L, "invalid value type (%s)", lua_typename(L, val_type)); + } + lua_pop(L, 1); +} + +static int mar_encode_table(lua_State *L, mar_Buffer *buf, size_t *idx) +{ + lua_pushnil(L); + while (lua_next(L, -2) != 0) { + mar_encode_value(L, buf, -2, idx); + mar_encode_value(L, buf, -1, idx); + lua_pop(L, 1); + } + return 1; +} + +#define mar_incr_ptr(l) \ + if (((*p)-buf)+(l) > len) luaL_error(L, "bad code"); (*p) += (l); + +#define mar_next_len(l,T) \ + if (((*p)-buf)+sizeof(T) > len) luaL_error(L, "bad code"); \ + l = *(T*)*p; (*p) += sizeof(T); + +static void mar_decode_value + (lua_State *L, const char *buf, size_t len, const char **p, size_t *idx) +{ + size_t l; + char val_type = **p; + mar_incr_ptr(MAR_CHR); + switch (val_type) { + case LUA_TBOOLEAN: + lua_pushboolean(L, *(char*)*p); + mar_incr_ptr(MAR_CHR); + break; + case LUA_TNUMBER: + lua_pushnumber(L, *(lua_Number*)*p); + mar_incr_ptr(MAR_I64); + break; + case LUA_TSTRING: + mar_next_len(l, uint32_t); + lua_pushlstring(L, *p, l); + mar_incr_ptr(l); + break; + case LUA_TTABLE: { + char tag = *(char*)*p; + mar_incr_ptr(MAR_CHR); + if (tag == MAR_TREF) { + int ref; + mar_next_len(ref, int); + lua_rawgeti(L, SEEN_IDX, ref); + } + else if (tag == MAR_TVAL) { + mar_next_len(l, uint32_t); + lua_newtable(L); + lua_pushvalue(L, -1); + lua_rawseti(L, SEEN_IDX, (*idx)++); + mar_decode_table(L, *p, l, idx); + mar_incr_ptr(l); + } + else if (tag == MAR_TUSR) { + mar_next_len(l, uint32_t); + lua_newtable(L); + mar_decode_table(L, *p, l, idx); + lua_rawgeti(L, -1, 1); + lua_call(L, 0, 1); + lua_remove(L, -2); + lua_pushvalue(L, -1); + lua_rawseti(L, SEEN_IDX, (*idx)++); + mar_incr_ptr(l); + } + else { + luaL_error(L, "bad encoded data"); + } + break; + } + case LUA_TFUNCTION: { + size_t nups; + int i; + mar_Buffer dec_buf; + char tag = *(char*)*p; + mar_incr_ptr(1); + if (tag == MAR_TREF) { + int ref; + mar_next_len(ref, int); + lua_rawgeti(L, SEEN_IDX, ref); + } + else { + mar_next_len(l, uint32_t); + dec_buf.data = (char*)*p; + dec_buf.size = l; + dec_buf.head = l; + dec_buf.seek = 0; + lua_load(L, (lua_Reader)buf_read, &dec_buf, "=marshal"); + mar_incr_ptr(l); + + lua_pushvalue(L, -1); + lua_rawseti(L, SEEN_IDX, (*idx)++); + + mar_next_len(l, uint32_t); + lua_newtable(L); + mar_decode_table(L, *p, l, idx); + nups = lua_objlen(L, -1); + for (i=1; i <= nups; i++) { + lua_rawgeti(L, -1, i); + lua_setupvalue(L, -3, i); + } + lua_pop(L, 1); + mar_incr_ptr(l); + } + break; + } + case LUA_TUSERDATA: { + char tag = *(char*)*p; + mar_incr_ptr(MAR_CHR); + if (tag == MAR_TREF) { + int ref; + mar_next_len(ref, int); + lua_rawgeti(L, SEEN_IDX, ref); + } + else if (tag == MAR_TUSR) { + mar_next_len(l, uint32_t); + lua_newtable(L); + mar_decode_table(L, *p, l, idx); + lua_rawgeti(L, -1, 1); + lua_call(L, 0, 1); + lua_remove(L, -2); + lua_pushvalue(L, -1); + lua_rawseti(L, SEEN_IDX, (*idx)++); + mar_incr_ptr(l); + } + else { /* tag == MAR_TVAL */ + lua_pushnil(L); + } + break; + } + case LUA_TNIL: + case LUA_TTHREAD: + lua_pushnil(L); + break; + default: + luaL_error(L, "bad code"); + } +} + +static int mar_decode_table(lua_State *L, const char* buf, size_t len, size_t *idx) +{ + const char* p; + p = buf; + while (p - buf < len) { + mar_decode_value(L, buf, len, &p, idx); + mar_decode_value(L, buf, len, &p, idx); + lua_settable(L, -3); + } + return 1; +} + +static int mar_encode(lua_State* L) +{ + const unsigned char m = MAR_MAGIC; + size_t idx, len; + mar_Buffer buf; + + if (lua_isnone(L, 1)) { + lua_pushnil(L); + } + if (lua_isnoneornil(L, 2)) { + lua_newtable(L); + } + else if (!lua_istable(L, 2)) { + luaL_error(L, "bad argument #2 to encode (expected table)"); + } + lua_settop(L, 2); + + len = lua_objlen(L, 2); + lua_newtable(L); + for (idx = 1; idx <= len; idx++) { + lua_rawgeti(L, 2, idx); + if (lua_isnil(L, -1)) { + lua_pop(L, 1); + continue; + } + lua_pushinteger(L, idx); + lua_rawset(L, SEEN_IDX); + } + lua_pushvalue(L, 1); + + buf_init(L, &buf); + buf_write(L, (void*)&m, 1, &buf); + + mar_encode_value(L, &buf, -1, &idx); + + lua_pop(L, 1); + + lua_pushlstring(L, buf.data, buf.head); + + buf_done(L, &buf); + + lua_remove(L, SEEN_IDX); + + return 1; +} + +static int mar_decode(lua_State* L) +{ + size_t l, idx, len; + const char *p; + const char *s = luaL_checklstring(L, 1, &l); + + if (l < 1) luaL_error(L, "bad header"); + if (*(unsigned char *)s++ != MAR_MAGIC) luaL_error(L, "bad magic"); + l -= 1; + + if (lua_isnoneornil(L, 2)) { + lua_newtable(L); + } + else if (!lua_istable(L, 2)) { + luaL_error(L, "bad argument #2 to decode (expected table)"); + } + lua_settop(L, 2); + + len = lua_objlen(L, 2); + lua_newtable(L); + for (idx = 1; idx <= len; idx++) { + lua_rawgeti(L, 2, idx); + lua_rawseti(L, SEEN_IDX, idx); + } + + p = s; + mar_decode_value(L, s, l, &p, &idx); + + lua_remove(L, SEEN_IDX); + lua_remove(L, 2); + + return 1; +} + +static int mar_clone(lua_State* L) +{ + mar_encode(L); + lua_replace(L, 1); + mar_decode(L); + return 1; +} + +static const luaL_reg R[] = +{ + {"encode", mar_encode}, + {"decode", mar_decode}, + {"clone", mar_clone}, + {NULL, NULL} +}; + +int luaopen_marshal(lua_State *L) +{ + lua_newtable(L); + luaL_register(L, "marshal", R); + return 1; +} + + + + + diff --git a/src/script/scripting_mainmenu.cpp b/src/script/scripting_mainmenu.cpp index 31581a1bf..a4619e9da 100644 --- a/src/script/scripting_mainmenu.cpp +++ b/src/script/scripting_mainmenu.cpp @@ -28,8 +28,9 @@ with this program; if not, write to the Free Software Foundation, Inc., extern "C" { #include "lualib.h" + int luaopen_marshal(lua_State *L); } - +/******************************************************************************/ MainMenuScripting::MainMenuScripting(GUIEngine* guiengine) { setGuiEngine(guiengine); @@ -37,6 +38,7 @@ MainMenuScripting::MainMenuScripting(GUIEngine* guiengine) //TODO add security luaL_openlibs(getStack()); + luaopen_marshal(getStack()); SCRIPTAPI_PRECHECKHEADER @@ -58,6 +60,7 @@ MainMenuScripting::MainMenuScripting(GUIEngine* guiengine) infostream << "SCRIPTAPI: initialized mainmenu modules" << std::endl; } +/******************************************************************************/ void MainMenuScripting::InitializeModApi(lua_State *L, int top) { // Initialize mod api modules @@ -66,4 +69,23 @@ void MainMenuScripting::InitializeModApi(lua_State *L, int top) // Register reference classes (userdata) LuaSettings::Register(L); + + // Register functions to async environment + ModApiMainMenu::InitializeAsync(m_AsyncEngine); + ModApiUtil::InitializeAsync(m_AsyncEngine); + + // Initialize async environment + //TODO possibly make number of async threads configurable + m_AsyncEngine.Initialize(MAINMENU_NUMBER_OF_ASYNC_THREADS); +} + +/******************************************************************************/ +void MainMenuScripting::Step() { + m_AsyncEngine.Step(getStack()); +} + +/******************************************************************************/ +unsigned int MainMenuScripting::DoAsync(std::string serialized_fct, + std::string serialized_params) { + return m_AsyncEngine.doAsyncJob(serialized_fct,serialized_params); } diff --git a/src/script/scripting_mainmenu.h b/src/script/scripting_mainmenu.h index 7592c8e23..f4d78f664 100644 --- a/src/script/scripting_mainmenu.h +++ b/src/script/scripting_mainmenu.h @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "cpp_api/s_base.h" #include "cpp_api/s_mainmenu.h" +#include "lua_api/l_async_events.h" /*****************************************************************************/ /* Scripting <-> Main Menu Interface */ @@ -37,8 +38,16 @@ public: // use ScriptApiBase::loadMod() or ScriptApiBase::loadScript() // to load scripts + /* global step handler to pass back async events */ + void Step(); + + /* pass async events from engine to async threads */ + unsigned int DoAsync(std::string serialized_fct, + std::string serialized_params); private: void InitializeModApi(lua_State *L, int top); + + AsyncEngine m_AsyncEngine; }; From d02ce1cf4d5d283cc6045771612e5b351740e07e Mon Sep 17 00:00:00 2001 From: sapier Date: Fri, 29 Nov 2013 23:36:18 +0100 Subject: [PATCH 132/198] Fix old gcc build --- src/script/lua_api/l_async_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/lua_api/l_async_events.h b/src/script/lua_api/l_async_events.h index 4aaf3bdfe..347d9c0fc 100644 --- a/src/script/lua_api/l_async_events.h +++ b/src/script/lua_api/l_async_events.h @@ -132,7 +132,7 @@ private: /** asynchornous thread and job management **/ class AsyncEngine { - friend AsyncWorkerThread; + friend class AsyncWorkerThread; public: /** * default constructor From d19a69cd0d22dfbe802286baf8b33ebb8c6f4fa2 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 30 Nov 2013 01:51:54 +0100 Subject: [PATCH 133/198] Fix broken thread stop handling --- src/jthread/jthread.h | 2 ++ src/jthread/pthread/jthread.cpp | 13 ++++++++++++- src/jthread/win32/jthread.cpp | 13 ++++++++++++- src/script/lua_api/l_async_events.cpp | 11 +++++++---- src/script/lua_api/l_async_events.h | 2 ++ 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/jthread/jthread.h b/src/jthread/jthread.h index 92b05f1c5..867701c75 100644 --- a/src/jthread/jthread.h +++ b/src/jthread/jthread.h @@ -47,6 +47,7 @@ public: int Kill(); virtual void *Thread() = 0; bool IsRunning(); + bool StopRequested(); void *GetReturnValue(); bool IsSameThread(); protected: @@ -69,6 +70,7 @@ private: #endif // WIN32 void *retval; bool running; + bool requeststop; JMutex runningmutex; JMutex continuemutex,continuemutex2; diff --git a/src/jthread/pthread/jthread.cpp b/src/jthread/pthread/jthread.cpp index 2980e26b1..c4d9162c8 100644 --- a/src/jthread/pthread/jthread.cpp +++ b/src/jthread/pthread/jthread.cpp @@ -34,6 +34,7 @@ JThread::JThread() { retval = NULL; mutexinit = false; + requeststop = false; running = false; } @@ -44,7 +45,7 @@ JThread::~JThread() void JThread::Stop() { runningmutex.Lock(); - running = false; + requeststop = true; runningmutex.Unlock(); } @@ -78,6 +79,7 @@ int JThread::Start() runningmutex.Unlock(); return ERR_JTHREAD_ALREADYRUNNING; } + requeststop = false; runningmutex.Unlock(); pthread_attr_t attr; @@ -141,6 +143,15 @@ bool JThread::IsRunning() return r; } +bool JThread::StopRequested() { + bool r; + + runningmutex.Lock(); + r = requeststop; + runningmutex.Unlock(); + return r; +} + void *JThread::GetReturnValue() { void *val; diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index 1cf4f93a3..e56c16271 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -35,6 +35,7 @@ JThread::JThread() { retval = NULL; mutexinit = false; + requeststop = false; running = false; } @@ -45,7 +46,7 @@ JThread::~JThread() void JThread::Stop() { runningmutex.Lock(); - running = false; + requeststop = false; runningmutex.Unlock(); } @@ -76,6 +77,7 @@ int JThread::Start() runningmutex.Unlock(); return ERR_JTHREAD_ALREADYRUNNING; } + requeststop = false;e runningmutex.Unlock(); continuemutex.Lock(); @@ -134,6 +136,15 @@ bool JThread::IsRunning() return r; } +bool JThread::StopRequested() { + bool r; + + runningmutex.Lock(); + r = requeststop; + runningmutex.Unlock(); + return r; +} + void *JThread::GetReturnValue() { void *val; diff --git a/src/script/lua_api/l_async_events.cpp b/src/script/lua_api/l_async_events.cpp index cc4644cdf..63ca87aed 100644 --- a/src/script/lua_api/l_async_events.cpp +++ b/src/script/lua_api/l_async_events.cpp @@ -149,9 +149,11 @@ LuaJobInfo AsyncEngine::getJob() { m_JobQueueMutex.Lock(); LuaJobInfo retval; + retval.valid = false; if (m_JobQueue.size() != 0) { retval = m_JobQueue.front(); + retval.valid = true; m_JobQueue.erase((m_JobQueue.begin())); } m_JobQueueMutex.Unlock(); @@ -322,11 +324,12 @@ void* AsyncWorkerThread::worker_thread_main() { assert("no future with broken builtin async environment scripts" == 0); } /** main loop **/ - while(IsRunning()) { + while(!StopRequested()) { //wait for job LuaJobInfo toprocess = m_JobDispatcher->getJob(); - if (!IsRunning()) { continue; } + if (toprocess.valid == false) { continue; } + if (StopRequested()) { continue; } //first push error handler lua_pushcfunction(m_LuaStack, script_error_handler); @@ -350,7 +353,7 @@ void* AsyncWorkerThread::worker_thread_main() { toprocess.serializedParams.c_str(), toprocess.serializedParams.length()); - if (!IsRunning()) { continue; } + if (StopRequested()) { continue; } if(lua_pcall(m_LuaStack, 2, 2, errorhandler)) { scriptError("Async WORKER thread: %s\n", lua_tostring(m_LuaStack, -1)); toprocess.serializedResult="ERROR"; @@ -362,7 +365,7 @@ void* AsyncWorkerThread::worker_thread_main() { toprocess.serializedResult = std::string(retval,lenght); } - if (!IsRunning()) { continue; } + if (StopRequested()) { continue; } //put job result m_JobDispatcher->putJobResult(toprocess); } diff --git a/src/script/lua_api/l_async_events.h b/src/script/lua_api/l_async_events.h index 347d9c0fc..079a08009 100644 --- a/src/script/lua_api/l_async_events.h +++ b/src/script/lua_api/l_async_events.h @@ -57,6 +57,8 @@ struct LuaJobInfo { std::string serializedResult; /** jobid used to identify a job and match it to callback **/ unsigned int JobId; + /** valid marker **/ + bool valid; }; /** class encapsulating a asynchronous working environment **/ From 747bc40840ff13bcf9c7a60b790a6de24f94f946 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Fri, 29 Nov 2013 20:54:04 -0500 Subject: [PATCH 134/198] Cavegen: Respect is_ground_content MapNode setting; fix some code formatting issues --- src/cavegen.cpp | 8 +++++--- src/mapnode.cpp | 11 ++++++----- src/nodedef.cpp | 35 ++++++++++++++++++----------------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/cavegen.cpp b/src/cavegen.cpp index 51af50984..71f005d5b 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -236,6 +236,9 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) { continue; u32 i = vm->m_area.index(p); + content_t c = vm->m_data[i].getContent(); + if (!ndef->get(c).is_ground_content) + continue; if (large_cave) { int full_ymin = node_min.Y - MAP_BLOCKSIZE; @@ -250,7 +253,6 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) { } } else { // Don't replace air or water or lava or ignore - content_t c = vm->m_data[i].getContent(); if (c == CONTENT_IGNORE || c == CONTENT_AIR || c == c_water_source || c == c_lava_source) continue; @@ -530,8 +532,8 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) { // Don't replace air, water, lava, or ice content_t c = vm->m_data[i].getContent(); - if (c == CONTENT_AIR || c == c_water_source || - c == c_lava_source || c == c_ice) + if (!ndef->get(c).is_ground_content || c == CONTENT_AIR || + c == c_water_source || c == c_lava_source || c == c_ice) continue; if (large_cave) { diff --git a/src/mapnode.cpp b/src/mapnode.cpp index a47a48bc0..d52677be0 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -383,8 +383,10 @@ u8 MapNode::getLevel(INodeDefManager *nodemgr) const return getParam2() & LIQUID_LEVEL_MASK; if(f.leveled || f.param_type_2 == CPT2_LEVELED) { u8 level = getParam2() & LEVELED_MASK; - if(level) return level; - if(f.leveled > LEVELED_MAX) return LEVELED_MAX; + if(level) + return level; + if(f.leveled > LEVELED_MAX) + return LEVELED_MAX; return f.leveled; //default } return 0; @@ -398,7 +400,7 @@ u8 MapNode::setLevel(INodeDefManager *nodemgr, s8 level) return 0; } const ContentFeatures &f = nodemgr->get(*this); - if ( f.param_type_2 == CPT2_FLOWINGLIQUID + if (f.param_type_2 == CPT2_FLOWINGLIQUID || f.liquid_type == LIQUID_FLOWING || f.liquid_type == LIQUID_SOURCE) { if (level >= LIQUID_LEVEL_SOURCE) { @@ -487,8 +489,7 @@ void MapNode::deSerialize(u8 *source, u8 version) param0 = readU16(source+0); param1 = readU8(source+2); param2 = readU8(source+3); - } - else{ + }else{ param0 = readU8(source+0); param1 = readU8(source+1); param2 = readU8(source+2); diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 41956ca2e..d13d0653d 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -396,15 +396,16 @@ public: // Set CONTENT_AIR { ContentFeatures f; - f.name = "air"; - f.drawtype = NDT_AIRLIKE; - f.param_type = CPT_LIGHT; - f.light_propagates = true; + f.name = "air"; + f.drawtype = NDT_AIRLIKE; + f.param_type = CPT_LIGHT; + f.light_propagates = true; f.sunlight_propagates = true; - f.walkable = false; - f.pointable = false; - f.diggable = false; - f.buildable_to = true; + f.walkable = false; + f.pointable = false; + f.diggable = false; + f.buildable_to = true; + f.is_ground_content = true; // Insert directly into containers content_t c = CONTENT_AIR; m_content_features[c] = f; @@ -414,16 +415,16 @@ public: // Set CONTENT_IGNORE { ContentFeatures f; - f.name = "ignore"; - f.drawtype = NDT_AIRLIKE; - f.param_type = CPT_NONE; - f.light_propagates = false; + f.name = "ignore"; + f.drawtype = NDT_AIRLIKE; + f.param_type = CPT_NONE; + f.light_propagates = false; f.sunlight_propagates = false; - f.walkable = false; - f.pointable = false; - f.diggable = false; - // A way to remove accidental CONTENT_IGNOREs - f.buildable_to = true; + f.walkable = false; + f.pointable = false; + f.diggable = false; + f.buildable_to = true; // A way to remove accidental CONTENT_IGNOREs + f.is_ground_content = true; // Insert directly into containers content_t c = CONTENT_IGNORE; m_content_features[c] = f; From 5be786c804d36e9950598a01cf39f05574af2acc Mon Sep 17 00:00:00 2001 From: MetaDucky Date: Wed, 20 Nov 2013 22:11:57 +0100 Subject: [PATCH 135/198] Fixed potential NULL pointer and leak when setting node metadata --- src/map.cpp | 19 ++++++++----------- src/map.h | 17 ++++++++++++++++- src/rollback_interface.cpp | 8 +++++++- src/script/lua_api/l_nodemeta.cpp | 18 ++++++++++++------ src/script/lua_api/l_nodemeta.h | 13 +++++++++++++ 5 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 0dbfd42f4..0f9c82c3c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2279,7 +2279,7 @@ void Map::transformLiquids(std::map & modified_blocks) updateLighting(lighting_modified_blocks, modified_blocks); } -NodeMetadata* Map::getNodeMetadata(v3s16 p) +NodeMetadata *Map::getNodeMetadata(v3s16 p) { v3s16 blockpos = getNodeBlockPos(p); v3s16 p_rel = p - blockpos*MAP_BLOCKSIZE; @@ -2289,8 +2289,7 @@ NodeMetadata* Map::getNodeMetadata(v3s16 p) <m_node_metadata.set(p_rel, meta); + return true; } void Map::removeNodeMetadata(v3s16 p) @@ -2342,8 +2341,7 @@ NodeTimer Map::getNodeTimer(v3s16 p) <setNodeMetadata(p, meta); + if(!map->setNodeMetadata(p, meta)){ + delete meta; + infostream<<"RollbackAction::applyRevert(): " + <<"setNodeMetadata failed at " + <deSerialize(is); diff --git a/src/script/lua_api/l_nodemeta.cpp b/src/script/lua_api/l_nodemeta.cpp index f9c8794d5..4f20e56f9 100644 --- a/src/script/lua_api/l_nodemeta.cpp +++ b/src/script/lua_api/l_nodemeta.cpp @@ -42,10 +42,12 @@ NodeMetaRef* NodeMetaRef::checkobject(lua_State *L, int narg) NodeMetadata* NodeMetaRef::getmeta(NodeMetaRef *ref, bool auto_create) { NodeMetadata *meta = ref->m_env->getMap().getNodeMetadata(ref->m_p); - if(meta == NULL && auto_create) - { + if(meta == NULL && auto_create) { meta = new NodeMetadata(ref->m_env->getGameDef()); - ref->m_env->getMap().setNodeMetadata(ref->m_p, meta); + if(!ref->m_env->getMap().setNodeMetadata(ref->m_p, meta)) { + delete meta; + return NULL; + } } return meta; } @@ -227,17 +229,21 @@ int NodeMetaRef::l_from_table(lua_State *L) NodeMetaRef *ref = checkobject(L, 1); int base = 2; + // clear old metadata first + ref->m_env->getMap().removeNodeMetadata(ref->m_p); + if(lua_isnil(L, base)){ // No metadata - ref->m_env->getMap().removeNodeMetadata(ref->m_p); lua_pushboolean(L, true); return 1; } - // Has metadata; clear old one first - ref->m_env->getMap().removeNodeMetadata(ref->m_p); // Create new metadata NodeMetadata *meta = getmeta(ref, true); + if(meta == NULL){ + lua_pushboolean(L, false); + return 1; + } // Set fields lua_getfield(L, base, "fields"); int fieldstable = lua_gettop(L); diff --git a/src/script/lua_api/l_nodemeta.h b/src/script/lua_api/l_nodemeta.h index ed06ff0fa..e39ac3931 100644 --- a/src/script/lua_api/l_nodemeta.h +++ b/src/script/lua_api/l_nodemeta.h @@ -39,6 +39,19 @@ private: static NodeMetaRef *checkobject(lua_State *L, int narg); + /** + * Retrieve metadata for a node. + * If @p auto_create is set and the specified node has no metadata information + * associated with it yet, the method attempts to attach a new metadata object + * to the node and returns a pointer to the metadata when successful. + * + * However, it is NOT guaranteed that the method will return a pointer, + * and @c NULL may be returned in case of an error regardless of @p auto_create. + * + * @param ref specifies the node for which the associated metadata is retrieved. + * @param auto_create when true, try to create metadata information for the node if it has none. + * @return pointer to a @c NodeMetadata object or @c NULL in case of error. + */ static NodeMetadata* getmeta(NodeMetaRef *ref, bool auto_create); static void reportMetadataChange(NodeMetaRef *ref); From 769b2d7c0582a6e294472aa9ac166d8d1064cd77 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Fri, 29 Nov 2013 21:16:08 -0500 Subject: [PATCH 136/198] LuaVoxelManip: Add get_light_data() and set_light_data() --- doc/lua_api.txt | 7 ++++++ src/script/lua_api/l_vmanip.cpp | 44 +++++++++++++++++++++++++++++++++ src/script/lua_api/l_vmanip.h | 3 +++ 3 files changed, 54 insertions(+) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index cd9e27b7a..b8ad99ce7 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1818,6 +1818,13 @@ methods: - set_lighting(light): Set the lighting within the VoxelManip ^ light is a table, {day=<0...15>, night=<0...15>} ^ To be used only by a VoxelManip object from minetest.get_mapgen_object + +- get_light_data(): Gets the light data read into the VoxelManip object + ^ Returns an array (indicies 1 to volume) of integers ranging from 0 to 255 + ^ Each value is the bitwise combination of day and night light values (0..15 each) + ^ light = day + (night * 16) +- set_light_data(light_data): Sets the param1 (light) contents of each node in the VoxelManip + ^ expects lighting data in the same format that get_light_data() returns - calc_lighting(): Calculate lighting within the VoxelManip ^ To be used only by a VoxelManip object from minetest.get_mapgen_object - update_liquids(): Update liquid flow diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index db8884e10..5228b7c06 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -178,6 +178,48 @@ int LuaVoxelManip::l_set_lighting(lua_State *L) return 0; } +int LuaVoxelManip::l_get_light_data(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + + LuaVoxelManip *o = checkobject(L, 1); + ManualMapVoxelManipulator *vm = o->vm; + + int volume = vm->m_area.getVolume(); + + lua_newtable(L); + for (int i = 0; i != volume; i++) { + lua_Integer light = vm->m_data[i].param1; + lua_pushinteger(L, light); + lua_rawseti(L, -2, i + 1); + } + + return 1; +} + +int LuaVoxelManip::l_set_light_data(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + + LuaVoxelManip *o = checkobject(L, 1); + ManualMapVoxelManipulator *vm = o->vm; + + if (!lua_istable(L, 2)) + return 0; + + int volume = vm->m_area.getVolume(); + for (int i = 0; i != volume; i++) { + lua_rawgeti(L, 2, i + 1); + u8 light = lua_tointeger(L, -1); + + vm->m_data[i].param1 = light; + + lua_pop(L, 1); + } + + return 0; +} + int LuaVoxelManip::l_update_map(lua_State *L) { LuaVoxelManip *o = checkobject(L, 1); @@ -299,5 +341,7 @@ const luaL_reg LuaVoxelManip::methods[] = { luamethod(LuaVoxelManip, update_liquids), luamethod(LuaVoxelManip, calc_lighting), luamethod(LuaVoxelManip, set_lighting), + luamethod(LuaVoxelManip, get_light_data), + luamethod(LuaVoxelManip, set_light_data), {0,0} }; diff --git a/src/script/lua_api/l_vmanip.h b/src/script/lua_api/l_vmanip.h index d2f035a3e..b3393e09a 100644 --- a/src/script/lua_api/l_vmanip.h +++ b/src/script/lua_api/l_vmanip.h @@ -49,8 +49,11 @@ private: static int l_update_map(lua_State *L); static int l_update_liquids(lua_State *L); + static int l_calc_lighting(lua_State *L); static int l_set_lighting(lua_State *L); + static int l_get_light_data(lua_State *L); + static int l_set_light_data(lua_State *L); public: LuaVoxelManip(ManualMapVoxelManipulator *mmvm, bool is_mapgen_vm); From ff7d7080e3ea2d2ca1669cb8c47c35a6c4753d39 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 30 Nov 2013 00:27:39 -0500 Subject: [PATCH 137/198] LuaVoxelManip: Add area parameters back to calc_lighting and set_lighting, made optional this time; also fixed a slight bug with night values being ignored --- doc/lua_api.txt | 7 ++++--- src/script/lua_api/l_vmanip.cpp | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index b8ad99ce7..7fa8870aa 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1815,18 +1815,19 @@ methods: - update_map(): Update map after writing chunk back to map. ^ To be used only by VoxelManip objects created by the mod itself; not a VoxelManip that was ^ retrieved from minetest.get_mapgen_object -- set_lighting(light): Set the lighting within the VoxelManip +- set_lighting(light, p1, p2): Set the lighting within the VoxelManip to a uniform value ^ light is a table, {day=<0...15>, night=<0...15>} ^ To be used only by a VoxelManip object from minetest.get_mapgen_object - + ^ (p1, p2) is the area in which lighting is set; defaults to the whole area if left out - get_light_data(): Gets the light data read into the VoxelManip object ^ Returns an array (indicies 1 to volume) of integers ranging from 0 to 255 ^ Each value is the bitwise combination of day and night light values (0..15 each) ^ light = day + (night * 16) - set_light_data(light_data): Sets the param1 (light) contents of each node in the VoxelManip ^ expects lighting data in the same format that get_light_data() returns -- calc_lighting(): Calculate lighting within the VoxelManip +- calc_lighting(p1, p2): Calculate lighting within the VoxelManip ^ To be used only by a VoxelManip object from minetest.get_mapgen_object + ^ (p1, p2) is the area in which lighting is set; defaults to the whole area if left out - update_liquids(): Update liquid flow VoxelArea: A helper class for voxel areas diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index 5228b7c06..92c04db3a 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -135,18 +135,23 @@ int LuaVoxelManip::l_calc_lighting(lua_State *L) LuaVoxelManip *o = checkobject(L, 1); if (!o->is_mapgen_vm) return 0; - + INodeDefManager *ndef = getServer(L)->getNodeDefManager(); EmergeManager *emerge = getServer(L)->getEmergeManager(); ManualMapVoxelManipulator *vm = o->vm; + v3s16 p1 = lua_istable(L, 2) ? read_v3s16(L, 2) : + vm->m_area.MinEdge + v3s16(0, 1, 0) * MAP_BLOCKSIZE; + v3s16 p2 = lua_istable(L, 3) ? read_v3s16(L, 3) : + vm->m_area.MaxEdge - v3s16(0, 1, 0) * MAP_BLOCKSIZE; + sortBoxVerticies(p1, p2); + Mapgen mg; mg.vm = vm; mg.ndef = ndef; mg.water_level = emerge->params->water_level; - mg.calcLighting(vm->m_area.MinEdge + v3s16(0, 1, 0) * MAP_BLOCKSIZE, - vm->m_area.MaxEdge - v3s16(0, 1, 0) * MAP_BLOCKSIZE); + mg.calcLighting(p1, p2); return 0; } @@ -164,16 +169,20 @@ int LuaVoxelManip::l_set_lighting(lua_State *L) u8 light; light = (getintfield_default(L, 2, "day", 0) & 0x0F); - light |= (getintfield_default(L, 2, "night", 0) & 0x0F) << 8; + light |= (getintfield_default(L, 2, "night", 0) & 0x0F) << 4; ManualMapVoxelManipulator *vm = o->vm; + v3s16 p1 = lua_istable(L, 3) ? read_v3s16(L, 3) : + vm->m_area.MinEdge + v3s16(0, 1, 0) * MAP_BLOCKSIZE; + v3s16 p2 = lua_istable(L, 4) ? read_v3s16(L, 4) : + vm->m_area.MaxEdge - v3s16(0, 1, 0) * MAP_BLOCKSIZE; + sortBoxVerticies(p1, p2); + Mapgen mg; mg.vm = vm; - mg.setLighting(vm->m_area.MinEdge + v3s16(0, 1, 0) * MAP_BLOCKSIZE, - vm->m_area.MaxEdge - v3s16(0, 1, 0) * MAP_BLOCKSIZE, - light); + mg.setLighting(p1, p2, light); return 0; } From 9a927476ca22a28d0640ef35d95964c3077532ab Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 30 Nov 2013 02:37:10 -0500 Subject: [PATCH 138/198] Change default value of is_ground_content to true Most modders would otherwise forget to explicitly define this, and generated nodes aliased from mods would wall-off caves --- builtin/item.lua | 2 +- games/minimal/mods/default/init.lua | 35 ++++++++--------------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/builtin/item.lua b/builtin/item.lua index b3ab9bc4c..2f2422c81 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -501,7 +501,7 @@ minetest.nodedef_default = { post_effect_color = {a=0, r=0, g=0, b=0}, paramtype = "none", paramtype2 = "none", - is_ground_content = false, + is_ground_content = true, sunlight_propagates = false, walkable = true, pointable = true, diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index eae1fabcc..8cef3fcc0 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -712,7 +712,6 @@ end minetest.register_node("default:stone", { description = "Stone", tiles ={"default_stone.png"}, - is_ground_content = true, groups = {cracky=3}, drop = 'default:cobble', legacy_mineral = true, @@ -722,7 +721,6 @@ minetest.register_node("default:stone", { minetest.register_node("default:stone_with_coal", { description = "Stone with coal", tiles ={"default_stone.png^default_mineral_coal.png"}, - is_ground_content = true, groups = {cracky=3}, drop = 'default:coal_lump', sounds = default.node_sound_stone_defaults(), @@ -731,7 +729,6 @@ minetest.register_node("default:stone_with_coal", { minetest.register_node("default:stone_with_iron", { description = "Stone with iron", tiles ={"default_stone.png^default_mineral_iron.png"}, - is_ground_content = true, groups = {cracky=3}, drop = 'default:iron_lump', sounds = default.node_sound_stone_defaults(), @@ -740,7 +737,6 @@ minetest.register_node("default:stone_with_iron", { minetest.register_node("default:dirt_with_grass", { description = "Dirt with grass", tiles ={"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, - is_ground_content = true, groups = {crumbly=3, soil=1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ @@ -751,7 +747,6 @@ minetest.register_node("default:dirt_with_grass", { minetest.register_node("default:dirt_with_grass_footsteps", { description = "Dirt with grass and footsteps", tiles ={"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, - is_ground_content = true, groups = {crumbly=3, soil=1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ @@ -762,7 +757,6 @@ minetest.register_node("default:dirt_with_grass_footsteps", { minetest.register_node("default:dirt", { description = "Dirt", tiles ={"default_dirt.png"}, - is_ground_content = true, groups = {crumbly=3, soil=1}, sounds = default.node_sound_dirt_defaults(), }) @@ -770,7 +764,6 @@ minetest.register_node("default:dirt", { minetest.register_node("default:sand", { description = "Sand", tiles ={"default_sand.png"}, - is_ground_content = true, groups = {crumbly=3, falling_node=1}, sounds = default.node_sound_sand_defaults(), }) @@ -778,7 +771,6 @@ minetest.register_node("default:sand", { minetest.register_node("default:gravel", { description = "Gravel", tiles ={"default_gravel.png"}, - is_ground_content = true, groups = {crumbly=2, falling_node=1}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_gravel_footstep", gain=0.45}, @@ -788,7 +780,6 @@ minetest.register_node("default:gravel", { minetest.register_node("default:sandstone", { description = "Sandstone", tiles ={"default_sandstone.png"}, - is_ground_content = true, groups = {crumbly=2,cracky=2}, drop = 'default:sand', sounds = default.node_sound_stone_defaults(), @@ -797,7 +788,6 @@ minetest.register_node("default:sandstone", { minetest.register_node("default:clay", { description = "Clay", tiles ={"default_clay.png"}, - is_ground_content = true, groups = {crumbly=3}, drop = 'default:clay_lump 4', sounds = default.node_sound_dirt_defaults({ @@ -808,7 +798,6 @@ minetest.register_node("default:clay", { minetest.register_node("default:brick", { description = "Brick", tiles ={"default_brick.png"}, - is_ground_content = true, groups = {cracky=3}, drop = 'default:clay_brick 4', sounds = default.node_sound_stone_defaults(), @@ -817,7 +806,6 @@ minetest.register_node("default:brick", { minetest.register_node("default:tree", { description = "Tree", tiles ={"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, - is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1}, sounds = default.node_sound_wood_defaults(), }) @@ -825,7 +813,6 @@ minetest.register_node("default:tree", { minetest.register_node("default:jungletree", { description = "Jungle Tree", tiles ={"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, - is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1}, sounds = default.node_sound_wood_defaults(), }) @@ -849,6 +836,7 @@ minetest.register_node("default:leaves", { visual_scale = 1.3, tiles ={"default_leaves.png"}, paramtype = "light", + is_ground_content = false, groups = {snappy=3}, drop = { max_items = 1, @@ -871,7 +859,6 @@ minetest.register_node("default:leaves", { minetest.register_node("default:cactus", { description = "Cactus", tiles ={"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, - is_ground_content = true, groups = {snappy=2,choppy=3}, sounds = default.node_sound_wood_defaults(), }) @@ -883,7 +870,6 @@ minetest.register_node("default:papyrus", { inventory_image = "default_papyrus.png", wield_image = "default_papyrus.png", paramtype = "light", - is_ground_content = true, walkable = false, groups = {snappy=3}, sounds = default.node_sound_leaves_defaults(), @@ -892,7 +878,6 @@ minetest.register_node("default:papyrus", { minetest.register_node("default:bookshelf", { description = "Bookshelf", tiles ={"default_wood.png", "default_wood.png", "default_bookshelf.png"}, - is_ground_content = true, groups = {snappy=2,choppy=3,oddly_breakable_by_hand=2}, sounds = default.node_sound_wood_defaults(), }) @@ -904,7 +889,6 @@ minetest.register_node("default:glass", { inventory_image = minetest.inventorycube("default_glass.png"), paramtype = "light", sunlight_propagates = true, - is_ground_content = true, groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3}, sounds = default.node_sound_glass_defaults(), }) @@ -916,7 +900,6 @@ minetest.register_node("default:fence_wood", { inventory_image = "default_fence.png", wield_image = "default_fence.png", paramtype = "light", - is_ground_content = true, selection_box = { type = "fixed", fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, @@ -932,7 +915,6 @@ minetest.register_node("default:rail", { inventory_image = "default_rail.png", wield_image = "default_rail.png", paramtype = "light", - is_ground_content = true, walkable = false, selection_box = { type = "fixed", @@ -949,7 +931,6 @@ minetest.register_node("default:ladder", { wield_image = "default_ladder.png", paramtype = "light", paramtype2 = "wallmounted", - is_ground_content = true, walkable = false, climbable = true, selection_box = { @@ -966,7 +947,6 @@ minetest.register_node("default:ladder", { minetest.register_node("default:wood", { description = "Wood", tiles ={"default_wood.png"}, - is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, sounds = default.node_sound_wood_defaults(), }) @@ -974,7 +954,6 @@ minetest.register_node("default:wood", { minetest.register_node("default:mese", { description = "Mese", tiles ={"default_mese.png"}, - is_ground_content = true, groups = {cracky=1,level=2}, sounds = default.node_sound_defaults(), }) @@ -982,7 +961,6 @@ minetest.register_node("default:mese", { minetest.register_node("default:cloud", { description = "Cloud", tiles ={"default_cloud.png"}, - is_ground_content = true, sounds = default.node_sound_defaults(), }) @@ -1104,6 +1082,7 @@ minetest.register_node("default:torch", { paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, + is_ground_content = false, walkable = false, light_source = LIGHT_MAX-1, selection_box = { @@ -1126,6 +1105,7 @@ minetest.register_node("default:sign_wall", { paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, + is_ground_content = false, walkable = false, selection_box = { type = "wallmounted", @@ -1160,6 +1140,7 @@ minetest.register_node("default:chest", { paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, + is_ground_content = false, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -1192,6 +1173,7 @@ minetest.register_node("default:chest_locked", { paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, + is_ground_content = false, sounds = default.node_sound_wood_defaults(), after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) @@ -1277,6 +1259,7 @@ minetest.register_node("default:furnace", { paramtype2 = "facedir", groups = {cracky=2}, legacy_facedir_simple = true, + is_ground_content = false, sounds = default.node_sound_stone_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -1310,6 +1293,7 @@ minetest.register_node("default:furnace_active", { drop = "default:furnace", groups = {cracky=2}, legacy_facedir_simple = true, + is_ground_content = false, sounds = default.node_sound_stone_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -1452,7 +1436,6 @@ minetest.register_abm({ minetest.register_node("default:cobble", { description = "Cobble", tiles ={"default_cobble.png"}, - is_ground_content = true, groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), }) @@ -1460,7 +1443,6 @@ minetest.register_node("default:cobble", { minetest.register_node("default:mossycobble", { description = "Mossy Cobble", tiles ={"default_mossycobble.png"}, - is_ground_content = true, groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), }) @@ -1468,7 +1450,6 @@ minetest.register_node("default:mossycobble", { minetest.register_node("default:steelblock", { description = "Steel Block", tiles ={"default_steel_block.png"}, - is_ground_content = true, groups = {snappy=1,bendy=2}, sounds = default.node_sound_stone_defaults(), }) @@ -1481,6 +1462,7 @@ minetest.register_node("default:nyancat", { paramtype2 = "facedir", groups = {cracky=2}, legacy_facedir_simple = true, + is_ground_content = false, sounds = default.node_sound_defaults(), }) @@ -1488,6 +1470,7 @@ minetest.register_node("default:nyancat_rainbow", { description = "Nyancat Rainbow", tiles ={"default_nc_rb.png"}, inventory_image = "default_nc_rb.png", + is_ground_content = false, groups = {cracky=2}, sounds = default.node_sound_defaults(), }) From 752e11e11411d72868a406d35538adc5d1126655 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sat, 30 Nov 2013 21:00:18 +0400 Subject: [PATCH 139/198] Fix MSVC build. --- src/jthread/win32/jthread.cpp | 2 +- src/script/lua_api/l_async_events.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index e56c16271..fc1464064 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -77,7 +77,7 @@ int JThread::Start() runningmutex.Unlock(); return ERR_JTHREAD_ALREADYRUNNING; } - requeststop = false;e + requeststop = false; runningmutex.Unlock(); continuemutex.Lock(); diff --git a/src/script/lua_api/l_async_events.h b/src/script/lua_api/l_async_events.h index 079a08009..3364bac6e 100644 --- a/src/script/lua_api/l_async_events.h +++ b/src/script/lua_api/l_async_events.h @@ -22,7 +22,17 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include + +#ifndef _MSC_VER #include +#else +#define _WINSOCKAPI_ +#include +static unsigned sleep(unsigned seconds) { + Sleep(seconds * 1000); + return 0; +} +#endif /******************************************************************************/ /* Includes */ From d879a539cd19ddd1ee34afec2512fb2238de2822 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 23 Nov 2013 15:35:49 +0100 Subject: [PATCH 140/198] Add minetest.swap_node --- games/minimal/mods/default/init.lua | 15 +++++---------- src/client.cpp | 12 +++++++++--- src/client.h | 2 +- src/clientserver.h | 8 +++++++- src/environment.cpp | 5 +++++ src/environment.h | 1 + src/map.cpp | 14 ++++++++------ src/map.h | 9 +++++++-- src/script/lua_api/l_env.cpp | 17 +++++++++++++++++ src/script/lua_api/l_env.h | 4 ++++ src/server.cpp | 21 ++++++++++++++++----- src/server.h | 3 ++- 12 files changed, 82 insertions(+), 29 deletions(-) diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index 8cef3fcc0..038bf9abc 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1318,18 +1318,13 @@ minetest.register_node("default:furnace_active", { end, }) -function hacky_swap_node(pos,name) +function swap_node(pos,name) local node = minetest.get_node(pos) - local meta = minetest.get_meta(pos) - local meta0 = meta:to_table() if node.name == name then return end node.name = name - local meta0 = meta:to_table() - minetest.set_node(pos,node) - meta = minetest.get_meta(pos) - meta:from_table(meta0) + minetest.swap_node(pos, node) end minetest.register_abm({ @@ -1384,7 +1379,7 @@ minetest.register_abm({ local percent = math.floor(meta:get_float("fuel_time") / meta:get_float("fuel_totaltime") * 100) meta:set_string("infotext","Furnace active: "..percent.."%") - hacky_swap_node(pos,"default:furnace_active") + swap_node(pos,"default:furnace_active") meta:set_string("formspec", "size[8,9]".. "image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:".. @@ -1410,7 +1405,7 @@ minetest.register_abm({ if fuel.time <= 0 then meta:set_string("infotext","Furnace out of fuel") - hacky_swap_node(pos,"default:furnace") + swap_node(pos,"default:furnace") meta:set_string("formspec", default.furnace_inactive_formspec) return end @@ -1418,7 +1413,7 @@ minetest.register_abm({ if cooked.item:is_empty() then if was_active then meta:set_string("infotext","Furnace is empty") - hacky_swap_node(pos,"default:furnace") + swap_node(pos,"default:furnace") meta:set_string("formspec", default.furnace_inactive_formspec) end return diff --git a/src/client.cpp b/src/client.cpp index 5e8f20620..a9a1f6dd9 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1262,7 +1262,13 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) MapNode n; n.deSerialize(&data[8], ser_version); - addNode(p, n); + bool remove_metadata = true; + u32 index = 8 + MapNode::serializedLength(ser_version); + if ((datasize >= index+1) && data[index]){ + remove_metadata = false; + } + + addNode(p, n, remove_metadata); } else if(command == TOCLIENT_BLOCKDATA) { @@ -2514,7 +2520,7 @@ void Client::removeNode(v3s16 p) } } -void Client::addNode(v3s16 p, MapNode n) +void Client::addNode(v3s16 p, MapNode n, bool remove_metadata) { TimeTaker timer1("Client::addNode()"); @@ -2523,7 +2529,7 @@ void Client::addNode(v3s16 p, MapNode n) try { //TimeTaker timer3("Client::addNode(): addNodeAndUpdate"); - m_env.getMap().addNodeAndUpdate(p, n, modified_blocks); + m_env.getMap().addNodeAndUpdate(p, n, modified_blocks, remove_metadata); } catch(InvalidPositionException &e) {} diff --git a/src/client.h b/src/client.h index 9f5eb833b..eb0f225a2 100644 --- a/src/client.h +++ b/src/client.h @@ -365,7 +365,7 @@ public: // Causes urgent mesh updates (unlike Map::add/removeNodeWithEvent) void removeNode(v3s16 p); - void addNode(v3s16 p, MapNode n); + void addNode(v3s16 p, MapNode n, bool remove_metadata = true); void setPlayerControl(PlayerControl &control); diff --git a/src/clientserver.h b/src/clientserver.h index 67a4846a6..90f6f9a88 100644 --- a/src/clientserver.h +++ b/src/clientserver.h @@ -102,7 +102,7 @@ with this program; if not, write to the Free Software Foundation, Inc., added to object properties */ -#define LATEST_PROTOCOL_VERSION 21 +#define LATEST_PROTOCOL_VERSION 22 // Server's supported network protocol range #define SERVER_PROTOCOL_VERSION_MIN 13 @@ -139,6 +139,12 @@ enum ToClientCommand TOCLIENT_BLOCKDATA = 0x20, //TODO: Multiple blocks TOCLIENT_ADDNODE = 0x21, + /* + u16 command + v3s16 position + serialized mapnode + u8 keep_metadata // Added in protocol version 22 + */ TOCLIENT_REMOVENODE = 0x22, TOCLIENT_PLAYERPOS = 0x23, // Obsolete diff --git a/src/environment.cpp b/src/environment.cpp index f019591df..e4567a78e 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -874,6 +874,11 @@ bool ServerEnvironment::removeNode(v3s16 p) return true; } +bool ServerEnvironment::swapNode(v3s16 p, const MapNode &n) +{ + return m_map->addNodeWithEvent(p, n, false); +} + std::set ServerEnvironment::getObjectsInsideRadius(v3f pos, float radius) { std::set objects; diff --git a/src/environment.h b/src/environment.h index 86654937d..9f9a0a23c 100644 --- a/src/environment.h +++ b/src/environment.h @@ -283,6 +283,7 @@ public: // Script-aware node setters bool setNode(v3s16 p, const MapNode &n); bool removeNode(v3s16 p); + bool swapNode(v3s16 p, const MapNode &n); // Find all active objects inside a radius around a point std::set getObjectsInsideRadius(v3f pos, float radius); diff --git a/src/map.cpp b/src/map.cpp index 0f9c82c3c..c85876a75 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -931,7 +931,8 @@ void Map::updateLighting(std::map & a_blocks, /* */ void Map::addNodeAndUpdate(v3s16 p, MapNode n, - std::map &modified_blocks) + std::map &modified_blocks, + bool remove_metadata) { INodeDefManager *ndef = m_gamedef->ndef(); @@ -1018,8 +1019,9 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n, /* Remove node metadata */ - - removeNodeMetadata(p); + if (remove_metadata) { + removeNodeMetadata(p); + } /* Set the node on the map @@ -1319,17 +1321,17 @@ void Map::removeNodeAndUpdate(v3s16 p, } } -bool Map::addNodeWithEvent(v3s16 p, MapNode n) +bool Map::addNodeWithEvent(v3s16 p, MapNode n, bool remove_metadata) { MapEditEvent event; - event.type = MEET_ADDNODE; + event.type = remove_metadata ? MEET_ADDNODE : MEET_SWAPNODE; event.p = p; event.n = n; bool succeeded = true; try{ std::map modified_blocks; - addNodeAndUpdate(p, n, modified_blocks); + addNodeAndUpdate(p, n, modified_blocks, remove_metadata); // Copy modified_blocks to event for(std::map::iterator diff --git a/src/map.h b/src/map.h index 8e55af437..8abea896e 100644 --- a/src/map.h +++ b/src/map.h @@ -61,6 +61,8 @@ enum MapEditEventType{ MEET_ADDNODE, // Node removed (changed to air) MEET_REMOVENODE, + // Node swapped (changed without metadata change) + MEET_SWAPNODE, // Node metadata of block changed (not knowing which node exactly) // p stores block coordinate MEET_BLOCK_NODE_METADATA_CHANGED, @@ -99,6 +101,8 @@ struct MapEditEvent return VoxelArea(p); case MEET_REMOVENODE: return VoxelArea(p); + case MEET_SWAPNODE: + return VoxelArea(p); case MEET_BLOCK_NODE_METADATA_CHANGED: { v3s16 np1 = p*MAP_BLOCKSIZE; @@ -236,7 +240,8 @@ public: These handle lighting but not faces. */ void addNodeAndUpdate(v3s16 p, MapNode n, - std::map &modified_blocks); + std::map &modified_blocks, + bool remove_metadata = true); void removeNodeAndUpdate(v3s16 p, std::map &modified_blocks); @@ -245,7 +250,7 @@ public: These emit events. Return true if succeeded, false if not. */ - bool addNodeWithEvent(v3s16 p, MapNode n); + bool addNodeWithEvent(v3s16 p, MapNode n, bool remove_metadata = true); bool removeNodeWithEvent(v3s16 p); /* diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 76e8c6907..a33882bdf 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -120,6 +120,22 @@ int ModApiEnvMod::l_remove_node(lua_State *L) return 1; } +// minetest.swap_node(pos, node) +// pos = {x=num, y=num, z=num} +int ModApiEnvMod::l_swap_node(lua_State *L) +{ + GET_ENV_PTR; + + INodeDefManager *ndef = env->getGameDef()->ndef(); + // parameters + v3s16 pos = read_v3s16(L, 1); + MapNode n = readnode(L, 2, ndef); + // Do it + bool succeeded = env->swapNode(pos, n); + lua_pushboolean(L, succeeded); + return 1; +} + // minetest.get_node(pos) // pos = {x=num, y=num, z=num} int ModApiEnvMod::l_get_node(lua_State *L) @@ -798,6 +814,7 @@ void ModApiEnvMod::Initialize(lua_State *L, int top) { API_FCT(set_node); API_FCT(add_node); + API_FCT(swap_node); API_FCT(add_item); API_FCT(remove_node); API_FCT(get_node); diff --git a/src/script/lua_api/l_env.h b/src/script/lua_api/l_env.h index 814d12165..126349c6e 100644 --- a/src/script/lua_api/l_env.h +++ b/src/script/lua_api/l_env.h @@ -34,6 +34,10 @@ private: // minetest.remove_node(pos) // pos = {x=num, y=num, z=num} static int l_remove_node(lua_State *L); + + // minetest.swap_node(pos, node) + // pos = {x=num, y=num, z=num} + static int l_swap_node(lua_State *L); // minetest.get_node(pos) // pos = {x=num, y=num, z=num} diff --git a/src/server.cpp b/src/server.cpp index c29ec3d83..f0de54f66 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1582,16 +1582,16 @@ void Server::AsyncRunStep() // for them. std::list far_players; - if(event->type == MEET_ADDNODE) + if(event->type == MEET_ADDNODE || event->type == MEET_SWAPNODE) { //infostream<<"Server: MEET_ADDNODE"<p, event->n, event->already_known_by_peer, - &far_players, 5); + &far_players, 5, event->type == MEET_ADDNODE); else sendAddNode(event->p, event->n, event->already_known_by_peer, - &far_players, 30); + &far_players, 30, event->type == MEET_ADDNODE); } else if(event->type == MEET_REMOVENODE) { @@ -4070,7 +4070,8 @@ void Server::sendRemoveNode(v3s16 p, u16 ignore_id, } void Server::sendAddNode(v3s16 p, MapNode n, u16 ignore_id, - std::list *far_players, float far_d_nodes) + std::list *far_players, float far_d_nodes, + bool remove_metadata) { float maxd = far_d_nodes*BS; v3f p_f = intToFloat(p, BS); @@ -4106,13 +4107,23 @@ void Server::sendAddNode(v3s16 p, MapNode n, u16 ignore_id, } // Create packet - u32 replysize = 8 + MapNode::serializedLength(client->serialization_version); + u32 replysize = 9 + MapNode::serializedLength(client->serialization_version); SharedBuffer reply(replysize); writeU16(&reply[0], TOCLIENT_ADDNODE); writeS16(&reply[2], p.X); writeS16(&reply[4], p.Y); writeS16(&reply[6], p.Z); n.serialize(&reply[8], client->serialization_version); + u32 index = 8 + MapNode::serializedLength(client->serialization_version); + writeU8(&reply[index], remove_metadata ? 0 : 1); + + if (!remove_metadata) { + if (client->net_proto_version <= 21) { + // Old clients always clear metadata; fix it + // by sending the full block again. + client->SetBlockNotSent(p); + } + } // Send as reliable m_con.Send(client->peer_id, 0, reply, true); diff --git a/src/server.h b/src/server.h index b52ae02dc..87a603533 100644 --- a/src/server.h +++ b/src/server.h @@ -556,7 +556,8 @@ private: void sendRemoveNode(v3s16 p, u16 ignore_id=0, std::list *far_players=NULL, float far_d_nodes=100); void sendAddNode(v3s16 p, MapNode n, u16 ignore_id=0, - std::list *far_players=NULL, float far_d_nodes=100); + std::list *far_players=NULL, float far_d_nodes=100, + bool remove_metadata=true); void setBlockNotSent(v3s16 p); // Environment and Connection must be locked when called From 06baf05c641355ead97e9428c4455af9e8b11cef Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 30 Nov 2013 18:57:56 +0100 Subject: [PATCH 141/198] Add documentation for minetest.swap_node --- doc/lua_api.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 7fa8870aa..6c06d558f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1254,6 +1254,8 @@ Environment access: minetest.set_node(pos, node) minetest.add_node(pos, node): alias set_node(pos, node) ^ Set node at position (node = {name="foo", param1=0, param2=0}) +minetest.swap_node(pos, node) +^ Set node at position, but don't remove metadata minetest.remove_node(pos) ^ Equivalent to set_node(pos, "air") minetest.get_node(pos) From 4594ba652293e776ccba2184c16502a346f4147a Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sat, 30 Nov 2013 12:11:07 -0500 Subject: [PATCH 142/198] Optimize table creation --- src/script/common/c_content.cpp | 23 +++--------- src/script/lua_api/l_craft.cpp | 59 ++++++++++++------------------- src/script/lua_api/l_env.cpp | 45 ++++++++--------------- src/script/lua_api/l_rollback.cpp | 3 +- src/script/lua_api/l_server.cpp | 32 +++++------------ 5 files changed, 50 insertions(+), 112 deletions(-) diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 65239ff1f..fd98e9480 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -871,26 +871,13 @@ void read_groups(lua_State *L, int index, /******************************************************************************/ void push_items(lua_State *L, const std::vector &items) { - lua_pushcfunction(L, script_error_handler); - int errorhandler = lua_gettop(L); - // Get the table insert function - lua_getglobal(L, "table"); - lua_getfield(L, -1, "insert"); - int table_insert = lua_gettop(L); // Create and fill table - lua_newtable(L); - int table = lua_gettop(L); - for(u32 i=0; i::const_iterator iter = items.begin(); + for (u32 i = 0; iter != items.end(); iter++) { + LuaItemStack::create(L, *iter); + lua_rawseti(L, -2, ++i); } - lua_remove(L, -2); // Remove insert - lua_remove(L, -2); // Remove table - lua_remove(L, -2); // Remove error handler } /******************************************************************************/ diff --git a/src/script/lua_api/l_craft.cpp b/src/script/lua_api/l_craft.cpp index c5732bad2..035abb78d 100644 --- a/src/script/lua_api/l_craft.cpp +++ b/src/script/lua_api/l_craft.cpp @@ -389,67 +389,52 @@ int ModApiCraft::l_get_all_craft_recipes(lua_State *L) ICraftDefManager *cdef = gdef->cdef(); CraftInput input; CraftOutput output(o_item,0); - std::vector recipes_list = cdef->getCraftRecipes(output, gdef); - if (recipes_list.empty()) - { + std::vector recipes_list; + recipes_list = cdef->getCraftRecipes(output, gdef); + if (recipes_list.empty()) { lua_pushnil(L); return 1; } - // Get the table insert function - lua_getglobal(L, "table"); - lua_getfield(L, -1, "insert"); - int table_insert = lua_gettop(L); - lua_newtable(L); - int table = lua_gettop(L); - for (std::vector::const_iterator - i = recipes_list.begin(); - i != recipes_list.end(); i++) - { + + lua_createtable(L, recipes_list.size(), 0); + std::vector::const_iterator iter = recipes_list.begin(); + for (u16 i = 0; iter != recipes_list.end(); iter++) { CraftOutput tmpout; tmpout.item = ""; tmpout.time = 0; - CraftDefinition *def = *i; - tmpout = def->getOutput(input, gdef); + tmpout = (*iter)->getOutput(input, gdef); std::string query = tmpout.item; char *fmtpos, *fmt = &query[0]; - if (strtok_r(fmt, " ", &fmtpos) == output.item) - { - input = def->getInput(output, gdef); - lua_pushvalue(L, table_insert); - lua_pushvalue(L, table); + if (strtok_r(fmt, " ", &fmtpos) == output.item) { + input = (*iter)->getInput(output, gdef); lua_newtable(L); - int k = 1; - lua_newtable(L); - for(std::vector::const_iterator - i = input.items.begin(); - i != input.items.end(); i++, k++) - { - if (i->empty()) + lua_newtable(L); // items + std::vector::const_iterator iter = input.items.begin(); + for (u16 j = 0; iter != input.items.end(); iter++) { + if (iter->empty()) continue; - lua_pushinteger(L,k); - lua_pushstring(L,i->name.c_str()); - lua_settable(L, -3); + lua_pushstring(L, iter->name.c_str()); + lua_rawseti(L, -2, ++j); } lua_setfield(L, -2, "items"); setintfield(L, -1, "width", input.width); switch (input.method) { case CRAFT_METHOD_NORMAL: - lua_pushstring(L,"normal"); + lua_pushstring(L, "normal"); break; case CRAFT_METHOD_COOKING: - lua_pushstring(L,"cooking"); + lua_pushstring(L, "cooking"); break; case CRAFT_METHOD_FUEL: - lua_pushstring(L,"fuel"); + lua_pushstring(L, "fuel"); break; default: - lua_pushstring(L,"unknown"); - } + lua_pushstring(L, "unknown"); + } lua_setfield(L, -2, "type"); lua_pushstring(L, &tmpout.item[0]); lua_setfield(L, -2, "output"); - if (lua_pcall(L, 2, 0, 0)) - script_error(L); + lua_rawseti(L, -2, ++i); } } return 1; diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index a33882bdf..4a8150396 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -448,28 +448,20 @@ int ModApiEnvMod::l_get_player_by_name(lua_State *L) // minetest.get_objects_inside_radius(pos, radius) int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L) { - // Get the table insert function - lua_getglobal(L, "table"); - lua_getfield(L, -1, "insert"); - int table_insert = lua_gettop(L); - GET_ENV_PTR; // Do it v3f pos = checkFloatPos(L, 1); float radius = luaL_checknumber(L, 2) * BS; std::set ids = env->getObjectsInsideRadius(pos, radius); - lua_newtable(L); - int table = lua_gettop(L); - for(std::set::const_iterator - i = ids.begin(); i != ids.end(); i++){ - ServerActiveObject *obj = env->getActiveObject(*i); + ScriptApiBase *script = getScriptApiBase(L); + lua_createtable(L, ids.size(), 0); + std::set::const_iterator iter = ids.begin(); + for(u32 i = 0; iter != ids.end(); iter++) { + ServerActiveObject *obj = env->getActiveObject(*iter); // Insert object reference into table - lua_pushvalue(L, table_insert); - lua_pushvalue(L, table); - getScriptApiBase(L)->objectrefGetOrCreate(obj); - if(lua_pcall(L, 2, 0, 0)) - script_error(L); + script->objectrefGetOrCreate(obj); + lua_rawseti(L, -2, ++i); } return 1; } @@ -579,25 +571,16 @@ int ModApiEnvMod::l_find_nodes_in_area(lua_State *L) ndef->getIds(lua_tostring(L, 3), filter); } - // Get the table insert function - lua_getglobal(L, "table"); - lua_getfield(L, -1, "insert"); - int table_insert = lua_gettop(L); - lua_newtable(L); - int table = lua_gettop(L); - for(s16 x=minp.X; x<=maxp.X; x++) - for(s16 y=minp.Y; y<=maxp.Y; y++) - for(s16 z=minp.Z; z<=maxp.Z; z++) - { - v3s16 p(x,y,z); + u64 i = 0; + for(s16 x = minp.X; x <= maxp.X; x++) + for(s16 y = minp.Y; y <= maxp.Y; y++) + for(s16 z = minp.Z; z <= maxp.Z; z++) { + v3s16 p(x, y, z); content_t c = env->getMap().getNodeNoEx(p).getContent(); - if(filter.count(c) != 0){ - lua_pushvalue(L, table_insert); - lua_pushvalue(L, table); + if(filter.count(c) != 0) { push_v3s16(L, p); - if(lua_pcall(L, 2, 0, 0)) - script_error(L); + lua_rawseti(L, -2, ++i); } } return 1; diff --git a/src/script/lua_api/l_rollback.cpp b/src/script/lua_api/l_rollback.cpp index e7185b00b..b3685c8d1 100644 --- a/src/script/lua_api/l_rollback.cpp +++ b/src/script/lua_api/l_rollback.cpp @@ -50,7 +50,6 @@ int ModApiRollback::l_rollback_get_node_actions(lua_State *L) lua_createtable(L, actions.size(), 0); for (unsigned int i = 1; iter != actions.end(); ++iter, ++i) { - lua_pushnumber(L, i); // Push index lua_createtable(L, 0, 5); // Make a table with enough space pre-allocated lua_pushstring(L, iter->actor.c_str()); @@ -68,7 +67,7 @@ int ModApiRollback::l_rollback_get_node_actions(lua_State *L) push_RollbackNode(L, iter->n_new); lua_setfield(L, -2, "newnode"); - lua_settable(L, -3); // Add action table to main table + lua_rawseti(L, -2, i); // Add action table to main table } return 1; diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 19e2f1bcb..9d3575a72 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -229,16 +229,13 @@ int ModApiServer::l_get_modnames(lua_State *L) // mods_sorted; not great performance but the number of mods on a // server will likely be small. for(std::list::iterator i = mods_unsorted.begin(); - i != mods_unsorted.end(); ++i) - { + i != mods_unsorted.end(); ++i) { bool added = false; for(std::list::iterator x = mods_sorted.begin(); - x != mods_sorted.end(); ++x) - { + x != mods_sorted.end(); ++x) { // I doubt anybody using Minetest will be using // anything not ASCII based :) - if((*i).compare(*x) <= 0) - { + if(i->compare(*x) <= 0) { mods_sorted.insert(x, *i); added = true; break; @@ -248,25 +245,12 @@ int ModApiServer::l_get_modnames(lua_State *L) mods_sorted.push_back(*i); } - // Get the table insertion function from Lua. - lua_getglobal(L, "table"); - lua_getfield(L, -1, "insert"); - int insertion_func = lua_gettop(L); - // Package them up for Lua - lua_newtable(L); - int new_table = lua_gettop(L); - std::list::iterator i = mods_sorted.begin(); - while(i != mods_sorted.end()) - { - lua_pushvalue(L, insertion_func); - lua_pushvalue(L, new_table); - lua_pushstring(L, (*i).c_str()); - if(lua_pcall(L, 2, 0, 0) != 0) - { - script_error(L); - } - ++i; + lua_createtable(L, mods_sorted.size(), 0); + std::list::iterator iter = mods_sorted.begin(); + for (u16 i = 0; iter != mods_sorted.end(); iter++) { + lua_pushstring(L, iter->c_str()); + lua_rawseti(L, -2, ++i); } return 1; } From 4696c59a5f3ad5884d57c7848207c39950f7052e Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sat, 30 Nov 2013 12:24:54 -0500 Subject: [PATCH 143/198] Add error handler to async step --- src/script/lua_api/l_async_events.cpp | 52 ++++++--------------------- 1 file changed, 11 insertions(+), 41 deletions(-) diff --git a/src/script/lua_api/l_async_events.cpp b/src/script/lua_api/l_async_events.cpp index 63ca87aed..8cd835688 100644 --- a/src/script/lua_api/l_async_events.cpp +++ b/src/script/lua_api/l_async_events.cpp @@ -29,36 +29,7 @@ int luaopen_marshal(lua_State *L); #include "log.h" #include "filesys.h" #include "porting.h" - -//TODO replace by ShadowNinja version not yet merged to master -static int script_error_handler(lua_State *L) { - lua_getfield(L, LUA_GLOBALSINDEX, "debug"); - if (!lua_istable(L, -1)) { - lua_pop(L, 1); - return 1; - } - lua_getfield(L, -1, "traceback"); - if (!lua_isfunction(L, -1)) { - lua_pop(L, 2); - return 1; - } - lua_pushvalue(L, 1); - lua_pushinteger(L, 2); - lua_call(L, 2, 1); - return 1; -} - -/******************************************************************************/ -static void scriptError(const char *fmt, ...) -{ - va_list argp; - va_start(argp, fmt); - char buf[10000]; - vsnprintf(buf, 10000, fmt, argp); - va_end(argp); - errorstream<<"ERROR: "< Date: Tue, 15 Oct 2013 22:17:06 -0700 Subject: [PATCH 144/198] Assume a selection box for fences Similar to assuming a selection box for the nodebox drawtype, minetest.register_item() now assumes a selection box for the fencelike drawtype. --- builtin/misc_register.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index bb2c62ab8..aa062d731 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -106,6 +106,11 @@ function minetest.register_item(name, itemdef) -- Use the nodebox as selection box if it's not set manually if itemdef.drawtype == "nodebox" and not itemdef.selection_box then itemdef.selection_box = itemdef.node_box + elseif itemdef.drawtype == "fencelike" and not itemdef.selection_box then + itemdef.selection_box = { + type = "fixed", + fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}, + } end setmetatable(itemdef, {__index = minetest.nodedef_default}) minetest.registered_nodes[itemdef.name] = itemdef From de0cdbc01cc39e4f89a9d012661031a66ba3294f Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 30 Nov 2013 21:22:15 +0100 Subject: [PATCH 145/198] Fix log threadname lookup handling not beeing threadsafe --- src/jthread/pthread/jmutex.cpp | 14 +++++--------- src/jthread/win32/jmutex.cpp | 19 ++++++++----------- src/log.cpp | 7 ++++++- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/jthread/pthread/jmutex.cpp b/src/jthread/pthread/jmutex.cpp index 29e0baac0..3dfad5e6c 100644 --- a/src/jthread/pthread/jmutex.cpp +++ b/src/jthread/pthread/jmutex.cpp @@ -29,7 +29,8 @@ JMutex::JMutex() { - initialized = false; + pthread_mutex_init(&mutex,NULL); + initialized = true; } JMutex::~JMutex() @@ -40,19 +41,14 @@ JMutex::~JMutex() int JMutex::Init() { - if (initialized) - return ERR_JMUTEX_ALREADYINIT; - - pthread_mutex_init(&mutex,NULL); - initialized = true; - return 0; + return 0; } int JMutex::Lock() { if (!initialized) return ERR_JMUTEX_NOTINIT; - + pthread_mutex_lock(&mutex); return 0; } @@ -61,7 +57,7 @@ int JMutex::Unlock() { if (!initialized) return ERR_JMUTEX_NOTINIT; - + pthread_mutex_unlock(&mutex); return 0; } diff --git a/src/jthread/win32/jmutex.cpp b/src/jthread/win32/jmutex.cpp index d079d448d..8a31495cd 100644 --- a/src/jthread/win32/jmutex.cpp +++ b/src/jthread/win32/jmutex.cpp @@ -29,7 +29,14 @@ JMutex::JMutex() { - initialized = false; +#ifdef JMUTEX_CRITICALSECTION + InitializeCriticalSection(&mutex); +#else + mutex = CreateMutex(NULL,FALSE,NULL); + if (mutex == NULL) + return ERR_JMUTEX_CANTCREATEMUTEX; +#endif // JMUTEX_CRITICALSECTION + initialized = true; } JMutex::~JMutex() @@ -44,16 +51,6 @@ JMutex::~JMutex() int JMutex::Init() { - if (initialized) - return ERR_JMUTEX_ALREADYINIT; -#ifdef JMUTEX_CRITICALSECTION - InitializeCriticalSection(&mutex); -#else - mutex = CreateMutex(NULL,FALSE,NULL); - if (mutex == NULL) - return ERR_JMUTEX_CANTCREATEMUTEX; -#endif // JMUTEX_CRITICALSECTION - initialized = true; return 0; } diff --git a/src/log.cpp b/src/log.cpp index 366d83b64..527f54480 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., std::list log_outputs[LMT_NUM_VALUES]; std::map log_threadnames; +JMutex log_threadnamemutex; void log_add_output(ILogOutput *out, enum LogMessageLevel lev) { @@ -60,13 +61,17 @@ void log_remove_output(ILogOutput *out) void log_register_thread(const std::string &name) { threadid_t id = get_current_thread_id(); + log_threadnamemutex.Lock(); log_threadnames[id] = name; + log_threadnamemutex.Unlock(); } void log_deregister_thread() { threadid_t id = get_current_thread_id(); + log_threadnamemutex.Lock(); log_threadnames.erase(id); + log_threadnamemutex.Unlock(); } static std::string get_lev_string(enum LogMessageLevel lev) @@ -144,7 +149,7 @@ public: } m_buf += c; } - + private: enum LogMessageLevel m_lev; std::string m_buf; From 20e3d550fa3ec42a065f7c776a2f9be9bc364503 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 1 Dec 2013 01:23:39 -0500 Subject: [PATCH 146/198] Decoration: Add schematic Y-slice probability support --- doc/lua_api.txt | 5 +- src/mapgen.cpp | 117 +++++++++++++++++++++----------- src/mapgen.h | 8 ++- src/script/lua_api/l_mapgen.cpp | 25 +++++-- 4 files changed, 108 insertions(+), 47 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 6c06d558f..f3240dd40 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1491,7 +1491,7 @@ minetest.delete_particlespawner(id, player) ^ otherwise on all clients Schematics: -minetest.create_schematic(p1, p2, probability_list, filename) +minetest.create_schematic(p1, p2, probability_list, filename, slice_prob_list) ^ Create a schematic from the volume of map specified by the box formed by p1 and p2. ^ Apply the specified probability values to the specified nodes in probability_list. ^ probability_list is an array of tables containing two fields, pos and prob. @@ -1500,6 +1500,9 @@ minetest.create_schematic(p1, p2, probability_list, filename) ^ If there are two or more entries with the same pos value, the last occuring in the array is used. ^ If pos is not inside the box formed by p1 and p2, it is ignored. ^ If probability_list is nil, no probabilities are applied. + ^ Slice probability works in the same manner, except takes a field called ypos instead which indicates + ^ the y position of the slice with a probability applied. + ^ If slice probability list is nil, no slice probabilities are applied. ^ Saves schematic in the Minetest Schematic format to filename. minetest.place_schematic(pos, schematic, rotation, replacements) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index f63118491..2be0c1dd2 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -482,16 +482,18 @@ std::string DecoSimple::getName() { DecoSchematic::DecoSchematic() { - node_names = NULL; - schematic = NULL; - flags = 0; - size = v3s16(0, 0, 0); + node_names = NULL; + schematic = NULL; + slice_probs = NULL; + flags = 0; + size = v3s16(0, 0, 0); } DecoSchematic::~DecoSchematic() { delete node_names; delete []schematic; + delete []slice_probs; } @@ -599,37 +601,44 @@ void DecoSchematic::blitToVManip(v3s16 p, ManualMapVoxelManipulator *vm, i_step_x = xstride; i_step_z = zstride; } - - for (s16 z = 0; z != sz; z++) - for (s16 y = 0; y != sy; y++) { - u32 i = z * i_step_z + y * ystride + i_start; - for (s16 x = 0; x != sx; x++, i += i_step_x) { - u32 vi = vm->m_area.index(p.X + x, p.Y + y, p.Z + z); - if (!vm->m_area.contains(vi)) - continue; - - if (schematic[i].getContent() == CONTENT_IGNORE) - continue; - - if (schematic[i].param1 == MTSCHEM_PROB_NEVER) - continue; - if (!force_placement) { - content_t c = vm->m_data[vi].getContent(); - if (c != CONTENT_AIR && c != CONTENT_IGNORE) + s16 y_map = p.Y; + for (s16 y = 0; y != sy; y++) { + if (slice_probs[y] != MTSCHEM_PROB_ALWAYS && + myrand_range(1, 255) > slice_probs[y]) + continue; + + for (s16 z = 0; z != sz; z++) { + u32 i = z * i_step_z + y * ystride + i_start; + for (s16 x = 0; x != sx; x++, i += i_step_x) { + u32 vi = vm->m_area.index(p.X + x, y_map, p.Z + z); + if (!vm->m_area.contains(vi)) continue; + + if (schematic[i].getContent() == CONTENT_IGNORE) + continue; + + if (schematic[i].param1 == MTSCHEM_PROB_NEVER) + continue; + + if (!force_placement) { + content_t c = vm->m_data[vi].getContent(); + if (c != CONTENT_AIR && c != CONTENT_IGNORE) + continue; + } + + if (schematic[i].param1 != MTSCHEM_PROB_ALWAYS && + myrand_range(1, 255) > schematic[i].param1) + continue; + + vm->m_data[vi] = schematic[i]; + vm->m_data[vi].param1 = 0; + + if (rot) + vm->m_data[vi].rotateAlongYAxis(ndef, rot); } - - if (schematic[i].param1 != MTSCHEM_PROB_ALWAYS && - myrand_range(1, 255) > schematic[i].param1) - continue; - - vm->m_data[vi] = schematic[i]; - vm->m_data[vi].param1 = 0; - - if (rot) - vm->m_data[vi].rotateAlongYAxis(ndef, rot); } + y_map++; } } @@ -690,13 +699,24 @@ bool DecoSchematic::loadSchematicFile() { } u16 version = readU16(is); - if (version > 2) { + if (version > MTSCHEM_FILE_VER_HIGHEST_READ) { errorstream << "loadSchematicFile: unsupported schematic " "file version" << std::endl; return false; } size = readV3S16(is); + + delete []slice_probs; + slice_probs = new u8[size.Y]; + if (version >= 3) { + for (int y = 0; y != size.Y; y++) + slice_probs[y] = readU8(is); + } else { + for (int y = 0; y != size.Y; y++) + slice_probs[y] = MTSCHEM_PROB_ALWAYS; + } + int nodecount = size.X * size.Y * size.Z; u16 nidmapcount = readU16(is); @@ -712,7 +732,7 @@ bool DecoSchematic::loadSchematicFile() { node_names->push_back(name); } - delete schematic; + delete []schematic; schematic = new MapNode[nodecount]; MapNode::deSerializeBulk(is, SER_FMT_VER_HIGHEST_READ, schematic, nodecount, 2, 2, true); @@ -735,10 +755,12 @@ bool DecoSchematic::loadSchematicFile() { All values are stored in big-endian byte order. [u32] signature: 'MTSM' - [u16] version: 2 + [u16] version: 3 [u16] size X [u16] size Y [u16] size Z + For each Y: + [u8] slice probability value [Name-ID table] Name ID Mapping Table [u16] name-id count For each name-id mapping: @@ -760,10 +782,13 @@ bool DecoSchematic::loadSchematicFile() { void DecoSchematic::saveSchematicFile(INodeDefManager *ndef) { std::ostringstream ss(std::ios_base::binary); - writeU32(ss, MTSCHEM_FILE_SIGNATURE); // signature - writeU16(ss, 2); // version - writeV3S16(ss, size); // schematic size - + writeU32(ss, MTSCHEM_FILE_SIGNATURE); // signature + writeU16(ss, MTSCHEM_FILE_VER_HIGHEST_WRITE); // version + writeV3S16(ss, size); // schematic size + + for (int y = 0; y != size.Y; y++) // Y slice probabilities + writeU8(ss, slice_probs[y]); + std::vector usednodes; int nodecount = size.X * size.Y * size.Z; build_nnlist_and_update_ids(schematic, nodecount, &usednodes); @@ -813,6 +838,11 @@ bool DecoSchematic::getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2) { vm->initialEmerge(bp1, bp2); size = p2 - p1 + 1; + + slice_probs = new u8[size.Y]; + for (s16 y = 0; y != size.Y; y++) + slice_probs[y] = MTSCHEM_PROB_ALWAYS; + schematic = new MapNode[size.X * size.Y * size.Z]; u32 i = 0; @@ -830,8 +860,10 @@ bool DecoSchematic::getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2) { } -void DecoSchematic::applyProbabilities(std::vector > *plist, - v3s16 p0) { +void DecoSchematic::applyProbabilities(v3s16 p0, + std::vector > *plist, + std::vector > *splist) { + for (size_t i = 0; i != plist->size(); i++) { v3s16 p = (*plist)[i].first - p0; int index = p.Z * (size.Y * size.X) + p.Y * size.X + p.X; @@ -844,6 +876,11 @@ void DecoSchematic::applyProbabilities(std::vector > *plist schematic[index].setContent(CONTENT_AIR); } } + + for (size_t i = 0; i != splist->size(); i++) { + s16 y = (*splist)[i].first - p0.Y; + slice_probs[y] = (*splist)[i].second; + } } diff --git a/src/mapgen.h b/src/mapgen.h index 040320f27..46261a202 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -256,6 +256,9 @@ public: }; #define MTSCHEM_FILE_SIGNATURE 0x4d54534d // 'MTSM' +#define MTSCHEM_FILE_VER_HIGHEST_READ 3 +#define MTSCHEM_FILE_VER_HIGHEST_WRITE 3 + #define MTSCHEM_PROB_NEVER 0x00 #define MTSCHEM_PROB_ALWAYS 0xFF @@ -271,6 +274,7 @@ public: Rotation rotation; v3s16 size; MapNode *schematic; + u8 *slice_probs; DecoSchematic(); ~DecoSchematic(); @@ -288,7 +292,9 @@ public: bool getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2); void placeStructure(Map *map, v3s16 p); - void applyProbabilities(std::vector > *plist, v3s16 p0); + void applyProbabilities(v3s16 p0, + std::vector > *plist, + std::vector > *splist); }; void build_nnlist_and_update_ids(MapNode *nodes, u32 nodecount, diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index b0ad202be..de9b5aba7 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -475,7 +475,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L) v3s16 p2 = read_v3s16(L, 2); sortBoxVerticies(p1, p2); - std::vector > probability_list; + std::vector > prob_list; if (lua_istable(L, 3)) { lua_pushnil(L); while (lua_next(L, 3)) { @@ -485,22 +485,37 @@ int ModApiMapgen::l_create_schematic(lua_State *L) lua_pop(L, 1); u8 prob = getintfield_default(L, -1, "prob", MTSCHEM_PROB_ALWAYS); - probability_list.push_back(std::make_pair(pos, prob)); + prob_list.push_back(std::make_pair(pos, prob)); } lua_pop(L, 1); } } - dschem.filename = std::string(lua_tostring(L, 4)); + std::vector > slice_prob_list; + if (lua_istable(L, 5)) { + lua_pushnil(L); + while (lua_next(L, 5)) { + if (lua_istable(L, -1)) { + s16 ypos = getintfield_default(L, -1, "ypos", 0); + u8 prob = getintfield_default(L, -1, "prob", MTSCHEM_PROB_ALWAYS); + slice_prob_list.push_back(std::make_pair(ypos, prob)); + } + + lua_pop(L, 1); + } + } + + const char *s = lua_tostring(L, 4); + dschem.filename = std::string(s ? s : ""); if (!dschem.getSchematicFromMap(map, p1, p2)) { errorstream << "create_schematic: failed to get schematic " "from map" << std::endl; return 0; } - - dschem.applyProbabilities(&probability_list, p1); + + dschem.applyProbabilities(p1, &prob_list, &slice_prob_list); dschem.saveSchematicFile(ndef); actionstream << "create_schematic: saved schematic file '" From f3439c40d85967c4f66eeefbc325f9ebf94d75e1 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 1 Dec 2013 08:57:35 -0500 Subject: [PATCH 147/198] Cavegen: Fix possible out-of-bounds heightmap access --- src/cavegen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cavegen.cpp b/src/cavegen.cpp index 71f005d5b..f04c02db9 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -518,7 +518,8 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) { v3s16 p(cp.X + x0, cp.Y + y0, cp.Z + z0); p += of; - if (!is_ravine && mg->heightmap && should_make_cave_hole) { + if (!is_ravine && mg->heightmap && should_make_cave_hole && + p.X <= node_max.X && p.Z <= node_max.Z) { int maplen = node_max.X - node_min.X + 1; int idx = (p.Z - node_min.Z) * maplen + (p.X - node_min.X); if (p.Y >= mg->heightmap[idx] - 2) From 04e9a9d5410a151d232a577b46791d2edffba527 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 1 Dec 2013 01:52:06 +0100 Subject: [PATCH 148/198] Cleanup jthread and fix win32 build --- src/ban.cpp | 1 - src/client.cpp | 13 +++---- src/clientmap.cpp | 3 -- src/debug.cpp | 1 - src/emerge.cpp | 14 +++---- src/jthread/CMakeLists.txt | 2 + src/jthread/jevent.h | 52 ++++++++++++++++++++++++++ src/jthread/jmutex.h | 53 --------------------------- src/jthread/jthread.h | 1 - src/jthread/pthread/jevent.cpp | 44 ++++++++++++++++++++++ src/jthread/pthread/jmutex.cpp | 23 +++--------- src/jthread/pthread/jsemaphore.cpp | 11 +++--- src/jthread/pthread/jthread.cpp | 21 ----------- src/jthread/win32/jevent.cpp | 43 ++++++++++++++++++++++ src/jthread/win32/jmutex.cpp | 20 ++-------- src/jthread/win32/jthread.cpp | 20 ---------- src/main.cpp | 3 +- src/map.cpp | 18 ++++----- src/mapblock.cpp | 1 - src/profiler.h | 1 - src/quicktune.cpp | 1 - src/script/cpp_api/s_base.cpp | 2 - src/script/lua_api/l_async_events.cpp | 2 - src/server.cpp | 13 +++---- src/settings.h | 5 +-- src/shader.cpp | 2 - src/tile.cpp | 2 - src/util/container.h | 5 --- src/util/thread.h | 2 - 29 files changed, 185 insertions(+), 194 deletions(-) create mode 100644 src/jthread/jevent.h create mode 100644 src/jthread/pthread/jevent.cpp create mode 100644 src/jthread/win32/jevent.cpp diff --git a/src/ban.cpp b/src/ban.cpp index 50ba0dba1..8f543b235 100644 --- a/src/ban.cpp +++ b/src/ban.cpp @@ -31,7 +31,6 @@ BanManager::BanManager(const std::string &banfilepath): m_banfilepath(banfilepath), m_modified(false) { - m_mutex.Init(); try{ load(); } diff --git a/src/client.cpp b/src/client.cpp index a9a1f6dd9..8b80e3ecf 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -82,7 +82,6 @@ QueuedMeshUpdate::~QueuedMeshUpdate() MeshUpdateQueue::MeshUpdateQueue() { - m_mutex.Init(); } MeshUpdateQueue::~MeshUpdateQueue() @@ -474,7 +473,7 @@ void Client::step(float dtime) core::list deleted_blocks; - float delete_unused_sectors_timeout = + float delete_unused_sectors_timeout = g_settings->getFloat("client_delete_unused_sectors_timeout"); // Delete sector blocks @@ -1266,7 +1265,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) u32 index = 8 + MapNode::serializedLength(ser_version); if ((datasize >= index+1) && data[index]){ remove_metadata = false; - } + } addNode(p, n, remove_metadata); } @@ -2126,7 +2125,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) m_client_event_queue.push_back(event); } else if(command == TOCLIENT_HUDCHANGE) - { + { std::string sdata; v2f v2fdata; u32 intdata = 0; @@ -2155,7 +2154,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) m_client_event_queue.push_back(event); } else if(command == TOCLIENT_HUD_SET_FLAGS) - { + { std::string datastring((char *)&data[2], datasize - 2); std::istringstream is(datastring, std::ios_base::binary); @@ -2264,7 +2263,7 @@ void Client::sendNodemetaFields(v3s16 p, const std::string &formname, Send(0, data, true); } -void Client::sendInventoryFields(const std::string &formname, +void Client::sendInventoryFields(const std::string &formname, const std::map &fields) { std::ostringstream os(std::ios_base::binary); @@ -2468,7 +2467,7 @@ void Client::sendPlayerPos() writeV3S32(&data[2], position); writeV3S32(&data[2+12], speed); writeS32(&data[2+12+12], pitch); - writeS32(&data[2+12+12+4], yaw); + writeS32(&data[2+12+12+4], yaw); writeU32(&data[2+12+12+4+4], keyPressed); // Send as unreliable Send(0, data, false); diff --git a/src/clientmap.cpp b/src/clientmap.cpp index e0c41c762..df6c2822c 100644 --- a/src/clientmap.cpp +++ b/src/clientmap.cpp @@ -50,9 +50,6 @@ ClientMap::ClientMap( m_camera_direction(0,0,1), m_camera_fov(M_PI) { - m_camera_mutex.Init(); - assert(m_camera_mutex.IsInitialized()); - m_box = core::aabbox3d(-BS*1000000,-BS*1000000,-BS*1000000, BS*1000000,BS*1000000,BS*1000000); } diff --git a/src/debug.cpp b/src/debug.cpp index b5bf3f705..278902a08 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -206,7 +206,6 @@ JMutex g_debug_stacks_mutex; void debug_stacks_init() { - g_debug_stacks_mutex.Init(); } void debug_stacks_print_to(std::ostream &os) diff --git a/src/emerge.cpp b/src/emerge.cpp index 167473ecf..e66e9520b 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "server.h" #include #include +#include "jthread/jevent.h" #include "map.h" #include "environment.h" #include "util/container.h" @@ -106,7 +107,6 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info"); - queuemutex.Init(); int nthreads; if (g_settings->get("num_emerge_threads").empty()) { @@ -385,7 +385,7 @@ void EmergeManager::registerMapgen(std::string mgname, MapgenFactory *mgfactory) } -////////////////////////////// Emerge Thread ////////////////////////////////// +////////////////////////////// Emerge Thread ////////////////////////////////// bool EmergeThread::popBlockEmerge(v3s16 *pos, u8 *flags) { std::map::iterator iter; @@ -399,7 +399,7 @@ bool EmergeThread::popBlockEmerge(v3s16 *pos, u8 *flags) { *pos = p; iter = emerge->blocks_enqueued.find(p); - if (iter == emerge->blocks_enqueued.end()) + if (iter == emerge->blocks_enqueued.end()) return false; //uh oh, queue and map out of sync!! BlockEmergeData *bedata = iter->second; @@ -414,11 +414,11 @@ bool EmergeThread::popBlockEmerge(v3s16 *pos, u8 *flags) { } -bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b, +bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b, BlockMakeData *data, bool allow_gen) { v2s16 p2d(p.X, p.Z); //envlock: usually takes <=1ms, sometimes 90ms or ~400ms to acquire - JMutexAutoLock envlock(m_server->m_env_mutex); + JMutexAutoLock envlock(m_server->m_env_mutex); // Load sector if it isn't loaded if (map->getSectorNoGenerateNoEx(p2d) == NULL) @@ -496,7 +496,7 @@ void *EmergeThread::Thread() { { //envlock: usually 0ms, but can take either 30 or 400ms to acquire - JMutexAutoLock envlock(m_server->m_env_mutex); + JMutexAutoLock envlock(m_server->m_env_mutex); ScopeProfiler sp(g_profiler, "EmergeThread: after " "Mapgen::makeChunk (envlock)", SPT_AVG); @@ -513,7 +513,7 @@ void *EmergeThread::Thread() { // Ignore map edit events, they will not need to be sent // to anybody because the block hasn't been sent to anybody - MapEditEventAreaIgnorer + MapEditEventAreaIgnorer ign(&m_server->m_ignore_map_edit_events_area, VoxelArea(minp, maxp)); { // takes about 90ms with -O1 on an e3-1230v2 diff --git a/src/jthread/CMakeLists.txt b/src/jthread/CMakeLists.txt index 6c29671e6..a581a3b02 100644 --- a/src/jthread/CMakeLists.txt +++ b/src/jthread/CMakeLists.txt @@ -3,11 +3,13 @@ if( UNIX ) ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jmutex.cpp ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jthread.cpp ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jsemaphore.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jevent.cpp PARENT_SCOPE) else( UNIX ) set(JTHREAD_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/win32/jmutex.cpp ${CMAKE_CURRENT_SOURCE_DIR}/win32/jthread.cpp ${CMAKE_CURRENT_SOURCE_DIR}/win32/jsemaphore.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/win32/jevent.cpp PARENT_SCOPE) endif( UNIX ) diff --git a/src/jthread/jevent.h b/src/jthread/jevent.h new file mode 100644 index 000000000..d31d8e654 --- /dev/null +++ b/src/jthread/jevent.h @@ -0,0 +1,52 @@ +/* + + This file is a part of the JThread package, which contains some object- + oriented thread wrappers for different thread implementations. + + Copyright (c) 2000-2006 Jori Liesenborgs (jori.liesenborgs@gmail.com) + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef JEVENT_H_ +#define JEVENT_H_ + +#ifdef _WIN32 +#include +#else +#include +#endif + + +class Event { +#ifdef _WIN32 + HANDLE hEvent; +#else + sem_t sem; +#endif + +public: + Event(); + ~Event(); + void wait(); + void signal(); +}; + +#endif /* JEVENT_H_ */ diff --git a/src/jthread/jmutex.h b/src/jthread/jmutex.h index 8efdc7bc5..e57cd8a43 100644 --- a/src/jthread/jmutex.h +++ b/src/jthread/jmutex.h @@ -53,10 +53,8 @@ class JMutex public: JMutex(); ~JMutex(); - int Init(); int Lock(); int Unlock(); - bool IsInitialized() { return initialized; } private: #if (defined(WIN32) || defined(_WIN32_WCE)) @@ -76,57 +74,6 @@ private: return false; } #endif // WIN32 - bool initialized; }; -#ifdef _WIN32 - -class Event { - HANDLE hEvent; - -public: - Event() { - hEvent = CreateEvent(NULL, 0, 0, NULL); - } - - ~Event() { - CloseHandle(hEvent); - } - - void wait() { - WaitForSingleObject(hEvent, INFINITE); - } - - void signal() { - SetEvent(hEvent); - } -}; - -#else - -#include - -class Event { - sem_t sem; - -public: - Event() { - sem_init(&sem, 0, 0); - } - - ~Event() { - sem_destroy(&sem); - } - - void wait() { - sem_wait(&sem); - } - - void signal() { - sem_post(&sem); - } -}; - -#endif - #endif // JMUTEX_H diff --git a/src/jthread/jthread.h b/src/jthread/jthread.h index 867701c75..798750ebb 100644 --- a/src/jthread/jthread.h +++ b/src/jthread/jthread.h @@ -74,7 +74,6 @@ private: JMutex runningmutex; JMutex continuemutex,continuemutex2; - bool mutexinit; }; #endif // JTHREAD_H diff --git a/src/jthread/pthread/jevent.cpp b/src/jthread/pthread/jevent.cpp new file mode 100644 index 000000000..738e74f83 --- /dev/null +++ b/src/jthread/pthread/jevent.cpp @@ -0,0 +1,44 @@ +/* + + This file is a part of the JThread package, which contains some object- + oriented thread wrappers for different thread implementations. + + Copyright (c) 2000-2006 Jori Liesenborgs (jori.liesenborgs@gmail.com) + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +*/ +#include +#include "jthread/jevent.h" + +Event::Event() { + assert(sem_init(&sem, 0, 0) == 0); +} + +Event::~Event() { + assert(sem_destroy(&sem) == 0); +} + +void Event::wait() { + assert(sem_wait(&sem) == 0); +} + +void Event::signal() { + assert(sem_post(&sem) == 0); +} diff --git a/src/jthread/pthread/jmutex.cpp b/src/jthread/pthread/jmutex.cpp index 3dfad5e6c..bcc3853d2 100644 --- a/src/jthread/pthread/jmutex.cpp +++ b/src/jthread/pthread/jmutex.cpp @@ -24,40 +24,27 @@ DEALINGS IN THE SOFTWARE. */ - +#include #include "jthread/jmutex.h" JMutex::JMutex() { - pthread_mutex_init(&mutex,NULL); - initialized = true; + assert(pthread_mutex_init(&mutex,NULL) == 0); } JMutex::~JMutex() { - if (initialized) - pthread_mutex_destroy(&mutex); -} - -int JMutex::Init() -{ - return 0; + assert(pthread_mutex_destroy(&mutex) == 0); } int JMutex::Lock() { - if (!initialized) - return ERR_JMUTEX_NOTINIT; - - pthread_mutex_lock(&mutex); + assert(pthread_mutex_lock(&mutex) == 0); return 0; } int JMutex::Unlock() { - if (!initialized) - return ERR_JMUTEX_NOTINIT; - - pthread_mutex_unlock(&mutex); + assert(pthread_mutex_unlock(&mutex) == 0); return 0; } diff --git a/src/jthread/pthread/jsemaphore.cpp b/src/jthread/pthread/jsemaphore.cpp index 963ac83cf..31bf39466 100644 --- a/src/jthread/pthread/jsemaphore.cpp +++ b/src/jthread/pthread/jsemaphore.cpp @@ -16,26 +16,27 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include "jthread/jsemaphore.h" JSemaphore::JSemaphore() { - sem_init(&m_semaphore,0,0); + assert(sem_init(&m_semaphore,0,0) == 0); } JSemaphore::~JSemaphore() { - sem_destroy(&m_semaphore); + assert(sem_destroy(&m_semaphore) == 0); } JSemaphore::JSemaphore(int initval) { - sem_init(&m_semaphore,0,initval); + assert(sem_init(&m_semaphore,0,initval) == 0); } void JSemaphore::Post() { - sem_post(&m_semaphore); + assert(sem_post(&m_semaphore) == 0); } void JSemaphore::Wait() { - sem_wait(&m_semaphore); + assert(sem_wait(&m_semaphore) == 0); } int JSemaphore::GetValue() { diff --git a/src/jthread/pthread/jthread.cpp b/src/jthread/pthread/jthread.cpp index c4d9162c8..e7bf17612 100644 --- a/src/jthread/pthread/jthread.cpp +++ b/src/jthread/pthread/jthread.cpp @@ -33,7 +33,6 @@ JThread::JThread() { retval = NULL; - mutexinit = false; requeststop = false; running = false; } @@ -53,26 +52,6 @@ int JThread::Start() { int status; - if (!mutexinit) - { - if (!runningmutex.IsInitialized()) - { - if (runningmutex.Init() < 0) - return ERR_JTHREAD_CANTINITMUTEX; - } - if (!continuemutex.IsInitialized()) - { - if (continuemutex.Init() < 0) - return ERR_JTHREAD_CANTINITMUTEX; - } - if (!continuemutex2.IsInitialized()) - { - if (continuemutex2.Init() < 0) - return ERR_JTHREAD_CANTINITMUTEX; - } - mutexinit = true; - } - runningmutex.Lock(); if (running) { diff --git a/src/jthread/win32/jevent.cpp b/src/jthread/win32/jevent.cpp new file mode 100644 index 000000000..67b468f01 --- /dev/null +++ b/src/jthread/win32/jevent.cpp @@ -0,0 +1,43 @@ +/* + + This file is a part of the JThread package, which contains some object- + oriented thread wrappers for different thread implementations. + + Copyright (c) 2000-2006 Jori Liesenborgs (jori.liesenborgs@gmail.com) + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +*/ +#include "jthread/jevent.h" + +Event::Event() { + hEvent = CreateEvent(NULL, 0, 0, NULL); +} + +Event::~Event() { + CloseHandle(hEvent); +} + +void Event::wait() { + WaitForSingleObject(hEvent, INFINITE); +} + +void Event::signal() { + SetEvent(hEvent); +} diff --git a/src/jthread/win32/jmutex.cpp b/src/jthread/win32/jmutex.cpp index 8a31495cd..b9f5e0e73 100644 --- a/src/jthread/win32/jmutex.cpp +++ b/src/jthread/win32/jmutex.cpp @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. */ - +#include #include "jthread/jmutex.h" JMutex::JMutex() @@ -33,31 +33,21 @@ JMutex::JMutex() InitializeCriticalSection(&mutex); #else mutex = CreateMutex(NULL,FALSE,NULL); - if (mutex == NULL) - return ERR_JMUTEX_CANTCREATEMUTEX; + assert(mutex != NULL); #endif // JMUTEX_CRITICALSECTION - initialized = true; } JMutex::~JMutex() { - if (initialized) #ifdef JMUTEX_CRITICALSECTION - DeleteCriticalSection(&mutex); + DeleteCriticalSection(&mutex); #else - CloseHandle(mutex); + CloseHandle(mutex); #endif // JMUTEX_CRITICALSECTION } -int JMutex::Init() -{ - return 0; -} - int JMutex::Lock() { - if (!initialized) - return ERR_JMUTEX_NOTINIT; #ifdef JMUTEX_CRITICALSECTION EnterCriticalSection(&mutex); #else @@ -68,8 +58,6 @@ int JMutex::Lock() int JMutex::Unlock() { - if (!initialized) - return ERR_JMUTEX_NOTINIT; #ifdef JMUTEX_CRITICALSECTION LeaveCriticalSection(&mutex); #else diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index fc1464064..3d897822e 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -34,7 +34,6 @@ JThread::JThread() { retval = NULL; - mutexinit = false; requeststop = false; running = false; } @@ -52,25 +51,6 @@ void JThread::Stop() { int JThread::Start() { - if (!mutexinit) - { - if (!runningmutex.IsInitialized()) - { - if (runningmutex.Init() < 0) - return ERR_JTHREAD_CANTINITMUTEX; - } - if (!continuemutex.IsInitialized()) - { - if (continuemutex.Init() < 0) - return ERR_JTHREAD_CANTINITMUTEX; - } - if (!continuemutex2.IsInitialized()) - { - if (continuemutex2.Init() < 0) - return ERR_JTHREAD_CANTINITMUTEX; - } mutexinit = true; - } - runningmutex.Lock(); if (running) { diff --git a/src/main.cpp b/src/main.cpp index 2833bdcf7..d5a121e79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,7 +86,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif #if USE_CURL -#include "curl.h" +#include "curl/curl.h" #endif /* @@ -708,7 +708,6 @@ void SpeedTests() TimeTaker timer("Testing mutex speed"); JMutex m; - m.Init(); u32 n = 0; u32 i = 0; do{ diff --git a/src/map.cpp b/src/map.cpp index c85876a75..4d32ecdfe 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -75,8 +75,6 @@ Map::Map(std::ostream &dout, IGameDef *gamedef): m_gamedef(gamedef), m_sector_cache(NULL) { - /*m_sector_mutex.Init(); - assert(m_sector_mutex.IsInitialized());*/ } Map::~Map() @@ -1681,7 +1679,7 @@ void Map::transformLiquidsFinite(std::map & modified_blocks) v3s16 p0 = m_transforming_liquid.pop_front(); u16 total_level = 0; // surrounding flowing liquid nodes - NodeNeighbor neighbors[7]; + NodeNeighbor neighbors[7]; // current level of every block s8 liquid_levels[7] = {-1, -1, -1, -1, -1, -1, -1}; // target levels @@ -1782,8 +1780,8 @@ void Map::transformLiquidsFinite(std::map & modified_blocks) liquid_levels[D_BOTTOM] == LIQUID_LEVEL_SOURCE && total_level >= LIQUID_LEVEL_SOURCE * can_liquid_same_level- (can_liquid_same_level - relax) && - can_liquid_same_level >= relax + 1) { - total_level = LIQUID_LEVEL_SOURCE * can_liquid_same_level; + can_liquid_same_level >= relax + 1) { + total_level = LIQUID_LEVEL_SOURCE * can_liquid_same_level; } // prevent lakes in air above unloaded blocks @@ -1792,9 +1790,9 @@ void Map::transformLiquidsFinite(std::map & modified_blocks) } // calculate self level 5 blocks - u8 want_level = + u8 want_level = total_level >= LIQUID_LEVEL_SOURCE * can_liquid_same_level - ? LIQUID_LEVEL_SOURCE + ? LIQUID_LEVEL_SOURCE : total_level / can_liquid_same_level; total_level -= want_level * can_liquid_same_level; @@ -1852,7 +1850,7 @@ void Map::transformLiquidsFinite(std::map & modified_blocks) /* if (total_level > 0) //|| flowed != volume) - infostream <<" AFTER level=" << (int)total_level + infostream <<" AFTER level=" << (int)total_level //<< " flowed="< unsatisfied_mods = modconf.getUnsatisfiedMods(); // complain about mods with unsatisfied dependencies - if(!modconf.isConsistent()) + if(!modconf.isConsistent()) { for(std::vector::iterator it = unsatisfied_mods.begin(); it != unsatisfied_mods.end(); ++it) @@ -741,10 +738,10 @@ Server::Server( worldmt_settings.readConfigFile(worldmt.c_str()); std::vector names = worldmt_settings.getNames(); std::set load_mod_names; - for(std::vector::iterator it = names.begin(); + for(std::vector::iterator it = names.begin(); it != names.end(); ++it) - { - std::string name = *it; + { + std::string name = *it; if(name.compare(0,9,"load_mod_")==0 && worldmt_settings.getBool(name)) load_mod_names.insert(name.substr(9)); } @@ -756,7 +753,7 @@ Server::Server( it != unsatisfied_mods.end(); ++it) load_mod_names.erase((*it).name); if(!load_mod_names.empty()) - { + { errorstream << "The following mods could not be found:"; for(std::set::iterator it = load_mod_names.begin(); it != load_mod_names.end(); ++it) diff --git a/src/settings.h b/src/settings.h index 4ee5b5913..e19f83e3f 100644 --- a/src/settings.h +++ b/src/settings.h @@ -60,7 +60,6 @@ class Settings public: Settings() { - m_mutex.Init(); } void writeLines(std::ostream &os) @@ -77,7 +76,7 @@ public: } } - // return all keys used + // return all keys used std::vector getNames(){ std::vector names; for(std::map::iterator @@ -86,7 +85,7 @@ public: { names.push_back(i->first); } - return names; + return names; } // remove a setting diff --git a/src/shader.cpp b/src/shader.cpp index 4bf10ce31..ec192b9a2 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -373,8 +373,6 @@ ShaderSource::ShaderSource(IrrlichtDevice *device): m_shader_callback = new ShaderCallback(this, "default"); - m_shaderinfo_cache_mutex.Init(); - m_main_thread = get_current_thread_id(); // Add a dummy ShaderInfo as the first index, named "" diff --git a/src/tile.cpp b/src/tile.cpp index 71c7290b7..e003c3020 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -433,8 +433,6 @@ TextureSource::TextureSource(IrrlichtDevice *device): { assert(m_device); - m_textureinfo_cache_mutex.Init(); - m_main_thread = get_current_thread_id(); // Add a NULL TextureInfo as the first index, named "" diff --git a/src/util/container.h b/src/util/container.h index 89daa3fbc..fdd76cc59 100644 --- a/src/util/container.h +++ b/src/util/container.h @@ -83,8 +83,6 @@ class MutexedMap public: MutexedMap() { - m_mutex.Init(); - assert(m_mutex.IsInitialized()); } void set(const Key &name, const Value &value) @@ -150,8 +148,6 @@ class MutexedIdGenerator public: MutexedIdGenerator() { - m_mutex.Init(); - assert(m_mutex.IsInitialized()); } // Returns true if found @@ -253,7 +249,6 @@ class MutexedQueue public: MutexedQueue() { - m_mutex.Init(); } bool empty() { diff --git a/src/util/thread.h b/src/util/thread.h index 6258a09a1..3f5ef1199 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -32,7 +32,6 @@ public: MutexedVariable(T value): m_value(value) { - m_mutex.Init(); } T get() @@ -75,7 +74,6 @@ public: JThread(), run(true) { - run_mutex.Init(); } virtual ~SimpleThread() From 6fa3892a715ec3db24b16f0ff4bb9ac8ed855d6d Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sun, 1 Dec 2013 20:58:46 +0100 Subject: [PATCH 149/198] Fix MinGW build --- src/script/lua_api/l_async_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/lua_api/l_async_events.h b/src/script/lua_api/l_async_events.h index 3364bac6e..c33f3a962 100644 --- a/src/script/lua_api/l_async_events.h +++ b/src/script/lua_api/l_async_events.h @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include -#ifndef _MSC_VER +#ifndef _WIN32 #include #else #define _WINSOCKAPI_ From 6cbd1b8bf739e0d776ee508708b5076b491fb638 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 3 Dec 2013 19:48:43 +0400 Subject: [PATCH 150/198] Remove link to #, add unlimited_player_transfer_distance to announce --- src/serverlist.cpp | 1 + util/master/servers.jst | 2 +- util/master/style.css | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/serverlist.cpp b/src/serverlist.cpp index f9e3c6734..97a7b0bf7 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -226,6 +226,7 @@ void sendAnnounce(std::string action, const std::vector & clients_n server["rollback"] = g_settings->getBool("enable_rollback_recording"); server["liquid_finite"] = g_settings->getBool("liquid_finite"); server["mapgen"] = g_settings->get("mg_name"); + server["names"] = g_settings->getBool("unlimited_player_transfer_distance"); server["mods"] = Json::Value(Json::arrayValue); for(std::vector::iterator m = mods.begin(); m != mods.end(); m++) { server["mods"].append(m->name); diff --git a/util/master/servers.jst b/util/master/servers.jst index 3db07d05a..26cbd0434 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -69,5 +69,5 @@ {{~}}
{{? master.min_clients || master.limit}} - More... + More... {{?}} diff --git a/util/master/style.css b/util/master/style.css index 76a4f998d..13bcf2979 100644 --- a/util/master/style.css +++ b/util/master/style.css @@ -28,3 +28,8 @@ td:hover .mts_hover_list { text-decoration: underline; text-decoration-style: dashed; } + +.clickable { + text-decoration: underline; + cursor: pointer; +} \ No newline at end of file From 5004f31575c52b59e1fc654dfa08336a692afeee Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 2 Dec 2013 22:21:58 +0100 Subject: [PATCH 151/198] Fix broken async locking in release build --- src/jthread/jthread.h | 9 +++++++ src/jthread/pthread/jevent.cpp | 18 +++++++++++--- src/jthread/pthread/jmutex.cpp | 22 +++++++++++------ src/jthread/pthread/jsemaphore.cpp | 22 ++++++++++++----- src/jthread/pthread/jthread.cpp | 38 ++++++++++++++++++++++++++++- src/jthread/win32/jthread.cpp | 9 ++++++- src/script/lua_api/l_async_events.h | 26 +++----------------- 7 files changed, 102 insertions(+), 42 deletions(-) diff --git a/src/jthread/jthread.h b/src/jthread/jthread.h index 798750ebb..f7bce6f9a 100644 --- a/src/jthread/jthread.h +++ b/src/jthread/jthread.h @@ -50,6 +50,13 @@ public: bool StopRequested(); void *GetReturnValue(); bool IsSameThread(); + + /* + * Wait for thread to finish + * Note: this does not stop a thread you have to do this on your own + * WARNING: never ever call this on a thread not started or already killed! + */ + void Wait(); protected: void ThreadStarted(); private: @@ -67,6 +74,8 @@ private: static void *TheThread(void *param); pthread_t threadid; + + bool started; #endif // WIN32 void *retval; bool running; diff --git a/src/jthread/pthread/jevent.cpp b/src/jthread/pthread/jevent.cpp index 738e74f83..26a6fb05c 100644 --- a/src/jthread/pthread/jevent.cpp +++ b/src/jthread/pthread/jevent.cpp @@ -27,18 +27,28 @@ #include #include "jthread/jevent.h" +#define UNUSED(expr) do { (void)(expr); } while (0) + Event::Event() { - assert(sem_init(&sem, 0, 0) == 0); + int sem_init_retval = sem_init(&sem, 0, 0); + assert(sem_init_retval == 0); + UNUSED(sem_init_retval); } Event::~Event() { - assert(sem_destroy(&sem) == 0); + int sem_destroy_retval = sem_destroy(&sem); + assert(sem_destroy_retval == 0); + UNUSED(sem_destroy_retval); } void Event::wait() { - assert(sem_wait(&sem) == 0); + int sem_wait_retval = sem_wait(&sem); + assert(sem_wait_retval == 0); + UNUSED(sem_wait_retval); } void Event::signal() { - assert(sem_post(&sem) == 0); + int sem_post_retval = sem_post(&sem); + assert(sem_post_retval == 0); + UNUSED(sem_post_retval); } diff --git a/src/jthread/pthread/jmutex.cpp b/src/jthread/pthread/jmutex.cpp index bcc3853d2..0551b9728 100644 --- a/src/jthread/pthread/jmutex.cpp +++ b/src/jthread/pthread/jmutex.cpp @@ -26,25 +26,33 @@ */ #include #include "jthread/jmutex.h" - +#define UNUSED(expr) do { (void)(expr); } while (0) JMutex::JMutex() { - assert(pthread_mutex_init(&mutex,NULL) == 0); + int mutex_init_retval = pthread_mutex_init(&mutex,NULL); + assert( mutex_init_retval == 0 ); + UNUSED(mutex_init_retval); } JMutex::~JMutex() { - assert(pthread_mutex_destroy(&mutex) == 0); + int mutex_dextroy_retval = pthread_mutex_destroy(&mutex); + assert( mutex_dextroy_retval == 0 ); + UNUSED(mutex_dextroy_retval); } int JMutex::Lock() { - assert(pthread_mutex_lock(&mutex) == 0); - return 0; + int mutex_lock_retval = pthread_mutex_lock(&mutex); + assert( mutex_lock_retval == 0 ); + return mutex_lock_retval; + UNUSED(mutex_lock_retval); } int JMutex::Unlock() { - assert(pthread_mutex_unlock(&mutex) == 0); - return 0; + int mutex_unlock_retval = pthread_mutex_unlock(&mutex); + assert( mutex_unlock_retval == 0 ); + return mutex_unlock_retval; + UNUSED(mutex_unlock_retval); } diff --git a/src/jthread/pthread/jsemaphore.cpp b/src/jthread/pthread/jsemaphore.cpp index 31bf39466..962b582f1 100644 --- a/src/jthread/pthread/jsemaphore.cpp +++ b/src/jthread/pthread/jsemaphore.cpp @@ -18,25 +18,35 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include #include "jthread/jsemaphore.h" - +#define UNUSED(expr) do { (void)(expr); } while (0) JSemaphore::JSemaphore() { - assert(sem_init(&m_semaphore,0,0) == 0); + int sem_init_retval = sem_init(&m_semaphore,0,0); + assert(sem_init_retval == 0); + UNUSED(sem_init_retval); } JSemaphore::~JSemaphore() { - assert(sem_destroy(&m_semaphore) == 0); + int sem_destroy_retval = sem_destroy(&m_semaphore); + assert(sem_destroy_retval == 0); + UNUSED(sem_destroy_retval); } JSemaphore::JSemaphore(int initval) { - assert(sem_init(&m_semaphore,0,initval) == 0); + int sem_init_retval = sem_init(&m_semaphore,0,initval); + assert(sem_init_retval == 0); + UNUSED(sem_init_retval); } void JSemaphore::Post() { - assert(sem_post(&m_semaphore) == 0); + int sem_post_retval = sem_post(&m_semaphore); + assert(sem_post_retval == 0); + UNUSED(sem_post_retval); } void JSemaphore::Wait() { - assert(sem_wait(&m_semaphore) == 0); + int sem_wait_retval = sem_wait(&m_semaphore); + assert(sem_wait_retval == 0); + UNUSED(sem_wait_retval); } int JSemaphore::GetValue() { diff --git a/src/jthread/pthread/jthread.cpp b/src/jthread/pthread/jthread.cpp index e7bf17612..d818b19ed 100644 --- a/src/jthread/pthread/jthread.cpp +++ b/src/jthread/pthread/jthread.cpp @@ -26,15 +26,19 @@ */ #include "jthread/jthread.h" +#include #include #include #include +#define UNUSED(expr) do { (void)(expr); } while (0) + JThread::JThread() { retval = NULL; requeststop = false; running = false; + started = false; } JThread::~JThread() @@ -48,6 +52,20 @@ void JThread::Stop() { runningmutex.Unlock(); } +void JThread::Wait() { + void* status; + runningmutex.Lock(); + if (started) { + runningmutex.Unlock(); + int pthread_join_retval = pthread_join(threadid,&status); + assert(pthread_join_retval == 0); + UNUSED(pthread_join_retval); + runningmutex.Lock(); + started = false; + } + runningmutex.Unlock(); +} + int JThread::Start() { int status; @@ -63,7 +81,7 @@ int JThread::Start() pthread_attr_t attr; pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); + //pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); continuemutex.Lock(); status = pthread_create(&threadid,&attr,TheThread,this); @@ -89,6 +107,7 @@ int JThread::Start() runningmutex.Lock(); } + started = true; runningmutex.Unlock(); continuemutex.Unlock(); @@ -100,13 +119,30 @@ int JThread::Start() int JThread::Kill() { + void* status; runningmutex.Lock(); if (!running) { + if (started) { + runningmutex.Unlock(); + int pthread_join_retval = pthread_join(threadid,&status); + assert(pthread_join_retval == 0); + UNUSED(pthread_join_retval); + runningmutex.Lock(); + started = false; + } runningmutex.Unlock(); return ERR_JTHREAD_NOTRUNNING; } pthread_cancel(threadid); + if (started) { + runningmutex.Unlock(); + int pthread_join_retval = pthread_join(threadid,&status); + assert(pthread_join_retval == 0); + UNUSED(pthread_join_retval); + runningmutex.Lock(); + started = false; + } running = false; runningmutex.Unlock(); return 0; diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index 3d897822e..0781982e2 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -26,7 +26,8 @@ */ #include "jthread/jthread.h" - +#include +#define UNUSED(expr) do { (void)(expr); } while (0) #ifndef _WIN32_WCE #include #endif // _WIN32_WCE @@ -49,6 +50,12 @@ void JThread::Stop() { runningmutex.Unlock(); } +void JThread::Wait() { + int WaitForSingleObject_retval = WaitForSingleObject(threadhandle, INFINITE); + assert(WaitForSingleObject_retval == 0); + UNUSED(WaitForSingleObject_retval); +} + int JThread::Start() { runningmutex.Lock(); diff --git a/src/script/lua_api/l_async_events.h b/src/script/lua_api/l_async_events.h index c33f3a962..9d42b07cf 100644 --- a/src/script/lua_api/l_async_events.h +++ b/src/script/lua_api/l_async_events.h @@ -17,23 +17,12 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef C_ASYNC_EVENTS_H_ -#define C_ASYNC_EVENTS_H_ +#ifndef L_ASYNC_EVENTS_H_ +#define L_ASYNC_EVENTS_H_ #include #include -#ifndef _WIN32 -#include -#else -#define _WINSOCKAPI_ -#include -static unsigned sleep(unsigned seconds) { - Sleep(seconds * 1000); - return 0; -} -#endif - /******************************************************************************/ /* Includes */ /******************************************************************************/ @@ -93,15 +82,6 @@ public: return worker_thread_wrapper(this); } - /** - * wait for thread to stop - */ - void Wait() { - while(IsRunning()) { - sleep(1); - } - } - private: /** * helper function to run a lua script @@ -237,4 +217,4 @@ private: JSemaphore m_JobQueueCounter; }; -#endif /* C_ASYNC_EVENTS_H_ */ +#endif /* L_ASYNC_EVENTS_H_ */ From 1309e52198e04a50d322914fb4d5667e6760b3af Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 3 Dec 2013 20:13:33 +0400 Subject: [PATCH 152/198] Rename names -> can_see_far_names in announce --- src/serverlist.cpp | 2 +- util/master/servers.jst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 97a7b0bf7..7376bce99 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -226,7 +226,7 @@ void sendAnnounce(std::string action, const std::vector & clients_n server["rollback"] = g_settings->getBool("enable_rollback_recording"); server["liquid_finite"] = g_settings->getBool("liquid_finite"); server["mapgen"] = g_settings->get("mg_name"); - server["names"] = g_settings->getBool("unlimited_player_transfer_distance"); + server["can_see_far_names"] = g_settings->getBool("unlimited_player_transfer_distance"); server["mods"] = Json::Value(Json::arrayValue); for(std::vector::iterator m = mods.begin(); m != mods.end(); m++) { server["mods"].append(m->name); diff --git a/util/master/servers.jst b/util/master/servers.jst index 26cbd0434..48116133a 100644 --- a/util/master/servers.jst +++ b/util/master/servers.jst @@ -56,6 +56,7 @@ {{=server.pvp ? 'PvP ' : ''}} {{=server.password ? 'Pwd ' : ''}} {{=server.rollback ? 'Rol ' : ''}} + {{=server.can_see_far_names ? 'Far ' : ''}} {{?}} {{? !master.no_uptime}} From 60113bde74784f4a0125ffa005e9404fbd5cb5b1 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Tue, 3 Dec 2013 18:05:36 +0100 Subject: [PATCH 153/198] Dont move item back when not clicking on a slot --- src/guiFormSpecMenu.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 8ffddcbc6..920a7f1f2 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2462,12 +2462,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) move_amount = 0; } } - else if(getAbsoluteClippingRect().isPointInside(m_pointer)) - { - // Clicked somewhere else: deselect - m_selected_amount = 0; - } - else + else if (!getAbsoluteClippingRect().isPointInside(m_pointer)) { // Clicked outside of the window: drop if(button == 1) // right From 2330267d2207208799ad347ea0d129c0b4551d61 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Tue, 3 Dec 2013 17:21:40 +0100 Subject: [PATCH 154/198] Shaders rework. --- builtin/mainmenu.lua | 80 ++++++++++---- .../base.txt | 0 .../shaders/alpha_shader/opengl_fragment.glsl | 67 ++++++++++++ .../shaders/alpha_shader/opengl_vertex.glsl | 99 ++++++++++++++++++ .../bumpmaps_liquids/opengl_fragment.glsl | 46 -------- .../bumpmaps_liquids/opengl_vertex.glsl | 98 ----------------- .../bumpmaps_solids/opengl_fragment.glsl | 45 -------- .../bumpmaps_solids/opengl_vertex.glsl | 98 ----------------- .../base.txt | 0 .../leaves_shader/opengl_fragment.glsl | 54 ++++++++++ .../shaders/leaves_shader/opengl_vertex.glsl | 87 +++++++++++++++ .../base.txt | 0 .../liquids_shader/opengl_fragment.glsl | 53 ++++++++++ .../opengl_vertex.glsl | 37 ++++--- .../{test_shader_1 => plants_shader}/base.txt | 0 .../plants_shader/opengl_fragment.glsl | 53 ++++++++++ .../shaders/plants_shader/opengl_vertex.glsl | 87 +++++++++++++++ client/shaders/solids_shader/base.txt | 1 + .../solids_shader/opengl_fragment.glsl | 87 +++++++++++++++ .../shaders/solids_shader/opengl_vertex.glsl | 99 ++++++++++++++++++ .../test_shader_1/opengl_fragment.glsl | 25 ----- .../test_shader_2/opengl_fragment.glsl | 23 ---- .../shaders/test_shader_2/opengl_vertex.glsl | 51 --------- client/shaders/test_shader_3/base.txt | 1 - .../test_shader_3/opengl_fragment.glsl | 25 ----- .../shaders/test_shader_3/opengl_vertex.glsl | 51 --------- minetest.conf.example | 16 +++ src/defaultsettings.cpp | 9 ++ src/game.cpp | 57 +++++++++- src/itemdef.cpp | 11 +- src/mapblock_mesh.cpp | 65 ++++++------ src/nodedef.cpp | 13 ++- src/nodedef.h | 2 + src/script/common/c_content.cpp | 3 + src/tile.h | 18 +++- textures/base/pack/disable_img.png | Bin 0 -> 150 bytes textures/base/pack/enable_img.png | Bin 0 -> 160 bytes 37 files changed, 918 insertions(+), 543 deletions(-) rename client/shaders/{bumpmaps_liquids => alpha_shader}/base.txt (100%) create mode 100644 client/shaders/alpha_shader/opengl_fragment.glsl create mode 100644 client/shaders/alpha_shader/opengl_vertex.glsl delete mode 100644 client/shaders/bumpmaps_liquids/opengl_fragment.glsl delete mode 100644 client/shaders/bumpmaps_liquids/opengl_vertex.glsl delete mode 100644 client/shaders/bumpmaps_solids/opengl_fragment.glsl delete mode 100644 client/shaders/bumpmaps_solids/opengl_vertex.glsl rename client/shaders/{bumpmaps_solids => leaves_shader}/base.txt (100%) create mode 100644 client/shaders/leaves_shader/opengl_fragment.glsl create mode 100644 client/shaders/leaves_shader/opengl_vertex.glsl rename client/shaders/{test_shader_2 => liquids_shader}/base.txt (100%) create mode 100644 client/shaders/liquids_shader/opengl_fragment.glsl rename client/shaders/{test_shader_1 => liquids_shader}/opengl_vertex.glsl (53%) rename client/shaders/{test_shader_1 => plants_shader}/base.txt (100%) create mode 100644 client/shaders/plants_shader/opengl_fragment.glsl create mode 100644 client/shaders/plants_shader/opengl_vertex.glsl create mode 100644 client/shaders/solids_shader/base.txt create mode 100644 client/shaders/solids_shader/opengl_fragment.glsl create mode 100644 client/shaders/solids_shader/opengl_vertex.glsl delete mode 100644 client/shaders/test_shader_1/opengl_fragment.glsl delete mode 100644 client/shaders/test_shader_2/opengl_fragment.glsl delete mode 100644 client/shaders/test_shader_2/opengl_vertex.glsl delete mode 100644 client/shaders/test_shader_3/base.txt delete mode 100644 client/shaders/test_shader_3/opengl_fragment.glsl delete mode 100644 client/shaders/test_shader_3/opengl_vertex.glsl create mode 100644 textures/base/pack/disable_img.png create mode 100644 textures/base/pack/enable_img.png diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 6c0aaf252..9555146d4 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -687,7 +687,21 @@ function tabbuilder.handle_settings_buttons(fields) if fields["cb_finite_liquid"] then engine.setting_set("liquid_finite", fields["cb_finite_liquid"]) end - + if fields["cb_bumpmapping"] then + engine.setting_set("enable_bumpmapping", fields["cb_bumpmapping"]) + end + if fields["cb_parallax"] then + engine.setting_set("enable_parallax_occlusion", fields["cb_parallax"]) + end + if fields["cb_waving_water"] then + engine.setting_set("enable_waving_water", fields["cb_waving_water"]) + end + if fields["cb_waving_leaves"] then + engine.setting_set("enable_waving_leaves", fields["cb_waving_leaves"]) + end + if fields["cb_waving_plants"] then + engine.setting_set("enable_waving_plants", fields["cb_waving_plants"]) + end if fields["btn_change_keys"] ~= nil then engine.show_keys_menu() end @@ -923,35 +937,57 @@ end -------------------------------------------------------------------------------- function tabbuilder.tab_settings() - return "vertlabel[0,0;" .. fgettext("SETTINGS") .. "]" .. - "checkbox[1,0.75;cb_fancy_trees;".. fgettext("Fancy trees") .. ";" + tab_string = + "vertlabel[0,0;" .. fgettext("SETTINGS") .. "]" .. + "checkbox[1,0;cb_fancy_trees;".. fgettext("Fancy Trees") .. ";" .. dump(engine.setting_getbool("new_style_leaves")) .. "]".. - "checkbox[1,1.25;cb_smooth_lighting;".. fgettext("Smooth Lighting") + "checkbox[1,0.5;cb_smooth_lighting;".. fgettext("Smooth Lighting") .. ";".. dump(engine.setting_getbool("smooth_lighting")) .. "]".. - "checkbox[1,1.75;cb_3d_clouds;".. fgettext("3D Clouds") .. ";" + "checkbox[1,1;cb_3d_clouds;".. fgettext("3D Clouds") .. ";" .. dump(engine.setting_getbool("enable_3d_clouds")) .. "]".. - "checkbox[1,2.25;cb_opaque_water;".. fgettext("Opaque Water") .. ";" + "checkbox[1,1.5;cb_opaque_water;".. fgettext("Opaque Water") .. ";" .. dump(engine.setting_getbool("opaque_water")) .. "]".. - - "checkbox[4,0.75;cb_mipmapping;".. fgettext("Mip-Mapping") .. ";" - .. dump(engine.setting_getbool("mip_map")) .. "]".. - "checkbox[4,1.25;cb_anisotrophic;".. fgettext("Anisotropic Filtering") .. ";" - .. dump(engine.setting_getbool("anisotropic_filter")) .. "]".. - "checkbox[4,1.75;cb_bilinear;".. fgettext("Bi-Linear Filtering") .. ";" - .. dump(engine.setting_getbool("bilinear_filter")) .. "]".. - "checkbox[4,2.25;cb_trilinear;".. fgettext("Tri-Linear Filtering") .. ";" - .. dump(engine.setting_getbool("trilinear_filter")) .. "]".. - - "checkbox[7.5,0.75;cb_shaders;".. fgettext("Shaders") .. ";" - .. dump(engine.setting_getbool("enable_shaders")) .. "]".. - "checkbox[7.5,1.25;cb_pre_ivis;".. fgettext("Preload item visuals") .. ";" + "checkbox[1,2.0;cb_pre_ivis;".. fgettext("Preload item visuals") .. ";" .. dump(engine.setting_getbool("preload_item_visuals")) .. "]".. - "checkbox[7.5,1.75;cb_particles;".. fgettext("Enable Particles") .. ";" + "checkbox[1,2.5;cb_particles;".. fgettext("Enable Particles") .. ";" .. dump(engine.setting_getbool("enable_particles")) .. "]".. - "checkbox[7.5,2.25;cb_finite_liquid;".. fgettext("Finite Liquid") .. ";" + "checkbox[1,3.0;cb_finite_liquid;".. fgettext("Finite Liquid") .. ";" .. dump(engine.setting_getbool("liquid_finite")) .. "]".. - "button[1,4.25;2.25,0.5;btn_change_keys;".. fgettext("Change keys") .. "]" + "checkbox[4.5,0;cb_mipmapping;".. fgettext("Mip-Mapping") .. ";" + .. dump(engine.setting_getbool("mip_map")) .. "]".. + "checkbox[4.5,0.5;cb_anisotrophic;".. fgettext("Anisotropic Filtering") .. ";" + .. dump(engine.setting_getbool("anisotropic_filter")) .. "]".. + "checkbox[4.5,1.0;cb_bilinear;".. fgettext("Bi-Linear Filtering") .. ";" + .. dump(engine.setting_getbool("bilinear_filter")) .. "]".. + "checkbox[4.5,1.5;cb_trilinear;".. fgettext("Tri-Linear Filtering") .. ";" + .. dump(engine.setting_getbool("trilinear_filter")) .. "]".. + + "checkbox[8,0;cb_shaders;".. fgettext("Shaders") .. ";" + .. dump(engine.setting_getbool("enable_shaders")) .. "]".. + "button[1,4.5;2.25,0.5;btn_change_keys;".. fgettext("Change keys") .. "]" + +if engine.setting_getbool("enable_shaders") then + tab_string = tab_string .. + "checkbox[8,0.5;cb_bumpmapping;".. fgettext("Bumpmapping") .. ";" + .. dump(engine.setting_getbool("enable_bumpmapping")) .. "]".. + "checkbox[8,1.0;cb_parallax;".. fgettext("Parallax Occlusion") .. ";" + .. dump(engine.setting_getbool("enable_parallax_occlusion")) .. "]".. + "checkbox[8,1.5;cb_waving_water;".. fgettext("Waving Water") .. ";" + .. dump(engine.setting_getbool("enable_waving_water")) .. "]".. + "checkbox[8,2.0;cb_waving_leaves;".. fgettext("Waving Leaves") .. ";" + .. dump(engine.setting_getbool("enable_waving_leaves")) .. "]".. + "checkbox[8,2.5;cb_waving_plants;".. fgettext("Waving Plants") .. ";" + .. dump(engine.setting_getbool("enable_waving_plants")) .. "]" +else + tab_string = tab_string .. + "textlist[8.33,0.7;4,1;;#888888" .. fgettext("Bumpmapping") .. ";0;true]" .. + "textlist[8.33,1.2;4,1;;#888888" .. fgettext("Parallax Occlusion") .. ";0;true]" .. + "textlist[8.33,1.7;4,1;;#888888" .. fgettext("Waving Water") .. ";0;true]" .. + "textlist[8.33,2.2;4,1;;#888888" .. fgettext("Waving Leaves") .. ";0;true]" .. + "textlist[8.33,2.7;4,1;;#888888" .. fgettext("Waving Plants") .. ";0;true]" + end +return tab_string end -------------------------------------------------------------------------------- diff --git a/client/shaders/bumpmaps_liquids/base.txt b/client/shaders/alpha_shader/base.txt similarity index 100% rename from client/shaders/bumpmaps_liquids/base.txt rename to client/shaders/alpha_shader/base.txt diff --git a/client/shaders/alpha_shader/opengl_fragment.glsl b/client/shaders/alpha_shader/opengl_fragment.glsl new file mode 100644 index 000000000..e72c1b9a6 --- /dev/null +++ b/client/shaders/alpha_shader/opengl_fragment.glsl @@ -0,0 +1,67 @@ +#version 120 + +uniform sampler2D baseTexture; +uniform sampler2D normalTexture; +uniform sampler2D useNormalmap; + +uniform float enableBumpmapping; +uniform float enableParallaxOcclusion; +uniform float parallaxOcclusionScale; +uniform float parallaxOcclusionBias; + + +uniform vec4 skyBgColor; +uniform float fogDistance; + +varying vec3 vPosition; +varying vec3 tsEyeVec; +varying vec3 eyeVec; + +const float e = 2.718281828459; + +void main (void) +{ + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + + vec3 color; + vec2 uv = gl_TexCoord[0].st; + float height; + vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y); + + if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) { + float map_height = texture2D(normalTexture, uv).a; + if (map_height < 1.0){ + float height = parallaxOcclusionScale * map_height - parallaxOcclusionBias; + uv = uv + height * tsEye; + } + } + + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { + vec3 base = texture2D(baseTexture, uv).rgb; + vec3 vVec = normalize(eyeVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vVec); + float diffuse = max(dot(lVec, bump), 0.0); + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color = mix (base,diffuse*base,1.0) + 0.1 * specular * diffuse; + } else { + color = texture2D(baseTexture, uv).rgb; + } + + float alpha = texture2D(baseTexture, uv).a; + vec4 col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / e; + col.g = 1.0 - exp(1.0 - col.g) / e; + col.b = 1.0 - exp(1.0 - col.b) / e; + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + col = mix(col, skyBgColor, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/alpha_shader/opengl_vertex.glsl b/client/shaders/alpha_shader/opengl_vertex.glsl new file mode 100644 index 000000000..c26fdd3d5 --- /dev/null +++ b/client/shaders/alpha_shader/opengl_vertex.glsl @@ -0,0 +1,99 @@ +#version 120 + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; +varying vec3 tsEyeVec; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec3 normal,tangent,binormal; + normal = normalize(gl_NormalMatrix * gl_Normal); + + if (gl_Normal.x > 0.5) { + // 1.0, 0.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, -1.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } else if (gl_Normal.x < -0.5) { + // -1.0, 0.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } else if (gl_Normal.y > 0.5) { + // 0.0, 1.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); + } else if (gl_Normal.y < -0.5) { + // 0.0, -1.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); + } else if (gl_Normal.z > 0.5) { + // 0.0, 0.0, 1.0 + tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } else if (gl_Normal.z < -0.5) { + // 0.0, 0.0, -1.0 + tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } + + mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x, + tangent.y, binormal.y, normal.y, + tangent.z, binormal.z, normal.z); + + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; + tsEyeVec = normalize(eyeVec * tbnMatrix); + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 2.5; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = clamp(rg,0.0,1.0); + color.g = clamp(rg,0.0,1.0); + color.b = clamp(b,0.0,1.0); + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; + +} diff --git a/client/shaders/bumpmaps_liquids/opengl_fragment.glsl b/client/shaders/bumpmaps_liquids/opengl_fragment.glsl deleted file mode 100644 index bf6bbf043..000000000 --- a/client/shaders/bumpmaps_liquids/opengl_fragment.glsl +++ /dev/null @@ -1,46 +0,0 @@ - -uniform sampler2D myTexture; -uniform sampler2D normalTexture; - -uniform vec4 skyBgColor; -uniform float fogDistance; - -varying vec3 vPosition; - -varying vec3 viewVec; - -void main (void) -{ - vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); - float alpha = col.a; - vec2 uv = gl_TexCoord[0].st; - vec4 base = texture2D(myTexture, uv); - vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base; - vec3 vVec = normalize(viewVec); - vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); - vec3 R = reflect(-vVec, bump); - vec3 lVec = normalize(vec3(0.0, -0.4, 0.5)); - float diffuse = max(dot(lVec, bump), 0.0); - - vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb; - - - float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); - color += vec3(0.2*specular*diffuse); - - - col = vec4(color.r, color.g, color.b, alpha); - col *= gl_Color; - col = col * col; // SRGB -> Linear - col *= 1.8; - col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); - col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); - col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); - col = sqrt(col); // Linear -> SRGB - if(fogDistance != 0.0){ - float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); - alpha = mix(alpha, 0.0, d); - } - - gl_FragColor = vec4(col.r, col.g, col.b, alpha); -} diff --git a/client/shaders/bumpmaps_liquids/opengl_vertex.glsl b/client/shaders/bumpmaps_liquids/opengl_vertex.glsl deleted file mode 100644 index 99c208bdd..000000000 --- a/client/shaders/bumpmaps_liquids/opengl_vertex.glsl +++ /dev/null @@ -1,98 +0,0 @@ - -uniform mat4 mWorldViewProj; -uniform mat4 mInvWorld; -uniform mat4 mTransWorld; -uniform float dayNightRatio; - -varying vec3 vPosition; -varying vec3 viewVec; - -void main(void) -{ - gl_Position = mWorldViewProj * gl_Vertex; - - vPosition = (mWorldViewProj * gl_Vertex).xyz; - - vec3 tangent; - vec3 binormal; - - vec3 c1 = cross( gl_Normal, vec3(0.0, 0.0, 1.0) ); - vec3 c2 = cross( gl_Normal, vec3(0.0, 1.0, 0.0) ); - - if( length(c1)>length(c2) ) - { - tangent = c1; - } - else - { - tangent = c2; - } - - tangent = normalize(tangent); - -//binormal = cross(gl_Normal, tangent); -//binormal = normalize(binormal); - - vec4 color; - //color = vec4(1.0, 1.0, 1.0, 1.0); - - float day = gl_Color.r; - float night = gl_Color.g; - float light_source = gl_Color.b; - - /*color.r = mix(night, day, dayNightRatio); - color.g = color.r; - color.b = color.r;*/ - - float rg = mix(night, day, dayNightRatio); - rg += light_source * 1.5; // Make light sources brighter - float b = rg; - - // Moonlight is blue - b += (day - night) / 13.0; - rg -= (day - night) / 13.0; - - // Emphase blue a bit in darker places - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); - - // Artificial light is yellow-ish - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); - - color.r = rg; - color.g = rg; - color.b = b; - - // Make sides and bottom darker than the top - color = color * color; // SRGB -> Linear - if(gl_Normal.y <= 0.5) - color *= 0.6; - //color *= 0.7; - color = sqrt(color); // Linear -> SRGB - - color.a = gl_Color.a; - - gl_FrontColor = gl_BackColor = color; - - gl_TexCoord[0] = gl_MultiTexCoord0; - - vec3 n1 = normalize(gl_NormalMatrix * gl_Normal); - vec4 tangent1 = vec4(tangent.x, tangent.y, tangent.z, 0); - //vec3 t1 = normalize(gl_NormalMatrix * tangent1); - //vec3 b1 = cross(n1, t1); - - vec3 v; - vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex); - vec3 vVec = -vVertex; - //v.x = dot(vVec, t1); - //v.y = dot(vVec, b1); - //v.z = dot(vVec, n1); - //viewVec = vVec; - viewVec = normalize(vec3(0.0, -0.4, 0.5)); - //Vector representing the 0th texture coordinate passed to fragment shader -//gl_TexCoord[0] = vec2(gl_MultiTexCoord0); - -// Transform the current vertex -//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -} diff --git a/client/shaders/bumpmaps_solids/opengl_fragment.glsl b/client/shaders/bumpmaps_solids/opengl_fragment.glsl deleted file mode 100644 index c72e8cbce..000000000 --- a/client/shaders/bumpmaps_solids/opengl_fragment.glsl +++ /dev/null @@ -1,45 +0,0 @@ - -uniform sampler2D myTexture; -uniform sampler2D normalTexture; - -uniform vec4 skyBgColor; -uniform float fogDistance; - -varying vec3 vPosition; - -varying vec3 viewVec; - -void main (void) -{ - vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); - float alpha = col.a; - vec2 uv = gl_TexCoord[0].st; - vec4 base = texture2D(myTexture, uv); - vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base; - vec3 vVec = normalize(viewVec); - vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); - vec3 R = reflect(-vVec, bump); - vec3 lVec = normalize(vec3(0.0, -0.4, 0.5)); - float diffuse = max(dot(lVec, bump), 0.0); - - vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb; - - - float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); - color += vec3(0.2*specular*diffuse); - - - col = vec4(color.r, color.g, color.b, alpha); - col *= gl_Color; - col = col * col; // SRGB -> Linear - col *= 1.8; - col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); - col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); - col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); - col = sqrt(col); // Linear -> SRGB - if(fogDistance != 0.0){ - float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); - col = mix(col, skyBgColor, d); - } - gl_FragColor = vec4(col.r, col.g, col.b, alpha); -} diff --git a/client/shaders/bumpmaps_solids/opengl_vertex.glsl b/client/shaders/bumpmaps_solids/opengl_vertex.glsl deleted file mode 100644 index 99c208bdd..000000000 --- a/client/shaders/bumpmaps_solids/opengl_vertex.glsl +++ /dev/null @@ -1,98 +0,0 @@ - -uniform mat4 mWorldViewProj; -uniform mat4 mInvWorld; -uniform mat4 mTransWorld; -uniform float dayNightRatio; - -varying vec3 vPosition; -varying vec3 viewVec; - -void main(void) -{ - gl_Position = mWorldViewProj * gl_Vertex; - - vPosition = (mWorldViewProj * gl_Vertex).xyz; - - vec3 tangent; - vec3 binormal; - - vec3 c1 = cross( gl_Normal, vec3(0.0, 0.0, 1.0) ); - vec3 c2 = cross( gl_Normal, vec3(0.0, 1.0, 0.0) ); - - if( length(c1)>length(c2) ) - { - tangent = c1; - } - else - { - tangent = c2; - } - - tangent = normalize(tangent); - -//binormal = cross(gl_Normal, tangent); -//binormal = normalize(binormal); - - vec4 color; - //color = vec4(1.0, 1.0, 1.0, 1.0); - - float day = gl_Color.r; - float night = gl_Color.g; - float light_source = gl_Color.b; - - /*color.r = mix(night, day, dayNightRatio); - color.g = color.r; - color.b = color.r;*/ - - float rg = mix(night, day, dayNightRatio); - rg += light_source * 1.5; // Make light sources brighter - float b = rg; - - // Moonlight is blue - b += (day - night) / 13.0; - rg -= (day - night) / 13.0; - - // Emphase blue a bit in darker places - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); - - // Artificial light is yellow-ish - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); - - color.r = rg; - color.g = rg; - color.b = b; - - // Make sides and bottom darker than the top - color = color * color; // SRGB -> Linear - if(gl_Normal.y <= 0.5) - color *= 0.6; - //color *= 0.7; - color = sqrt(color); // Linear -> SRGB - - color.a = gl_Color.a; - - gl_FrontColor = gl_BackColor = color; - - gl_TexCoord[0] = gl_MultiTexCoord0; - - vec3 n1 = normalize(gl_NormalMatrix * gl_Normal); - vec4 tangent1 = vec4(tangent.x, tangent.y, tangent.z, 0); - //vec3 t1 = normalize(gl_NormalMatrix * tangent1); - //vec3 b1 = cross(n1, t1); - - vec3 v; - vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex); - vec3 vVec = -vVertex; - //v.x = dot(vVec, t1); - //v.y = dot(vVec, b1); - //v.z = dot(vVec, n1); - //viewVec = vVec; - viewVec = normalize(vec3(0.0, -0.4, 0.5)); - //Vector representing the 0th texture coordinate passed to fragment shader -//gl_TexCoord[0] = vec2(gl_MultiTexCoord0); - -// Transform the current vertex -//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -} diff --git a/client/shaders/bumpmaps_solids/base.txt b/client/shaders/leaves_shader/base.txt similarity index 100% rename from client/shaders/bumpmaps_solids/base.txt rename to client/shaders/leaves_shader/base.txt diff --git a/client/shaders/leaves_shader/opengl_fragment.glsl b/client/shaders/leaves_shader/opengl_fragment.glsl new file mode 100644 index 000000000..127b32d51 --- /dev/null +++ b/client/shaders/leaves_shader/opengl_fragment.glsl @@ -0,0 +1,54 @@ +#version 120 + +uniform sampler2D baseTexture; +uniform sampler2D normalTexture; +uniform sampler2D useNormalmap; + +uniform float enableBumpmapping; + +uniform vec4 skyBgColor; +uniform float fogDistance; +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; +varying vec4 vColor; + +const float e = 2.718281828459; + +void main (void) +{ + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + + vec3 color; + vec2 uv = gl_TexCoord[0].st; + + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { + vec3 base = texture2D(baseTexture, uv).rgb; + vec3 vVec = normalize(eyeVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vVec); + float diffuse = max(dot(lVec, bump), 0.0); + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color = mix (base,diffuse*base,1.0) + 0.1 * specular * diffuse; + } else { + color = texture2D(baseTexture, uv).rgb; + } + + float alpha = texture2D(baseTexture, uv).a; + vec4 col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / e; + col.g = 1.0 - exp(1.0 - col.g) / e; + col.b = 1.0 - exp(1.0 - col.b) / e; + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + col = mix(col, skyBgColor, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/leaves_shader/opengl_vertex.glsl b/client/shaders/leaves_shader/opengl_vertex.glsl new file mode 100644 index 000000000..8dfb0669e --- /dev/null +++ b/client/shaders/leaves_shader/opengl_vertex.glsl @@ -0,0 +1,87 @@ +#version 120 + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; +uniform float animationTimer; + +uniform float enableWavingLeaves; +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; + +float smoothCurve( float x ) { + return x * x *( 3.0 - 2.0 * x ); +} +float triangleWave( float x ) { + return abs( fract( x + 0.5 ) * 2.0 - 1.0 ); +} +float smoothTriangleWave( float x ) { + return smoothCurve( triangleWave( x ) ) * 2.0 - 1.0; +} + +void main(void) +{ + gl_TexCoord[0] = gl_MultiTexCoord0; + if (enableWavingLeaves == 1.0){ + vec4 pos = gl_Vertex; + vec4 pos2 = mTransWorld*gl_Vertex; + pos.x += (smoothTriangleWave(animationTimer*10.0 + pos2.x * 0.01 + pos2.z * 0.01) * 2.0 - 1.0) * 0.4; + pos.y += (smoothTriangleWave(animationTimer*15.0 + pos2.x * -0.01 + pos2.z * -0.01) * 2.0 - 1.0) * 0.2; + pos.z += (smoothTriangleWave(animationTimer*10.0 + pos2.x * -0.01 + pos2.z * -0.01) * 2.0 - 1.0) * 0.4; + gl_Position = mWorldViewProj * pos; + } + else + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 2.5; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = clamp(rg,0.0,1.0); + color.g = clamp(rg,0.0,1.0); + color.b = clamp(b,0.0,1.0); + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; + +} diff --git a/client/shaders/test_shader_2/base.txt b/client/shaders/liquids_shader/base.txt similarity index 100% rename from client/shaders/test_shader_2/base.txt rename to client/shaders/liquids_shader/base.txt diff --git a/client/shaders/liquids_shader/opengl_fragment.glsl b/client/shaders/liquids_shader/opengl_fragment.glsl new file mode 100644 index 000000000..a5ffd71bb --- /dev/null +++ b/client/shaders/liquids_shader/opengl_fragment.glsl @@ -0,0 +1,53 @@ +#version 120 + +uniform sampler2D baseTexture; +uniform sampler2D normalTexture; +uniform sampler2D useNormalmap; + +uniform float enableBumpmapping; + +uniform vec4 skyBgColor; +uniform float fogDistance; +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; + +const float e = 2.718281828459; + +void main (void) +{ + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + + vec3 color; + vec2 uv = gl_TexCoord[0].st; + + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { + vec3 base = texture2D(baseTexture, uv).rgb; + vec3 vVec = normalize(eyeVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vVec); + float diffuse = max(dot(vec3(-1.0, -0.4, 0.5), bump), 0.0); + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color = mix (base,diffuse*base,1.0) + 0.1 * specular * diffuse; + } else { + color = texture2D(baseTexture, uv).rgb; + } + + float alpha = gl_Color.a; + vec4 col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / e; + col.g = 1.0 - exp(1.0 - col.g) / e; + col.b = 1.0 - exp(1.0 - col.b) / e; + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + alpha = mix(alpha, 0.0, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/test_shader_1/opengl_vertex.glsl b/client/shaders/liquids_shader/opengl_vertex.glsl similarity index 53% rename from client/shaders/test_shader_1/opengl_vertex.glsl rename to client/shaders/liquids_shader/opengl_vertex.glsl index 3cf1f122b..8ceb9f2cb 100644 --- a/client/shaders/test_shader_1/opengl_vertex.glsl +++ b/client/shaders/liquids_shader/opengl_vertex.glsl @@ -1,15 +1,33 @@ +#version 120 uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; uniform float dayNightRatio; +uniform float animationTimer; + +uniform float enableWavingWater; +uniform float waterWaveLength; +uniform float waterWaveHeight; +uniform float waterWaveSpeed; + +uniform vec3 eyePosition; varying vec3 vPosition; +varying vec3 eyeVec; void main(void) { - gl_Position = mWorldViewProj * gl_Vertex; + if (enableWavingWater == 1.0){ + vec4 pos2 = gl_Vertex; + pos2.y -= 2.0; + pos2.y -= sin (pos2.z/waterWaveLength + animationTimer * waterWaveSpeed * waterWaveLength) * waterWaveHeight + + sin ((pos2.z/waterWaveLength + animationTimer * waterWaveSpeed * waterWaveLength) / 7.0) * waterWaveHeight; + gl_Position = mWorldViewProj * pos2; + } else + gl_Position = mWorldViewProj * gl_Vertex; + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; vPosition = (mWorldViewProj * gl_Vertex).xyz; vec4 color; @@ -24,7 +42,7 @@ void main(void) color.b = color.r;*/ float rg = mix(night, day, dayNightRatio); - rg += light_source * 1.0; // Make light sources brighter + rg += light_source * 2.5; // Make light sources brighter float b = rg; // Moonlight is blue @@ -39,20 +57,13 @@ void main(void) // See C++ implementation in mapblock_mesh.cpp finalColorBlend() rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); - color.r = rg; - color.g = rg; - color.b = b; - - // Make sides and bottom darker than the top - color = color * color; // SRGB -> Linear - if(gl_Normal.y <= 0.5) - color *= 0.6; - //color *= 0.7; - color = sqrt(color); // Linear -> SRGB - + color.r = clamp(rg,0.0,1.0); + color.g = clamp(rg,0.0,1.0); + color.b = clamp(b,0.0,1.0); color.a = gl_Color.a; gl_FrontColor = gl_BackColor = color; gl_TexCoord[0] = gl_MultiTexCoord0; + } diff --git a/client/shaders/test_shader_1/base.txt b/client/shaders/plants_shader/base.txt similarity index 100% rename from client/shaders/test_shader_1/base.txt rename to client/shaders/plants_shader/base.txt diff --git a/client/shaders/plants_shader/opengl_fragment.glsl b/client/shaders/plants_shader/opengl_fragment.glsl new file mode 100644 index 000000000..de6ad4c05 --- /dev/null +++ b/client/shaders/plants_shader/opengl_fragment.glsl @@ -0,0 +1,53 @@ +#version 120 + +uniform sampler2D baseTexture; +uniform sampler2D normalTexture; +uniform sampler2D useNormalmap; + +uniform float enableBumpmapping; + +uniform vec4 skyBgColor; +uniform float fogDistance; +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; + +const float e = 2.718281828459; + +void main (void) +{ + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + + vec3 color; + vec2 uv = gl_TexCoord[0].st; + + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { + vec3 base = texture2D(baseTexture, uv).rgb; + vec3 vVec = normalize(eyeVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vVec); + float diffuse = max(dot(lVec, bump), 0.0); + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color = mix (base,diffuse*base,1.0) + 0.1 * specular * diffuse; + } else { + color = texture2D(baseTexture, uv).rgb; + } + + float alpha = texture2D(baseTexture, uv).a; + vec4 col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / e; + col.g = 1.0 - exp(1.0 - col.g) / e; + col.b = 1.0 - exp(1.0 - col.b) / e; + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + col = mix(col, skyBgColor, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/plants_shader/opengl_vertex.glsl b/client/shaders/plants_shader/opengl_vertex.glsl new file mode 100644 index 000000000..c1bdd62a9 --- /dev/null +++ b/client/shaders/plants_shader/opengl_vertex.glsl @@ -0,0 +1,87 @@ +#version 120 + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; +uniform float animationTimer; + +uniform float enableWavingPlants; + +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; + +float smoothCurve( float x ) { + return x * x *( 3.0 - 2.0 * x ); +} +float triangleWave( float x ) { + return abs( fract( x + 0.5 ) * 2.0 - 1.0 ); +} +float smoothTriangleWave( float x ) { + return smoothCurve( triangleWave( x ) ) * 2.0 - 1.0; +} + +void main(void) +{ + + gl_TexCoord[0] = gl_MultiTexCoord0; + if (enableWavingPlants == 1.0){ + vec4 pos = gl_Vertex; + vec4 pos2 = mTransWorld * gl_Vertex; + if (gl_TexCoord[0].y < 0.05) { + pos.x += (smoothTriangleWave(animationTimer * 20.0 + pos2.x * 0.1 + pos2.z * 0.1) * 2.0 - 1.0) * 0.8; + pos.y -= (smoothTriangleWave(animationTimer * 10.0 + pos2.x * -0.5 + pos2.z * -0.5) * 2.0 - 1.0) * 0.4; + } + gl_Position = mWorldViewProj * pos; + } + else + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 2.5; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = clamp(rg,0.0,1.0); + color.g = clamp(rg,0.0,1.0); + color.b = clamp(b,0.0,1.0); + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + +} diff --git a/client/shaders/solids_shader/base.txt b/client/shaders/solids_shader/base.txt new file mode 100644 index 000000000..080df30dd --- /dev/null +++ b/client/shaders/solids_shader/base.txt @@ -0,0 +1 @@ +trans_alphach_ref diff --git a/client/shaders/solids_shader/opengl_fragment.glsl b/client/shaders/solids_shader/opengl_fragment.glsl new file mode 100644 index 000000000..80efc86a7 --- /dev/null +++ b/client/shaders/solids_shader/opengl_fragment.glsl @@ -0,0 +1,87 @@ +#version 120 + +uniform sampler2D baseTexture; +uniform sampler2D normalTexture; +uniform sampler2D useNormalmap; + +uniform float enableBumpmapping; +uniform float enableParallaxOcclusion; +uniform float parallaxOcclusionScale; +uniform float parallaxOcclusionBias; + + +uniform vec4 skyBgColor; +uniform float fogDistance; +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 tsEyeVec; +varying vec3 eyeVec; +varying vec4 vColor; + +const float e = 2.718281828459; + +void main (void) +{ + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + + vec3 color; + vec2 uv = gl_TexCoord[0].st; + float height; + vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y); + + if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) { + float map_height = texture2D(normalTexture, uv).a; + if (map_height < 1.0){ + float height = parallaxOcclusionScale * map_height - parallaxOcclusionBias; + uv = uv + height * tsEye; + } + } +/* Steep parallax code, for future use + if ((parallaxMappingMode == 2.0) && (use_normalmap > 0.0)) { + const float numSteps = 40.0; + float height = 1.0; + float step = 1.0 / numSteps; + vec4 NB = texture2D(normalTexture, uv); + vec2 delta = tsEye * parallaxMappingScale / numSteps; + for (float i = 0.0; i < numSteps; i++) { + if (NB.a < height) { + height -= step; + uv += delta; + NB = texture2D(normalTexture, uv); + } else { + break; + } + } + } +*/ + + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { + vec3 base = texture2D(baseTexture, uv).rgb; + vec3 vVec = normalize(eyeVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vVec); + float diffuse = max(dot(lVec, bump), 0.0); + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color = mix (base,diffuse*base,1.0) + 0.1 * specular * diffuse; + } else { + color = texture2D(baseTexture, uv).rgb; + } + + float alpha = texture2D(baseTexture, uv).a; + vec4 col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / e; + col.g = 1.0 - exp(1.0 - col.g) / e; + col.b = 1.0 - exp(1.0 - col.b) / e; + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + col = mix(col, skyBgColor, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/solids_shader/opengl_vertex.glsl b/client/shaders/solids_shader/opengl_vertex.glsl new file mode 100644 index 000000000..c26fdd3d5 --- /dev/null +++ b/client/shaders/solids_shader/opengl_vertex.glsl @@ -0,0 +1,99 @@ +#version 120 + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +uniform vec3 eyePosition; + +varying vec3 vPosition; +varying vec3 eyeVec; +varying vec3 tsEyeVec; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec3 normal,tangent,binormal; + normal = normalize(gl_NormalMatrix * gl_Normal); + + if (gl_Normal.x > 0.5) { + // 1.0, 0.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, -1.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } else if (gl_Normal.x < -0.5) { + // -1.0, 0.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } else if (gl_Normal.y > 0.5) { + // 0.0, 1.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); + } else if (gl_Normal.y < -0.5) { + // 0.0, -1.0, 0.0 + tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); + } else if (gl_Normal.z > 0.5) { + // 0.0, 0.0, 1.0 + tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } else if (gl_Normal.z < -0.5) { + // 0.0, 0.0, -1.0 + tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0)); + binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); + } + + mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x, + tangent.y, binormal.y, normal.y, + tangent.z, binormal.z, normal.z); + + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; + tsEyeVec = normalize(eyeVec * tbnMatrix); + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 2.5; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = clamp(rg,0.0,1.0); + color.g = clamp(rg,0.0,1.0); + color.b = clamp(b,0.0,1.0); + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; + +} diff --git a/client/shaders/test_shader_1/opengl_fragment.glsl b/client/shaders/test_shader_1/opengl_fragment.glsl deleted file mode 100644 index ebf943ced..000000000 --- a/client/shaders/test_shader_1/opengl_fragment.glsl +++ /dev/null @@ -1,25 +0,0 @@ - -uniform sampler2D myTexture; -uniform vec4 skyBgColor; -uniform float fogDistance; - -varying vec3 vPosition; - -void main (void) -{ - //vec4 col = vec4(1.0, 0.0, 0.0, 1.0); - vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); - float a = col.a; - col *= gl_Color; - col = col * col; // SRGB -> Linear - col *= 1.8; - col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); - col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); - col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); - col = sqrt(col); // Linear -> SRGB - if(fogDistance != 0.0){ - float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); - col = mix(col, skyBgColor, d); - } - gl_FragColor = vec4(col.r, col.g, col.b, a); -} diff --git a/client/shaders/test_shader_2/opengl_fragment.glsl b/client/shaders/test_shader_2/opengl_fragment.glsl deleted file mode 100644 index 38bc94311..000000000 --- a/client/shaders/test_shader_2/opengl_fragment.glsl +++ /dev/null @@ -1,23 +0,0 @@ - -uniform sampler2D myTexture; -uniform float fogDistance; - -varying vec3 vPosition; - -void main (void) -{ - vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); - col *= gl_Color; - float a = gl_Color.a; - col = col * col; // SRGB -> Linear - col *= 1.8; - col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); - col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); - col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); - col = sqrt(col); // Linear -> SRGB - if(fogDistance != 0.0){ - float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); - a = mix(a, 0.0, d); - } - gl_FragColor = vec4(col.r, col.g, col.b, a); -} diff --git a/client/shaders/test_shader_2/opengl_vertex.glsl b/client/shaders/test_shader_2/opengl_vertex.glsl deleted file mode 100644 index 2881bad21..000000000 --- a/client/shaders/test_shader_2/opengl_vertex.glsl +++ /dev/null @@ -1,51 +0,0 @@ - -uniform mat4 mWorldViewProj; -uniform mat4 mInvWorld; -uniform mat4 mTransWorld; -uniform float dayNightRatio; - -varying vec3 vPosition; - -void main(void) -{ - gl_Position = mWorldViewProj * gl_Vertex; - - vPosition = (mWorldViewProj * gl_Vertex).xyz; - - vec4 color; - //color = vec4(1.0, 1.0, 1.0, 1.0); - - float day = gl_Color.r; - float night = gl_Color.g; - float light_source = gl_Color.b; - - /*color.r = mix(night, day, dayNightRatio); - color.g = color.r; - color.b = color.r;*/ - - float rg = mix(night, day, dayNightRatio); - rg += light_source * 1.0; // Make light sources brighter - float b = rg; - - // Moonlight is blue - b += (day - night) / 13.0; - rg -= (day - night) / 13.0; - - // Emphase blue a bit in darker places - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); - - // Artificial light is yellow-ish - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); - - color.r = rg; - color.g = rg; - color.b = b; - - color.a = gl_Color.a; - - gl_FrontColor = gl_BackColor = color; - - gl_TexCoord[0] = gl_MultiTexCoord0; -} diff --git a/client/shaders/test_shader_3/base.txt b/client/shaders/test_shader_3/base.txt deleted file mode 100644 index 1c2647118..000000000 --- a/client/shaders/test_shader_3/base.txt +++ /dev/null @@ -1 +0,0 @@ -trans_alphach diff --git a/client/shaders/test_shader_3/opengl_fragment.glsl b/client/shaders/test_shader_3/opengl_fragment.glsl deleted file mode 100644 index 535774c11..000000000 --- a/client/shaders/test_shader_3/opengl_fragment.glsl +++ /dev/null @@ -1,25 +0,0 @@ - -uniform sampler2D myTexture; -uniform float fogDistance; - -varying vec3 vPosition; - -void main (void) -{ - vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); - col *= gl_Color; - float a = col.a; - col = col * col; // SRGB -> Linear - col *= 1.8; - col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); - col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); - col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); - col = sqrt(col); // Linear -> SRGB - - if(fogDistance != 0.0){ - float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); - a = mix(a, 0.0, d); - } - - gl_FragColor = vec4(col.r, col.g, col.b, a); -} diff --git a/client/shaders/test_shader_3/opengl_vertex.glsl b/client/shaders/test_shader_3/opengl_vertex.glsl deleted file mode 100644 index 2881bad21..000000000 --- a/client/shaders/test_shader_3/opengl_vertex.glsl +++ /dev/null @@ -1,51 +0,0 @@ - -uniform mat4 mWorldViewProj; -uniform mat4 mInvWorld; -uniform mat4 mTransWorld; -uniform float dayNightRatio; - -varying vec3 vPosition; - -void main(void) -{ - gl_Position = mWorldViewProj * gl_Vertex; - - vPosition = (mWorldViewProj * gl_Vertex).xyz; - - vec4 color; - //color = vec4(1.0, 1.0, 1.0, 1.0); - - float day = gl_Color.r; - float night = gl_Color.g; - float light_source = gl_Color.b; - - /*color.r = mix(night, day, dayNightRatio); - color.g = color.r; - color.b = color.r;*/ - - float rg = mix(night, day, dayNightRatio); - rg += light_source * 1.0; // Make light sources brighter - float b = rg; - - // Moonlight is blue - b += (day - night) / 13.0; - rg -= (day - night) / 13.0; - - // Emphase blue a bit in darker places - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); - - // Artificial light is yellow-ish - // See C++ implementation in mapblock_mesh.cpp finalColorBlend() - rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); - - color.r = rg; - color.g = rg; - color.b = b; - - color.a = gl_Color.a; - - gl_FrontColor = gl_BackColor = color; - - gl_TexCoord[0] = gl_MultiTexCoord0; -} diff --git a/minetest.conf.example b/minetest.conf.example index 69ed31a64..46a9e8cfc 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -171,6 +171,22 @@ #enable_shaders = true # Set to true to enable textures bumpmapping. Requires shaders enabled. #enable_bumpmapping = false +# Set to true enables parallax occlusion mapping. Requires shaders enabled. +#enable_parallax_occlusion = false +# Scale of parallax occlusion effect +#parallax_mapping_scale = 0.08 +# Bias of parallax occlusion effect, usually scale/2 +#parallax_mapping_scale = 0.04 +# Set to true enables waving water. Requires shaders enabled. +#enable_waving_water = false +# Parameters for waving water: +#water_wave_height = 1.0 +#water_wave_length = 20.0 +#water_wave_speed = 5.0 +# Set to true enables waving leaves. Requires shaders enabled. +#enable_waving_leaves = false +# Set to true enables waving plants. Requires shaders enabled. +#enable_waving_plants = false # The time in seconds it takes between repeated # right clicks when holding the right mouse button #repeat_rightclick_time = 0.25 diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index df7570b33..68350bec0 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -126,6 +126,15 @@ void set_default_settings(Settings *settings) settings->setDefault("trilinear_filter", "false"); settings->setDefault("preload_item_visuals", "true"); settings->setDefault("enable_bumpmapping", "false"); + settings->setDefault("enable_parallax_occlusion", "false"); + settings->setDefault("parallax_occlusion_scale", "0.08"); + settings->setDefault("parallax_occlusion_bias", "0.04"); + settings->setDefault("enable_waving_water", "false"); + settings->setDefault("water_wave_height", "1.0"); + settings->setDefault("water_wave_length", "20.0"); + settings->setDefault("water_wave_speed", "5.0"); + settings->setDefault("enable_waving_leaves", "false"); + settings->setDefault("enable_waving_plants", "false"); settings->setDefault("enable_shaders", "true"); settings->setDefault("repeat_rightclick_time", "0.25"); settings->setDefault("enable_particles", "true"); diff --git a/src/game.cpp b/src/game.cpp index 71a578a65..22abe4c74 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -805,13 +805,64 @@ public: float daynight_ratio_f = (float)daynight_ratio / 1000.0; services->setPixelShaderConstant("dayNightRatio", &daynight_ratio_f, 1); + u32 animation_timer = porting::getTimeMs() % 100000; + float animation_timer_f = (float)animation_timer / 100000.0; + services->setPixelShaderConstant("animationTimer", &animation_timer_f, 1); + services->setVertexShaderConstant("animationTimer", &animation_timer_f, 1); + + LocalPlayer* player = m_client->getEnv().getLocalPlayer(); + v3f eye_position = player->getEyePosition(); + services->setPixelShaderConstant("eyePosition", (irr::f32*)&eye_position, 3); + services->setVertexShaderConstant("eyePosition", (irr::f32*)&eye_position, 3); + + float enable_bumpmapping = 0; + if (g_settings->getBool("enable_bumpmapping")) + enable_bumpmapping = 1; + services->setPixelShaderConstant("enableBumpmapping", &enable_bumpmapping, 1); + + float enable_parallax_occlusion = 0; + if (g_settings->getBool("enable_parallax_occlusion"));{ + enable_parallax_occlusion = 1; + float parallax_occlusion_scale = g_settings->getFloat("parallax_occlusion_scale"); + services->setPixelShaderConstant("parallaxOcclusionScale", ¶llax_occlusion_scale, 1); + float parallax_occlusion_bias = g_settings->getFloat("parallax_occlusion_bias"); + services->setPixelShaderConstant("parallaxOcclusionBias", ¶llax_occlusion_bias, 1); + } + services->setPixelShaderConstant("enableParallaxOcclusion", &enable_parallax_occlusion, 1); + + float enable_waving_water = 0; + if (g_settings->getBool("enable_waving_water")){ + enable_waving_water = 1; + float water_wave_height_f = g_settings->getFloat("water_wave_height"); + services->setVertexShaderConstant("waterWaveHeight", &water_wave_height_f, 1); + float water_wave_length_f = g_settings->getFloat("water_wave_length"); + services->setVertexShaderConstant("waterWaveLength", &water_wave_length_f, 1); + float water_wave_speed_f = g_settings->getFloat("water_wave_speed"); + services->setVertexShaderConstant("waterWaveSpeed", &water_wave_speed_f, 1); + } + services->setVertexShaderConstant("enableWavingWater", &enable_waving_water, 1); + + float enable_waving_leaves = 0; + if (g_settings->getBool("enable_waving_leaves")) + enable_waving_leaves = 1; + services->setVertexShaderConstant("enableWavingLeaves", &enable_waving_leaves, 1); + + float enable_waving_plants = 0; + if (g_settings->getBool("enable_waving_plants")) + enable_waving_plants = 1; + services->setVertexShaderConstant("enableWavingPlants", &enable_waving_plants, 1); + + // Normal map texture layer - int layer = 1; + int layer1 = 1; + int layer2 = 2; // before 1.8 there isn't a "integer interface", only float #if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8) - services->setPixelShaderConstant("normalTexture" , (irr::f32*)&layer, 1); + services->setPixelShaderConstant("normalTexture" , (irr::f32*)&layer1, 1); + services->setPixelShaderConstant("useNormalmap" , (irr::f32*)&layer2, 1); #else - services->setPixelShaderConstant("normalTexture" , (irr::s32*)&layer, 1); + services->setPixelShaderConstant("normalTexture" , (irr::s32*)&layer1, 1); + services->setPixelShaderConstant("useNormalmap" , (irr::s32*)&layer2, 1); #endif } }; diff --git a/src/itemdef.cpp b/src/itemdef.cpp index d34d68582..f77a198b5 100644 --- a/src/itemdef.cpp +++ b/src/itemdef.cpp @@ -390,16 +390,18 @@ public: /* Make a mesh from the node */ + bool reenable_shaders = false; + if(g_settings->getBool("enable_shaders")){ + reenable_shaders = true; + g_settings->setBool("enable_shaders",false); + } MeshMakeData mesh_make_data(gamedef); MapNode mesh_make_node(id, param1, 0); mesh_make_data.fillSingleNode(&mesh_make_node); MapBlockMesh mapblock_mesh(&mesh_make_data); - scene::IMesh *node_mesh = mapblock_mesh.getMesh(); assert(node_mesh); video::SColor c(255, 255, 255, 255); - if(g_settings->getBool("enable_shaders")) - c = MapBlock_LightColor(255, 0xffff, decode_light(f.light_source)); setMeshColor(node_mesh, c); /* @@ -455,6 +457,9 @@ public: //no way reference count can be smaller than 2 in this place! assert(cc->wield_mesh->getReferenceCount() >= 2); + + if (reenable_shaders) + g_settings->setBool("enable_shaders",true); } // Put in cache diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index 253703ddc..81aac72d7 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -1112,18 +1112,18 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data): bool enable_shaders = g_settings->getBool("enable_shaders"); bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping"); - video::E_MATERIAL_TYPE shadermat1, shadermat2, shadermat3, bumpmaps1, bumpmaps2; - shadermat1 = shadermat2 = shadermat3 = bumpmaps1 = bumpmaps2 = video::EMT_SOLID; + video::E_MATERIAL_TYPE shadermat1, shadermat2, shadermat3, + shadermat4, shadermat5; + shadermat1 = shadermat2 = shadermat3 = shadermat4 = shadermat5 = + video::EMT_SOLID; if (enable_shaders) { IShaderSource *shdrsrc = m_gamedef->getShaderSource(); - shadermat1 = shdrsrc->getShader("test_shader_1").material; - shadermat2 = shdrsrc->getShader("test_shader_2").material; - shadermat3 = shdrsrc->getShader("test_shader_3").material; - if (enable_bumpmapping) { - bumpmaps1 = shdrsrc->getShader("bumpmaps_solids").material; - bumpmaps2 = shdrsrc->getShader("bumpmaps_liquids").material; - } + shadermat1 = shdrsrc->getShader("solids_shader").material; + shadermat2 = shdrsrc->getShader("liquids_shader").material; + shadermat3 = shdrsrc->getShader("alpha_shader").material; + shadermat4 = shdrsrc->getShader("leaves_shader").material; + shadermat5 = shdrsrc->getShader("plants_shader").material; } for(u32 i = 0; i < collector.prebuffers.size(); i++) @@ -1204,22 +1204,18 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data): material.setFlag(video::EMF_FOG_ENABLE, true); //material.setFlag(video::EMF_ANTI_ALIASING, video::EAAM_OFF); //material.setFlag(video::EMF_ANTI_ALIASING, video::EAAM_SIMPLE); - material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + //material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; material.setTexture(0, p.tile.texture); - - if (enable_shaders) { - video::E_MATERIAL_TYPE smat1 = shadermat1; - video::E_MATERIAL_TYPE smat2 = shadermat2; - video::E_MATERIAL_TYPE smat3 = shadermat3; - - if (enable_bumpmapping) { - ITextureSource *tsrc = data->m_gamedef->tsrc(); - std::string fname_base = tsrc->getTextureName(p.tile.texture_id); + if (enable_shaders) { + ITextureSource *tsrc = data->m_gamedef->tsrc(); + material.setTexture(2, tsrc->getTexture("disable_img.png")); + if (enable_bumpmapping) { + std::string fname_base = tsrc->getTextureName(p.tile.texture_id); std::string normal_ext = "_normal.png"; size_t pos = fname_base.find("."); std::string fname_normal = fname_base.substr(0, pos) + normal_ext; - + if (tsrc->isKnownSourceImage(fname_normal)) { // look for image extension and replace it size_t i = 0; @@ -1227,19 +1223,15 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data): fname_base.replace(i, 4, normal_ext); i += normal_ext.length(); } - material.setTexture(1, tsrc->getTexture(fname_base)); - - smat1 = bumpmaps1; - smat2 = bumpmaps2; + material.setTexture(2, tsrc->getTexture("enable_img.png")); } } - - p.tile.applyMaterialOptionsWithShaders(material, smat1, smat2, smat3); + p.tile.applyMaterialOptionsWithShaders(material, + shadermat1, shadermat2, shadermat3, shadermat4, shadermat5); } else { p.tile.applyMaterialOptions(material); } - // Create meshbuffer // This is a "Standard MeshBuffer", @@ -1369,18 +1361,21 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat os<<"^[verticalframe:"<<(int)tile.animation_frame_count<<":"<getMaterial().setTexture(0, tsrc->getTexture(os.str())); + buf->getMaterial().setTexture(2, tsrc->getTexture("disable_img.png")); if (enable_shaders && enable_bumpmapping) { - std::string basename,normal; - basename = tsrc->getTextureName(tile.texture_id); + std::string fname_base,fname_normal; + fname_base = tsrc->getTextureName(tile.texture_id); unsigned pos; - pos = basename.find("."); - normal = basename.substr (0, pos); - normal += "_normal.png"; - os.str(""); - os<isKnownSourceImage(normal)) + pos = fname_base.find("."); + fname_normal = fname_base.substr (0, pos); + fname_normal += "_normal.png"; + if (tsrc->isKnownSourceImage(fname_normal)){ + os.str(""); + os<getMaterial().setTexture(1, tsrc->getTexture(os.str())); + buf->getMaterial().setTexture(2, tsrc->getTexture("enable_img.png")); + } } } diff --git a/src/nodedef.cpp b/src/nodedef.cpp index d13d0653d..2b6de0461 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -225,6 +225,7 @@ void ContentFeatures::reset() damage_per_second = 0; node_box = NodeBox(); selection_box = NodeBox(); + waving = 0; legacy_facedir_simple = false; legacy_wallmounted = false; sound_footstep = SimpleSoundSpec(); @@ -292,6 +293,7 @@ void ContentFeatures::serialize(std::ostream &os, u16 protocol_version) writeU8(os, liquid_range); // Stuff below should be moved to correct place in a version that otherwise changes // the protocol version + writeU8(os, waving); } void ContentFeatures::deSerialize(std::istream &is) @@ -359,6 +361,7 @@ void ContentFeatures::deSerialize(std::istream &is) try{ // Stuff below should be moved to correct place in a version that // otherwise changes the protocol version + waving = readU8(is); }catch(SerializationError &e) {}; } @@ -618,6 +621,9 @@ public: } bool is_liquid = false; + u8 material_type; + material_type = (f->alpha == 255) ? TILE_MATERIAL_BASIC : TILE_MATERIAL_ALPHA; + switch(f->drawtype){ default: case NDT_NORMAL: @@ -669,10 +675,14 @@ public: tiledef[i].name += std::string("^[noalpha"); } } + if (f->waving == 1) + material_type = TILE_MATERIAL_LEAVES; break; case NDT_PLANTLIKE: f->solidness = 0; f->backface_culling = false; + if (f->waving == 1) + material_type = TILE_MATERIAL_PLANTS; break; case NDT_TORCHLIKE: case NDT_SIGNLIKE: @@ -683,11 +693,8 @@ public: break; } - u8 material_type; if (is_liquid) material_type = (f->alpha == 255) ? TILE_MATERIAL_LIQUID_OPAQUE : TILE_MATERIAL_LIQUID_TRANSPARENT; - else - material_type = (f->alpha == 255) ? TILE_MATERIAL_BASIC : TILE_MATERIAL_ALPHA; // Tiles (fill in f->tiles[]) for(u16 j=0; j<6; j++){ diff --git a/src/nodedef.h b/src/nodedef.h index c0322d919..d4cd66f80 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -234,6 +234,8 @@ struct ContentFeatures u32 damage_per_second; NodeBox node_box; NodeBox selection_box; + // Used for waving leaves/plants + u8 waving; // Compatibility with old maps // Set to true if paramtype used to be 'facedir_simple' bool legacy_facedir_simple; diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index fd98e9480..d58479042 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -428,6 +428,9 @@ ContentFeatures read_content_features(lua_State *L, int index) f.selection_box = read_nodebox(L, -1); lua_pop(L, 1); + f.waving = getintfield_default(L, index, + "waving", f.waving); + // Set to true if paramtype used to be 'facedir_simple' getboolfield(L, index, "legacy_facedir_simple", f.legacy_facedir_simple); // Set to true if wall_mounted used to be set to true diff --git a/src/tile.h b/src/tile.h index 90e180a48..b748c092e 100644 --- a/src/tile.h +++ b/src/tile.h @@ -136,6 +136,8 @@ enum MaterialType{ TILE_MATERIAL_ALPHA, TILE_MATERIAL_LIQUID_TRANSPARENT, TILE_MATERIAL_LIQUID_OPAQUE, + TILE_MATERIAL_LEAVES, + TILE_MATERIAL_PLANTS }; // Material flags @@ -204,13 +206,21 @@ struct TileSpec case TILE_MATERIAL_LIQUID_OPAQUE: material.MaterialType = video::EMT_SOLID; break; + case TILE_MATERIAL_LEAVES: + material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + break; + case TILE_MATERIAL_PLANTS: + material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + break; } material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING) ? true : false; } void applyMaterialOptionsWithShaders(video::SMaterial &material, const video::E_MATERIAL_TYPE &basic, const video::E_MATERIAL_TYPE &liquid, - const video::E_MATERIAL_TYPE &alpha) const + const video::E_MATERIAL_TYPE &alpha, + const video::E_MATERIAL_TYPE &leaves, + const video::E_MATERIAL_TYPE &plants) const { switch(material_type){ case TILE_MATERIAL_BASIC: @@ -225,6 +235,12 @@ struct TileSpec case TILE_MATERIAL_LIQUID_OPAQUE: material.MaterialType = liquid; break; + case TILE_MATERIAL_LEAVES: + material.MaterialType = leaves; + break; + case TILE_MATERIAL_PLANTS: + material.MaterialType = plants; + break; } material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING) ? true : false; } diff --git a/textures/base/pack/disable_img.png b/textures/base/pack/disable_img.png new file mode 100644 index 0000000000000000000000000000000000000000..4d3a1b45ddb50404cf74ae6d05a934ab2727d033 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#E*B%O0uRe1MSq}>WQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyvF pfTxRNh{pNk1PRu~2_gp=7?=eZ7&9j39tO%Wc)I$ztaD0e0sunoAi)3t literal 0 HcmV?d00001 diff --git a/textures/base/pack/enable_img.png b/textures/base/pack/enable_img.png new file mode 100644 index 0000000000000000000000000000000000000000..e07f4e9dda6e3b88c6b95368cea5aca3e826d798 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#E*B%Of_#Hc!bG5uWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyvF zl&6bhh{pNkKmY&RGix? Date: Tue, 3 Dec 2013 20:03:20 +0100 Subject: [PATCH 155/198] Fix LevelDB maps --- src/database-leveldb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index 2a8f59c20..0526b0b29 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -94,7 +94,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos) std::string datastr; leveldb::Status s = m_database->Get(leveldb::ReadOptions(), i64tos(getBlockAsInteger(blockpos)), &datastr); - if (datastr.length() == 0) { + if (datastr.length() == 0 && s.ok()) { errorstream << "Blank block data in database (datastr.length() == 0) (" << blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" << std::endl; From 15be2659eae6da2c3807713eb6e068d8aa436423 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Tue, 3 Dec 2013 18:51:15 +0100 Subject: [PATCH 156/198] Add sneak and sneak_glitch to set_physics_override() --- doc/lua_api.txt | 3 ++- src/content_cao.cpp | 6 ++++++ src/content_sao.cpp | 10 ++++++++-- src/content_sao.h | 2 ++ src/genericobject.cpp | 6 +++++- src/genericobject.h | 3 ++- src/localplayer.cpp | 12 +++++++++--- src/player.cpp | 8 +++++--- src/player.h | 2 ++ src/script/lua_api/l_object.cpp | 11 ++++++++++- src/script/lua_api/l_object.h | 3 ++- 11 files changed, 53 insertions(+), 13 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index f3240dd40..410998cc6 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1706,10 +1706,11 @@ Player-only: (no-op for other objects) {jump=bool,right=bool,left=bool,LMB=bool,RMB=bool,sneak=bool,aux1=bool,down=bool,up=bool} - get_player_control_bits(): returns integer with bit packed player pressed keys bit nr/meaning: 0/up ,1/down ,2/left ,3/right ,4/jump ,5/aux1 ,6/sneak ,7/LMB ,8/RMB -- set_physics_override(speed, jump, gravity) +- set_physics_override(speed, jump, gravity, sneak, sneak_glitch) modifies per-player walking speed, jump height, and gravity. Values default to 1 and act as offsets to the physics settings in minetest.conf. nil will keep the current setting. + sneak and sneak_glitch are booleans, default is true - hud_add(hud definition): add a HUD element described by HUD def, returns ID number on success - hud_remove(id): remove the HUD element of the specified id - hud_change(id, stat, value): change a value of a previously added HUD element diff --git a/src/content_cao.cpp b/src/content_cao.cpp index e97e3a1be..ec8cde35b 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1693,12 +1693,18 @@ public: float override_speed = readF1000(is); float override_jump = readF1000(is); float override_gravity = readF1000(is); + // these are sent inverted so we get true when the server sends nothing + bool sneak = !readU8(is); + bool sneak_glitch = !readU8(is); + if(m_is_local_player) { LocalPlayer *player = m_env->getLocalPlayer(); player->physics_override_speed = override_speed; player->physics_override_jump = override_jump; player->physics_override_gravity = override_gravity; + player->physics_override_sneak = sneak; + player->physics_override_sneak_glitch = sneak_glitch; } } else if(cmd == GENERIC_CMD_SET_ANIMATION) diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 85ab8d307..52b741365 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -969,6 +969,8 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_, m_physics_override_speed(1), m_physics_override_jump(1), m_physics_override_gravity(1), + m_physics_override_sneak(true), + m_physics_override_sneak_glitch(true), m_physics_override_sent(false) { assert(m_player); @@ -1060,7 +1062,9 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version) os<getBool("free_move")) && !in_liquid) + if(control.sneak && m_sneak_node_exists && + !(fly_allowed && g_settings->getBool("free_move")) && !in_liquid && + physics_override_sneak) { f32 maxd = 0.5*BS + sneak_max; v3f lwn_f = intToFloat(m_sneak_node, BS); @@ -225,7 +227,7 @@ void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d, // node. m_need_to_get_new_sneak_node = true; } - if(m_need_to_get_new_sneak_node) + if(m_need_to_get_new_sneak_node && physics_override_sneak) { v3s16 pos_i_bottom = floatToInt(position - v3f(0,BS/2,0), BS); v2f player_p2df(position.X, position.Z); @@ -264,6 +266,10 @@ void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d, // And the node above it has to be nonwalkable if(nodemgr->get(map->getNode(p+v3s16(0,1,0))).walkable == true) continue; + if (!physics_override_sneak_glitch) { + if (nodemgr->get(map->getNode(p+v3s16(0,2,0))).walkable) + continue; + } } catch(InvalidPositionException &e) { @@ -576,6 +582,6 @@ v3s16 LocalPlayer::getStandingNodePos() { if(m_sneak_node_exists) return m_sneak_node; - return floatToInt(getPosition(), BS); + return floatToInt(getPosition() - v3f(0, BS, 0), BS); } diff --git a/src/player.cpp b/src/player.cpp index 584c00dd0..3481260c0 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -85,9 +85,11 @@ Player::Player(IGameDef *gamedef): movement_gravity = 9.81 * BS; // Movement overrides are multipliers and must be 1 by default - physics_override_speed = 1; - physics_override_jump = 1; - physics_override_gravity = 1; + physics_override_speed = 1; + physics_override_jump = 1; + physics_override_gravity = 1; + physics_override_sneak = true; + physics_override_sneak_glitch = true; hud_flags = HUD_FLAG_HOTBAR_VISIBLE | HUD_FLAG_HEALTHBAR_VISIBLE | HUD_FLAG_CROSSHAIR_VISIBLE | HUD_FLAG_WIELDITEM_VISIBLE | diff --git a/src/player.h b/src/player.h index 12ea0dba1..a1050d4c7 100644 --- a/src/player.h +++ b/src/player.h @@ -266,6 +266,8 @@ public: float physics_override_speed; float physics_override_jump; float physics_override_gravity; + bool physics_override_sneak; + bool physics_override_sneak_glitch; u16 hp; diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index cbcaa40eb..5e1517e46 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -349,7 +349,8 @@ int ObjectRef::l_set_armor_groups(lua_State *L) return 0; } -// set_physics_override(self, physics_override_speed, physics_override_jump, physics_override_gravity) +// set_physics_override(self, physics_override_speed, physics_override_jump, +// physics_override_gravity, sneak, sneak_glitch) int ObjectRef::l_set_physics_override(lua_State *L) { ObjectRef *ref = checkobject(L, 1); @@ -368,6 +369,14 @@ int ObjectRef::l_set_physics_override(lua_State *L) co->m_physics_override_gravity = lua_tonumber(L, 4); co->m_physics_override_sent = false; } + if (lua_isboolean(L, 5)) { + co->m_physics_override_sneak = lua_toboolean(L, 5); + co->m_physics_override_sent = false; + } + if (lua_isboolean(L, 6)) { + co->m_physics_override_sneak_glitch = lua_toboolean(L, 6); + co->m_physics_override_sent = false; + } return 0; } diff --git a/src/script/lua_api/l_object.h b/src/script/lua_api/l_object.h index 4b4f5eff7..c8c67f2c5 100644 --- a/src/script/lua_api/l_object.h +++ b/src/script/lua_api/l_object.h @@ -101,7 +101,8 @@ private: // set_armor_groups(self, groups) static int l_set_armor_groups(lua_State *L); - // set_physics_override(self, physics_override_speed, physics_override_jump, physics_override_gravity) + // set_physics_override(self, physics_override_speed, physics_override_jump, + // physics_override_gravity, sneak, sneak_glitch) static int l_set_physics_override(lua_State *L); // set_animation(self, frame_range, frame_speed, frame_blend) From e51ad5337f78060557d63de6407a2c6bce071aba Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Tue, 3 Dec 2013 22:26:40 +0100 Subject: [PATCH 157/198] Use a table in set_physics_override() --- doc/lua_api.txt | 12 ++++++----- src/script/lua_api/l_object.cpp | 38 +++++++++++++++++---------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 410998cc6..3505b4635 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1706,11 +1706,13 @@ Player-only: (no-op for other objects) {jump=bool,right=bool,left=bool,LMB=bool,RMB=bool,sneak=bool,aux1=bool,down=bool,up=bool} - get_player_control_bits(): returns integer with bit packed player pressed keys bit nr/meaning: 0/up ,1/down ,2/left ,3/right ,4/jump ,5/aux1 ,6/sneak ,7/LMB ,8/RMB -- set_physics_override(speed, jump, gravity, sneak, sneak_glitch) - modifies per-player walking speed, jump height, and gravity. - Values default to 1 and act as offsets to the physics settings - in minetest.conf. nil will keep the current setting. - sneak and sneak_glitch are booleans, default is true +- set_physics_override({ + speed = 1.0, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1.0, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = true, -- whether player can use the sneak glitch + }) - hud_add(hud definition): add a HUD element described by HUD def, returns ID number on success - hud_remove(id): remove the HUD element of the specified id - hud_change(id, stat, value): change a value of a previously added HUD element diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 5e1517e46..3a990887b 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -357,25 +357,27 @@ int ObjectRef::l_set_physics_override(lua_State *L) PlayerSAO *co = (PlayerSAO *) getobject(ref); if(co == NULL) return 0; // Do it - if(!lua_isnil(L, 2)){ - co->m_physics_override_speed = lua_tonumber(L, 2); - co->m_physics_override_sent = false; - } - if(!lua_isnil(L, 3)){ - co->m_physics_override_jump = lua_tonumber(L, 3); - co->m_physics_override_sent = false; - } - if(!lua_isnil(L, 4)){ - co->m_physics_override_gravity = lua_tonumber(L, 4); - co->m_physics_override_sent = false; - } - if (lua_isboolean(L, 5)) { - co->m_physics_override_sneak = lua_toboolean(L, 5); - co->m_physics_override_sent = false; - } - if (lua_isboolean(L, 6)) { - co->m_physics_override_sneak_glitch = lua_toboolean(L, 6); + if (lua_istable(L, 2)) { + co->m_physics_override_speed = getfloatfield_default(L, 2, "speed", co->m_physics_override_speed); + co->m_physics_override_jump = getfloatfield_default(L, 2, "jump", co->m_physics_override_jump); + co->m_physics_override_gravity = getfloatfield_default(L, 2, "gravity", co->m_physics_override_gravity); + co->m_physics_override_sneak = getboolfield_default(L, 2, "sneak", co->m_physics_override_sneak); + co->m_physics_override_sneak_glitch = getboolfield_default(L, 2, "sneak_glitch", co->m_physics_override_sneak_glitch); co->m_physics_override_sent = false; + } else { + // old, non-table format + if(!lua_isnil(L, 2)){ + co->m_physics_override_speed = lua_tonumber(L, 2); + co->m_physics_override_sent = false; + } + if(!lua_isnil(L, 3)){ + co->m_physics_override_jump = lua_tonumber(L, 3); + co->m_physics_override_sent = false; + } + if(!lua_isnil(L, 4)){ + co->m_physics_override_gravity = lua_tonumber(L, 4); + co->m_physics_override_sent = false; + } } return 0; } From 000da6b25de2af1cc517b9f3c5e9b3576625ec4c Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 4 Dec 2013 13:39:57 -0500 Subject: [PATCH 158/198] Only create one alias metatable --- builtin/misc_register.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index aa062d731..54022a361 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -24,17 +24,15 @@ minetest.registered_aliases = {} -- For tables that are indexed by item name: -- If table[X] does not exist, default to table[minetest.registered_aliases[X]] -local function set_alias_metatable(table) - setmetatable(table, { - __index = function(name) - return rawget(table, minetest.registered_aliases[name]) - end - }) -end -set_alias_metatable(minetest.registered_items) -set_alias_metatable(minetest.registered_nodes) -set_alias_metatable(minetest.registered_craftitems) -set_alias_metatable(minetest.registered_tools) +local alias_metatable = { + __index = function(t, name) + return rawget(t, minetest.registered_aliases[name]) + end +} +setmetatable(minetest.registered_items, alias_metatable) +setmetatable(minetest.registered_nodes, alias_metatable) +setmetatable(minetest.registered_craftitems, alias_metatable) +setmetatable(minetest.registered_tools, alias_metatable) -- These item names may not be used because they would interfere -- with legacy itemstrings From 22dbbf0a6fc9547f0dbdb7f6076337b8c6acd48b Mon Sep 17 00:00:00 2001 From: sweetbomber Date: Thu, 30 May 2013 17:14:22 +0100 Subject: [PATCH 159/198] Improve (re)spawn, add cache_block_before_spawn and max_spawn_height settings --- minetest.conf.example | 4 +++ src/defaultsettings.cpp | 2 ++ src/map.cpp | 78 +++++++++++++++++++++++------------------ src/map.h | 2 +- src/server.cpp | 9 ++--- 5 files changed, 55 insertions(+), 40 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index 46a9e8cfc..4d6b76c84 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -266,6 +266,10 @@ #disable_anticheat = false # If true, actions are recorded for rollback #enable_rollback_recording = false +# If true, blocks are cached (and generated if not before) before a player is spawned. +#cache_block_before_spawn = true +# Defines the maximum height a player can spawn in a map, above water level +#max_spawn_height = 50 # Profiler data print interval. #0 = disable. #profiler_print_interval = 0 diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 68350bec0..106e5d9c2 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -182,6 +182,8 @@ void set_default_settings(Settings *settings) settings->setDefault("disallow_empty_password", "false"); settings->setDefault("disable_anticheat", "false"); settings->setDefault("enable_rollback_recording", "false"); + settings->setDefault("cache_block_before_spawn", "true"); + settings->setDefault("max_spawn_height", "50"); settings->setDefault("profiler_print_interval", "0"); settings->setDefault("enable_mapgen_debug_info", "false"); diff --git a/src/map.cpp b/src/map.cpp index 4d32ecdfe..55f91c8a6 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3185,48 +3185,56 @@ void ServerMap::prepareBlock(MapBlock *block) { } } -s16 ServerMap::findGroundLevel(v2s16 p2d) +/** + * Get the ground level by searching for a non CONTENT_AIR node in a column from top to bottom + */ +s16 ServerMap::findGroundLevel(v2s16 p2d, bool cacheBlocks) { -#if 0 - /* - Uh, just do something random... - */ - // Find existing map from top to down - s16 max=63; - s16 min=-64; - v3s16 p(p2d.X, max, p2d.Y); - for(; p.Y>min; p.Y--) + + s16 level; + + // The reference height is the original mapgen height + s16 referenceHeight = m_emerge->getGroundLevelAtPoint(p2d); + s16 maxSearchHeight = 63 + referenceHeight; + s16 minSearchHeight = -63 + referenceHeight; + v3s16 probePosition(p2d.X, maxSearchHeight, p2d.Y); + v3s16 blockPosition = getNodeBlockPos(probePosition); + v3s16 prevBlockPosition = blockPosition; + + // Cache the block to be inspected. + if(cacheBlocks) { + emergeBlock(blockPosition, true); + } + + // Probes the nodes in the given column + for(; probePosition.Y > minSearchHeight; probePosition.Y--) { - MapNode n = getNodeNoEx(p); - if(n.getContent() != CONTENT_IGNORE) + if(cacheBlocks) { + // Calculate the block position of the given node + blockPosition = getNodeBlockPos(probePosition); + + // If the node is in an different block, cache it + if(blockPosition != prevBlockPosition) { + emergeBlock(blockPosition, true); + prevBlockPosition = blockPosition; + } + } + + MapNode node = getNodeNoEx(probePosition); + if (node.getContent() != CONTENT_IGNORE && + node.getContent() != CONTENT_AIR) { break; - } - if(p.Y == min) - goto plan_b; - // If this node is not air, go to plan b - if(getNodeNoEx(p).getContent() != CONTENT_AIR) - goto plan_b; - // Search existing walkable and return it - for(; p.Y>min; p.Y--) - { - MapNode n = getNodeNoEx(p); - if(content_walkable(n.d) && n.getContent() != CONTENT_IGNORE) - return p.Y; + } } - // Move to plan b -plan_b: -#endif + // Could not determine the ground. Use map generator noise functions. + if(probePosition.Y == minSearchHeight) { + level = referenceHeight; + } else { + level = probePosition.Y; + } - /* - Determine from map generator noise functions - */ - - s16 level = m_emerge->getGroundLevelAtPoint(p2d); return level; - - //double level = base_rock_level_2d(m_seed, p2d) + AVERAGE_MUD_AMOUNT; - //return (s16)level; } bool ServerMap::loadFromFolders() { diff --git a/src/map.h b/src/map.h index 8abea896e..d4656acc6 100644 --- a/src/map.h +++ b/src/map.h @@ -428,7 +428,7 @@ public: void prepareBlock(MapBlock *block); // Helper for placing objects on ground level - s16 findGroundLevel(v2s16 p2d); + s16 findGroundLevel(v2s16 p2d, bool cacheBlocks); /* Misc. helper functions for fiddling with directory and file diff --git a/src/server.cpp b/src/server.cpp index 6b9e656e9..13b59e7f5 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2285,8 +2285,9 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } /*infostream<<"Server::ProcessData(): Moved player "< water_level + 6) // Don't go to high places + if (groundheight > water_level + g_settings->getS16("max_spawn_height")) // Don't go to high places continue; nodepos = v3s16(nodepos2d.X, groundheight, nodepos2d.Y); From 35f88ac67c872077206f01d05589dc208ee5851f Mon Sep 17 00:00:00 2001 From: sapier Date: Fri, 6 Dec 2013 17:49:10 +0100 Subject: [PATCH 160/198] Fix win32 jthread implementation --- src/jthread/win32/jsemaphore.cpp | 2 +- src/jthread/win32/jthread.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/jthread/win32/jsemaphore.cpp mode change 100644 => 100755 src/jthread/win32/jthread.cpp diff --git a/src/jthread/win32/jsemaphore.cpp b/src/jthread/win32/jsemaphore.cpp old mode 100644 new mode 100755 index 8eca6d247..3a1f2715c --- a/src/jthread/win32/jsemaphore.cpp +++ b/src/jthread/win32/jsemaphore.cpp @@ -27,7 +27,7 @@ JSemaphore::JSemaphore() { } JSemaphore::~JSemaphore() { - CloseHandle(&m_hSemaphore); + CloseHandle(m_hSemaphore); } JSemaphore::JSemaphore(int initval) { diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp old mode 100644 new mode 100755 index 0781982e2..6a745c590 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -46,14 +46,21 @@ JThread::~JThread() void JThread::Stop() { runningmutex.Lock(); - requeststop = false; + requeststop = true; runningmutex.Unlock(); } void JThread::Wait() { - int WaitForSingleObject_retval = WaitForSingleObject(threadhandle, INFINITE); - assert(WaitForSingleObject_retval == 0); - UNUSED(WaitForSingleObject_retval); + runningmutex.Lock(); + if (running) + { + runningmutex.Unlock(); + WaitForSingleObject(threadhandle, INFINITE); + } + else + { + runningmutex.Unlock(); + } } int JThread::Start() From e15681080e4f7cd5a830fae2e21abf683ea344ba Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 6 Dec 2013 18:37:32 +0100 Subject: [PATCH 161/198] Fix small mistake in Lua API docs --- doc/lua_api.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 3505b4635..cc8044fa9 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1105,6 +1105,7 @@ minetest.pos_to_string({x=X,y=Y,z=Z}) -> "(X,Y,Z)" ^ Convert position to a printable string minetest.string_to_pos(string) -> position ^ Same but in reverse +minetest.formspec_escape(string) -> string ^ escapes characters [ ] \ , ; that can not be used in formspecs minetest.is_yes(arg) ^ returns whether arg can be interpreted as yes From 96f753a108600619f94015bf889a73d97e44ce3a Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 6 Dec 2013 22:40:04 -0500 Subject: [PATCH 162/198] Fix paralax occlusion setting --- src/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index 22abe4c74..68bd12b97 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -821,7 +821,7 @@ public: services->setPixelShaderConstant("enableBumpmapping", &enable_bumpmapping, 1); float enable_parallax_occlusion = 0; - if (g_settings->getBool("enable_parallax_occlusion"));{ + if (g_settings->getBool("enable_parallax_occlusion")) { enable_parallax_occlusion = 1; float parallax_occlusion_scale = g_settings->getFloat("parallax_occlusion_scale"); services->setPixelShaderConstant("parallaxOcclusionScale", ¶llax_occlusion_scale, 1); From a0dce51af62e41ddda312b7e877f6a350667a17d Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sat, 7 Dec 2013 22:03:07 -0500 Subject: [PATCH 163/198] Move script_run_callbacks to Lua --- builtin/misc_register.lua | 39 ++++++++++++ src/script/common/c_internal.cpp | 102 ++++++------------------------- 2 files changed, 57 insertions(+), 84 deletions(-) diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index 54022a361..249d272eb 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -314,6 +314,45 @@ minetest.register_item(":", { groups = {not_in_creative_inventory=1}, }) + +function minetest.run_callbacks(callbacks, mode, ...) + assert(type(callbacks) == "table") + local cb_len = #callbacks + if cb_len == 0 then + if mode == 2 or mode == 3 then + return true + elseif mode == 4 or mode == 5 then + return false + end + end + local ret = nil + for i = 1, cb_len do + local cb_ret = callbacks[i](...) + + if mode == 0 and i == 1 then + ret = cb_ret + elseif mode == 1 and i == cb_len then + ret = cb_ret + elseif mode == 2 then + if not cb_ret or i == 1 then + ret = cb_ret + end + elseif mode == 3 then + if cb_ret then + return cb_ret + end + ret = cb_ret + elseif mode == 4 then + if (cb_ret and not ret) or i == 1 then + ret = cb_ret + end + elseif mode == 5 and cb_ret then + return cb_ret + end + end + return ret +end + -- -- Callback registration -- diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp index f22e9b0ff..2866cfe86 100644 --- a/src/script/common/c_internal.cpp +++ b/src/script/common/c_internal.cpp @@ -66,101 +66,35 @@ void script_error(lua_State *L) // Then push nargs arguments. // Then call this function, which // - runs the callbacks -// - removes the table and arguments from the lua stack -// - pushes the return value, computed depending on mode +// - replaces the table and arguments with the return value, +// computed depending on mode void script_run_callbacks(lua_State *L, int nargs, RunCallbacksMode mode) { - // Insert the return value into the lua stack, below the table assert(lua_gettop(L) >= nargs + 1); - lua_pushnil(L); - int rv = lua_gettop(L) - nargs - 1; - lua_insert(L, rv); - - // Insert error handler after return value + // Insert error handler lua_pushcfunction(L, script_error_handler); - int errorhandler = rv + 1; + int errorhandler = lua_gettop(L) - nargs - 1; lua_insert(L, errorhandler); + // Insert minetest.run_callbacks between error handler and table + lua_getglobal(L, "minetest"); + lua_getfield(L, -1, "run_callbacks"); + lua_remove(L, -2); + lua_insert(L, errorhandler + 1); + + // Insert mode after table + lua_pushnumber(L, (int) mode); + lua_insert(L, errorhandler + 3); + // Stack now looks like this: - // ... ... + // ...
... - int table = errorhandler + 1; - int arg = table + 1; - - luaL_checktype(L, table, LUA_TTABLE); - - // Foreach - lua_pushnil(L); - bool first_loop = true; - while(lua_next(L, table) != 0){ - // key at index -2 and value at index -1 - luaL_checktype(L, -1, LUA_TFUNCTION); - // Call function - for(int i = 0; i < nargs; i++) - lua_pushvalue(L, arg+i); - if(lua_pcall(L, nargs, 1, errorhandler)) - script_error(L); - - // Move return value to designated space in stack - // Or pop it - if(first_loop){ - // Result of first callback is always moved - lua_replace(L, rv); - first_loop = false; - } else { - // Otherwise, what happens depends on the mode - if(mode == RUN_CALLBACKS_MODE_FIRST) - lua_pop(L, 1); - else if(mode == RUN_CALLBACKS_MODE_LAST) - lua_replace(L, rv); - else if(mode == RUN_CALLBACKS_MODE_AND || - mode == RUN_CALLBACKS_MODE_AND_SC){ - if((bool)lua_toboolean(L, rv) == true && - (bool)lua_toboolean(L, -1) == false) - lua_replace(L, rv); - else - lua_pop(L, 1); - } - else if(mode == RUN_CALLBACKS_MODE_OR || - mode == RUN_CALLBACKS_MODE_OR_SC){ - if((bool)lua_toboolean(L, rv) == false && - (bool)lua_toboolean(L, -1) == true) - lua_replace(L, rv); - else - lua_pop(L, 1); - } - else - assert(0); - } - - // Handle short circuit modes - if(mode == RUN_CALLBACKS_MODE_AND_SC && - (bool)lua_toboolean(L, rv) == false) - break; - else if(mode == RUN_CALLBACKS_MODE_OR_SC && - (bool)lua_toboolean(L, rv) == true) - break; - - // value removed, keep key for next iteration + if (lua_pcall(L, nargs + 2, 1, errorhandler)) { + script_error(L); } - // Remove stuff from stack, leaving only the return value - lua_settop(L, rv); - - // Fix return value in case no callbacks were called - if(first_loop){ - if(mode == RUN_CALLBACKS_MODE_AND || - mode == RUN_CALLBACKS_MODE_AND_SC){ - lua_pop(L, 1); - lua_pushboolean(L, true); - } - else if(mode == RUN_CALLBACKS_MODE_OR || - mode == RUN_CALLBACKS_MODE_OR_SC){ - lua_pop(L, 1); - lua_pushboolean(L, false); - } - } + lua_remove(L, -2); // Remove error handler } From bbae8eb7514be2fef4d3931c3cec37c04c415786 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 7 Dec 2013 22:45:21 -0500 Subject: [PATCH 164/198] Dungeongen: Create dungeon gen tuneables; add desert temples for Mapgen V6 --- src/dungeongen.cpp | 135 ++++++++++++++++++++++++++++----------------- src/dungeongen.h | 84 ++++++++++------------------ src/mapgen_v6.cpp | 40 +++++++++++++- src/mapgen_v6.h | 7 ++- src/mapgen_v7.cpp | 2 +- 5 files changed, 158 insertions(+), 110 deletions(-) diff --git a/src/dungeongen.cpp b/src/dungeongen.cpp index 7b529a83f..fee6f66c0 100644 --- a/src/dungeongen.cpp +++ b/src/dungeongen.cpp @@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "settings.h" // For g_settings #include "main.h" // For g_profiler +//#define DGEN_USE_TORCHES + NoiseParams nparams_dungeon_rarity = {0.0, 1.0, v3f(500.0, 500.0, 500.0), 0, 2, 0.8}; NoiseParams nparams_dungeon_wetness = @@ -40,42 +42,49 @@ NoiseParams nparams_dungeon_density = /////////////////////////////////////////////////////////////////////////////// -DungeonGen::DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel) { +DungeonGen::DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel, + DungeonParams *dparams) { this->ndef = ndef; this->mapseed = seed; this->water_level = waterlevel; + +#ifdef DGEN_USE_TORCHES + c_torch = ndef->getId("default:torch"); +#endif - np_rarity = &nparams_dungeon_rarity; - np_wetness = &nparams_dungeon_wetness; - np_density = &nparams_dungeon_density; - /* - cid_water_source = ndef->getId("mapgen_water_source"); - cid_cobble = ndef->getId("mapgen_cobble"); - cid_mossycobble = ndef->getId("mapgen_mossycobble"); - cid_torch = ndef->getId("default:torch"); - */ + if (dparams) { + memcpy(&dp, dparams, sizeof(dp)); + } else { + dp.c_water = ndef->getId("mapgen_water_source"); + dp.c_cobble = ndef->getId("mapgen_cobble"); + dp.c_moss = ndef->getId("mapgen_mossycobble"); + dp.c_stair = ndef->getId("mapgen_stair_cobble"); + + dp.diagonal_dirs = false; + dp.mossratio = 3.0; + dp.holesize = v3s16(1, 2, 1); + dp.roomsize = v3s16(0,0,0); + + dp.np_rarity = nparams_dungeon_rarity; + dp.np_wetness = nparams_dungeon_wetness; + dp.np_density = nparams_dungeon_density; + } } void DungeonGen::generate(ManualMapVoxelManipulator *vm, u32 bseed, - v3s16 nmin, v3s16 nmax) { + v3s16 nmin, v3s16 nmax) { //TimeTaker t("gen dungeons"); int approx_groundlevel = 10 + water_level; if ((nmin.Y + nmax.Y) / 2 >= approx_groundlevel || - NoisePerlin3D(np_rarity, nmin.X, nmin.Y, nmin.Z, mapseed) < 0.2) + NoisePerlin3D(&dp.np_rarity, nmin.X, nmin.Y, nmin.Z, mapseed) < 0.2) return; this->vmanip = vm; this->blockseed = bseed; random.seed(bseed + 2); - cid_water_source = ndef->getId("mapgen_water_source"); - cid_cobble = ndef->getId("mapgen_cobble"); - cid_mossycobble = ndef->getId("mapgen_mossycobble"); - //cid_torch = ndef->getId("default:torch"); - cid_cobblestair = ndef->getId("mapgen_stair_cobble"); - // Dungeon generator doesn't modify places which have this set vmanip->clearFlag(VMANIP_FLAG_DUNGEON_INSIDE | VMANIP_FLAG_DUNGEON_PRESERVE); @@ -86,7 +95,7 @@ void DungeonGen::generate(ManualMapVoxelManipulator *vm, u32 bseed, u32 i = vmanip->m_area.index(nmin.X, y, z); for (s16 x = nmin.X; x <= nmax.X; x++) { content_t c = vmanip->m_data[i].getContent(); - if (c == CONTENT_AIR || c == cid_water_source) + if (c == CONTENT_AIR || c == dp.c_water) vmanip->m_flags[i] |= VMANIP_FLAG_DUNGEON_PRESERVE; i++; } @@ -95,17 +104,18 @@ void DungeonGen::generate(ManualMapVoxelManipulator *vm, u32 bseed, // Add it makeDungeon(v3s16(1,1,1) * MAP_BLOCKSIZE); - + // Convert some cobble to mossy cobble - for (s16 z = nmin.Z; z <= nmax.Z; z++) { + if (dp.mossratio != 0.0) { + for (s16 z = nmin.Z; z <= nmax.Z; z++) for (s16 y = nmin.Y; y <= nmax.Y; y++) { u32 i = vmanip->m_area.index(nmin.X, y, z); for (s16 x = nmin.X; x <= nmax.X; x++) { - if (vmanip->m_data[i].getContent() == cid_cobble) { - float wetness = NoisePerlin3D(np_wetness, x, y, z, mapseed); - float density = NoisePerlin3D(np_density, x, y, z, blockseed); - if (density < wetness / 3.0) - vmanip->m_data[i].setContent(cid_mossycobble); + if (vmanip->m_data[i].getContent() == dp.c_cobble) { + float wetness = NoisePerlin3D(&dp.np_wetness, x, y, z, mapseed); + float density = NoisePerlin3D(&dp.np_density, x, y, z, blockseed); + if (density < wetness / dp.mossratio) + vmanip->m_data[i].setContent(dp.c_moss); } i++; } @@ -132,7 +142,8 @@ void DungeonGen::makeDungeon(v3s16 start_padding) roomsize = is_large_room ? v3s16(random.range(8, 16),random.range(8, 16),random.range(8, 16)) : v3s16(random.range(4, 8),random.range(4, 6),random.range(4, 8)); - + roomsize += dp.roomsize; + // start_padding is used to disallow starting the generation of // a dungeon in a neighboring generation chunk roomplace = vmanip->m_area.MinEdge + start_padding + v3s16( @@ -184,8 +195,10 @@ void DungeonGen::makeDungeon(v3s16 start_padding) v3s16 room_center = roomplace + v3s16(roomsize.X / 2, 1, roomsize.Z / 2); +#ifdef DGEN_USE_TORCHES // Place torch at room center (for testing) - //vmanip->m_data[vmanip->m_area.index(room_center)] = MapNode(cid_torch); + vmanip->m_data[vmanip->m_area.index(room_center)] = MapNode(c_torch); +#endif // Quit if last room if (i == room_count - 1) @@ -231,6 +244,8 @@ void DungeonGen::makeDungeon(v3s16 start_padding) // Find a place for a random sized room roomsize = v3s16(random.range(4,8),random.range(4,6),random.range(4,8)); + roomsize += dp.roomsize; + m_pos = corridor_end; m_dir = corridor_end_dir; r = findPlaceForRoomDoor(roomsize, doorplace, doordir, roomplace); @@ -250,7 +265,7 @@ void DungeonGen::makeDungeon(v3s16 start_padding) void DungeonGen::makeRoom(v3s16 roomsize, v3s16 roomplace) { - MapNode n_cobble(cid_cobble); + MapNode n_cobble(dp.c_cobble); MapNode n_air(CONTENT_AIR); // Make +-X walls @@ -361,16 +376,19 @@ void DungeonGen::makeFill(v3s16 place, v3s16 size, void DungeonGen::makeHole(v3s16 place) { - makeFill(place, v3s16(1, 2, 1), 0, MapNode(CONTENT_AIR), - VMANIP_FLAG_DUNGEON_INSIDE); + makeFill(place, dp.holesize, 0, + MapNode(CONTENT_AIR), VMANIP_FLAG_DUNGEON_INSIDE); } void DungeonGen::makeDoor(v3s16 doorplace, v3s16 doordir) { makeHole(doorplace); + +#ifdef DGEN_USE_TORCHES // Place torch (for testing) - //vmanip->m_data[vmanip->m_area.index(doorplace)] = MapNode(cid_torch); + vmanip->m_data[vmanip->m_area.index(doorplace)] = MapNode(c_torch); +#endif } @@ -401,30 +419,32 @@ void DungeonGen::makeCorridor(v3s16 doorplace, if (vmanip->m_area.contains(p) == true && vmanip->m_area.contains(p + v3s16(0, 1, 0)) == true) { if (make_stairs) { - makeFill(p + v3s16(-1, -1, -1), v3s16(3, 5, 3), - VMANIP_FLAG_DUNGEON_UNTOUCHABLE, MapNode(cid_cobble), 0); + makeFill(p + v3s16(-1, -1, -1), dp.holesize + v3s16(2, 3, 2), + VMANIP_FLAG_DUNGEON_UNTOUCHABLE, MapNode(dp.c_cobble), 0); makeHole(p); makeHole(p - dir); // TODO: fix stairs code so it works 100% (quite difficult) // exclude stairs from the bottom step - if (((make_stairs == 1) && i != 0) || - ((make_stairs == -1) && i != length - 1)) { + // exclude stairs from diagonal steps + if (((dir.X ^ dir.Z) & 1) && + (((make_stairs == 1) && i != 0) || + ((make_stairs == -1) && i != length - 1))) { // rotate face 180 deg if making stairs backwards int facedir = dir_to_facedir(dir * make_stairs); u32 vi = vmanip->m_area.index(p.X - dir.X, p.Y - 1, p.Z - dir.Z); - if (vmanip->m_data[vi].getContent() == cid_cobble) - vmanip->m_data[vi] = MapNode(cid_cobblestair, 0, facedir); + if (vmanip->m_data[vi].getContent() == dp.c_cobble) + vmanip->m_data[vi] = MapNode(dp.c_stair, 0, facedir); vi = vmanip->m_area.index(p.X, p.Y, p.Z); - if (vmanip->m_data[vi].getContent() == cid_cobble) - vmanip->m_data[vi] = MapNode(cid_cobblestair, 0, facedir); + if (vmanip->m_data[vi].getContent() == dp.c_cobble) + vmanip->m_data[vi] = MapNode(dp.c_stair, 0, facedir); } } else { - makeFill(p + v3s16(-1, -1, -1), v3s16(3, 4, 3), - VMANIP_FLAG_DUNGEON_UNTOUCHABLE, MapNode(cid_cobble), 0); + makeFill(p + v3s16(-1, -1, -1), dp.holesize + v3s16(2, 2, 2), + VMANIP_FLAG_DUNGEON_UNTOUCHABLE, MapNode(dp.c_cobble), 0); makeHole(p); } @@ -469,8 +489,8 @@ bool DungeonGen::findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir) randomizeDir(); continue; } - if (vmanip->getNodeNoExNoEmerge(p).getContent() == cid_cobble - && vmanip->getNodeNoExNoEmerge(p1).getContent() == cid_cobble) + if (vmanip->getNodeNoExNoEmerge(p).getContent() == dp.c_cobble + && vmanip->getNodeNoExNoEmerge(p1).getContent() == dp.c_cobble) { // Found wall, this is a good place! result_place = p; @@ -483,12 +503,12 @@ bool DungeonGen::findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir) Determine where to move next */ // Jump one up if the actual space is there - if (vmanip->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == cid_cobble + if (vmanip->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == dp.c_cobble && vmanip->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == CONTENT_AIR && vmanip->getNodeNoExNoEmerge(p+v3s16(0,2,0)).getContent() == CONTENT_AIR) p += v3s16(0,1,0); // Jump one down if the actual space is there - if (vmanip->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == cid_cobble + if (vmanip->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == dp.c_cobble && vmanip->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == CONTENT_AIR && vmanip->getNodeNoExNoEmerge(p+v3s16(0,-1,0)).getContent() == CONTENT_AIR) p += v3s16(0,-1,0); @@ -577,12 +597,25 @@ bool DungeonGen::findPlaceForRoomDoor(v3s16 roomsize, v3s16 &result_doorplace, } -v3s16 rand_ortho_dir(PseudoRandom &random) +v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs) { - if (random.next() % 2 == 0) - return random.next() % 2 ? v3s16(-1, 0, 0) : v3s16(1, 0, 0); - else - return random.next() % 2 ? v3s16(0, 0, -1) : v3s16(0, 0, 1); + // Make diagonal directions somewhat rare + if (diagonal_dirs && (random.next() % 4 == 0)) { + v3s16 dir; + int trycount = 0; + + do { + trycount++; + dir = v3s16(random.next() % 3 - 1, 0, random.next() % 3 - 1); + } while ((dir.X == 0 && dir.Z == 0) && trycount < 10); + + return dir; + } else { + if (random.next() % 2 == 0) + return random.next() % 2 ? v3s16(-1, 0, 0) : v3s16(1, 0, 0); + else + return random.next() % 2 ? v3s16(0, 0, -1) : v3s16(0, 0, 1); + } } diff --git a/src/dungeongen.h b/src/dungeongen.h index 4be3df4aa..b2b28db3a 100644 --- a/src/dungeongen.h +++ b/src/dungeongen.h @@ -31,11 +31,29 @@ with this program; if not, write to the Free Software Foundation, Inc., class ManualMapVoxelManipulator; class INodeDefManager; -v3s16 rand_ortho_dir(PseudoRandom &random); + +v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs); v3s16 turn_xz(v3s16 olddir, int t); v3s16 random_turn(PseudoRandom &random, v3s16 olddir); int dir_to_facedir(v3s16 d); + +struct DungeonParams { + content_t c_water; + content_t c_cobble; + content_t c_moss; + content_t c_stair; + + bool diagonal_dirs; + float mossratio; + v3s16 holesize; + v3s16 roomsize; + + NoiseParams np_rarity; + NoiseParams np_wetness; + NoiseParams np_density; +}; + class DungeonGen { public: u32 blockseed; @@ -45,25 +63,17 @@ public: PseudoRandom random; v3s16 csize; s16 water_level; - - NoiseParams *np_rarity; - NoiseParams *np_wetness; - NoiseParams *np_density; - - content_t cid_water_source; - content_t cid_cobble; - content_t cid_mossycobble; - content_t cid_torch; - content_t cid_cobblestair; + + content_t c_torch; + DungeonParams dp; //RoomWalker v3s16 m_pos; v3s16 m_dir; - DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel); + DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel, DungeonParams *dparams); void generate(ManualMapVoxelManipulator *vm, u32 bseed, - v3s16 full_node_min, v3s16 full_node_max); - //void generate(v3s16 full_node_min, v3s16 full_node_max, u32 bseed); + v3s16 full_node_min, v3s16 full_node_max); void makeDungeon(v3s16 start_padding); void makeRoom(v3s16 roomsize, v3s16 roomplace); @@ -79,50 +89,12 @@ public: void randomizeDir() { - m_dir = rand_ortho_dir(random); + m_dir = rand_ortho_dir(random, dp.diagonal_dirs); } }; -class RoomWalker -{ -public: - - RoomWalker(VoxelManipulator &vmanip_, v3s16 pos, PseudoRandom &random, - INodeDefManager *ndef): - vmanip(vmanip_), - m_pos(pos), - m_random(random), - m_ndef(ndef) - { - randomizeDir(); - } - - void randomizeDir() - { - m_dir = rand_ortho_dir(m_random); - } - - void setPos(v3s16 pos) - { - m_pos = pos; - } - - void setDir(v3s16 dir) - { - m_dir = dir; - } - - //bool findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir); - //bool findPlaceForRoomDoor(v3s16 roomsize, v3s16 &result_doorplace, - // v3s16 &result_doordir, v3s16 &result_roomplace); - -private: - VoxelManipulator &vmanip; - v3s16 m_pos; - v3s16 m_dir; - PseudoRandom &m_random; - INodeDefManager *m_ndef; -}; - +extern NoiseParams nparams_dungeon_rarity; +extern NoiseParams nparams_dungeon_wetness; +extern NoiseParams nparams_dungeon_density; #endif diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index 64f3b9ed9..11491b6b6 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -393,10 +393,22 @@ void MapgenV6::makeChunk(BlockMakeData *data) { c_cobble = ndef->getId("mapgen_cobble"); c_desert_sand = ndef->getId("mapgen_desert_sand"); c_desert_stone = ndef->getId("mapgen_desert_stone"); + c_mossycobble = ndef->getId("mapgen_mossycobble"); + c_sandbrick = ndef->getId("mapgen_sandstonebrick"); + c_stair_cobble = ndef->getId("mapgen_stair_cobble"); + c_stair_sandstone = ndef->getId("mapgen_stair_sandstone"); if (c_desert_sand == CONTENT_IGNORE) c_desert_sand = c_sand; if (c_desert_stone == CONTENT_IGNORE) c_desert_stone = c_stone; + if (c_mossycobble == CONTENT_IGNORE) + c_mossycobble = c_cobble; + if (c_sandbrick == CONTENT_IGNORE) + c_sandbrick = c_desert_stone; + if (c_stair_cobble == CONTENT_IGNORE) + c_stair_cobble = c_cobble; + if (c_stair_sandstone == CONTENT_IGNORE) + c_stair_sandstone = c_sandbrick; // Maximum height of the stone surface and obstacles. // This is used to guide the cave generation @@ -432,7 +444,33 @@ void MapgenV6::makeChunk(BlockMakeData *data) { // Add dungeons if (flags & MG_DUNGEONS) { - DungeonGen dgen(ndef, data->seed, water_level); + DungeonParams dp; + + dp.np_rarity = nparams_dungeon_rarity; + dp.np_density = nparams_dungeon_density; + dp.np_wetness = nparams_dungeon_wetness; + dp.c_water = c_water_source; + if (getBiome(0, v2s16(node_min.X, node_min.Z)) == BT_NORMAL) { + dp.c_cobble = c_cobble; + dp.c_moss = c_mossycobble; + dp.c_stair = c_stair_cobble; + + dp.diagonal_dirs = false; + dp.mossratio = 3.0; + dp.holesize = v3s16(1, 2, 1); + dp.roomsize = v3s16(0, 0, 0); + } else { + dp.c_cobble = c_sandbrick; + dp.c_moss = c_sandbrick; // should make this 'cracked sandstone' later + dp.c_stair = c_stair_sandstone; + + dp.diagonal_dirs = true; + dp.mossratio = 0.0; + dp.holesize = v3s16(2, 3, 2); + dp.roomsize = v3s16(2, 5, 2); + } + + DungeonGen dgen(ndef, data->seed, water_level, &dp); dgen.generate(vm, blockseed, full_node_min, full_node_max); } diff --git a/src/mapgen_v6.h b/src/mapgen_v6.h index 14736e3d0..eec5e4677 100644 --- a/src/mapgen_v6.h +++ b/src/mapgen_v6.h @@ -107,7 +107,7 @@ public: NoiseParams *np_apple_trees; float freq_desert; float freq_beach; - + content_t c_stone; content_t c_dirt; content_t c_dirt_with_grass; @@ -119,6 +119,11 @@ public: content_t c_desert_sand; content_t c_desert_stone; + content_t c_mossycobble; + content_t c_sandbrick; + content_t c_stair_cobble; + content_t c_stair_sandstone; + MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge); ~MapgenV6(); diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp index 1579c313c..88da4fcd2 100644 --- a/src/mapgen_v7.cpp +++ b/src/mapgen_v7.cpp @@ -207,7 +207,7 @@ void MapgenV7::makeChunk(BlockMakeData *data) { generateCaves(stone_surface_max_y); if (flags & MG_DUNGEONS) { - DungeonGen dgen(ndef, data->seed, water_level); + DungeonGen dgen(ndef, data->seed, water_level, NULL); dgen.generate(vm, blockseed, full_node_min, full_node_max); } From 83cc8823354c1c476498ddf35052f403ea247e80 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 7 Dec 2013 23:43:46 -0500 Subject: [PATCH 165/198] EmergeManager: Fix Lua mapgen override param handling --- src/emerge.cpp | 145 +++++++++++++++++++++++++++++++------------------ src/emerge.h | 13 +++-- src/mapgen.cpp | 138 +++++++++++++++++++++++----------------------- src/mapgen.h | 38 ++++++------- 4 files changed, 186 insertions(+), 148 deletions(-) diff --git a/src/emerge.cpp b/src/emerge.cpp index e66e9520b..94b6464f6 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -56,10 +56,10 @@ public: Mapgen *mapgen; bool enable_mapgen_debug_info; int id; - + Event qevent; std::queue blockqueue; - + EmergeThread(Server *server, int ethreadid): SimpleThread(), m_server(server), @@ -100,14 +100,14 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { this->ndef = gamedef->getNodeDefManager(); this->biomedef = new BiomeDefManager(); this->params = NULL; - + this->luaoverride_params = NULL; this->luaoverride_params_modified = 0; this->luaoverride_flagmask = 0; - + mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info"); - + int nthreads; if (g_settings->get("num_emerge_threads").empty()) { int nprocs = porting::getNumberOfProcessors(); @@ -118,7 +118,7 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { } if (nthreads < 1) nthreads = 1; - + qlimit_total = g_settings->getU16("emergequeue_limit_total"); qlimit_diskonly = g_settings->get("emergequeue_limit_diskonly").empty() ? nthreads * 5 + 1 : @@ -126,10 +126,10 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { qlimit_generate = g_settings->get("emergequeue_limit_generate").empty() ? nthreads + 1 : g_settings->getU16("emergequeue_limit_generate"); - + for (int i = 0; i != nthreads; i++) emergethread.push_back(new EmergeThread((Server *)gamedef, i)); - + infostream << "EmergeManager: using " << nthreads << " threads" << std::endl; } @@ -152,7 +152,7 @@ EmergeManager::~EmergeManager() { for (unsigned int i = 0; i < decorations.size(); i++) delete decorations[i]; decorations.clear(); - + for (std::map::iterator iter = mglist.begin(); iter != mglist.end(); iter ++) { delete iter->second; @@ -165,61 +165,97 @@ EmergeManager::~EmergeManager() { void EmergeManager::initMapgens(MapgenParams *mgparams) { Mapgen *mg; - + if (mapgen.size()) return; - + // Resolve names of nodes for things that were registered // (at this point, the registration period is over) biomedef->resolveNodeNames(ndef); - + for (size_t i = 0; i != ores.size(); i++) ores[i]->resolveNodeNames(ndef); - + for (size_t i = 0; i != decorations.size(); i++) decorations[i]->resolveNodeNames(ndef); - + // Apply mapgen parameter overrides from Lua if (luaoverride_params) { - if (luaoverride_params_modified & MGPARAMS_SET_MGNAME) - mgparams->mg_name = luaoverride_params->mg_name; - + if (luaoverride_params_modified & MGPARAMS_SET_MGNAME) { + MapgenParams *mgp = setMapgenType(mgparams, luaoverride_params->mg_name); + if (!mgp) { + errorstream << "EmergeManager: Failed to set new mapgen name" + << std::endl; + } else { + mgparams = mgp; + } + } + if (luaoverride_params_modified & MGPARAMS_SET_SEED) mgparams->seed = luaoverride_params->seed; - + if (luaoverride_params_modified & MGPARAMS_SET_WATER_LEVEL) mgparams->water_level = luaoverride_params->water_level; - + if (luaoverride_params_modified & MGPARAMS_SET_FLAGS) { mgparams->flags &= ~luaoverride_flagmask; mgparams->flags |= luaoverride_params->flags; } - + delete luaoverride_params; luaoverride_params = NULL; } - + // Create the mapgens this->params = mgparams; for (size_t i = 0; i != emergethread.size(); i++) { - mg = createMapgen(params->mg_name, 0, params); + mg = createMapgen(params->mg_name, i, params); if (!mg) { - infostream << "EmergeManager: falling back to mapgen v6" << std::endl; - delete params; - params = createMapgenParams("v6"); - mg = createMapgen("v6", 0, params); + infostream << "EmergeManager: Falling back to Mapgen V6" << std::endl; + + params = setMapgenType(params, "v6"); + mg = createMapgen(params->mg_name, i, params); + if (!mg) { + errorstream << "EmergeManager: CRITICAL ERROR: Failed to fall" + "back to Mapgen V6, not generating map" << std::endl; + } } mapgen.push_back(mg); } } +MapgenParams *EmergeManager::setMapgenType(MapgenParams *mgparams, + std::string newname) { + MapgenParams *newparams = createMapgenParams(newname); + if (!newparams) { + errorstream << "EmergeManager: Mapgen override failed" << std::endl; + return NULL; + } + + newparams->mg_name = newname; + newparams->seed = mgparams->seed; + newparams->water_level = mgparams->water_level; + newparams->chunksize = mgparams->chunksize; + newparams->flags = mgparams->flags; + + if (!newparams->readParams(g_settings)) { + errorstream << "EmergeManager: Mapgen override failed" << std::endl; + delete newparams; + return NULL; + } + + delete mgparams; + return newparams; +} + + Mapgen *EmergeManager::getCurrentMapgen() { for (unsigned int i = 0; i != emergethread.size(); i++) { if (emergethread[i]->IsSameThread()) return emergethread[i]->mapgen; } - + return NULL; } @@ -229,19 +265,20 @@ void EmergeManager::triggerAllThreads() { emergethread[i]->trigger(); } + bool EmergeManager::enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate) { std::map::const_iterator iter; BlockEmergeData *bedata; u16 count; u8 flags = 0; int idx = 0; - + if (allow_generate) flags |= BLOCK_EMERGE_ALLOWGEN; { JMutexAutoLock queuelock(queuemutex); - + count = blocks_enqueued.size(); if (count >= qlimit_total) return false; @@ -250,7 +287,7 @@ bool EmergeManager::enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate u16 qlimit_peer = allow_generate ? qlimit_generate : qlimit_diskonly; if (count >= qlimit_peer) return false; - + iter = blocks_enqueued.find(p); if (iter != blocks_enqueued.end()) { bedata = iter->second; @@ -262,9 +299,9 @@ bool EmergeManager::enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate bedata->flags = flags; bedata->peer_requested = peer_id; blocks_enqueued.insert(std::make_pair(p, bedata)); - + peer_queue_count[peer_id] = count + 1; - + // insert into the EmergeThread queue with the least items int lowestitems = emergethread[0]->blockqueue.size(); for (unsigned int i = 1; i != emergethread.size(); i++) { @@ -274,11 +311,11 @@ bool EmergeManager::enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate lowestitems = nitems; } } - + emergethread[idx]->blockqueue.push(p); } emergethread[idx]->qevent.signal(); - + return true; } @@ -286,10 +323,10 @@ bool EmergeManager::enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate int EmergeManager::getGroundLevelAtPoint(v2s16 p) { if (mapgen.size() == 0 || !mapgen[0]) { errorstream << "EmergeManager: getGroundLevelAtPoint() called" - " before mapgen initialized" << std::endl; + " before mapgen initialized" << std::endl; return 0; } - + return mapgen[0]->getGroundLevelAtPoint(p); } @@ -325,7 +362,7 @@ Mapgen *EmergeManager::createMapgen(std::string mgname, int mgid, " not registered" << std::endl; return NULL; } - + MapgenFactory *mgfactory = iter->second; return mgfactory->createMapgen(mgid, mgparams, this); } @@ -339,7 +376,7 @@ MapgenParams *EmergeManager::createMapgenParams(std::string mgname) { " not registered" << std::endl; return NULL; } - + MapgenFactory *mgfactory = iter->second; return mgfactory->createMapgenParams(); } @@ -350,10 +387,10 @@ MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) { MapgenParams *mgparams = createMapgenParams(mg_name); if (!mgparams) return NULL; - + std::string seedstr = settings->get(settings == g_settings ? "fixed_map_seed" : "seed"); - + mgparams->mg_name = mg_name; mgparams->seed = read_seed(seedstr.c_str()); mgparams->water_level = settings->getS16("water_level"); @@ -395,21 +432,21 @@ bool EmergeThread::popBlockEmerge(v3s16 *pos, u8 *flags) { return false; v3s16 p = blockqueue.front(); blockqueue.pop(); - + *pos = p; - + iter = emerge->blocks_enqueued.find(p); if (iter == emerge->blocks_enqueued.end()) return false; //uh oh, queue and map out of sync!! BlockEmergeData *bedata = iter->second; *flags = bedata->flags; - + emerge->peer_queue_count[bedata->peer_requested]--; delete bedata; emerge->blocks_enqueued.erase(iter); - + return true; } @@ -419,7 +456,7 @@ bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b, v2s16 p2d(p.X, p.Z); //envlock: usually takes <=1ms, sometimes 90ms or ~400ms to acquire JMutexAutoLock envlock(m_server->m_env_mutex); - + // Load sector if it isn't loaded if (map->getSectorNoGenerateNoEx(p2d) == NULL) map->loadSectorMeta(p2d); @@ -440,7 +477,7 @@ bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b, *b = block; return map->initBlockMake(data, p); } - + *b = block; return false; } @@ -455,12 +492,12 @@ void *EmergeThread::Thread() { v3s16 last_tried_pos(-32768,-32768,-32768); // For error output v3s16 p; u8 flags; - + map = (ServerMap *)&(m_server->m_env->getMap()); emerge = m_server->m_emerge; mapgen = emerge->mapgen[id]; enable_mapgen_debug_info = emerge->mapgen_debug_info; - + while (getRun()) try { if (!popBlockEmerge(&p, &flags)) { @@ -474,7 +511,7 @@ void *EmergeThread::Thread() { bool allow_generate = flags & BLOCK_EMERGE_ALLOWGEN; EMERGE_DBG_OUT("p=" PP(p) " allow_generate=" << allow_generate); - + /* Try to fetch block from memory or disk. If not found and asked to generate, initialize generator. @@ -482,8 +519,8 @@ void *EmergeThread::Thread() { BlockMakeData data; MapBlock *block = NULL; std::map modified_blocks; - - if (getBlockOrStartGen(p, &block, &data, allow_generate)) { + + if (getBlockOrStartGen(p, &block, &data, allow_generate) && mapgen) { { ScopeProfiler sp(g_profiler, "EmergeThread: Mapgen::makeChunk", SPT_AVG); TimeTaker t("mapgen::make_block()"); @@ -501,7 +538,7 @@ void *EmergeThread::Thread() { "Mapgen::makeChunk (envlock)", SPT_AVG); map->finishBlockMake(&data, modified_blocks); - + block = map->getBlockNoCreateNoEx(p); if (block) { /* @@ -522,7 +559,7 @@ void *EmergeThread::Thread() { } EMERGE_DBG_OUT("ended up with: " << analyze_block(block)); - + m_server->m_env->activateBlock(block, 0); } } @@ -568,7 +605,7 @@ void *EmergeThread::Thread() { err << "You can ignore this using [ignore_world_load_errors = true]."<setAsyncFatalError(err.str()); } - + END_DEBUG_EXCEPTION_HANDLER(errorstream) log_deregister_thread(); return NULL; diff --git a/src/emerge.h b/src/emerge.h index d2ab6894d..ed982924b 100644 --- a/src/emerge.h +++ b/src/emerge.h @@ -83,21 +83,21 @@ public: INodeDefManager *ndef; std::map mglist; - + std::vector mapgen; std::vector emergethread; - + //settings MapgenParams *params; bool mapgen_debug_info; u16 qlimit_total; u16 qlimit_diskonly; u16 qlimit_generate; - + MapgenParams *luaoverride_params; u32 luaoverride_params_modified; u32 luaoverride_flagmask; - + //block emerge queue data structures JMutex queuemutex; std::map blocks_enqueued; @@ -112,17 +112,18 @@ public: ~EmergeManager(); void initMapgens(MapgenParams *mgparams); + MapgenParams *setMapgenType(MapgenParams *mgparams, std::string newname); Mapgen *getCurrentMapgen(); Mapgen *createMapgen(std::string mgname, int mgid, MapgenParams *mgparams); MapgenParams *createMapgenParams(std::string mgname); void triggerAllThreads(); bool enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate); - + void registerMapgen(std::string name, MapgenFactory *mgfactory); MapgenParams *getParamsFromSettings(Settings *settings); void setParamsToSettings(Settings *settings); - + //mapgen helper methods Biome *getBiomeAtPoint(v3s16 p); int getGroundLevelAtPoint(v2s16 p); diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 2be0c1dd2..20fc4459b 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -151,7 +151,7 @@ void OreScatter::generate(ManualMapVoxelManipulator *vm, int seed, int x0 = pr.range(nmin.X, nmax.X - csize + 1); int y0 = pr.range(nmin.Y, nmax.Y - csize + 1); int z0 = pr.range(nmin.Z, nmax.Z - csize + 1); - + if (np && (NoisePerlin3D(np, x0, y0, z0, seed) < nthresh)) continue; @@ -241,7 +241,7 @@ Decoration::~Decoration() { void Decoration::resolveNodeNames(INodeDefManager *ndef) { this->ndef = ndef; - + if (c_place_on == CONTENT_IGNORE) c_place_on = ndef->getId(place_on_name); } @@ -257,7 +257,7 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { "sidelen; setting sidelen to " << carea_size << std::endl; sidelen = carea_size; } - + s16 divlen = carea_size / sidelen; int area = sidelen * sidelen; @@ -287,11 +287,11 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { s16 z = ps.range(p2d_min.Y, p2d_max.Y); int mapindex = carea_size * (z - nmin.Z) + (x - nmin.X); - - s16 y = mg->heightmap ? + + s16 y = mg->heightmap ? mg->heightmap[mapindex] : mg->findGroundLevel(v2s16(x, z), nmin.Y, nmax.Y); - + if (y < nmin.Y || y > nmax.Y) continue; @@ -309,7 +309,7 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { if (mg->biomemap) { std::set::iterator iter; - + if (biomes.size()) { iter = biomes.find(mg->biomemap[mapindex]); if (iter == biomes.end()) @@ -327,7 +327,7 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { PseudoRandom pr(blockseed + 53); std::vector handled_cutoffs; - + // Copy over the cutoffs we're interested in so we don't needlessly hold a lock { JMutexAutoLock cutofflock(cutoff_mutex); @@ -341,37 +341,37 @@ void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) continue; if (p.Y + height < nmin.Y || p.Y > nmax.Y) continue; - + handled_cutoffs.push_back(cutoff); } } - + // Generate the cutoffs for (size_t i = 0; i != handled_cutoffs.size(); i++) { v3s16 p = handled_cutoffs[i].p; s16 height = handled_cutoffs[i].height; - + if (p.Y + height > nmax.Y) { //printf("Decoration at (%d %d %d) cut off again!\n", p.X, p.Y, p.Z); cuttoffs.push_back(v3s16(p.X, p.Y, p.Z)); } - + generate(mg, &pr, nmax.Y, nmin.Y - p.Y, v3s16(p.X, nmin.Y, p.Z)); } - + // Remove cutoffs that were handled from the cutoff list { JMutexAutoLock cutofflock(cutoff_mutex); for (std::list::iterator i = cutoffs.begin(); i != cutoffs.end(); ++i) { - + for (size_t j = 0; j != handled_cutoffs.size(); j++) { CutoffData coff = *i; if (coff.p == handled_cutoffs[j].p) i = cutoffs.erase(i); } } - } + } } #endif @@ -381,7 +381,7 @@ void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) void DecoSimple::resolveNodeNames(INodeDefManager *ndef) { Decoration::resolveNodeNames(ndef); - + if (c_deco == CONTENT_IGNORE && !decolist_names.size()) { c_deco = ndef->getId(deco_name); if (c_deco == CONTENT_IGNORE) { @@ -399,11 +399,11 @@ void DecoSimple::resolveNodeNames(INodeDefManager *ndef) { c_spawnby = CONTENT_AIR; } } - + if (c_decolist.size()) return; - - for (size_t i = 0; i != decolist_names.size(); i++) { + + for (size_t i = 0; i != decolist_names.size(); i++) { content_t c = ndef->getId(decolist_names[i]); if (c == CONTENT_IGNORE) { errorstream << "DecoSimple::resolveNodeNames: decolist node '" @@ -422,7 +422,7 @@ void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) { if (vm->m_data[vi].getContent() != c_place_on && c_place_on != CONTENT_IGNORE) return; - + if (nspawnby != -1) { int nneighs = 0; v3s16 dirs[8] = { // a Moore neighborhood @@ -435,18 +435,18 @@ void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) { v3s16(-1, 0, -1), v3s16( 1, 0, -1) }; - + for (int i = 0; i != 8; i++) { u32 index = vm->m_area.index(p + dirs[i]); if (vm->m_area.contains(index) && vm->m_data[index].getContent() == c_spawnby) nneighs++; } - + if (nneighs < nspawnby) return; } - + size_t ndecos = c_decolist.size(); content_t c_place = ndecos ? c_decolist[pr->range(0, ndecos - 1)] : c_deco; @@ -454,15 +454,15 @@ void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) { pr->range(deco_height, deco_height_max) : deco_height; height = MYMIN(height, max_y - p.Y); - + v3s16 em = vm->m_area.getExtent(); for (int i = 0; i < height; i++) { vm->m_area.add_y(em, vi, 1); - + content_t c = vm->m_data[vi].getContent(); if (c != CONTENT_AIR && c != CONTENT_IGNORE) break; - + vm->m_data[vi] = MapNode(c_place); } } @@ -499,37 +499,37 @@ DecoSchematic::~DecoSchematic() { void DecoSchematic::resolveNodeNames(INodeDefManager *ndef) { Decoration::resolveNodeNames(ndef); - + if (filename.empty()) return; - + if (!node_names) { errorstream << "DecoSchematic::resolveNodeNames: node name list was " "not created" << std::endl; return; } - + for (size_t i = 0; i != node_names->size(); i++) { std::string name = node_names->at(i); - + std::map::iterator it; it = replacements.find(name); if (it != replacements.end()) name = it->second; - + content_t c = ndef->getId(name); if (c == CONTENT_IGNORE) { errorstream << "DecoSchematic::resolveNodeNames: node '" << name << "' not defined" << std::endl; c = CONTENT_AIR; } - + c_nodes.push_back(c); } - + for (int i = 0; i != size.X * size.Y * size.Z; i++) schematic[i].setContent(c_nodes[schematic[i].getContent()]); - + delete node_names; node_names = NULL; } @@ -544,15 +544,15 @@ void DecoSchematic::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) { p.Y -= (size.Y + 1) / 2; if (flags & DECO_PLACE_CENTER_Z) p.Z -= (size.Z + 1) / 2; - + u32 vi = vm->m_area.index(p); if (vm->m_data[vi].getContent() != c_place_on && c_place_on != CONTENT_IGNORE) return; - + Rotation rot = (rotation == ROTATE_RAND) ? (Rotation)pr->range(ROTATE_0, ROTATE_270) : rotation; - + blitToVManip(p, vm, rot, false); } @@ -649,7 +649,7 @@ void DecoSchematic::placeStructure(Map *map, v3s16 p) { Rotation rot = (rotation == ROTATE_RAND) ? (Rotation)myrand_range(ROTATE_0, ROTATE_270) : rotation; - + v3s16 s = (rot == ROTATE_90 || rot == ROTATE_270) ? v3s16(size.Z, size.Y, size.X) : size; @@ -659,17 +659,17 @@ void DecoSchematic::placeStructure(Map *map, v3s16 p) { p.Y -= (s.Y + 1) / 2; if (flags & DECO_PLACE_CENTER_Z) p.Z -= (s.Z + 1) / 2; - + v3s16 bp1 = getNodeBlockPos(p); v3s16 bp2 = getNodeBlockPos(p + s - v3s16(1,1,1)); vm->initialEmerge(bp1, bp2); - + blitToVManip(p, vm, rot, true); - + std::map lighting_modified_blocks; std::map modified_blocks; vm->blitBackAll(&modified_blocks); - + // TODO: Optimize this by using Mapgen::calcLighting() instead lighting_modified_blocks.insert(modified_blocks.begin(), modified_blocks.end()); map->updateLighting(lighting_modified_blocks, modified_blocks); @@ -680,7 +680,7 @@ void DecoSchematic::placeStructure(Map *map, v3s16 p) { it = modified_blocks.begin(); it != modified_blocks.end(); ++it) event.modified_blocks.insert(it->first); - + map->dispatchEvent(&event); } @@ -688,7 +688,7 @@ void DecoSchematic::placeStructure(Map *map, v3s16 p) { bool DecoSchematic::loadSchematicFile() { content_t cignore = CONTENT_IGNORE; bool have_cignore = false; - + std::ifstream is(filename.c_str(), std::ios_base::binary); u32 signature = readU32(is); @@ -697,7 +697,7 @@ bool DecoSchematic::loadSchematicFile() { "file" << std::endl; return false; } - + u16 version = readU16(is); if (version > MTSCHEM_FILE_VER_HIGHEST_READ) { errorstream << "loadSchematicFile: unsupported schematic " @@ -718,9 +718,9 @@ bool DecoSchematic::loadSchematicFile() { } int nodecount = size.X * size.Y * size.Z; - + u16 nidmapcount = readU16(is); - + node_names = new std::vector; for (int i = 0; i != nidmapcount; i++) { std::string name = deSerializeString(is); @@ -736,7 +736,7 @@ bool DecoSchematic::loadSchematicFile() { schematic = new MapNode[nodecount]; MapNode::deSerializeBulk(is, SER_FMT_VER_HIGHEST_READ, schematic, nodecount, 2, 2, true); - + if (version == 1) { // fix up the probability values for (int i = 0; i != nodecount; i++) { if (schematic[i].param1 == 0) @@ -745,7 +745,7 @@ bool DecoSchematic::loadSchematicFile() { schematic[i].param1 = MTSCHEM_PROB_NEVER; } } - + return true; } @@ -774,7 +774,7 @@ bool DecoSchematic::loadSchematicFile() { For each node in schematic: [u8] param2 } - + Version changes: 1 - Initial version 2 - Fixed messy never/always place; 0 probability is now never, 0xFF is always @@ -792,12 +792,12 @@ void DecoSchematic::saveSchematicFile(INodeDefManager *ndef) { std::vector usednodes; int nodecount = size.X * size.Y * size.Z; build_nnlist_and_update_ids(schematic, nodecount, &usednodes); - + u16 numids = usednodes.size(); writeU16(ss, numids); // name count for (int i = 0; i != numids; i++) ss << serializeString(ndef->get(usednodes[i]).name); // node names - + // compressed bulk node data MapNode::serializeBulk(ss, SER_FMT_VER_HIGHEST_WRITE, schematic, nodecount, 2, 2, true); @@ -810,7 +810,7 @@ void build_nnlist_and_update_ids(MapNode *nodes, u32 nodecount, std::vector *usednodes) { std::map nodeidmap; content_t numids = 0; - + for (u32 i = 0; i != nodecount; i++) { content_t id; content_t c = nodes[i].getContent(); @@ -836,7 +836,7 @@ bool DecoSchematic::getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2) { v3s16 bp1 = getNodeBlockPos(p1); v3s16 bp2 = getNodeBlockPos(p2); vm->initialEmerge(bp1, bp2); - + size = p2 - p1 + 1; slice_probs = new u8[size.Y]; @@ -844,7 +844,7 @@ bool DecoSchematic::getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2) { slice_probs[y] = MTSCHEM_PROB_ALWAYS; schematic = new MapNode[size.X * size.Y * size.Z]; - + u32 i = 0; for (s16 z = p1.Z; z <= p2.Z; z++) for (s16 y = p1.Y; y <= p2.Y; y++) { @@ -870,7 +870,7 @@ void DecoSchematic::applyProbabilities(v3s16 p0, if (index < size.Z * size.Y * size.X) { u8 prob = (*plist)[i].second; schematic[index].param1 = prob; - + // trim unnecessary node names from schematic if (prob == MTSCHEM_PROB_NEVER) schematic[index].setContent(CONTENT_AIR); @@ -906,7 +906,7 @@ s16 Mapgen::findGroundLevelFull(v2s16 p2d) { s16 y_nodes_min = vm->m_area.MinEdge.Y; u32 i = vm->m_area.index(p2d.X, y_nodes_max, p2d.Y); s16 y; - + for (y = y_nodes_max; y >= y_nodes_min; y--) { MapNode &n = vm->m_data[i]; if (ndef->get(n).walkable) @@ -922,7 +922,7 @@ s16 Mapgen::findGroundLevel(v2s16 p2d, s16 ymin, s16 ymax) { v3s16 em = vm->m_area.getExtent(); u32 i = vm->m_area.index(p2d.X, ymax, p2d.Y); s16 y; - + for (y = ymax; y >= ymin; y--) { MapNode &n = vm->m_data[i]; if (ndef->get(n).walkable) @@ -937,7 +937,7 @@ s16 Mapgen::findGroundLevel(v2s16 p2d, s16 ymin, s16 ymax) { void Mapgen::updateHeightmap(v3s16 nmin, v3s16 nmax) { if (!heightmap) return; - + //TimeTaker t("Mapgen::updateHeightmap", NULL, PRECISION_MICRO); int index = 0; for (s16 z = nmin.Z; z <= nmax.Z; z++) { @@ -949,7 +949,7 @@ void Mapgen::updateHeightmap(v3s16 nmin, v3s16 nmax) { continue; if (y == nmin.Y - 1 && heightmap[index] < nmin.Y) continue; - + heightmap[index] = y; } } @@ -1040,7 +1040,7 @@ void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax) { continue; } vm->m_area.add_y(em, i, -1); - + for (int y = a.MaxEdge.Y; y >= a.MinEdge.Y; y--) { MapNode &n = vm->m_data[i]; if (!ndef->get(n).sunlight_propagates) @@ -1103,15 +1103,15 @@ void Mapgen::calcLightingOld(v3s16 nmin, v3s16 nmax) { vm->spreadLight(bank, light_sources, ndef); } } - - + + //////////////////////// Mapgen V6 parameter read/write - + bool MapgenV6Params::readParams(Settings *settings) { freq_desert = settings->getFloat("mgv6_freq_desert"); freq_beach = settings->getFloat("mgv6_freq_beach"); - bool success = + bool success = settings->getNoiseParams("mgv6_np_terrain_base", np_terrain_base) && settings->getNoiseParams("mgv6_np_terrain_higher", np_terrain_higher) && settings->getNoiseParams("mgv6_np_steepness", np_steepness) && @@ -1125,12 +1125,12 @@ bool MapgenV6Params::readParams(Settings *settings) { settings->getNoiseParams("mgv6_np_apple_trees", np_apple_trees); return success; } - - + + void MapgenV6Params::writeParams(Settings *settings) { settings->setFloat("mgv6_freq_desert", freq_desert); settings->setFloat("mgv6_freq_beach", freq_beach); - + settings->setNoiseParams("mgv6_np_terrain_base", np_terrain_base); settings->setNoiseParams("mgv6_np_terrain_higher", np_terrain_higher); settings->setNoiseParams("mgv6_np_steepness", np_steepness); @@ -1146,7 +1146,7 @@ void MapgenV6Params::writeParams(Settings *settings) { bool MapgenV7Params::readParams(Settings *settings) { - bool success = + bool success = settings->getNoiseParams("mgv7_np_terrain_base", np_terrain_base) && settings->getNoiseParams("mgv7_np_terrain_alt", np_terrain_alt) && settings->getNoiseParams("mgv7_np_terrain_persist", np_terrain_persist) && diff --git a/src/mapgen.h b/src/mapgen.h index 46261a202..47a7204bc 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -41,7 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /////////////////// Ore generation flags // Use absolute value of height to determine ore placement -#define OREFLAG_ABSHEIGHT 0x01 +#define OREFLAG_ABSHEIGHT 0x01 // Use 3d noise to get density of ore placement, instead of just the position #define OREFLAG_DENSITY 0x02 // not yet implemented // For claylike ore types, place ore if the number of surrounding @@ -81,7 +81,7 @@ struct MapgenParams { chunksize = 5; flags = MG_TREES | MG_CAVES | MGV6_BIOME_BLEND; } - + virtual bool readParams(Settings *settings) { return true; } virtual void writeParams(Settings *settings) {} virtual ~MapgenParams() {} @@ -95,7 +95,7 @@ public: int id; ManualMapVoxelManipulator *vm; INodeDefManager *ndef; - + s16 *heightmap; u8 *biomemap; v3s16 csize; @@ -153,18 +153,18 @@ public: s16 height_max; u8 ore_param2; // to set node-specific attributes u32 flags; // attributes for this ore - float nthresh; // threshhold for noise at which an ore is placed + float nthresh; // threshhold for noise at which an ore is placed NoiseParams *np; // noise for distribution of clusters (NULL for uniform scattering) Noise *noise; - + Ore() { ore = CONTENT_IGNORE; np = NULL; noise = NULL; } - + virtual ~Ore(); - + void resolveNodeNames(INodeDefManager *ndef); void placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); virtual void generate(ManualMapVoxelManipulator *vm, int seed, @@ -199,7 +199,7 @@ struct CutoffData { //v3s16 p; //v3s16 size; //s16 height; - + CutoffData(s16 x, s16 y, s16 z, s16 h) { p = v3s16(x, y, z); height = h; @@ -210,25 +210,25 @@ struct CutoffData { class Decoration { public: INodeDefManager *ndef; - + int mapseed; std::string place_on_name; content_t c_place_on; s16 sidelen; float fill_ratio; NoiseParams *np; - + std::set biomes; //std::list cutoffs; //JMutex cutoff_mutex; Decoration(); virtual ~Decoration(); - + virtual void resolveNodeNames(INodeDefManager *ndef); void placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); void placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); - + virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) = 0; virtual int getHeight() = 0; virtual std::string getName() = 0; @@ -243,12 +243,12 @@ public: s16 deco_height; s16 deco_height_max; s16 nspawnby; - + std::vector decolist_names; std::vector c_decolist; ~DecoSimple() {} - + void resolveNodeNames(INodeDefManager *ndef); virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p); virtual int getHeight(); @@ -265,7 +265,7 @@ public: class DecoSchematic : public Decoration { public: std::string filename; - + std::vector *node_names; std::vector c_nodes; std::map replacements; @@ -278,18 +278,18 @@ public: DecoSchematic(); ~DecoSchematic(); - + void resolveNodeNames(INodeDefManager *ndef); virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p); virtual int getHeight(); virtual std::string getName(); - + void blitToVManip(v3s16 p, ManualMapVoxelManipulator *vm, Rotation rot, bool force_placement); - + bool loadSchematicFile(); void saveSchematicFile(INodeDefManager *ndef); - + bool getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2); void placeStructure(Map *map, v3s16 p); void applyProbabilities(v3s16 p0, From 3cc45fd8adf4213bfd979273a094b33fecb6c7db Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 8 Dec 2013 01:37:41 -0500 Subject: [PATCH 166/198] Fix leak and possible segfault in minetest.set_mapgen_params --- src/script/lua_api/l_mapgen.cpp | 82 +++++++++++++++++---------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index de9b5aba7..fe7ac8dd6 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -81,45 +81,45 @@ struct EnumString ModApiMapgen::es_Rotation[] = int ModApiMapgen::l_get_mapgen_object(lua_State *L) { const char *mgobjstr = lua_tostring(L, 1); - + int mgobjint; if (!string_to_enum(es_MapgenObject, mgobjint, mgobjstr ? mgobjstr : "")) return 0; - + enum MapgenObject mgobj = (MapgenObject)mgobjint; EmergeManager *emerge = getServer(L)->getEmergeManager(); Mapgen *mg = emerge->getCurrentMapgen(); if (!mg) return 0; - + size_t maplen = mg->csize.X * mg->csize.Z; - + int nargs = 1; - + switch (mgobj) { case MGOBJ_VMANIP: { ManualMapVoxelManipulator *vm = mg->vm; - + // VoxelManip object LuaVoxelManip *o = new LuaVoxelManip(vm, true); *(void **)(lua_newuserdata(L, sizeof(void *))) = o; luaL_getmetatable(L, "VoxelManip"); lua_setmetatable(L, -2); - + // emerged min pos push_v3s16(L, vm->m_area.MinEdge); // emerged max pos push_v3s16(L, vm->m_area.MaxEdge); - + nargs = 3; - + break; } case MGOBJ_HEIGHTMAP: { if (!mg->heightmap) return 0; - + lua_newtable(L); for (size_t i = 0; i != maplen; i++) { lua_pushinteger(L, mg->heightmap[i]); @@ -129,7 +129,7 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) case MGOBJ_BIOMEMAP: { if (!mg->biomemap) return 0; - + lua_newtable(L); for (size_t i = 0; i != maplen; i++) { lua_pushinteger(L, mg->biomemap[i]); @@ -140,14 +140,14 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) case MGOBJ_HUMIDMAP: if (strcmp(emerge->params->mg_name.c_str(), "v7")) return 0; - + MapgenV7 *mgv7 = (MapgenV7 *)mg; - float *arr = (mgobj == MGOBJ_HEATMAP) ? + float *arr = (mgobj == MGOBJ_HEATMAP) ? mgv7->noise_heat->result : mgv7->noise_humidity->result; if (!arr) return 0; - + lua_newtable(L); for (size_t i = 0; i != maplen; i++) { lua_pushnumber(L, arr[i]); @@ -155,7 +155,7 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) } break; } } - + return nargs; } @@ -167,25 +167,25 @@ int ModApiMapgen::l_set_mapgen_params(lua_State *L) return 0; EmergeManager *emerge = getServer(L)->getEmergeManager(); - if (emerge->mapgen.size()) + if (!emerge || emerge->mapgen.size()) return 0; - + MapgenParams *oparams = new MapgenParams; u32 paramsmodified = 0; u32 flagmask = 0; - + lua_getfield(L, 1, "mgname"); if (lua_isstring(L, -1)) { oparams->mg_name = std::string(lua_tostring(L, -1)); paramsmodified |= MGPARAMS_SET_MGNAME; } - + lua_getfield(L, 1, "seed"); if (lua_isnumber(L, -1)) { oparams->seed = lua_tointeger(L, -1); paramsmodified |= MGPARAMS_SET_SEED; } - + lua_getfield(L, 1, "water_level"); if (lua_isnumber(L, -1)) { oparams->water_level = lua_tointeger(L, -1); @@ -197,18 +197,20 @@ int ModApiMapgen::l_set_mapgen_params(lua_State *L) std::string flagstr = std::string(lua_tostring(L, -1)); oparams->flags = readFlagString(flagstr, flagdesc_mapgen); paramsmodified |= MGPARAMS_SET_FLAGS; - + lua_getfield(L, 1, "flagmask"); if (lua_isstring(L, -1)) { flagstr = std::string(lua_tostring(L, -1)); flagmask = readFlagString(flagstr, flagdesc_mapgen); } } - + + delete emerge->luaoverride_params; + emerge->luaoverride_params = oparams; emerge->luaoverride_params_modified = paramsmodified; emerge->luaoverride_flagmask = flagmask; - + return 0; } @@ -240,7 +242,7 @@ int ModApiMapgen::l_register_biome(lua_State *L) "air"); b->nname_dust_water = getstringfield_default(L, index, "node_dust_water", "mapgen_water_source"); - + b->depth_top = getintfield_default(L, index, "depth_top", 1); b->depth_filler = getintfield_default(L, index, "depth_filler", 3); b->height_min = getintfield_default(L, index, "height_min", 0); @@ -254,7 +256,7 @@ int ModApiMapgen::l_register_biome(lua_State *L) b->c_water = CONTENT_IGNORE; b->c_dust = CONTENT_IGNORE; b->c_dust_water = CONTENT_IGNORE; - + verbosestream << "register_biome: " << b->name << std::endl; bmgr->addBiome(b); @@ -277,7 +279,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) "decoration placement type"; return 0; } - + Decoration *deco = createDecoration(decotype); if (!deco) { errorstream << "register_decoration: decoration placement type " @@ -295,11 +297,11 @@ int ModApiMapgen::l_register_decoration(lua_State *L) delete deco; return 0; } - + lua_getfield(L, index, "noise_params"); deco->np = read_noiseparams(L, -1); lua_pop(L, 1); - + lua_getfield(L, index, "biomes"); if (lua_istable(L, -1)) { lua_pushnil(L); @@ -313,7 +315,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) } lua_pop(L, 1); } - + switch (decotype) { case DECO_SIMPLE: { DecoSimple *dsimple = (DecoSimple *)deco; @@ -323,7 +325,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) dsimple->deco_height = getintfield_default(L, index, "height", 1); dsimple->deco_height_max = getintfield_default(L, index, "height_max", 0); dsimple->nspawnby = getintfield_default(L, index, "num_spawn_by", -1); - + lua_getfield(L, index, "decoration"); if (lua_istable(L, -1)) { lua_pushnil(L); @@ -340,7 +342,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) dsimple->deco_name = std::string("air"); } lua_pop(L, 1); - + if (dsimple->deco_height <= 0) { errorstream << "register_decoration: simple decoration height" " must be greater than 0" << std::endl; @@ -380,7 +382,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) return 0; } lua_pop(L, -1); - + if (!dschem->filename.empty() && !dschem->loadSchematicFile()) { errorstream << "register_decoration: failed to load schematic file '" << dschem->filename << "'" << std::endl; @@ -390,7 +392,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) break; } case DECO_LSYSTEM: { //DecoLSystem *decolsystem = (DecoLSystem *)deco; - + break; } } @@ -474,7 +476,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L) v3s16 p1 = read_v3s16(L, 1); v3s16 p2 = read_v3s16(L, 2); sortBoxVerticies(p1, p2); - + std::vector > prob_list; if (lua_istable(L, 3)) { lua_pushnil(L); @@ -483,7 +485,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L) lua_getfield(L, -1, "pos"); v3s16 pos = read_v3s16(L, -1); lua_pop(L, 1); - + u8 prob = getintfield_default(L, -1, "prob", MTSCHEM_PROB_ALWAYS); prob_list.push_back(std::make_pair(pos, prob)); } @@ -491,7 +493,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L) lua_pop(L, 1); } } - + std::vector > slice_prob_list; if (lua_istable(L, 5)) { lua_pushnil(L); @@ -516,7 +518,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L) } dschem.applyProbabilities(p1, &prob_list, &slice_prob_list); - + dschem.saveSchematicFile(ndef); actionstream << "create_schematic: saved schematic file '" << dschem.filename << "'." << std::endl; @@ -536,11 +538,11 @@ int ModApiMapgen::l_place_schematic(lua_State *L) v3s16 p = read_v3s16(L, 1); if (!read_schematic(L, 2, &dschem, getServer(L))) return 0; - + int rot = ROTATE_0; if (lua_isstring(L, 3)) string_to_enum(es_Rotation, rot, std::string(lua_tostring(L, 3))); - + dschem.rotation = (Rotation)rot; if (lua_istable(L, 4)) { @@ -568,7 +570,7 @@ int ModApiMapgen::l_place_schematic(lua_State *L) } dschem.resolveNodeNames(ndef); } - + dschem.placeStructure(map, p); return 1; From 206565d9650eeffc86b4223a75203a29bc94cce7 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sun, 8 Dec 2013 08:01:20 +0100 Subject: [PATCH 167/198] Fix shaders on some GPUs --- client/shaders/alpha_shader/opengl_fragment.glsl | 11 ++++++++--- client/shaders/leaves_shader/opengl_fragment.glsl | 10 +++++++--- client/shaders/liquids_shader/opengl_fragment.glsl | 10 +++++++--- client/shaders/plants_shader/opengl_fragment.glsl | 10 +++++++--- client/shaders/solids_shader/opengl_fragment.glsl | 11 ++++++++--- src/shader.cpp | 9 +++++++++ 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/client/shaders/alpha_shader/opengl_fragment.glsl b/client/shaders/alpha_shader/opengl_fragment.glsl index e72c1b9a6..3c0f35eae 100644 --- a/client/shaders/alpha_shader/opengl_fragment.glsl +++ b/client/shaders/alpha_shader/opengl_fragment.glsl @@ -21,14 +21,16 @@ const float e = 2.718281828459; void main (void) { - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - vec3 color; vec2 uv = gl_TexCoord[0].st; + +#ifdef NORMALS float height; vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y); + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) { float map_height = texture2D(normalTexture, uv).a; if (map_height < 1.0){ @@ -49,6 +51,9 @@ void main (void) } else { color = texture2D(baseTexture, uv).rgb; } +#else + color = texture2D(baseTexture, uv).rgb; +#endif float alpha = texture2D(baseTexture, uv).a; vec4 col = vec4(color.r, color.g, color.b, alpha); diff --git a/client/shaders/leaves_shader/opengl_fragment.glsl b/client/shaders/leaves_shader/opengl_fragment.glsl index 127b32d51..00b6884ab 100644 --- a/client/shaders/leaves_shader/opengl_fragment.glsl +++ b/client/shaders/leaves_shader/opengl_fragment.glsl @@ -18,12 +18,13 @@ const float e = 2.718281828459; void main (void) { - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - vec3 color; vec2 uv = gl_TexCoord[0].st; +#ifdef NORMALS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); @@ -36,6 +37,9 @@ void main (void) } else { color = texture2D(baseTexture, uv).rgb; } +#else + color = texture2D(baseTexture, uv).rgb; +#endif float alpha = texture2D(baseTexture, uv).a; vec4 col = vec4(color.r, color.g, color.b, alpha); diff --git a/client/shaders/liquids_shader/opengl_fragment.glsl b/client/shaders/liquids_shader/opengl_fragment.glsl index a5ffd71bb..b9156d06e 100644 --- a/client/shaders/liquids_shader/opengl_fragment.glsl +++ b/client/shaders/liquids_shader/opengl_fragment.glsl @@ -17,11 +17,12 @@ const float e = 2.718281828459; void main (void) { - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - vec3 color; vec2 uv = gl_TexCoord[0].st; + +#ifdef NORMALS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { vec3 base = texture2D(baseTexture, uv).rgb; @@ -35,6 +36,9 @@ void main (void) } else { color = texture2D(baseTexture, uv).rgb; } +#else + color = texture2D(baseTexture, uv).rgb; +#endif float alpha = gl_Color.a; vec4 col = vec4(color.r, color.g, color.b, alpha); diff --git a/client/shaders/plants_shader/opengl_fragment.glsl b/client/shaders/plants_shader/opengl_fragment.glsl index de6ad4c05..abbcada88 100644 --- a/client/shaders/plants_shader/opengl_fragment.glsl +++ b/client/shaders/plants_shader/opengl_fragment.glsl @@ -17,11 +17,12 @@ const float e = 2.718281828459; void main (void) { - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - vec3 color; vec2 uv = gl_TexCoord[0].st; + +#ifdef NORMALS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { vec3 base = texture2D(baseTexture, uv).rgb; @@ -35,6 +36,9 @@ void main (void) } else { color = texture2D(baseTexture, uv).rgb; } +#else + color = texture2D(baseTexture, uv).rgb; +#endif float alpha = texture2D(baseTexture, uv).a; vec4 col = vec4(color.r, color.g, color.b, alpha); diff --git a/client/shaders/solids_shader/opengl_fragment.glsl b/client/shaders/solids_shader/opengl_fragment.glsl index 80efc86a7..0b6d8f3fc 100644 --- a/client/shaders/solids_shader/opengl_fragment.glsl +++ b/client/shaders/solids_shader/opengl_fragment.glsl @@ -23,14 +23,16 @@ const float e = 2.718281828459; void main (void) { - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - vec3 color; vec2 uv = gl_TexCoord[0].st; + +#ifdef NORMALS float height; vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y); + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) { float map_height = texture2D(normalTexture, uv).a; if (map_height < 1.0){ @@ -69,6 +71,9 @@ void main (void) } else { color = texture2D(baseTexture, uv).rgb; } +#else + color = texture2D(baseTexture, uv).rgb; +#endif float alpha = texture2D(baseTexture, uv).a; vec4 col = vec4(color.r, color.g, color.b, alpha); diff --git a/src/shader.cpp b/src/shader.cpp index ec192b9a2..76af23686 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -673,6 +673,15 @@ ShaderInfo generate_shader(std::string name, IrrlichtDevice *device, if(vertex_program == "" && pixel_program == "" && geometry_program == "") return shaderinfo; + if (g_settings->getBool("enable_bumpmapping") || g_settings->getBool("enable_parallax_occlusion")) { + if(vertex_program != "") + vertex_program = "#define NORMALS\n" + vertex_program; + if(pixel_program != "") + pixel_program = "#define NORMALS\n" + pixel_program; + if(geometry_program != "") + geometry_program = "#define NORMALS\n" + geometry_program; + } + // Call addHighLevelShaderMaterial() or addShaderMaterial() const c8* vertex_program_ptr = 0; const c8* pixel_program_ptr = 0; From 50b0e9f7a4916044b1938d461c9c4029b30569da Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 8 Dec 2013 22:13:05 -0500 Subject: [PATCH 168/198] Mapgen Indev: Fix segfault in cave generation due to uninitialized variable --- src/mapgen_indev.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mapgen_indev.cpp b/src/mapgen_indev.cpp index 7203fc85d..a22e2522f 100644 --- a/src/mapgen_indev.cpp +++ b/src/mapgen_indev.cpp @@ -274,7 +274,9 @@ void MapgenIndev::generateCaves(int max_stone_y) { CaveIndev::CaveIndev(MapgenIndev *mg, PseudoRandom *ps, PseudoRandom *ps2, v3s16 node_min, bool is_large_cave) { + this->mg = mg; this->vm = mg->vm; + this->ndef = mg->ndef; this->water_level = mg->water_level; this->large_cave = is_large_cave; this->ps = ps; From dae03382bf1e3abfcc33417c611b9194c7783b3f Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Mon, 9 Dec 2013 13:25:43 +0100 Subject: [PATCH 169/198] Optimize shaders code. Add settings at compile time. --- .../shaders/alpha_shader/opengl_fragment.glsl | 37 +++++++------ .../shaders/alpha_shader/opengl_vertex.glsl | 21 ++++---- .../leaves_shader/opengl_fragment.glsl | 14 ++--- .../shaders/leaves_shader/opengl_vertex.glsl | 44 ++++++++-------- .../liquids_shader/opengl_fragment.glsl | 17 +++--- .../shaders/liquids_shader/opengl_vertex.glsl | 24 ++++----- .../plants_shader/opengl_fragment.glsl | 17 +++--- .../shaders/plants_shader/opengl_vertex.glsl | 45 ++++++++-------- .../solids_shader/opengl_fragment.glsl | 38 +++++++------- .../shaders/solids_shader/opengl_vertex.glsl | 21 ++++---- src/game.cpp | 38 -------------- src/mapblock_mesh.cpp | 8 +-- src/shader.cpp | 52 ++++++++++++++++--- 13 files changed, 181 insertions(+), 195 deletions(-) diff --git a/client/shaders/alpha_shader/opengl_fragment.glsl b/client/shaders/alpha_shader/opengl_fragment.glsl index 3c0f35eae..6ed00be25 100644 --- a/client/shaders/alpha_shader/opengl_fragment.glsl +++ b/client/shaders/alpha_shader/opengl_fragment.glsl @@ -1,45 +1,44 @@ -#version 120 - uniform sampler2D baseTexture; uniform sampler2D normalTexture; uniform sampler2D useNormalmap; -uniform float enableBumpmapping; -uniform float enableParallaxOcclusion; -uniform float parallaxOcclusionScale; -uniform float parallaxOcclusionBias; - - uniform vec4 skyBgColor; uniform float fogDistance; +uniform vec3 eyePosition; varying vec3 vPosition; -varying vec3 tsEyeVec; varying vec3 eyeVec; +#ifdef ENABLE_PARALLAX_OCCLUSION +varying vec3 tsEyeVec; +#endif + const float e = 2.718281828459; void main (void) { vec3 color; vec2 uv = gl_TexCoord[0].st; - -#ifdef NORMALS + +#ifdef USE_NORMALMAPS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; +#endif + +#ifdef ENABLE_PARALLAX_OCCLUSION float height; vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y); - - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - - if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) { + + if (use_normalmap > 0.0) { float map_height = texture2D(normalTexture, uv).a; if (map_height < 1.0){ - float height = parallaxOcclusionScale * map_height - parallaxOcclusionBias; + float height = PARALLAX_OCCLUSION_SCALE * map_height - PARALLAX_OCCLUSION_BIAS; uv = uv + height * tsEye; } } +#endif - if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { +#ifdef ENABLE_BUMPMAPPING + if (use_normalmap > 0.0) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); @@ -68,5 +67,5 @@ void main (void) float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); col = mix(col, skyBgColor, d); } - gl_FragColor = vec4(col.r, col.g, col.b, alpha); + gl_FragColor = vec4(col.r, col.g, col.b, alpha); } diff --git a/client/shaders/alpha_shader/opengl_vertex.glsl b/client/shaders/alpha_shader/opengl_vertex.glsl index c26fdd3d5..e359955d0 100644 --- a/client/shaders/alpha_shader/opengl_vertex.glsl +++ b/client/shaders/alpha_shader/opengl_vertex.glsl @@ -1,5 +1,3 @@ -#version 120 - uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; @@ -9,14 +7,19 @@ uniform vec3 eyePosition; varying vec3 vPosition; varying vec3 eyeVec; + +#ifdef ENABLE_PARALLAX_OCCLUSION varying vec3 tsEyeVec; +#endif void main(void) { gl_Position = mWorldViewProj * gl_Vertex; vPosition = (mWorldViewProj * gl_Vertex).xyz; + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; - vec3 normal,tangent,binormal; +#ifdef ENABLE_PARALLAX_OCCLUSION + vec3 normal,tangent,binormal; normal = normalize(gl_NormalMatrix * gl_Normal); if (gl_Normal.x > 0.5) { @@ -44,14 +47,14 @@ void main(void) tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } - - mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x, - tangent.y, binormal.y, normal.y, - tangent.z, binormal.z, normal.z); - eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; + mat3 tbnMatrix = mat3( tangent.x, binormal.x, normal.x, + tangent.y, binormal.y, normal.y, + tangent.z, binormal.z, normal.z); + tsEyeVec = normalize(eyeVec * tbnMatrix); - +#endif + vec4 color; //color = vec4(1.0, 1.0, 1.0, 1.0); diff --git a/client/shaders/leaves_shader/opengl_fragment.glsl b/client/shaders/leaves_shader/opengl_fragment.glsl index 00b6884ab..31981f9b9 100644 --- a/client/shaders/leaves_shader/opengl_fragment.glsl +++ b/client/shaders/leaves_shader/opengl_fragment.glsl @@ -1,18 +1,13 @@ -#version 120 - uniform sampler2D baseTexture; uniform sampler2D normalTexture; uniform sampler2D useNormalmap; -uniform float enableBumpmapping; - uniform vec4 skyBgColor; uniform float fogDistance; uniform vec3 eyePosition; varying vec3 vPosition; varying vec3 eyeVec; -varying vec4 vColor; const float e = 2.718281828459; @@ -21,11 +16,12 @@ void main (void) vec3 color; vec2 uv = gl_TexCoord[0].st; -#ifdef NORMALS +#ifdef USE_NORMALMAPS float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; +#endif - if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { +#ifdef ENABLE_BUMPMAPPING + if (use_normalmap > 0.0) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); @@ -54,5 +50,5 @@ void main (void) float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); col = mix(col, skyBgColor, d); } - gl_FragColor = vec4(col.r, col.g, col.b, alpha); + gl_FragColor = vec4(col.r, col.g, col.b, alpha); } diff --git a/client/shaders/leaves_shader/opengl_vertex.glsl b/client/shaders/leaves_shader/opengl_vertex.glsl index 8dfb0669e..3702b1b50 100644 --- a/client/shaders/leaves_shader/opengl_vertex.glsl +++ b/client/shaders/leaves_shader/opengl_vertex.glsl @@ -1,40 +1,40 @@ -#version 120 - uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; uniform float dayNightRatio; uniform float animationTimer; -uniform float enableWavingLeaves; uniform vec3 eyePosition; varying vec3 vPosition; varying vec3 eyeVec; -float smoothCurve( float x ) { - return x * x *( 3.0 - 2.0 * x ); -} -float triangleWave( float x ) { - return abs( fract( x + 0.5 ) * 2.0 - 1.0 ); -} -float smoothTriangleWave( float x ) { - return smoothCurve( triangleWave( x ) ) * 2.0 - 1.0; -} +#ifdef ENABLE_WAVING_LEAVES +float smoothCurve( float x ) { + return x * x *( 3.0 - 2.0 * x ); +} +float triangleWave( float x ) { + return abs( fract( x + 0.5 ) * 2.0 - 1.0 ); +} +float smoothTriangleWave( float x ) { + return smoothCurve( triangleWave( x ) ) * 2.0 - 1.0; +} +#endif void main(void) { gl_TexCoord[0] = gl_MultiTexCoord0; - if (enableWavingLeaves == 1.0){ - vec4 pos = gl_Vertex; - vec4 pos2 = mTransWorld*gl_Vertex; - pos.x += (smoothTriangleWave(animationTimer*10.0 + pos2.x * 0.01 + pos2.z * 0.01) * 2.0 - 1.0) * 0.4; - pos.y += (smoothTriangleWave(animationTimer*15.0 + pos2.x * -0.01 + pos2.z * -0.01) * 2.0 - 1.0) * 0.2; - pos.z += (smoothTriangleWave(animationTimer*10.0 + pos2.x * -0.01 + pos2.z * -0.01) * 2.0 - 1.0) * 0.4; - gl_Position = mWorldViewProj * pos; - } - else - gl_Position = mWorldViewProj * gl_Vertex; + +#ifdef ENABLE_WAVING_LEAVES + vec4 pos = gl_Vertex; + vec4 pos2 = mTransWorld*gl_Vertex; + pos.x += (smoothTriangleWave(animationTimer*10.0 + pos2.x * 0.01 + pos2.z * 0.01) * 2.0 - 1.0) * 0.4; + pos.y += (smoothTriangleWave(animationTimer*15.0 + pos2.x * -0.01 + pos2.z * -0.01) * 2.0 - 1.0) * 0.2; + pos.z += (smoothTriangleWave(animationTimer*10.0 + pos2.x * -0.01 + pos2.z * -0.01) * 2.0 - 1.0) * 0.4; + gl_Position = mWorldViewProj * pos; +#else + gl_Position = mWorldViewProj * gl_Vertex; +#endif vPosition = (mWorldViewProj * gl_Vertex).xyz; diff --git a/client/shaders/liquids_shader/opengl_fragment.glsl b/client/shaders/liquids_shader/opengl_fragment.glsl index b9156d06e..cab8d8e01 100644 --- a/client/shaders/liquids_shader/opengl_fragment.glsl +++ b/client/shaders/liquids_shader/opengl_fragment.glsl @@ -1,11 +1,7 @@ -#version 120 - uniform sampler2D baseTexture; uniform sampler2D normalTexture; uniform sampler2D useNormalmap; -uniform float enableBumpmapping; - uniform vec4 skyBgColor; uniform float fogDistance; uniform vec3 eyePosition; @@ -19,12 +15,13 @@ void main (void) { vec3 color; vec2 uv = gl_TexCoord[0].st; - -#ifdef NORMALS - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { +#ifdef USE_NORMALMAPS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; +#endif + +#ifdef ENABLE_BUMPMAPPING + if (use_normalmap > 0.0) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); @@ -53,5 +50,5 @@ void main (void) float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); alpha = mix(alpha, 0.0, d); } - gl_FragColor = vec4(col.r, col.g, col.b, alpha); + gl_FragColor = vec4(col.r, col.g, col.b, alpha); } diff --git a/client/shaders/liquids_shader/opengl_vertex.glsl b/client/shaders/liquids_shader/opengl_vertex.glsl index 8ceb9f2cb..e8f185825 100644 --- a/client/shaders/liquids_shader/opengl_vertex.glsl +++ b/client/shaders/liquids_shader/opengl_vertex.glsl @@ -1,16 +1,9 @@ -#version 120 - uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; uniform float dayNightRatio; uniform float animationTimer; -uniform float enableWavingWater; -uniform float waterWaveLength; -uniform float waterWaveHeight; -uniform float waterWaveSpeed; - uniform vec3 eyePosition; varying vec3 vPosition; @@ -18,14 +11,15 @@ varying vec3 eyeVec; void main(void) { - if (enableWavingWater == 1.0){ - vec4 pos2 = gl_Vertex; - pos2.y -= 2.0; - pos2.y -= sin (pos2.z/waterWaveLength + animationTimer * waterWaveSpeed * waterWaveLength) * waterWaveHeight - + sin ((pos2.z/waterWaveLength + animationTimer * waterWaveSpeed * waterWaveLength) / 7.0) * waterWaveHeight; - gl_Position = mWorldViewProj * pos2; - } else - gl_Position = mWorldViewProj * gl_Vertex; +#ifdef ENABLE_WAVING_WATER + vec4 pos2 = gl_Vertex; + pos2.y -= 2.0; + pos2.y -= sin (pos2.z/WATER_WAVE_LENGTH + animationTimer * WATER_WAVE_SPEED * WATER_WAVE_LENGTH) * WATER_WAVE_HEIGHT + + sin ((pos2.z/WATER_WAVE_LENGTH + animationTimer * WATER_WAVE_SPEED * WATER_WAVE_LENGTH) / 7.0) * WATER_WAVE_HEIGHT; + gl_Position = mWorldViewProj * pos2; +#else + gl_Position = mWorldViewProj * gl_Vertex; +#endif eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; vPosition = (mWorldViewProj * gl_Vertex).xyz; diff --git a/client/shaders/plants_shader/opengl_fragment.glsl b/client/shaders/plants_shader/opengl_fragment.glsl index abbcada88..31981f9b9 100644 --- a/client/shaders/plants_shader/opengl_fragment.glsl +++ b/client/shaders/plants_shader/opengl_fragment.glsl @@ -1,11 +1,7 @@ -#version 120 - uniform sampler2D baseTexture; uniform sampler2D normalTexture; uniform sampler2D useNormalmap; -uniform float enableBumpmapping; - uniform vec4 skyBgColor; uniform float fogDistance; uniform vec3 eyePosition; @@ -19,12 +15,13 @@ void main (void) { vec3 color; vec2 uv = gl_TexCoord[0].st; - -#ifdef NORMALS - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { +#ifdef USE_NORMALMAPS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; +#endif + +#ifdef ENABLE_BUMPMAPPING + if (use_normalmap > 0.0) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); @@ -53,5 +50,5 @@ void main (void) float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); col = mix(col, skyBgColor, d); } - gl_FragColor = vec4(col.r, col.g, col.b, alpha); + gl_FragColor = vec4(col.r, col.g, col.b, alpha); } diff --git a/client/shaders/plants_shader/opengl_vertex.glsl b/client/shaders/plants_shader/opengl_vertex.glsl index c1bdd62a9..7987fc16d 100644 --- a/client/shaders/plants_shader/opengl_vertex.glsl +++ b/client/shaders/plants_shader/opengl_vertex.glsl @@ -1,43 +1,42 @@ -#version 120 - uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; uniform float dayNightRatio; uniform float animationTimer; -uniform float enableWavingPlants; - uniform vec3 eyePosition; varying vec3 vPosition; varying vec3 eyeVec; -float smoothCurve( float x ) { - return x * x *( 3.0 - 2.0 * x ); -} -float triangleWave( float x ) { - return abs( fract( x + 0.5 ) * 2.0 - 1.0 ); -} -float smoothTriangleWave( float x ) { - return smoothCurve( triangleWave( x ) ) * 2.0 - 1.0; -} +#ifdef ENABLE_WAVING_PLANTS +float smoothCurve( float x ) { + return x * x *( 3.0 - 2.0 * x ); +} +float triangleWave( float x ) { + return abs( fract( x + 0.5 ) * 2.0 - 1.0 ); +} +float smoothTriangleWave( float x ) { + return smoothCurve( triangleWave( x ) ) * 2.0 - 1.0; +} +#endif void main(void) { gl_TexCoord[0] = gl_MultiTexCoord0; - if (enableWavingPlants == 1.0){ - vec4 pos = gl_Vertex; - vec4 pos2 = mTransWorld * gl_Vertex; - if (gl_TexCoord[0].y < 0.05) { - pos.x += (smoothTriangleWave(animationTimer * 20.0 + pos2.x * 0.1 + pos2.z * 0.1) * 2.0 - 1.0) * 0.8; - pos.y -= (smoothTriangleWave(animationTimer * 10.0 + pos2.x * -0.5 + pos2.z * -0.5) * 2.0 - 1.0) * 0.4; - } - gl_Position = mWorldViewProj * pos; + +#ifdef ENABLE_WAVING_PLANTS + vec4 pos = gl_Vertex; + vec4 pos2 = mTransWorld * gl_Vertex; + if (gl_TexCoord[0].y < 0.05) { + pos.x += (smoothTriangleWave(animationTimer * 20.0 + pos2.x * 0.1 + pos2.z * 0.1) * 2.0 - 1.0) * 0.8; + pos.y -= (smoothTriangleWave(animationTimer * 10.0 + pos2.x * -0.5 + pos2.z * -0.5) * 2.0 - 1.0) * 0.4; } - else - gl_Position = mWorldViewProj * gl_Vertex; + gl_Position = mWorldViewProj * pos; +#else + gl_Position = mWorldViewProj * gl_Vertex; +#endif vPosition = (mWorldViewProj * gl_Vertex).xyz; eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; diff --git a/client/shaders/solids_shader/opengl_fragment.glsl b/client/shaders/solids_shader/opengl_fragment.glsl index 0b6d8f3fc..d81506a4f 100644 --- a/client/shaders/solids_shader/opengl_fragment.glsl +++ b/client/shaders/solids_shader/opengl_fragment.glsl @@ -1,23 +1,17 @@ -#version 120 - uniform sampler2D baseTexture; uniform sampler2D normalTexture; uniform sampler2D useNormalmap; -uniform float enableBumpmapping; -uniform float enableParallaxOcclusion; -uniform float parallaxOcclusionScale; -uniform float parallaxOcclusionBias; - - uniform vec4 skyBgColor; uniform float fogDistance; uniform vec3 eyePosition; varying vec3 vPosition; -varying vec3 tsEyeVec; varying vec3 eyeVec; -varying vec4 vColor; + +#ifdef ENABLE_PARALLAX_OCCLUSION +varying vec3 tsEyeVec; +#endif const float e = 2.718281828459; @@ -25,21 +19,24 @@ void main (void) { vec3 color; vec2 uv = gl_TexCoord[0].st; - -#ifdef NORMALS + +#ifdef USE_NORMALMAPS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; +#endif + +#ifdef ENABLE_PARALLAX_OCCLUSION float height; vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y); - - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - - if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) { + + if (use_normalmap > 0.0) { float map_height = texture2D(normalTexture, uv).a; if (map_height < 1.0){ - float height = parallaxOcclusionScale * map_height - parallaxOcclusionBias; + float height = PARALLAX_OCCLUSION_SCALE * map_height - PARALLAX_OCCLUSION_BIAS; uv = uv + height * tsEye; } } +#endif + /* Steep parallax code, for future use if ((parallaxMappingMode == 2.0) && (use_normalmap > 0.0)) { const float numSteps = 40.0; @@ -59,7 +56,8 @@ void main (void) } */ - if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { +#ifdef ENABLE_BUMPMAPPING + if (use_normalmap > 0.0) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); @@ -88,5 +86,5 @@ void main (void) float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); col = mix(col, skyBgColor, d); } - gl_FragColor = vec4(col.r, col.g, col.b, alpha); + gl_FragColor = vec4(col.r, col.g, col.b, alpha); } diff --git a/client/shaders/solids_shader/opengl_vertex.glsl b/client/shaders/solids_shader/opengl_vertex.glsl index c26fdd3d5..e359955d0 100644 --- a/client/shaders/solids_shader/opengl_vertex.glsl +++ b/client/shaders/solids_shader/opengl_vertex.glsl @@ -1,5 +1,3 @@ -#version 120 - uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; @@ -9,14 +7,19 @@ uniform vec3 eyePosition; varying vec3 vPosition; varying vec3 eyeVec; + +#ifdef ENABLE_PARALLAX_OCCLUSION varying vec3 tsEyeVec; +#endif void main(void) { gl_Position = mWorldViewProj * gl_Vertex; vPosition = (mWorldViewProj * gl_Vertex).xyz; + eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; - vec3 normal,tangent,binormal; +#ifdef ENABLE_PARALLAX_OCCLUSION + vec3 normal,tangent,binormal; normal = normalize(gl_NormalMatrix * gl_Normal); if (gl_Normal.x > 0.5) { @@ -44,14 +47,14 @@ void main(void) tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } - - mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x, - tangent.y, binormal.y, normal.y, - tangent.z, binormal.z, normal.z); - eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz; + mat3 tbnMatrix = mat3( tangent.x, binormal.x, normal.x, + tangent.y, binormal.y, normal.y, + tangent.z, binormal.z, normal.z); + tsEyeVec = normalize(eyeVec * tbnMatrix); - +#endif + vec4 color; //color = vec4(1.0, 1.0, 1.0, 1.0); diff --git a/src/game.cpp b/src/game.cpp index 68bd12b97..b67602f5a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -815,44 +815,6 @@ public: services->setPixelShaderConstant("eyePosition", (irr::f32*)&eye_position, 3); services->setVertexShaderConstant("eyePosition", (irr::f32*)&eye_position, 3); - float enable_bumpmapping = 0; - if (g_settings->getBool("enable_bumpmapping")) - enable_bumpmapping = 1; - services->setPixelShaderConstant("enableBumpmapping", &enable_bumpmapping, 1); - - float enable_parallax_occlusion = 0; - if (g_settings->getBool("enable_parallax_occlusion")) { - enable_parallax_occlusion = 1; - float parallax_occlusion_scale = g_settings->getFloat("parallax_occlusion_scale"); - services->setPixelShaderConstant("parallaxOcclusionScale", ¶llax_occlusion_scale, 1); - float parallax_occlusion_bias = g_settings->getFloat("parallax_occlusion_bias"); - services->setPixelShaderConstant("parallaxOcclusionBias", ¶llax_occlusion_bias, 1); - } - services->setPixelShaderConstant("enableParallaxOcclusion", &enable_parallax_occlusion, 1); - - float enable_waving_water = 0; - if (g_settings->getBool("enable_waving_water")){ - enable_waving_water = 1; - float water_wave_height_f = g_settings->getFloat("water_wave_height"); - services->setVertexShaderConstant("waterWaveHeight", &water_wave_height_f, 1); - float water_wave_length_f = g_settings->getFloat("water_wave_length"); - services->setVertexShaderConstant("waterWaveLength", &water_wave_length_f, 1); - float water_wave_speed_f = g_settings->getFloat("water_wave_speed"); - services->setVertexShaderConstant("waterWaveSpeed", &water_wave_speed_f, 1); - } - services->setVertexShaderConstant("enableWavingWater", &enable_waving_water, 1); - - float enable_waving_leaves = 0; - if (g_settings->getBool("enable_waving_leaves")) - enable_waving_leaves = 1; - services->setVertexShaderConstant("enableWavingLeaves", &enable_waving_leaves, 1); - - float enable_waving_plants = 0; - if (g_settings->getBool("enable_waving_plants")) - enable_waving_plants = 1; - services->setVertexShaderConstant("enableWavingPlants", &enable_waving_plants, 1); - - // Normal map texture layer int layer1 = 1; int layer2 = 2; diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index 81aac72d7..afea3dcce 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -1111,6 +1111,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data): */ bool enable_shaders = g_settings->getBool("enable_shaders"); bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping"); + bool enable_parallax_occlusion = g_settings->getBool("enable_parallax_occlusion"); video::E_MATERIAL_TYPE shadermat1, shadermat2, shadermat3, shadermat4, shadermat5; @@ -1210,7 +1211,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data): if (enable_shaders) { ITextureSource *tsrc = data->m_gamedef->tsrc(); material.setTexture(2, tsrc->getTexture("disable_img.png")); - if (enable_bumpmapping) { + if (enable_bumpmapping || enable_parallax_occlusion) { std::string fname_base = tsrc->getTextureName(p.tile.texture_id); std::string normal_ext = "_normal.png"; size_t pos = fname_base.find("."); @@ -1292,7 +1293,8 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat { bool enable_shaders = g_settings->getBool("enable_shaders"); bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping"); - + bool enable_parallax_occlusion = g_settings->getBool("enable_parallax_occlusion"); + if(!m_has_animation) { m_animation_force_timer = 100000; @@ -1362,7 +1364,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat // Set the texture buf->getMaterial().setTexture(0, tsrc->getTexture(os.str())); buf->getMaterial().setTexture(2, tsrc->getTexture("disable_img.png")); - if (enable_shaders && enable_bumpmapping) + if (enable_shaders && (enable_bumpmapping || enable_parallax_occlusion)) { std::string fname_base,fname_normal; fname_base = tsrc->getTextureName(tile.texture_id); diff --git a/src/shader.cpp b/src/shader.cpp index 76af23686..39296f6a3 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -673,15 +673,51 @@ ShaderInfo generate_shader(std::string name, IrrlichtDevice *device, if(vertex_program == "" && pixel_program == "" && geometry_program == "") return shaderinfo; - if (g_settings->getBool("enable_bumpmapping") || g_settings->getBool("enable_parallax_occlusion")) { - if(vertex_program != "") - vertex_program = "#define NORMALS\n" + vertex_program; - if(pixel_program != "") - pixel_program = "#define NORMALS\n" + pixel_program; - if(geometry_program != "") - geometry_program = "#define NORMALS\n" + geometry_program; - } + // Create shaders header + std::string shaders_header = "#version 120\n"; + if (g_settings->getBool("enable_bumpmapping")) + shaders_header += "#define ENABLE_BUMPMAPPING\n"; + + if (g_settings->getBool("enable_parallax_occlusion")){ + shaders_header += "#define ENABLE_PARALLAX_OCCLUSION\n"; + shaders_header += "#define PARALLAX_OCCLUSION_SCALE "; + shaders_header += ftos(g_settings->getFloat("parallax_occlusion_scale")); + shaders_header += "\n"; + shaders_header += "#define PARALLAX_OCCLUSION_BIAS "; + shaders_header += ftos(g_settings->getFloat("parallax_occlusion_bias")); + shaders_header += "\n"; + } + + if (g_settings->getBool("enable_bumpmapping") || g_settings->getBool("enable_parallax_occlusion")) + shaders_header += "#define USE_NORMALMAPS\n"; + + if (g_settings->getBool("enable_waving_water")){ + shaders_header += "#define ENABLE_WAVING_WATER\n"; + shaders_header += "#define WATER_WAVE_HEIGHT "; + shaders_header += ftos(g_settings->getFloat("water_wave_height")); + shaders_header += "\n"; + shaders_header += "#define WATER_WAVE_LENGTH "; + shaders_header += ftos(g_settings->getFloat("water_wave_length")); + shaders_header += "\n"; + shaders_header += "#define WATER_WAVE_SPEED "; + shaders_header += ftos(g_settings->getFloat("water_wave_speed")); + shaders_header += "\n"; + } + + if (g_settings->getBool("enable_waving_leaves")) + shaders_header += "#define ENABLE_WAVING_LEAVES\n"; + + if (g_settings->getBool("enable_waving_plants")) + shaders_header += "#define ENABLE_WAVING_PLANTS\n"; + + if(pixel_program != "") + pixel_program = shaders_header + pixel_program; + if(vertex_program != "") + vertex_program = shaders_header + vertex_program; + if(geometry_program != "") + geometry_program = shaders_header + geometry_program; + // Call addHighLevelShaderMaterial() or addShaderMaterial() const c8* vertex_program_ptr = 0; const c8* pixel_program_ptr = 0; From 6c4a8766ab1f9ca6acb9e00bdfb275ffcd226bc0 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Mon, 9 Dec 2013 22:39:24 +0100 Subject: [PATCH 170/198] Check if width, height or start index of a list[] is negative --- src/guiFormSpecMenu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 920a7f1f2..82def7411 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -421,6 +421,12 @@ void GUIFormSpecMenu::parseList(parserData* data,std::string element) { s32 start_i = 0; if(startindex != "") start_i = stoi(startindex); + + if (geom.X < 0 || geom.Y < 0 || start_i < 0) { + errorstream<< "Invalid list element: '" << element << "'" << std::endl; + return; + } + if(data->bp_set != 2) errorstream<<"WARNING: invalid use of list without a size[] element"< Date: Wed, 11 Dec 2013 22:10:56 +0400 Subject: [PATCH 171/198] Add Lithuanian translation. --- po/lt/minetest.po | 968 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 968 insertions(+) create mode 100644 po/lt/minetest.po diff --git a/po/lt/minetest.po b/po/lt/minetest.po new file mode 100644 index 000000000..dd8af86e0 --- /dev/null +++ b/po/lt/minetest.po @@ -0,0 +1,968 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: minetest\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-11-23 17:37+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: builtin/gamemgr.lua:23 +msgid "Game Name" +msgstr "" + +#: builtin/gamemgr.lua:25 builtin/mainmenu.lua:310 +msgid "Create" +msgstr "" + +#: builtin/gamemgr.lua:26 builtin/mainmenu.lua:311 builtin/modmgr.lua:331 +#: builtin/modmgr.lua:448 src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 +msgid "Cancel" +msgstr "" + +#: builtin/gamemgr.lua:118 +msgid "Gamemgr: Unable to copy mod \"$1\" to game \"$2\"" +msgstr "" + +#: builtin/gamemgr.lua:216 +msgid "GAMES" +msgstr "" + +#: builtin/gamemgr.lua:217 builtin/mainmenu.lua:1076 +msgid "Games" +msgstr "" + +#: builtin/gamemgr.lua:234 +msgid "Mods:" +msgstr "" + +#: builtin/gamemgr.lua:235 +msgid "edit game" +msgstr "" + +#: builtin/gamemgr.lua:238 +msgid "new game" +msgstr "" + +#: builtin/gamemgr.lua:248 +msgid "EDIT GAME" +msgstr "" + +#: builtin/gamemgr.lua:269 +msgid "Remove selected mod" +msgstr "" + +#: builtin/gamemgr.lua:272 +msgid "<<-- Add mod" +msgstr "" + +#: builtin/mainmenu.lua:158 +msgid "Ok" +msgstr "" + +#: builtin/mainmenu.lua:297 +msgid "World name" +msgstr "" + +#: builtin/mainmenu.lua:300 +msgid "Seed" +msgstr "" + +#: builtin/mainmenu.lua:303 +msgid "Mapgen" +msgstr "" + +#: builtin/mainmenu.lua:306 +msgid "Game" +msgstr "" + +#: builtin/mainmenu.lua:319 +msgid "Delete World \"$1\"?" +msgstr "" + +#: builtin/mainmenu.lua:320 builtin/modmgr.lua:877 +msgid "Yes" +msgstr "" + +#: builtin/mainmenu.lua:321 +msgid "No" +msgstr "" + +#: builtin/mainmenu.lua:364 +msgid "A world named \"$1\" already exists" +msgstr "" + +#: builtin/mainmenu.lua:381 +msgid "No worldname given or no game selected" +msgstr "" + +#: builtin/mainmenu.lua:650 +msgid "To enable shaders the OpenGL driver needs to be used." +msgstr "" + +#: builtin/mainmenu.lua:818 +msgid "CLIENT" +msgstr "" + +#: builtin/mainmenu.lua:819 +msgid "Favorites:" +msgstr "" + +#: builtin/mainmenu.lua:820 +msgid "Address/Port" +msgstr "" + +#: builtin/mainmenu.lua:821 +msgid "Name/Password" +msgstr "" + +#: builtin/mainmenu.lua:824 +msgid "Public Serverlist" +msgstr "" + +#: builtin/mainmenu.lua:829 builtin/mainmenu.lua:874 builtin/mainmenu.lua:937 +#: src/keycode.cpp:229 +msgid "Delete" +msgstr "" + +#: builtin/mainmenu.lua:833 +msgid "Connect" +msgstr "" + +#: builtin/mainmenu.lua:875 builtin/mainmenu.lua:938 +msgid "New" +msgstr "" + +#: builtin/mainmenu.lua:876 builtin/mainmenu.lua:939 +msgid "Configure" +msgstr "" + +#: builtin/mainmenu.lua:877 +msgid "Start Game" +msgstr "" + +#: builtin/mainmenu.lua:878 builtin/mainmenu.lua:941 +msgid "Select World:" +msgstr "" + +#: builtin/mainmenu.lua:879 +msgid "START SERVER" +msgstr "" + +#: builtin/mainmenu.lua:880 builtin/mainmenu.lua:943 +msgid "Creative Mode" +msgstr "" + +#: builtin/mainmenu.lua:882 builtin/mainmenu.lua:945 +msgid "Enable Damage" +msgstr "" + +#: builtin/mainmenu.lua:884 +msgid "Public" +msgstr "" + +#: builtin/mainmenu.lua:886 +msgid "Name" +msgstr "" + +#: builtin/mainmenu.lua:888 +msgid "Password" +msgstr "" + +#: builtin/mainmenu.lua:889 +msgid "Server Port" +msgstr "" + +#: builtin/mainmenu.lua:899 +msgid "SETTINGS" +msgstr "" + +#: builtin/mainmenu.lua:900 +msgid "Fancy trees" +msgstr "" + +#: builtin/mainmenu.lua:902 +msgid "Smooth Lighting" +msgstr "" + +#: builtin/mainmenu.lua:904 +msgid "3D Clouds" +msgstr "" + +#: builtin/mainmenu.lua:906 +msgid "Opaque Water" +msgstr "" + +#: builtin/mainmenu.lua:909 +msgid "Mip-Mapping" +msgstr "" + +#: builtin/mainmenu.lua:911 +msgid "Anisotropic Filtering" +msgstr "" + +#: builtin/mainmenu.lua:913 +msgid "Bi-Linear Filtering" +msgstr "" + +#: builtin/mainmenu.lua:915 +msgid "Tri-Linear Filtering" +msgstr "" + +#: builtin/mainmenu.lua:918 +msgid "Shaders" +msgstr "" + +#: builtin/mainmenu.lua:920 +msgid "Preload item visuals" +msgstr "" + +#: builtin/mainmenu.lua:922 +msgid "Enable Particles" +msgstr "" + +#: builtin/mainmenu.lua:924 +msgid "Finite Liquid" +msgstr "" + +#: builtin/mainmenu.lua:927 +msgid "Change keys" +msgstr "" + +#: builtin/mainmenu.lua:940 src/keycode.cpp:248 +msgid "Play" +msgstr "" + +#: builtin/mainmenu.lua:942 +msgid "SINGLE PLAYER" +msgstr "" + +#: builtin/mainmenu.lua:955 +msgid "Select texture pack:" +msgstr "" + +#: builtin/mainmenu.lua:956 +msgid "TEXTURE PACKS" +msgstr "" + +#: builtin/mainmenu.lua:976 +msgid "No information available" +msgstr "" + +#: builtin/mainmenu.lua:1005 +msgid "Core Developers" +msgstr "" + +#: builtin/mainmenu.lua:1020 +msgid "Active Contributors" +msgstr "" + +#: builtin/mainmenu.lua:1028 +msgid "Previous Contributors" +msgstr "" + +#: builtin/mainmenu.lua:1069 +msgid "Singleplayer" +msgstr "" + +#: builtin/mainmenu.lua:1070 +msgid "Client" +msgstr "" + +#: builtin/mainmenu.lua:1071 +msgid "Server" +msgstr "" + +#: builtin/mainmenu.lua:1072 +msgid "Settings" +msgstr "" + +#: builtin/mainmenu.lua:1073 +msgid "Texture Packs" +msgstr "" + +#: builtin/mainmenu.lua:1080 +msgid "Mods" +msgstr "" + +#: builtin/mainmenu.lua:1082 +msgid "Credits" +msgstr "" + +#: builtin/modmgr.lua:236 +msgid "MODS" +msgstr "" + +#: builtin/modmgr.lua:237 +msgid "Installed Mods:" +msgstr "" + +#: builtin/modmgr.lua:243 +msgid "Add mod:" +msgstr "" + +#: builtin/modmgr.lua:244 +msgid "Local install" +msgstr "" + +#: builtin/modmgr.lua:245 +msgid "Online mod repository" +msgstr "" + +#: builtin/modmgr.lua:284 +msgid "No mod description available" +msgstr "" + +#: builtin/modmgr.lua:288 +msgid "Mod information:" +msgstr "" + +#: builtin/modmgr.lua:299 +msgid "Rename" +msgstr "" + +#: builtin/modmgr.lua:301 +msgid "Uninstall selected modpack" +msgstr "" + +#: builtin/modmgr.lua:312 +msgid "Uninstall selected mod" +msgstr "" + +#: builtin/modmgr.lua:324 +msgid "Rename Modpack:" +msgstr "" + +#: builtin/modmgr.lua:329 src/keycode.cpp:227 +msgid "Accept" +msgstr "" + +#: builtin/modmgr.lua:423 +msgid "World:" +msgstr "" + +#: builtin/modmgr.lua:427 builtin/modmgr.lua:429 +msgid "Hide Game" +msgstr "" + +#: builtin/modmgr.lua:433 builtin/modmgr.lua:435 +msgid "Hide mp content" +msgstr "" + +#: builtin/modmgr.lua:442 +msgid "Mod:" +msgstr "" + +#: builtin/modmgr.lua:444 +msgid "Depends:" +msgstr "" + +#: builtin/modmgr.lua:447 src/guiKeyChangeMenu.cpp:187 +msgid "Save" +msgstr "" + +#: builtin/modmgr.lua:464 +msgid "Enable MP" +msgstr "" + +#: builtin/modmgr.lua:466 +msgid "Disable MP" +msgstr "" + +#: builtin/modmgr.lua:470 builtin/modmgr.lua:472 +msgid "enabled" +msgstr "" + +#: builtin/modmgr.lua:478 +msgid "Enable all" +msgstr "" + +#: builtin/modmgr.lua:577 +msgid "Select Mod File:" +msgstr "" + +#: builtin/modmgr.lua:616 +msgid "Install Mod: file: \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:617 +msgid "" +"\n" +"Install Mod: unsupported filetype \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:638 +msgid "Failed to install $1 to $2" +msgstr "" + +#: builtin/modmgr.lua:641 +msgid "Install Mod: unable to find suitable foldername for modpack $1" +msgstr "" + +#: builtin/modmgr.lua:661 +msgid "Install Mod: unable to find real modname for: $1" +msgstr "" + +#: builtin/modmgr.lua:855 +msgid "Modmgr: failed to delete \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:859 +msgid "Modmgr: invalid modpath \"$1\"" +msgstr "" + +#: builtin/modmgr.lua:876 +msgid "Are you sure you want to delete \"$1\"?" +msgstr "" + +#: builtin/modmgr.lua:878 +msgid "No of course not!" +msgstr "" + +#: builtin/modstore.lua:183 +msgid "Page $1 of $2" +msgstr "" + +#: builtin/modstore.lua:243 +msgid "Rating" +msgstr "" + +#: builtin/modstore.lua:251 +msgid "re-Install" +msgstr "" + +#: builtin/modstore.lua:253 +msgid "Install" +msgstr "" + +#: src/client.cpp:2917 +msgid "Item textures..." +msgstr "" + +#: src/game.cpp:940 +msgid "Loading..." +msgstr "" + +#: src/game.cpp:1000 +msgid "Creating server...." +msgstr "" + +#: src/game.cpp:1016 +msgid "Creating client..." +msgstr "" + +#: src/game.cpp:1025 +msgid "Resolving address..." +msgstr "" + +#: src/game.cpp:1122 +msgid "Connecting to server..." +msgstr "" + +#: src/game.cpp:1219 +msgid "Item definitions..." +msgstr "" + +#: src/game.cpp:1226 +msgid "Node definitions..." +msgstr "" + +#: src/game.cpp:1233 +msgid "Media..." +msgstr "" + +#: src/game.cpp:3409 +msgid "Shutting down stuff..." +msgstr "" + +#: src/game.cpp:3439 +msgid "" +"\n" +"Check debug.txt for details." +msgstr "" + +#: src/guiDeathScreen.cpp:96 +msgid "You died." +msgstr "" + +#: src/guiDeathScreen.cpp:104 +msgid "Respawn" +msgstr "" + +#: src/guiFormSpecMenu.cpp:1656 src/guiMessageMenu.cpp:107 +#: src/guiTextInputMenu.cpp:139 +msgid "Proceed" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:121 +msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:161 +msgid "\"Use\" = climb down" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:176 +msgid "Double tap \"jump\" to toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:288 +msgid "Key already in use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:363 +msgid "press key" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:389 +msgid "Forward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:390 +msgid "Backward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:391 src/keycode.cpp:228 +msgid "Left" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:392 src/keycode.cpp:228 +msgid "Right" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:393 +msgid "Use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:394 +msgid "Jump" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:395 +msgid "Sneak" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:396 +msgid "Drop" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:397 +msgid "Inventory" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:398 +msgid "Chat" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:399 +msgid "Command" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:400 +msgid "Console" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:401 +msgid "Toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:402 +msgid "Toggle fast" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:403 +msgid "Toggle noclip" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:404 +msgid "Range select" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:405 +msgid "Print stacks" +msgstr "" + +#: src/guiPasswordChange.cpp:106 +msgid "Old Password" +msgstr "" + +#: src/guiPasswordChange.cpp:122 +msgid "New Password" +msgstr "" + +#: src/guiPasswordChange.cpp:137 +msgid "Confirm Password" +msgstr "" + +#: src/guiPasswordChange.cpp:153 +msgid "Change" +msgstr "" + +#: src/guiPasswordChange.cpp:162 +msgid "Passwords do not match!" +msgstr "" + +#: src/guiPauseMenu.cpp:122 +msgid "Continue" +msgstr "" + +#: src/guiPauseMenu.cpp:133 +msgid "Change Password" +msgstr "" + +#: src/guiPauseMenu.cpp:143 +msgid "Sound Volume" +msgstr "" + +#: src/guiPauseMenu.cpp:152 +msgid "Exit to Menu" +msgstr "" + +#: src/guiPauseMenu.cpp:161 +msgid "Exit to OS" +msgstr "" + +#: src/guiPauseMenu.cpp:170 +msgid "" +"Default Controls:\n" +"- WASD: move\n" +"- Space: jump/climb\n" +"- Shift: sneak/go down\n" +"- Q: drop item\n" +"- I: inventory\n" +"- Mouse: turn/look\n" +"- Mouse left: dig/punch\n" +"- Mouse right: place/use\n" +"- Mouse wheel: select item\n" +"- T: chat\n" +msgstr "" + +#: src/guiVolumeChange.cpp:107 +msgid "Sound Volume: " +msgstr "" + +#: src/guiVolumeChange.cpp:121 +msgid "Exit" +msgstr "" + +#: src/keycode.cpp:223 +msgid "Left Button" +msgstr "" + +#: src/keycode.cpp:223 +msgid "Middle Button" +msgstr "" + +#: src/keycode.cpp:223 +msgid "Right Button" +msgstr "" + +#: src/keycode.cpp:223 +msgid "X Button 1" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Back" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Clear" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Return" +msgstr "" + +#: src/keycode.cpp:224 +msgid "Tab" +msgstr "" + +#: src/keycode.cpp:224 +msgid "X Button 2" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Capital" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Control" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Kana" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Menu" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Pause" +msgstr "" + +#: src/keycode.cpp:225 +msgid "Shift" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Convert" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Escape" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Final" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Junja" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Kanji" +msgstr "" + +#: src/keycode.cpp:226 +msgid "Nonconvert" +msgstr "" + +#: src/keycode.cpp:227 +msgid "End" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Home" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Mode Change" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Next" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Prior" +msgstr "" + +#: src/keycode.cpp:227 +msgid "Space" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Down" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Execute" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Print" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Select" +msgstr "" + +#: src/keycode.cpp:228 +msgid "Up" +msgstr "" + +#: src/keycode.cpp:229 +msgid "Help" +msgstr "" + +#: src/keycode.cpp:229 +msgid "Insert" +msgstr "" + +#: src/keycode.cpp:229 +msgid "Snapshot" +msgstr "" + +#: src/keycode.cpp:232 +msgid "Left Windows" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Apps" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Numpad 0" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Numpad 1" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Right Windows" +msgstr "" + +#: src/keycode.cpp:233 +msgid "Sleep" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 2" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 3" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 4" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 5" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 6" +msgstr "" + +#: src/keycode.cpp:234 +msgid "Numpad 7" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad *" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad +" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad -" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad /" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad 8" +msgstr "" + +#: src/keycode.cpp:235 +msgid "Numpad 9" +msgstr "" + +#: src/keycode.cpp:239 +msgid "Num Lock" +msgstr "" + +#: src/keycode.cpp:239 +msgid "Scroll Lock" +msgstr "" + +#: src/keycode.cpp:240 +msgid "Left Shift" +msgstr "" + +#: src/keycode.cpp:240 +msgid "Right Shift" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Left Control" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Left Menu" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Right Control" +msgstr "" + +#: src/keycode.cpp:241 +msgid "Right Menu" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Comma" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Minus" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Period" +msgstr "" + +#: src/keycode.cpp:243 +msgid "Plus" +msgstr "" + +#: src/keycode.cpp:247 +msgid "Attn" +msgstr "" + +#: src/keycode.cpp:247 +msgid "CrSel" +msgstr "" + +#: src/keycode.cpp:248 +msgid "Erase OEF" +msgstr "" + +#: src/keycode.cpp:248 +msgid "ExSel" +msgstr "" + +#: src/keycode.cpp:248 +msgid "OEM Clear" +msgstr "" + +#: src/keycode.cpp:248 +msgid "PA1" +msgstr "" + +#: src/keycode.cpp:248 +msgid "Zoom" +msgstr "" + +#: src/main.cpp:1472 +msgid "needs_fallback_font" +msgstr "" + +#: src/main.cpp:1547 +msgid "Main Menu" +msgstr "" + +#: src/main.cpp:1723 +msgid "No world selected and no address provided. Nothing to do." +msgstr "" + +#: src/main.cpp:1731 +msgid "Could not find or load game \"" +msgstr "" + +#: src/main.cpp:1745 +msgid "Invalid gamespec." +msgstr "" + +#: src/main.cpp:1790 +msgid "Connection error (timed out?)" +msgstr "" From 4ccaa6d0af852d0aada01f341a61290a3760cffa Mon Sep 17 00:00:00 2001 From: sapier Date: Wed, 11 Dec 2013 23:07:38 +0100 Subject: [PATCH 172/198] Implement search tab and version picker --- builtin/filterlist.lua | 20 +- builtin/mainmenu.lua | 30 +- builtin/modmgr.lua | 8 +- builtin/modstore.lua | 552 +++++++++++++++++++++--------- src/convert_json.cpp | 2 +- src/guiEngine.cpp | 2 +- src/guiFormSpecMenu.cpp | 17 +- src/script/lua_api/l_mainmenu.cpp | 25 +- 8 files changed, 466 insertions(+), 190 deletions(-) diff --git a/builtin/filterlist.lua b/builtin/filterlist.lua index 1c2ceb031..379a5cea9 100644 --- a/builtin/filterlist.lua +++ b/builtin/filterlist.lua @@ -17,6 +17,20 @@ -------------------------------------------------------------------------------- -- Generic implementation of a filter/sortable list -- +-- Usage: -- +-- Filterlist needs to be initialized on creation. To achieve this you need to -- +-- pass following functions: -- +-- raw_fct() (mandatory): -- +-- function returning a table containing the elements to be filtered -- +-- compare_fct(element1,element2) (mandatory): -- +-- function returning true/false if element1 is same element as element2 -- +-- uid_match_fct(element1,uid) (optional) -- +-- function telling if uid is attached to element1 -- +-- filter_fct(element,filtercriteria) (optional) -- +-- function returning true/false if filtercriteria met to element -- +-- fetch_param (optional) -- +-- parameter passed to raw_fct to aquire correct raw data -- +-- -- -------------------------------------------------------------------------------- filterlist = {} @@ -157,7 +171,7 @@ function filterlist.process(this) this.m_processed_list = {} for k,v in pairs(this.m_raw_list) do - if this.m_filtercriteria == nil or + if this.m_filtercriteria == nil or this.m_filter_fct(v,this.m_filtercriteria) then table.insert(this.m_processed_list,v) end @@ -167,7 +181,7 @@ function filterlist.process(this) return end - if this.m_sort_list[this.m_sortmode] ~= nil and + if this.m_sort_list[this.m_sortmode] ~= nil and type(this.m_sort_list[this.m_sortmode]) == "function" then this.m_sort_list[this.m_sortmode](this) @@ -237,7 +251,7 @@ function compare_worlds(world1,world2) end -------------------------------------------------------------------------------- -function sort_worlds_alphabetic(this) +function sort_worlds_alphabetic(this) table.sort(this.m_processed_list, function(a, b) --fixes issue #857 (crash due to sorting nil in worldlist) diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 9555146d4..f8556a388 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -119,6 +119,30 @@ os.tempfolder = function() end +-------------------------------------------------------------------------------- +function text2textlist(xpos,ypos,width,height,tl_name,textlen,text,transparency) + local textlines = engine.splittext(text,textlen) + + local retval = "textlist[" .. xpos .. "," .. ypos .. ";" + .. width .. "," .. height .. ";" + .. tl_name .. ";" + + for i=1, #textlines, 1 do + textlines[i] = textlines[i]:gsub("\r","") + retval = retval .. engine.formspec_escape(textlines[i]) .. "," + end + + retval = retval .. ";0;" + + if transparency then + retval = retval .. "true" + end + + retval = retval .. "]" + + return retval +end + -------------------------------------------------------------------------------- function init_globals() --init gamedata @@ -939,9 +963,9 @@ end function tabbuilder.tab_settings() tab_string = "vertlabel[0,0;" .. fgettext("SETTINGS") .. "]" .. - "checkbox[1,0;cb_fancy_trees;".. fgettext("Fancy Trees") .. ";" + "checkbox[1,0;cb_fancy_trees;".. fgettext("Fancy Trees") .. ";" .. dump(engine.setting_getbool("new_style_leaves")) .. "]".. - "checkbox[1,0.5;cb_smooth_lighting;".. fgettext("Smooth Lighting") + "checkbox[1,0.5;cb_smooth_lighting;".. fgettext("Smooth Lighting") .. ";".. dump(engine.setting_getbool("smooth_lighting")) .. "]".. "checkbox[1,1;cb_3d_clouds;".. fgettext("3D Clouds") .. ";" .. dump(engine.setting_getbool("enable_3d_clouds")) .. "]".. @@ -979,7 +1003,7 @@ if engine.setting_getbool("enable_shaders") then .. dump(engine.setting_getbool("enable_waving_leaves")) .. "]".. "checkbox[8,2.5;cb_waving_plants;".. fgettext("Waving Plants") .. ";" .. dump(engine.setting_getbool("enable_waving_plants")) .. "]" -else +else tab_string = tab_string .. "textlist[8.33,0.7;4,1;;#888888" .. fgettext("Bumpmapping") .. ";0;true]" .. "textlist[8.33,1.2;4,1;;#888888" .. fgettext("Parallax Occlusion") .. ";0;true]" .. diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua index cc5e09513..13f81c6e0 100644 --- a/builtin/modmgr.lua +++ b/builtin/modmgr.lua @@ -56,10 +56,12 @@ function modmgr.extract(modfile) if tempfolder ~= nil and tempfolder ~= "" then engine.create_dir(tempfolder) - engine.extract_zip(modfile.name,tempfolder) - return tempfolder + if engine.extract_zip(modfile.name,tempfolder) then + return tempfolder + end end end + return nil end ------------------------------------------------------------------------------- @@ -615,7 +617,7 @@ function modmgr.installmod(modfilename,basename) if modpath == nil then gamedata.errormessage = fgettext("Install Mod: file: \"$1\"", modfile.name) .. - fgettext("\nInstall Mod: unsupported filetype \"$1\"", modfile.type) + fgettext("\nInstall Mod: unsupported filetype \"$1\" or broken archive", modfile.type) return end diff --git a/builtin/modstore.lua b/builtin/modstore.lua index acaff871b..b446a0553 100644 --- a/builtin/modstore.lua +++ b/builtin/modstore.lua @@ -21,6 +21,7 @@ modstore = {} -------------------------------------------------------------------------------- +-- @function [parent=#modstore] init function modstore.init() modstore.tabnames = {} @@ -33,11 +34,55 @@ function modstore.init() DIR_DELIM .. "pack" .. DIR_DELIM modstore.lastmodtitle = "" + modstore.last_search = "" + + modstore.searchlist = filterlist.create( + function() + if modstore.modlist_unsorted ~= nil and + modstore.modlist_unsorted.data ~= nil then + return modstore.modlist_unsorted.data + end + return {} + end, + function(element,modid) + if element.id == modid then + return true + end + return false + end, --compare fct + nil, --uid match fct + function(element,substring) + if substring == nil or + substring == "" then + return false + end + substring = substring:upper() + + if element.title ~= nil and + element.title:upper():find(substring) ~= nil then + return true + end + + if element.details ~= nil and + element.details.author ~= nil and + element.details.author:upper():find(substring) ~= nil then + return true + end + + if element.details ~= nil and + element.details.description ~= nil and + element.details.description:upper():find(substring) ~= nil then + return true + end + return false + end --filter fct + ) modstore.current_list = nil end -------------------------------------------------------------------------------- +-- @function [parent=#modstore] nametoindex function modstore.nametoindex(name) for i=1,#modstore.tabnames,1 do @@ -50,12 +95,34 @@ function modstore.nametoindex(name) end -------------------------------------------------------------------------------- +-- @function [parent=#modstore] getsuccessfuldialog +function modstore.getsuccessfuldialog() + local retval = "" + retval = retval .. "size[6,2]" + if modstore.lastmodentry ~= nil then + retval = retval .. "label[0,0.25;" .. fgettext("Successfully installed:") .. "]" + retval = retval .. "label[3,0.25;" .. modstore.lastmodentry.moddetails.title .. "]" + + + retval = retval .. "label[0,0.75;" .. fgettext("Shortname:") .. "]" + retval = retval .. "label[3,0.75;" .. engine.formspec_escape(modstore.lastmodentry.moddetails.basename) .. "]" + + end + retval = retval .. "button[2.5,1.5;1,0.5;btn_confirm_mod_successfull;" .. fgettext("ok") .. "]" + + + return retval +end + +-------------------------------------------------------------------------------- +-- @function [parent=#modstore] gettab function modstore.gettab(tabname) local retval = "" local is_modstore_tab = false if tabname == "dialog_modstore_unsorted" then + modstore.modsperpage = 5 retval = modstore.getmodlist(modstore.modlist_unsorted) is_modstore_tab = true end @@ -70,30 +137,33 @@ function modstore.gettab(tabname) end if tabname == "modstore_mod_installed" then - return "size[6,2]label[0.25,0.25;Mod(s): " .. modstore.lastmodtitle .. - " installed successfully]" .. - "button[2.5,1.5;1,0.5;btn_confirm_mod_successfull;ok]" + return modstore.getsuccessfuldialog() end if tabname == "modstore_downloading" then - return "size[6,2]label[0.25,0.25;Dowloading " .. modstore.lastmodtitle .. - " please wait]" + return "size[6,2]label[0.25,0.75;" .. fgettext("Downloading") .. + " " .. modstore.lastmodtitle .. " " .. + fgettext("please wait...") .. "]" end return "" end -------------------------------------------------------------------------------- +-- @function [parent=#modstore] tabheader function modstore.tabheader(tabname) - local retval = "size[12,9.25]" + local retval = "size[12,10.25]" retval = retval .. "tabheader[-0.3,-0.99;modstore_tab;" .. "Unsorted,Search;" .. - modstore.nametoindex(tabname) .. ";true;false]" + modstore.nametoindex(tabname) .. ";true;false]" .. + "button[4,9.9;4,0.5;btn_modstore_close;" .. + fgettext("Close modstore") .. "]" return retval end -------------------------------------------------------------------------------- +-- @function [parent=#modstore] handle_buttons function modstore.handle_buttons(current_tab,fields) if fields["modstore_tab"] then @@ -101,14 +171,25 @@ function modstore.handle_buttons(current_tab,fields) if index > 0 and index <= #modstore.tabnames then + if modstore.tabnames[index] == "dialog_modstore_search" then + filterlist.set_filtercriteria(modstore.searchlist,modstore.last_search) + filterlist.refresh(modstore.searchlist) + modstore.modsperpage = 4 + modstore.currentlist = { + page = 0, + pagecount = + math.ceil(filterlist.size(modstore.searchlist) / modstore.modsperpage), + data = filterlist.get_list(modstore.searchlist), + } + end + return { current_tab = modstore.tabnames[index], is_dialog = true, show_buttons = false } end - - modstore.modlist_page = 0 + end if fields["btn_modstore_page_up"] then @@ -124,15 +205,26 @@ function modstore.handle_buttons(current_tab,fields) end end - if fields["btn_hidden_close_download"] then - return { + if fields["btn_hidden_close_download"] ~= nil then + if fields["btn_hidden_close_download"].successfull then + modstore.lastmodentry = fields["btn_hidden_close_download"] + return { current_tab = "modstore_mod_installed", is_dialog = true, show_buttons = false } + else + modstore.lastmodtitle = "" + return { + current_tab = modstore.tabnames[1], + is_dialog = true, + show_buttons = false + } + end end if fields["btn_confirm_mod_successfull"] then + modstore.lastmodentry = nil modstore.lastmodtitle = "" return { current_tab = modstore.tabnames[1], @@ -141,74 +233,116 @@ function modstore.handle_buttons(current_tab,fields) } end - for i=1, modstore.modsperpage, 1 do - local installbtn = "btn_install_mod_" .. i + if fields["btn_modstore_search"] or + (fields["key_enter"] and fields["te_modstore_search"] ~= nil) then + modstore.last_search = fields["te_modstore_search"] + filterlist.set_filtercriteria(modstore.searchlist,fields["te_modstore_search"]) + filterlist.refresh(modstore.searchlist) + modstore.currentlist = { + page = 0, + pagecount = math.ceil(filterlist.size(modstore.searchlist) / modstore.modsperpage), + data = filterlist.get_list(modstore.searchlist), + } + end + + + if fields["btn_modstore_close"] then + return { + is_dialog = false, + show_buttons = true, + current_tab = engine.setting_get("main_menu_tab") + } + end + + for key,value in pairs(fields) do + local foundat = key:find("btn_install_mod_") + if ( foundat == 1) then + local modid = tonumber(key:sub(17)) + for i=1,#modstore.modlist_unsorted.data,1 do + if modstore.modlist_unsorted.data[i].id == modid then + local moddetails = modstore.modlist_unsorted.data[i].details - if fields[installbtn] then - local modlistentry = - modstore.current_list.page * modstore.modsperpage + i - - if modstore.modlist_unsorted.data[modlistentry] ~= nil and - modstore.modlist_unsorted.data[modlistentry].details ~= nil then - - local moddetails = modstore.modlist_unsorted.data[modlistentry].details - - if modstore.lastmodtitle ~= "" then - modstore.lastmodtitle = modstore.lastmodtitle .. ", " - end - - modstore.lastmodtitle = modstore.lastmodtitle .. moddetails.title - - engine.handle_async( - function(param) - local fullurl = engine.setting_get("modstore_download_url") .. - param.moddetails.download_url - - if engine.download_file(fullurl,param.filename) then - return { - moddetails = param.moddetails, - filename = param.filename, - successfull = true - } - else - return { - modtitle = param.title, - successfull = false - } - end - end, - { - moddetails = moddetails, - filename = os.tempfolder() .. ".zip" - }, - function(result) - if result.successfull then - modmgr.installmod(result.filename,result.moddetails.basename) - os.remove(result.filename) - else - gamedata.errormessage = "Failed to download " .. result.moddetails.title - end - - engine.button_handler({btn_hidden_close_download=true}) + if modstore.lastmodtitle ~= "" then + modstore.lastmodtitle = modstore.lastmodtitle .. ", " end - ) - - return { - current_tab = "modstore_downloading", - is_dialog = true, - show_buttons = false, - ignore_menu_quit = true - } - - else - gamedata.errormessage = - "Internal modstore error please leave modstore and reopen! (Sorry)" + + modstore.lastmodtitle = modstore.lastmodtitle .. moddetails.title + + engine.handle_async( + function(param) + + local fullurl = engine.setting_get("modstore_download_url") .. + param.moddetails.download_url + + if param.version ~= nil then + local found = false + for i=1,#param.moddetails.versions, 1 do + if param.moddetails.versions[i].date:sub(1,10) == param.version then + fullurl = engine.setting_get("modstore_download_url") .. + param.moddetails.versions[i].download_url + found = true + end + end + + if not found then + return { + moddetails = param.moddetails, + successfull = false + } + end + end + + if engine.download_file(fullurl,param.filename) then + return { + texturename = param.texturename, + moddetails = param.moddetails, + filename = param.filename, + successfull = true + } + else + return { + modtitle = param.title, + successfull = false + } + end + end, + { + moddetails = moddetails, + version = fields["dd_version" .. modid], + filename = os.tempfolder() .. "_MODNAME_" .. moddetails.basename .. ".zip", + texturename = modstore.modlist_unsorted.data[i].texturename + }, + function(result) + if result.successfull then + modmgr.installmod(result.filename,result.moddetails.basename) + os.remove(result.filename) + else + gamedata.errormessage = "Failed to download " .. result.moddetails.title + end + + if gamedata.errormessage == nil then + engine.button_handler({btn_hidden_close_download=result}) + else + engine.button_handler({btn_hidden_close_download={successfull=false}}) + end + end + ) + + return { + current_tab = "modstore_downloading", + is_dialog = true, + show_buttons = false, + ignore_menu_quit = true + } + end end + break end end end -------------------------------------------------------------------------------- +-- @function [parent=#modstore] update_modlist function modstore.update_modlist() modstore.modlist_unsorted = {} modstore.modlist_unsorted.data = {} @@ -241,6 +375,7 @@ function modstore.update_modlist() end -------------------------------------------------------------------------------- +-- @function [parent=#modstore] fetchdetails function modstore.fetchdetails() for i=1,#modstore.modlist_unsorted.data,1 do @@ -267,23 +402,160 @@ function modstore.fetchdetails() ) end end --------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -function modstore.getmodlist(list) - local retval = "" - retval = retval .. "label[10,-0.4;" .. fgettext("Page $1 of $2", list.page+1, list.pagecount) .. "]" +-- @function [parent=#modstore] getscreenshot +function modstore.getscreenshot(ypos,listentry) - retval = retval .. "button[11.6,-0.1;0.5,0.5;btn_modstore_page_up;^]" - retval = retval .. "box[11.6,0.35;0.28,8.6;#000000]" - local scrollbarpos = 0.35 + (8.1/(list.pagecount-1)) * list.page - retval = retval .. "box[11.6," ..scrollbarpos .. ";0.28,0.5;#32CD32]" - retval = retval .. "button[11.6,9.0;0.5,0.5;btn_modstore_page_down;v]" - - - if #list.data < (list.page * modstore.modsperpage) then - return retval + if listentry.details ~= nil and + (listentry.details.screenshot_url == nil or + listentry.details.screenshot_url == "") then + + if listentry.texturename == nil then + listentry.texturename = modstore.basetexturedir .. "no_screenshot.png" + end + + return "image[0,".. ypos .. ";3,2;" .. + engine.formspec_escape(listentry.texturename) .. "]" end + + if listentry.details ~= nil and + listentry.texturename == nil then + --make sure we don't download multiple times + listentry.texturename = "in progress" + + --prepare url and filename + local fullurl = engine.setting_get("modstore_download_url") .. + listentry.details.screenshot_url + local filename = os.tempfolder() .. "_MID_" .. listentry.id + + --trigger download + engine.handle_async( + --first param is downloadfct + function(param) + param.successfull = engine.download_file(param.fullurl,param.filename) + return param + end, + --second parameter is data passed to async job + { + fullurl = fullurl, + filename = filename, + modid = listentry.id + }, + --integrate result to raw list + function(result) + if result.successfull then + local found = false + for i=1,#modstore.modlist_unsorted.data,1 do + if modstore.modlist_unsorted.data[i].id == result.modid then + found = true + modstore.modlist_unsorted.data[i].texturename = result.filename + break + end + end + if found then + engine.event_handler("Refresh") + else + engine.log("error","got screenshot but didn't find matching mod: " .. result.modid) + end + end + end + ) + end + + if listentry.texturename ~= nil and + listentry.texturename ~= "in progress" then + return "image[0,".. ypos .. ";3,2;" .. + engine.formspec_escape(listentry.texturename) .. "]" + end + + return "" +end + +-------------------------------------------------------------------------------- +--@function [parent=#modstore] getshortmodinfo +function modstore.getshortmodinfo(ypos,listentry,details) + local retval = "" + + retval = retval .. "box[0," .. ypos .. ";11.4,1.75;#FFFFFF]" + + --screenshot + retval = retval .. modstore.getscreenshot(ypos,listentry) + + --title + author + retval = retval .."label[2.75," .. ypos .. ";" .. + engine.formspec_escape(details.title) .. " (" .. details.author .. ")]" + + --description + local descriptiony = ypos + 0.5 + retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.55;;" .. + engine.formspec_escape(details.description) .. ";]" + + --rating + local ratingy = ypos + retval = retval .."label[7," .. ratingy .. ";" .. + fgettext("Rating") .. ":]" + retval = retval .. "label[8.7," .. ratingy .. ";" .. details.rating .."]" + + --versions (IMPORTANT has to be defined AFTER rating) + if details.versions ~= nil and + #details.versions > 1 then + local versiony = ypos + 0.05 + retval = retval .. "dropdown[9.1," .. versiony .. ";2.48,0.25;dd_version" .. details.id .. ";" + local versions = "" + for i=1,#details.versions , 1 do + if versions ~= "" then + versions = versions .. "," + end + + versions = versions .. details.versions[i].date:sub(1,10) + end + retval = retval .. versions .. ";1]" + end + + if details.basename then + --install button + local buttony = ypos + 1.2 + retval = retval .."button[9.1," .. buttony .. ";2.5,0.5;btn_install_mod_" .. details.id .. ";" + + if modmgr.mod_exists(details.basename) then + retval = retval .. fgettext("re-Install") .."]" + else + retval = retval .. fgettext("Install") .."]" + end + end + + return retval +end + +-------------------------------------------------------------------------------- +--@function [parent=#modstore] getmodlist +function modstore.getmodlist(list,yoffset) + + modstore.current_list = list + + if #list.data == 0 then + return "" + end + + if yoffset == nil then + yoffset = 0 + end + + local scrollbar = "" + scrollbar = scrollbar .. "label[0.1,9.5;" + .. fgettext("Page $1 of $2", list.page+1, list.pagecount) .. "]" + scrollbar = scrollbar .. "box[11.6," .. (yoffset + 0.35) .. ";0.28," + .. (8.6 - yoffset) .. ";#000000]" + local scrollbarpos = (yoffset + 0.75) + + ((7.7 -yoffset)/(list.pagecount-1)) * list.page + scrollbar = scrollbar .. "box[11.6," ..scrollbarpos .. ";0.28,0.5;#32CD32]" + scrollbar = scrollbar .. "button[11.6," .. (yoffset + (0.3)) + .. ";0.5,0.5;btn_modstore_page_up;^]" + scrollbar = scrollbar .. "button[11.6," .. 9.0 + .. ";0.5,0.5;btn_modstore_page_down;v]" + + local retval = "" local endmod = (list.page * modstore.modsperpage) + modstore.modsperpage @@ -295,10 +567,6 @@ function modstore.getmodlist(list) --getmoddetails local details = list.data[i].details --- if details == nil then --- details = modstore.get_details(list.data[i].id) --- end - if details == nil then details = {} details.title = list.data[i].title @@ -308,97 +576,39 @@ function modstore.getmodlist(list) end if details ~= nil then - local screenshot_ypos = (i-1 - (list.page * modstore.modsperpage))*1.9 +0.2 - - retval = retval .. "box[0," .. screenshot_ypos .. ";11.4,1.75;#FFFFFF]" - - if details.basename then - --screenshot - if details.screenshot_url ~= nil and - details.screenshot_url ~= "" then - if list.data[i].texturename == nil then - local fullurl = engine.setting_get("modstore_download_url") .. - details.screenshot_url - local filename = os.tempfolder() .. "_MID_" .. list.data[i].id - list.data[i].texturename = "in progress" - engine.handle_async( - function(param) - param.successfull = engine.download_file(param.fullurl,param.filename) - return param - end, - { - fullurl = fullurl, - filename = filename, - listindex = i, - modid = list.data[i].id - }, - function(result) - if modstore.modlist_unsorted and - modstore.modlist_unsorted.data and - #modstore.modlist_unsorted.data >= result.listindex and - modstore.modlist_unsorted.data[result.listindex].id == result.modid then - if result.successfull then - modstore.modlist_unsorted.data[result.listindex].texturename = result.filename - else - modstore.modlist_unsorted.data[result.listindex].texturename = modstore.basetexturedir .. "no_screenshot.png" - end - engine.event_handler("Refresh") - end - end - ) - end - else - if list.data[i].texturename == nil then - list.data[i].texturename = modstore.basetexturedir .. "no_screenshot.png" - end - end - - if list.data[i].texturename ~= nil and - list.data[i].texturename ~= "in progress" then - retval = retval .. "image[0,".. screenshot_ypos .. ";3,2;" .. - engine.formspec_escape(list.data[i].texturename) .. "]" - end - end - - --title + author - retval = retval .."label[2.75," .. screenshot_ypos .. ";" .. - engine.formspec_escape(details.title) .. " (" .. details.author .. ")]" - - --description - local descriptiony = screenshot_ypos + 0.5 - retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.55;;" .. - engine.formspec_escape(details.description) .. ";]" - --rating - local ratingy = screenshot_ypos + 0.6 - retval = retval .."label[9.1," .. ratingy .. ";" .. - fgettext("Rating") .. ":]" - retval = retval .. "label[11.1," .. ratingy .. ";" .. details.rating .."]" - - if details.basename then - --install button - local buttony = screenshot_ypos + 1.2 - local buttonnumber = (i - (list.page * modstore.modsperpage)) - retval = retval .."button[9.1," .. buttony .. ";2.5,0.5;btn_install_mod_" .. buttonnumber .. ";" - - if modmgr.mod_exists(details.basename) then - retval = retval .. fgettext("re-Install") .."]" - else - retval = retval .. fgettext("Install") .."]" - end - end + local screenshot_ypos = + yoffset +(i-1 - (list.page * modstore.modsperpage))*1.9 +0.2 + + retval = retval .. modstore.getshortmodinfo(screenshot_ypos, + list.data[i], + details) end end - - modstore.current_list = list - - return retval + + return retval .. scrollbar end -------------------------------------------------------------------------------- +--@function [parent=#modstore] getsearchpage function modstore.getsearchpage() local retval = "" + local search = "" + + if modstore.last_search ~= nil then + search = modstore.last_search + end - --TODO implement search! + retval = retval .. + "button[9.5,0.2;2.5,0.5;btn_modstore_search;".. fgettext("Search") .. "]" .. + "field[0.5,0.5;9,0.5;te_modstore_search;;" .. search .. "]" + + + --show 4 mods only + modstore.modsperpage = 4 + retval = retval .. + modstore.getmodlist( + modstore.currentlist, + 1.75) return retval; end diff --git a/src/convert_json.cpp b/src/convert_json.cpp index e8eede0b1..0b69f43a3 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -210,7 +210,7 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { } if (retval.versions.size() < 1) { - errorstream << "readModStoreModDetails: not a single version specified!" << std::endl; + infostream << "readModStoreModDetails: not a single version specified!" << std::endl; retval.valid = false; } diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index 7acc00ef1..d008b2568 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -156,7 +156,7 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev, m_sound_manager = &dummySoundManager; //create topleft header - core::rect rect(0, 0, 500, 40); + core::rect rect(0, 0, 500, 20); rect += v2s32(4, 0); std::string t = std::string("Minetest ") + minetest_version_hash; diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 82def7411..87a46d9c9 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1856,7 +1856,7 @@ void GUIFormSpecMenu::drawMenu() v2u32 screenSize = driver->getScreenSize(); core::rect allbg(0, 0, screenSize.X , screenSize.Y); - if (m_bgfullscreen) + if (m_bgfullscreen) driver->draw2DRectangle(m_bgcolor, allbg, &allbg); else driver->draw2DRectangle(m_bgcolor, AbsoluteRect, &AbsoluteClippingRect); @@ -1959,7 +1959,7 @@ void GUIFormSpecMenu::drawMenu() IItemDefManager *idef = m_gamedef->idef(); ItemStack item; item.deSerialize(spec.name, idef); - video::ITexture *texture = idef->getInventoryTexture(item.getDefinition(idef).name, m_gamedef); + video::ITexture *texture = idef->getInventoryTexture(item.getDefinition(idef).name, m_gamedef); // Image size on screen core::rect imgrect(0, 0, spec.geom.X, spec.geom.Y); // Image rectangle on screen @@ -1998,7 +1998,7 @@ void GUIFormSpecMenu::drawMenu() if (spec.tooltip != "") { core::rect rect = spec.rect; - if (rect.isPointInside(m_pointer)) + if (rect.isPointInside(m_pointer)) { m_tooltip_element->setVisible(true); this->bringToFront(m_tooltip_element); @@ -2168,7 +2168,7 @@ void GUIFormSpecMenu::acceptInput(bool quit=false) for(u32 i=0; igetType() == gui::EGUIET_COMBO_BOX)) { e = static_cast(element); } - fields[wide_to_narrow(s.fname.c_str())] = - wide_to_narrow(e->getItem(e->getSelected())); + s32 selected = e->getSelected(); + if (selected >= 0) { + fields[wide_to_narrow(s.fname.c_str())] = + wide_to_narrow(e->getItem(selected)); + } } else if (s.ftype == f_TabHeader) { // no dynamic cast possible due to some distributions shipped @@ -2662,7 +2665,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) for(u32 i=0; igetID())) diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 42ddd0b14..ba8a09747 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -336,6 +336,26 @@ int ModApiMainMenu::l_get_modstore_details(lua_State *L) lua_pushstring(L,current_mod.versions[0].file.c_str()); lua_settable(L, top); + lua_pushstring(L,"versions"); + lua_newtable(L); + int versionstop = lua_gettop(L); + for (unsigned int i=0;i < current_mod.versions.size(); i++) { + lua_pushnumber(L,i+1); + lua_newtable(L); + int current_element = lua_gettop(L); + + lua_pushstring(L,"date"); + lua_pushstring(L,current_mod.versions[i].date.c_str()); + lua_settable(L,current_element); + + lua_pushstring(L,"download_url"); + lua_pushstring(L,current_mod.versions[i].file.c_str()); + lua_settable(L,current_element); + + lua_settable(L,versionstop); + } + lua_settable(L, top); + lua_pushstring(L,"screenshot_url"); lua_pushstring(L,current_mod.titlepic.file.c_str()); lua_settable(L, top); @@ -782,7 +802,10 @@ int ModApiMainMenu::l_extract_zip(lua_State *L) io::IFileSystem* fs = engine->m_device->getFileSystem(); - fs->addFileArchive(zipfile,true,false,io::EFAT_ZIP); + if (!fs->addFileArchive(zipfile,true,false,io::EFAT_ZIP)) { + lua_pushboolean(L,false); + return 1; + } assert(fs->getFileArchiveCount() > 0); From 76036abdb0d9cb2c971e5a69331c77872d38c56f Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Thu, 12 Dec 2013 21:47:54 +0400 Subject: [PATCH 173/198] Add configurable font shadow. --- minetest.conf.example | 3 +++ src/cguittfont/CGUITTFont.cpp | 12 +++++++++++- src/cguittfont/CGUITTFont.h | 3 ++- src/defaultsettings.cpp | 2 ++ src/main.cpp | 3 ++- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index 4d6b76c84..3dbbd773e 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -205,12 +205,15 @@ # Path to TrueTypeFont or bitmap #font_path = fonts/liberationsans.ttf #font_size = 13 +# Font shadow offset, if 0 then shadow will not be drawn. +#font_shadow = 1 #mono_font_path = fonts/liberationmono.ttf #mono_font_size = 13 # This font will be used for certain languages #fallback_font_path = fonts/DroidSansFallbackFull.ttf #fallback_font_size = 13 +#fallback_font_shadow = 1 # # Server stuff diff --git a/src/cguittfont/CGUITTFont.cpp b/src/cguittfont/CGUITTFont.cpp index fb8199e21..b9c979090 100644 --- a/src/cguittfont/CGUITTFont.cpp +++ b/src/cguittfont/CGUITTFont.cpp @@ -199,7 +199,7 @@ void SGUITTGlyph::unload() ////////////////////// -CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias, const bool transparency) +CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias, const bool transparency, const u32 shadow) { if (!c_libraryLoaded) { @@ -216,6 +216,8 @@ CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filen return 0; } + font->shadow_offset = shadow; + return font; } @@ -625,6 +627,14 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect& position CGUITTGlyphPage* page = n->getValue(); if (!use_transparency) color.color |= 0xff000000; + + if (shadow_offset) { + for (size_t i = 0; i < page->render_positions.size(); ++i) + page->render_positions[i] += core::vector2di(shadow_offset, shadow_offset); + Driver->draw2DImageBatch(page->texture, page->render_positions, page->render_source_rects, clip, video::SColor(255, 0, 0, 0), true); + for (size_t i = 0; i < page->render_positions.size(); ++i) + page->render_positions[i] -= core::vector2di(shadow_offset, shadow_offset); + } Driver->draw2DImageBatch(page->texture, page->render_positions, page->render_source_rects, clip, color, true); } } diff --git a/src/cguittfont/CGUITTFont.h b/src/cguittfont/CGUITTFont.h index 12e25e0f3..a58873da6 100644 --- a/src/cguittfont/CGUITTFont.h +++ b/src/cguittfont/CGUITTFont.h @@ -207,7 +207,7 @@ namespace gui //! \param antialias set the use_monochrome (opposite to antialias) flag //! \param transparency set the use_transparency flag //! \return Returns a pointer to a CGUITTFont. Will return 0 if the font failed to load. - static CGUITTFont* createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); + static CGUITTFont* createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true, const u32 shadow = 0); static CGUITTFont* createTTFont(IrrlichtDevice *device, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); static CGUITTFont* create(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); static CGUITTFont* create(IrrlichtDevice *device, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); @@ -369,6 +369,7 @@ namespace gui s32 GlobalKerningWidth; s32 GlobalKerningHeight; core::ustring Invisible; + u32 shadow_offset; }; } // end namespace gui diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 106e5d9c2..9b407b1c3 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -153,10 +153,12 @@ void set_default_settings(Settings *settings) settings->setDefault("freetype", "true"); settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "liberationsans.ttf")); settings->setDefault("font_size", "13"); + settings->setDefault("font_shadow", "1"); settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "liberationmono.ttf")); settings->setDefault("mono_font_size", "13"); settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf")); settings->setDefault("fallback_font_size", "13"); + settings->setDefault("fallback_font_shadow", "1"); #else settings->setDefault("freetype", "false"); settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "fontlucida.png")); diff --git a/src/main.cpp b/src/main.cpp index d5a121e79..57c2f06a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1481,7 +1481,8 @@ int main(int argc, char *argv[]) fallback = "fallback_"; u16 font_size = g_settings->getU16(fallback + "font_size"); font_path = g_settings->get(fallback + "font_path"); - font = gui::CGUITTFont::createTTFont(guienv, font_path.c_str(), font_size); + u32 font_shadow = g_settings->getU16(fallback + "font_shadow"); + font = gui::CGUITTFont::createTTFont(guienv, font_path.c_str(), font_size, true, true, font_shadow); } else { font = guienv->getFont(font_path.c_str()); } From 33de69a173a3646d8f5b9bf91b3e48d76cd40ae6 Mon Sep 17 00:00:00 2001 From: kaeza Date: Thu, 12 Dec 2013 04:51:35 -0200 Subject: [PATCH 174/198] Add 'on_prejoinplayer' callback --- builtin/misc_register.lua | 1 + doc/lua_api.txt | 3 +++ src/script/cpp_api/s_player.cpp | 18 ++++++++++++++++++ src/script/cpp_api/s_player.h | 1 + src/server.cpp | 13 +++++++++++++ 5 files changed, 36 insertions(+) diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index 249d272eb..6c50ff02e 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -380,6 +380,7 @@ minetest.registered_on_generateds, minetest.register_on_generated = make_registr minetest.registered_on_newplayers, minetest.register_on_newplayer = make_registration() minetest.registered_on_dieplayers, minetest.register_on_dieplayer = make_registration() minetest.registered_on_respawnplayers, minetest.register_on_respawnplayer = make_registration() +minetest.registered_on_prejoinplayers, minetest.register_on_prejoinplayer = make_registration() minetest.registered_on_joinplayers, minetest.register_on_joinplayer = make_registration() minetest.registered_on_leaveplayers, minetest.register_on_leaveplayer = make_registration() minetest.registered_on_player_receive_fields, minetest.register_on_player_receive_fields = make_registration_reverse() diff --git a/doc/lua_api.txt b/doc/lua_api.txt index cc8044fa9..ae7144442 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1175,6 +1175,9 @@ minetest.register_on_respawnplayer(func(ObjectRef)) ^ Called when player is to be respawned ^ Called _before_ repositioning of player occurs ^ return true in func to disable regular player placement +minetest.register_on_prejoinplayer(func(name, ip)) +^ Called before a player joins the game +^ If it returns a string, the player is disconnected with that string as reason minetest.register_on_joinplayer(func(ObjectRef)) ^ Called when a player joins the game minetest.register_on_leaveplayer(func(ObjectRef)) diff --git a/src/script/cpp_api/s_player.cpp b/src/script/cpp_api/s_player.cpp index 215a34d53..d357689f2 100644 --- a/src/script/cpp_api/s_player.cpp +++ b/src/script/cpp_api/s_player.cpp @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "cpp_api/s_player.h" #include "cpp_api/s_internal.h" +#include "util/string.h" void ScriptApiPlayer::on_newplayer(ServerActiveObject *player) { @@ -58,6 +59,23 @@ bool ScriptApiPlayer::on_respawnplayer(ServerActiveObject *player) return positioning_handled_by_some; } +bool ScriptApiPlayer::on_prejoinplayer(std::string name, std::string ip, std::string &reason) +{ + SCRIPTAPI_PRECHECKHEADER + + // Get minetest.registered_on_prejoinplayers + lua_getglobal(L, "minetest"); + lua_getfield(L, -1, "registered_on_prejoinplayers"); + lua_pushstring(L, name.c_str()); + lua_pushstring(L, ip.c_str()); + script_run_callbacks(L, 2, RUN_CALLBACKS_MODE_OR); + if (lua_isstring(L, -1)) { + reason.assign(lua_tostring(L, -1)); + return true; + } + return false; +} + void ScriptApiPlayer::on_joinplayer(ServerActiveObject *player) { SCRIPTAPI_PRECHECKHEADER diff --git a/src/script/cpp_api/s_player.h b/src/script/cpp_api/s_player.h index 88221f486..c77d397c4 100644 --- a/src/script/cpp_api/s_player.h +++ b/src/script/cpp_api/s_player.h @@ -34,6 +34,7 @@ public: void on_newplayer(ServerActiveObject *player); void on_dieplayer(ServerActiveObject *player); bool on_respawnplayer(ServerActiveObject *player); + bool on_prejoinplayer(std::string name, std::string ip, std::string &reason); void on_joinplayer(ServerActiveObject *player); void on_leaveplayer(ServerActiveObject *player); void on_cheat(ServerActiveObject *player, const std::string &cheat_type); diff --git a/src/server.cpp b/src/server.cpp index 13b59e7f5..2c38c66d3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1970,6 +1970,19 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) return; } + { + std::string reason; + if(m_script->on_prejoinplayer(playername, addr_s, reason)) + { + actionstream<<"Server: Player with the name \""< Date: Wed, 11 Dec 2013 20:33:39 +0000 Subject: [PATCH 175/198] Make line_of_sight return blocking node position --- doc/lua_api.txt | 5 +++-- src/environment.cpp | 5 ++++- src/environment.h | 2 +- src/script/lua_api/l_env.cpp | 10 ++++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index ae7144442..a8b671eb6 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1308,8 +1308,9 @@ minetest.set_mapgen_params(MapgenParams) ^ flags and flagmask are in the same format and have the same options as 'mgflags' in minetest.conf minetest.clear_objects() ^ clear all objects in the environments -minetest.line_of_sight(pos1,pos2,stepsize) ->true/false -^ checkif there is a direct line of sight between pos1 and pos2 +minetest.line_of_sight(pos1, pos2, stepsize) -> true/false, pos +^ Check if there is a direct line of sight between pos1 and pos2 +^ Returns the position of the blocking node when false ^ pos1 First position ^ pos2 Second position ^ stepsize smaller gives more accurate results but requires more computing diff --git a/src/environment.cpp b/src/environment.cpp index e4567a78e..7fe5d356a 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -354,7 +354,7 @@ ServerMap & ServerEnvironment::getServerMap() return *m_map; } -bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize) +bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize, v3s16 *p) { float distance = pos1.getDistanceFrom(pos2); @@ -372,6 +372,9 @@ bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize) MapNode n = getMap().getNodeNoEx(pos); if(n.param0 != CONTENT_AIR) { + if (p) { + *p = pos; + } return false; } } diff --git a/src/environment.h b/src/environment.h index 9f9a0a23c..d9804e781 100644 --- a/src/environment.h +++ b/src/environment.h @@ -295,7 +295,7 @@ public: void step(f32 dtime); //check if there's a line of sight between two positions - bool line_of_sight(v3f pos1, v3f pos2, float stepsize=1.0); + bool line_of_sight(v3f pos1, v3f pos2, float stepsize=1.0, v3s16 *p=NULL); u32 getGameTime() { return m_game_time; } diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 4a8150396..d01889401 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -648,7 +648,7 @@ int ModApiEnvMod::l_clear_objects(lua_State *L) return 0; } -// minetest.line_of_sight(pos1, pos2, stepsize) -> true/false +// minetest.line_of_sight(pos1, pos2, stepsize) -> true/false, pos int ModApiEnvMod::l_line_of_sight(lua_State *L) { float stepsize = 1.0; @@ -663,7 +663,13 @@ int ModApiEnvMod::l_line_of_sight(lua_State *L) { stepsize = lua_tonumber(L, 3); } - lua_pushboolean(L, env->line_of_sight(pos1,pos2,stepsize)); + v3s16 p; + bool success = env->line_of_sight(pos1, pos2, stepsize, &p); + lua_pushboolean(L, success); + if (!success) { + push_v3s16(L, p); + return 2; + } return 1; } From 67bf7130ce3f1780a432ae03eabdec3118ecab70 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Fri, 13 Dec 2013 13:18:00 +0400 Subject: [PATCH 176/198] Fix a bug in GenericCAO GENERIC_CMD_UPDATE_POSITION parsing. --- src/content_cao.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content_cao.cpp b/src/content_cao.cpp index ec8cde35b..640ab6c73 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1649,6 +1649,8 @@ public: m_acceleration = readV3F1000(is); if(fabs(m_prop.automatic_rotate) < 0.001) m_yaw = readF1000(is); + else + readF1000(is); bool do_interpolate = readU8(is); bool is_end_position = readU8(is); float update_interval = readF1000(is); From 0ea3e6dbe2288854d9d4a971fc6539c2e740a95a Mon Sep 17 00:00:00 2001 From: Kahrl Date: Thu, 29 Aug 2013 05:04:56 +0200 Subject: [PATCH 177/198] Implement httpfetch module and initialize it from main() Add curl_parallel_limit setting that will replace media_fetch_threads in a later commit. Fix a typo in MutexedQueue::pop_back() that made it impossible to compile code that used this function. (Noticed this while implementing httpfetch.) --- src/CMakeLists.txt | 11 +- src/defaultsettings.cpp | 1 + src/httpfetch.cpp | 718 ++++++++++++++++++++++++++++++++++++++++ src/httpfetch.h | 126 +++++++ src/main.cpp | 7 + src/util/container.h | 3 +- 6 files changed, 860 insertions(+), 6 deletions(-) create mode 100644 src/httpfetch.cpp create mode 100644 src/httpfetch.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a30dc9854..104e56406 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,7 +188,7 @@ message (STATUS "LuaJIT library: ${LUA_LIBRARY}") message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}") set(USE_LUAJIT 0) -if(LUA_LIBRARY AND LUA_INCLUDE_DIR) +if(LUA_LIBRARY AND LUA_INCLUDE_DIR) message (STATUS "LuaJIT found.") set(USE_LUAJIT 1) else(LUA_LIBRARY AND LUA_INCLUDE_DIR) @@ -307,6 +307,7 @@ set(common_SRCS pathfinder.cpp convert_json.cpp gettext.cpp + httpfetch.cpp ${JTHREAD_SRCS} ${common_SCRIPT_SRCS} ${UTIL_SRCS} @@ -500,7 +501,7 @@ if(MSVC) # Flags for C files (sqlite) # /MT = Link statically with standard library stuff set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MT") - + if(BUILD_SERVER) set_target_properties(${PROJECT_NAME}server PROPERTIES COMPILE_DEFINITIONS "SERVER") @@ -508,13 +509,13 @@ if(MSVC) else() # Probably GCC - + if(WARN_ALL) set(RELEASE_WARNING_FLAGS "-Wall") else() set(RELEASE_WARNING_FLAGS "") endif() - + if(NOT APPLE AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") CHECK_CXX_COMPILER_FLAG("-Wno-unused-but-set-variable" HAS_UNUSED_BUT_SET_VARIABLE_WARNING) if(HAS_UNUSED_BUT_SET_VARIABLE_WARNING) @@ -537,7 +538,7 @@ else() if(USE_GPROF) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") endif() - + if(BUILD_SERVER) set_target_properties(${PROJECT_NAME}server PROPERTIES COMPILE_DEFINITIONS "SERVER") diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 9b407b1c3..662717c8a 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -140,6 +140,7 @@ void set_default_settings(Settings *settings) settings->setDefault("enable_particles", "true"); settings->setDefault("media_fetch_threads", "8"); + settings->setDefault("curl_parallel_limit", "8"); settings->setDefault("serverlist_url", "servers.minetest.net"); settings->setDefault("serverlist_file", "favoriteservers.txt"); diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp new file mode 100644 index 000000000..4342a8b2a --- /dev/null +++ b/src/httpfetch.cpp @@ -0,0 +1,718 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "httpfetch.h" +#include +#include +#include +#include +#include +#include "jthread/jevent.h" +#include "config.h" +#include "exceptions.h" +#include "debug.h" +#include "log.h" +#include "util/container.h" +#include "util/thread.h" +#include "socket.h" // for select() + +JMutex g_httpfetch_mutex; +std::map > g_httpfetch_results; + +static void httpfetch_deliver_result(const HTTPFetchResult &fetchresult) +{ + unsigned long caller = fetchresult.caller; + if (caller != HTTPFETCH_DISCARD) { + JMutexAutoLock lock(g_httpfetch_mutex); + g_httpfetch_results[caller].push_back(fetchresult); + } +} + +static void httpfetch_request_clear(unsigned long caller); + +unsigned long httpfetch_caller_alloc() +{ + JMutexAutoLock lock(g_httpfetch_mutex); + + // Check each caller ID except HTTPFETCH_DISCARD + const unsigned long discard = HTTPFETCH_DISCARD; + for (unsigned long caller = discard + 1; caller != discard; ++caller) { + std::map >::iterator + it = g_httpfetch_results.find(caller); + if (it == g_httpfetch_results.end()) { + verbosestream<<"httpfetch_caller_alloc: allocating " + < >::iterator + it = g_httpfetch_results.find(caller); + if (it == g_httpfetch_results.end()) + return false; + + // Check that result queue is nonempty + std::list &callerresults = it->second; + if (callerresults.empty()) + return false; + + // Pop first result + fetchresult = callerresults.front(); + callerresults.pop_front(); + return true; +} + +#if USE_CURL +#include + +/* + USE_CURL is on: use cURL based httpfetch implementation +*/ + +static size_t httpfetch_writefunction( + char *ptr, size_t size, size_t nmemb, void *userdata) +{ + std::ostringstream *stream = (std::ostringstream*)userdata; + size_t count = size * nmemb; + stream->write(ptr, count); + return count; +} + +static size_t httpfetch_discardfunction( + char *ptr, size_t size, size_t nmemb, void *userdata) +{ + return size * nmemb; +} + +class CurlHandlePool +{ + std::list handles; + +public: + CurlHandlePool() {} + ~CurlHandlePool() + { + for (std::list::iterator it = handles.begin(); + it != handles.end(); ++it) { + curl_easy_cleanup(*it); + } + } + CURL * alloc() + { + CURL *curl; + if (handles.empty()) { + curl = curl_easy_init(); + if (curl == NULL) { + errorstream<<"curl_easy_init returned NULL"<alloc(); + if (curl != NULL) { + // Set static cURL options + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); + curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 1); + +#if LIBCURL_VERSION_NUM >= 0x071304 + // Restrict protocols so that curl vulnerabilities in + // other protocols don't affect us. + // These settings were introduced in curl 7.19.4. + long protocols = + CURLPROTO_HTTP | + CURLPROTO_HTTPS | + CURLPROTO_FTP | + CURLPROTO_FTPS; + curl_easy_setopt(curl, CURLOPT_PROTOCOLS, protocols); + curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, protocols); +#endif + + // Set cURL options based on HTTPFetchRequest + curl_easy_setopt(curl, CURLOPT_URL, + request.url.c_str()); + curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, + request.timeout); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, + request.connect_timeout); + // Set up a write callback that writes to the + // ostringstream ongoing->oss, unless the data + // is to be discarded + if (request.caller == HTTPFETCH_DISCARD) { + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, + httpfetch_discardfunction); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, NULL); + } + else { + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, + httpfetch_writefunction); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &oss); + } + // Set POST (or GET) data + if (request.post_fields.empty()) { + curl_easy_setopt(curl, CURLOPT_HTTPGET, 1); + } + else { + curl_easy_setopt(curl, CURLOPT_POST, 1); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, + request.post_fields.size()); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, + request.post_fields.c_str()); + // request.post_fields must now *never* be + // modified until CURLOPT_POSTFIELDS is cleared + } + // Set additional HTTP headers + for (size_t i = 0; i < request.extra_headers.size(); ++i) { + httpheader = curl_slist_append( + httpheader, + request.extra_headers[i].c_str()); + } + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, httpheader); + } + } + + CURLcode start(CURLM *multi_) + { + if (curl == NULL) + return CURLE_FAILED_INIT; + + if (multi_) { + // Multi interface (async) + CURLMcode mres = curl_multi_add_handle(multi_, curl); + if (mres != CURLM_OK) { + errorstream<<"curl_multi_add_handle" + <<" returned error code "<free(curl); + } +}; + +class CurlFetchThread : public SimpleThread +{ +protected: + enum RequestType { + RT_FETCH, + RT_CLEAR, + RT_WAKEUP, + }; + + struct Request { + RequestType type; + HTTPFetchRequest fetchrequest; + Event *event; + }; + + CURLM *m_multi; + MutexedQueue m_requests; + size_t m_parallel_limit; + + // Variables exclusively used within thread + std::vector m_all_ongoing; + std::list m_queued_fetches; + +public: + CurlFetchThread(int parallel_limit) + { + if (parallel_limit >= 1) + m_parallel_limit = parallel_limit; + else + m_parallel_limit = 1; + } + + void requestFetch(const HTTPFetchRequest &fetchrequest) + { + Request req; + req.type = RT_FETCH; + req.fetchrequest = fetchrequest; + req.event = NULL; + m_requests.push_back(req); + } + + void requestClear(unsigned long caller, Event *event) + { + Request req; + req.type = RT_CLEAR; + req.fetchrequest.caller = caller; + req.event = event; + m_requests.push_back(req); + } + + void requestWakeUp() + { + Request req; + req.type = RT_WAKEUP; + req.event = NULL; + m_requests.push_back(req); + } + +protected: + // Handle a request from some other thread + // E.g. new fetch; clear fetches for one caller; wake up + void processRequest(const Request &req) + { + if (req.type == RT_FETCH) { + // New fetch, queue until there are less + // than m_parallel_limit ongoing fetches + m_queued_fetches.push_back(req.fetchrequest); + + // see processQueued() for what happens next + + } + else if (req.type == RT_CLEAR) { + unsigned long caller = req.fetchrequest.caller; + + // Abort all ongoing fetches for the caller + for (std::vector::iterator + it = m_all_ongoing.begin(); + it != m_all_ongoing.end();) { + if ((*it)->request.caller == caller) { + delete (*it); + it = m_all_ongoing.erase(it); + } + else + ++it; + } + + // Also abort all queued fetches for the caller + for (std::list::iterator + it = m_queued_fetches.begin(); + it != m_queued_fetches.end();) { + if ((*it).caller == caller) + it = m_queued_fetches.erase(it); + else + ++it; + } + } + else if (req.type == RT_WAKEUP) { + // Wakeup: Nothing to do, thread is awake at this point + } + + if (req.event != NULL) + req.event->signal(); + } + + // Start new ongoing fetches if m_parallel_limit allows + void processQueued(CurlHandlePool *pool) + { + while (m_all_ongoing.size() < m_parallel_limit && + !m_queued_fetches.empty()) { + HTTPFetchRequest request = m_queued_fetches.front(); + m_queued_fetches.pop_front(); + + // Create ongoing fetch data and make a cURL handle + // Set cURL options based on HTTPFetchRequest + HTTPFetchOngoing *ongoing = + new HTTPFetchOngoing(request, pool); + + // Initiate the connection (curl_multi_add_handle) + CURLcode res = ongoing->start(m_multi); + if (res == CURLE_OK) { + m_all_ongoing.push_back(ongoing); + } + else { + ongoing->complete(res); + httpfetch_deliver_result(ongoing->result); + delete ongoing; + } + } + } + + // Process CURLMsg (indicates completion of a fetch) + void processCurlMessage(CURLMsg *msg) + { + // Determine which ongoing fetch the message pertains to + size_t i = 0; + bool found = false; + for (i = 0; i < m_all_ongoing.size(); ++i) { + if (m_all_ongoing[i]->curl == msg->easy_handle) { + found = true; + break; + } + } + if (msg->msg == CURLMSG_DONE && found) { + // m_all_ongoing[i] succeeded or failed. + HTTPFetchOngoing *ongoing = m_all_ongoing[i]; + ongoing->complete(msg->data.result); + httpfetch_deliver_result(ongoing->result); + delete ongoing; + m_all_ongoing.erase(m_all_ongoing.begin() + i); + } + } + + // Wait for a request from another thread, or timeout elapses + void waitForRequest(long timeout) + { + if (m_queued_fetches.empty()) { + try { + Request req = m_requests.pop_front(timeout); + processRequest(req); + } + catch (ItemNotFoundException &e) {} + } + } + + // Wait until some IO happens, or timeout elapses + void waitForIO(long timeout) + { + fd_set read_fd_set; + fd_set write_fd_set; + fd_set exc_fd_set; + int max_fd; + long select_timeout = -1; + struct timeval select_tv; + CURLMcode mres; + + FD_ZERO(&read_fd_set); + FD_ZERO(&write_fd_set); + FD_ZERO(&exc_fd_set); + + mres = curl_multi_fdset(m_multi, &read_fd_set, + &write_fd_set, &exc_fd_set, &max_fd); + if (mres != CURLM_OK) { + errorstream<<"curl_multi_fdset" + <<" returned error code "< timeout) + select_timeout = timeout; + + if (select_timeout > 0) { + select_tv.tv_sec = select_timeout / 1000; + select_tv.tv_usec = (select_timeout % 1000) * 1000; + int retval = select(max_fd + 1, &read_fd_set, + &write_fd_set, &exc_fd_set, + &select_tv); + if (retval == -1) { + #ifdef _WIN32 + errorstream<<"select returned error code " + <setRun(false); + g_httpfetch_thread->requestWakeUp(); + g_httpfetch_thread->stop(); + delete g_httpfetch_thread; + + curl_global_cleanup(); +} + +void httpfetch_async(const HTTPFetchRequest &fetchrequest) +{ + g_httpfetch_thread->requestFetch(fetchrequest); + if (!g_httpfetch_thread->IsRunning()) + g_httpfetch_thread->Start(); +} + +static void httpfetch_request_clear(unsigned long caller) +{ + if (g_httpfetch_thread->IsRunning()) { + Event event; + g_httpfetch_thread->requestClear(caller, &event); + event.wait(); + } + else { + g_httpfetch_thread->requestClear(caller, NULL); + } +} + +void httpfetch_sync(const HTTPFetchRequest &fetchrequest, + HTTPFetchResult &fetchresult) +{ + // Create ongoing fetch data and make a cURL handle + // Set cURL options based on HTTPFetchRequest + CurlHandlePool pool; + HTTPFetchOngoing ongoing(fetchrequest, &pool); + // Do the fetch (curl_easy_perform) + CURLcode res = ongoing.start(NULL); + // Update fetchresult + ongoing.complete(res); + fetchresult = ongoing.result; +} + +#else // USE_CURL + +/* + USE_CURL is off: + + Dummy httpfetch implementation that always returns an error. +*/ + +void httpfetch_init(int parallel_limit) +{ +} + +void httpfetch_cleanup() +{ +} + +void httpfetch_async(const HTTPFetchRequest &fetchrequest) +{ + errorstream<<"httpfetch_async: unable to fetch "< + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef HTTPFETCH_HEADER +#define HTTPFETCH_HEADER + +#include +#include +#include "config.h" + +// Can be used in place of "caller" in asynchronous transfers to discard result +// (used as default value of "caller") +#define HTTPFETCH_DISCARD 0 + +struct HTTPFetchRequest +{ + std::string url; + + // Identifies the caller (for asynchronous requests) + // Ignored by httpfetch_sync + unsigned long caller; + + // Some number that identifies the request + // (when the same caller issues multiple httpfetch_async calls) + unsigned long request_id; + + // Timeout for the whole transfer, in milliseconds + long timeout; + + // Timeout for the connection phase, in milliseconds + long connect_timeout; + + // POST data (should be application/x-www-form-urlencoded + // unless a Content-Type header is specified in extra_headers) + // If this is empty a GET request is done instead. + std::string post_fields; + + // If not empty, should contain entries such as "Accept: text/html" + std::vector extra_headers; + + HTTPFetchRequest() + { + url = ""; + caller = HTTPFETCH_DISCARD; + request_id = 0; + timeout = 0; + connect_timeout = 0; + } +}; + +struct HTTPFetchResult +{ + bool succeeded; + bool timeout; + long response_code; + std::string data; + // The caller and request_id from the corresponding HTTPFetchRequest. + unsigned long caller; + unsigned long request_id; + + HTTPFetchResult() + { + succeeded = false; + timeout = false; + response_code = 0; + data = ""; + caller = HTTPFETCH_DISCARD; + request_id = 0; + } + + HTTPFetchResult(const HTTPFetchRequest &fetchrequest) + { + succeeded = false; + timeout = false; + response_code = 0; + data = ""; + caller = fetchrequest.caller; + request_id = fetchrequest.request_id; + } +}; + +// Initializes the httpfetch module +void httpfetch_init(int parallel_limit); + +// Stops the httpfetch thread and cleans up resources +void httpfetch_cleanup(); + +// Starts an asynchronous HTTP fetch request +void httpfetch_async(const HTTPFetchRequest &fetchrequest); + +// If any fetch for the given caller ID is complete, removes it from the +// result queue, sets fetchresult and returns true. Otherwise returns false. +bool httpfetch_async_get(unsigned long caller, HTTPFetchResult &fetchresult); + +// Allocates a caller ID for httpfetch_async +// Not required if you want to set caller = HTTPFETCH_DISCARD +unsigned long httpfetch_caller_alloc(); + +// Frees a caller ID allocated with httpfetch_caller_alloc +// Note: This can be expensive, because the httpfetch thread is told +// to stop any ongoing fetches for the given caller. +void httpfetch_caller_free(unsigned long caller); + +// Performs a synchronous HTTP request. This blocks and therefore should +// only be used from background threads. +void httpfetch_sync(const HTTPFetchRequest &fetchrequest, + HTTPFetchResult &fetchresult); + + +#endif // !HTTPFETCH_HEADER diff --git a/src/main.cpp b/src/main.cpp index 57c2f06a5..239d68246 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -77,6 +77,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "subgame.h" #include "quicktune.h" #include "serverlist.h" +#include "httpfetch.h" #include "guiEngine.h" #include "mapsector.h" @@ -1001,6 +1002,9 @@ int main(int argc, char *argv[]) assert(res == CURLE_OK); #endif + // Initialize HTTP fetcher + httpfetch_init(g_settings->getS32("curl_parallel_limit")); + /* Run unit tests */ @@ -1858,6 +1862,9 @@ int main(int argc, char *argv[]) } } + // Stop httpfetch thread (if started) + httpfetch_cleanup(); + END_DEBUG_EXCEPTION_HANDLER(errorstream) debugstreams_deinit(); diff --git a/src/util/container.h b/src/util/container.h index fdd76cc59..e83c3cd37 100644 --- a/src/util/container.h +++ b/src/util/container.h @@ -297,7 +297,8 @@ public: if(!m_list.empty()) { - typename std::list::iterator last = m_list.back(); + typename std::list::iterator last = m_list.end(); + last--; T t = *last; m_list.erase(last); return t; From 0404bbf67196e83d04620180e704916671371ca1 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Thu, 29 Aug 2013 05:22:18 +0200 Subject: [PATCH 178/198] Rewrite client media download and support hash-based remote download Move most of the media-related code in client.cpp into a new class ClientMediaDownloader (clientmedia.cpp, clientmedia.h). Among other things, this class does the following things: - Download [remote_server][sha1] instead of [remote_server][name]. This is to support servers that provide the same file name with different contents. - Initially fetch [remote_server]index.mth. This file should follow the Minetest Hashset format (currently version 1) and contain a list of SHA1 hashes that exist on the server. - The list of needed SHA1s is uploaded (via HTTP POST) when index.mth is requested, so servers can optionally narrow down the list to the needs of the client. - If index.mth is missing (HTTP response code 404), we enter compat mode, fetching [remote_server][name] as before this commit. - remote_server can now contain multiple servers, separated by commas. The downloader code attempts to split requests between the different servers, as permitted by each server's index.mth. If one server claims to have a file but actually doesn't (or something fails), we ask a different server that also claims to have it. - As before, when none of the remote servers provide a particular file, we download it via the conventional method, i.e. using the minetest protocol: TOSERVER_REQUEST_MEDIA / TOCLIENT_MEDIA. - Bugfix: Every downloaded file's SHA1 is now verified against the SHA1 announced by the minetest server (before loading it and inserting it into the file cache). - Bugfix: Only send TOSERVER_RECEIVED_MEDIA when we actually have all media. This should fix #863. --- minetest.conf.example | 13 +- src/CMakeLists.txt | 1 + src/client.cpp | 313 +++++-------------- src/client.h | 67 +--- src/clientmedia.cpp | 656 ++++++++++++++++++++++++++++++++++++++++ src/clientmedia.h | 150 +++++++++ src/defaultsettings.cpp | 3 +- src/filecache.cpp | 31 -- src/filecache.h | 2 - src/game.cpp | 9 +- src/server.cpp | 20 +- src/server.h | 11 +- 12 files changed, 931 insertions(+), 345 deletions(-) create mode 100644 src/clientmedia.cpp create mode 100644 src/clientmedia.h diff --git a/minetest.conf.example b/minetest.conf.example index 3dbbd773e..59d8b32fb 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -191,9 +191,16 @@ # right clicks when holding the right mouse button #repeat_rightclick_time = 0.25 -# will only work for servers which use remote_media setting -# and only for clients compiled with cURL -#media_fetch_threads = 8 +# Default timeout for cURL, in milliseconds +# Only has an effect if compiled with cURL +#curl_timeout = 5000 +# Limits number of parallel HTTP requests. Affects: +# - Media fetch if server uses remote_media setting +# - Serverlist download and server announcement +# - Downloads performed by main menu (e.g. mod manager) +# - Downloads performed by mods (minetest.httpfetch) +# Only has an effect if compiled with cURL +#curl_parallel_limit = 8 # Url to the server list displayed in the Multiplayer Tab #serverlist_url = servers.minetest.net diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 104e56406..90f586785 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -360,6 +360,7 @@ set(minetest_SRCS guiDeathScreen.cpp guiChatConsole.cpp client.cpp + clientmedia.cpp filecache.cpp tile.cpp shader.cpp diff --git a/src/client.cpp b/src/client.cpp index 8b80e3ecf..ee63cf7c8 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client.h" #include +#include #include "clientserver.h" #include "jthread/jmutexautolock.h" #include "main.h" @@ -37,17 +38,17 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "itemdef.h" #include "shader.h" #include -#include "sha1.h" #include "base64.h" #include "clientmap.h" -#include "filecache.h" +#include "clientmedia.h" #include "sound.h" #include "util/string.h" -#include "hex.h" #include "IMeshCache.h" +#include "serialization.h" #include "util/serialize.h" #include "config.h" #include "util/directiontables.h" +#include "util/pointedthing.h" #include "version.h" #if USE_CURL @@ -222,46 +223,9 @@ void * MeshUpdateThread::Thread() return NULL; } -void * MediaFetchThread::Thread() -{ - ThreadStarted(); - - log_register_thread("MediaFetchThread"); - - DSTACK(__FUNCTION_NAME); - - BEGIN_DEBUG_EXCEPTION_HANDLER - - #if USE_CURL - CURL *curl; - CURLcode res; - for (std::list::iterator i = m_file_requests.begin(); - i != m_file_requests.end(); ++i) { - curl = curl_easy_init(); - assert(curl); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_URL, (m_remote_url + i->name).c_str()); - curl_easy_setopt(curl, CURLOPT_FAILONERROR, true); - std::ostringstream stream; - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_data); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &stream); - curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); - res = curl_easy_perform(curl); - if (res == CURLE_OK) { - std::string data = stream.str(); - m_file_data.push_back(make_pair(i->name, data)); - } else { - m_failed.push_back(*i); - infostream << "cURL request failed for " << i->name << " (" << curl_easy_strerror(res) << ")"<< std::endl; - } - curl_easy_cleanup(curl); - } - #endif - - END_DEBUG_EXCEPTION_HANDLER(errorstream) - - return NULL; -} +/* + Client +*/ Client::Client( IrrlichtDevice *device, @@ -303,12 +267,9 @@ Client::Client( m_map_seed(0), m_password(password), m_access_denied(false), - m_media_cache(getMediaCacheDir()), - m_media_receive_started(false), - m_media_count(0), - m_media_received_count(0), m_itemdef_received(false), m_nodedef_received(false), + m_media_downloader(new ClientMediaDownloader()), m_time_of_day_set(false), m_last_time_of_day_f(-1), m_time_of_day_update_timer(0), @@ -332,9 +293,6 @@ Client::Client( m_env.addPlayer(player); } - - for (size_t i = 0; i < g_settings->getU16("media_fetch_threads"); ++i) - m_media_fetch_threads.push_back(new MediaFetchThread(this)); } Client::~Client() @@ -364,10 +322,6 @@ Client::~Client() } } - for (std::list::iterator i = m_media_fetch_threads.begin(); - i != m_media_fetch_threads.end(); ++i) - delete *i; - // cleanup 3d model meshes on client shutdown while (m_device->getSceneManager()->getMeshCache()->getMeshCount() != 0) { scene::IAnimatedMesh * mesh = @@ -797,57 +751,11 @@ void Client::step(float dtime) /* Load fetched media */ - if (m_media_receive_started) { - bool all_stopped = true; - for (std::list::iterator thread = m_media_fetch_threads.begin(); - thread != m_media_fetch_threads.end(); ++thread) { - all_stopped &= !(*thread)->IsRunning(); - while (!(*thread)->m_file_data.empty()) { - std::pair out = (*thread)->m_file_data.pop_front(); - if(m_media_received_count < m_media_count) - m_media_received_count++; - - bool success = loadMedia(out.second, out.first); - if(success){ - verbosestream<<"Client: Loaded received media: " - <<"\""<::iterator n; - n = m_media_name_sha1_map.find(out.first); - if(n == m_media_name_sha1_map.end()) - errorstream<<"The server sent a file that has not " - <<"been announced."< fetch_failed; - for (std::list::iterator thread = m_media_fetch_threads.begin(); - thread != m_media_fetch_threads.end(); ++thread) { - for (std::list::iterator request = (*thread)->m_failed.begin(); - request != (*thread)->m_failed.end(); ++request) - fetch_failed.push_back(*request); - (*thread)->m_failed.clear(); - } - if (fetch_failed.size() > 0) { - infostream << "Failed to remote-fetch " << fetch_failed.size() << " files. " - << "Requesting them the usual way." << std::endl; - request_media(fetch_failed); - } + if (m_media_downloader && m_media_downloader->isStarted()) { + m_media_downloader->step(this); + if (m_media_downloader->isDone()) { + delete m_media_downloader; + m_media_downloader = NULL; } } @@ -1048,15 +956,15 @@ void Client::deletingPeer(con::Peer *peer, bool timeout) string name } */ -void Client::request_media(const std::list &file_requests) +void Client::request_media(const std::list &file_requests) { std::ostringstream os(std::ios_base::binary); writeU16(os, TOSERVER_REQUEST_MEDIA); writeU16(os, file_requests.size()); - for(std::list::const_iterator i = file_requests.begin(); + for(std::list::const_iterator i = file_requests.begin(); i != file_requests.end(); ++i) { - os<name); + os< &file_requests) < data((u8*)s.c_str(), s.size()); + // Send as reliable + Send(0, data, true); + infostream<<"Client: Notifying server that we received all media" + < file_requests; + if (m_media_downloader == NULL || + m_media_downloader->isStarted()) { + const char *problem = m_media_downloader ? + "we already saw another announcement" : + "all media has been received already"; + errorstream<<"Client: Received media announcement but " + <addFile(name, sha1_raw); } - std::string remote_media = ""; + std::vector remote_media; try { - remote_media = deSerializeString(is); + Strfnd sf(deSerializeString(is)); + while(!sf.atend()) { + std::string baseurl = trim(sf.next(",")); + if(baseurl != "") + m_media_downloader->addRemoteServer(baseurl); + } } catch(SerializationError) { // not supported by server or turned off } - m_media_count = file_requests.size(); - m_media_receive_started = true; - - if (remote_media == "" || !USE_CURL) { - request_media(file_requests); - } else { - #if USE_CURL - std::list::iterator cur = m_media_fetch_threads.begin(); - for(std::list::iterator i = file_requests.begin(); - i != file_requests.end(); ++i) { - (*cur)->m_file_requests.push_back(*i); - cur++; - if (cur == m_media_fetch_threads.end()) - cur = m_media_fetch_threads.begin(); - } - for (std::list::iterator i = m_media_fetch_threads.begin(); - i != m_media_fetch_threads.end(); ++i) { - (*i)->m_remote_url = remote_media; - (*i)->Start(); - } - #endif - - // notify server we received everything - std::ostringstream os(std::ios_base::binary); - writeU16(os, TOSERVER_RECEIVED_MEDIA); - std::string s = os.str(); - SharedBuffer data((u8*)s.c_str(), s.size()); - // Send as reliable - Send(0, data, true); + m_media_downloader->step(this); + if (m_media_downloader->isDone()) { + // might be done already if all media is in the cache + delete m_media_downloader; + m_media_downloader = NULL; } - ClientEvent event; - event.type = CE_TEXTURES_UPDATED; - m_client_event_queue.push_back(event); } else if(command == TOCLIENT_MEDIA) { @@ -1775,67 +1654,37 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) <::iterator n; - n = m_media_name_sha1_map.find(name); - if(n == m_media_name_sha1_map.end()) - errorstream<<"The server sent a file that has not " - <<"been announced."<conventionalTransferDone( + name, data, this); } - ClientEvent event; - event.type = CE_TEXTURES_UPDATED; - m_client_event_queue.push_back(event); + if (m_media_downloader->isDone()) { + delete m_media_downloader; + m_media_downloader = NULL; + } } else if(command == TOCLIENT_TOOLDEF) { @@ -2885,6 +2734,14 @@ ClientEvent Client::getClientEvent() return m_client_event_queue.pop_front(); } +float Client::mediaReceiveProgress() +{ + if (m_media_downloader) + return m_media_downloader->getProgress(); + else + return 1.0; // downloader only exists when not yet done +} + void draw_load_screen(const std::wstring &text, IrrlichtDevice* device, gui::IGUIFont* font, float dtime=0 ,int percent=0, bool clouds=true); @@ -2893,12 +2750,8 @@ void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font) infostream<<"Client::afterContentReceived() started"<rebuildImagesAndTextures(); diff --git a/src/client.h b/src/client.h index eb0f225a2..5969adc8e 100644 --- a/src/client.h +++ b/src/client.h @@ -31,32 +31,21 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "clientobject.h" #include "gamedef.h" #include "inventorymanager.h" -#include "filecache.h" #include "localplayer.h" -#include "server.h" +#include "hud.h" #include "particles.h" -#include "util/pointedthing.h" -#include struct MeshMakeData; class MapBlockMesh; -class IGameDef; class IWritableTextureSource; class IWritableShaderSource; class IWritableItemDefManager; class IWritableNodeDefManager; //class IWritableCraftDefManager; -class ClientEnvironment; +class ClientMediaDownloader; struct MapDrawControl; class MtEventManager; - -class ClientNotReadyException : public BaseException -{ -public: - ClientNotReadyException(const char *s): - BaseException(s) - {} -}; +struct PointedThing; struct QueuedMeshUpdate { @@ -132,31 +121,12 @@ public: IGameDef *m_gamedef; }; -class MediaFetchThread : public SimpleThread -{ -public: - - MediaFetchThread(IGameDef *gamedef): - m_gamedef(gamedef) - { - } - - void * Thread(); - - std::list m_file_requests; - MutexedQueue > m_file_data; - std::list m_failed; - std::string m_remote_url; - IGameDef *m_gamedef; -}; - enum ClientEventType { CE_NONE, CE_PLAYER_DAMAGE, CE_PLAYER_FORCE_MOVE, CE_DEATHSCREEN, - CE_TEXTURES_UPDATED, CE_SHOW_FORMSPEC, CE_SPAWN_PARTICLE, CE_ADD_PARTICLESPAWNER, @@ -426,19 +396,15 @@ public: std::wstring accessDeniedReason() { return m_access_denied_reason; } - float mediaReceiveProgress() - { - if (!m_media_receive_started) return 0; - return 1.0 * m_media_received_count / m_media_count; - } - - bool texturesReceived() - { return m_media_receive_started && m_media_received_count == m_media_count; } bool itemdefReceived() { return m_itemdef_received; } bool nodedefReceived() { return m_nodedef_received; } - + bool mediaReceived() + { return m_media_downloader == NULL; } + + float mediaReceiveProgress(); + void afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font); float getRTT(void); @@ -455,12 +421,15 @@ public: virtual bool checkLocalPrivilege(const std::string &priv) { return checkPrivilege(priv); } -private: - + // The following set of functions is used by ClientMediaDownloader // Insert a media file appropriately into the appropriate manager bool loadMedia(const std::string &data, const std::string &filename); + // Send a request for conventional media transfer + void request_media(const std::list &file_requests); + // Send a notification that no conventional media transfer is needed + void received_media(); - void request_media(const std::list &file_requests); +private: // Virtual methods from con::PeerHandler void peerAdded(con::Peer *peer); @@ -488,7 +457,6 @@ private: MtEventManager *m_event; MeshUpdateThread m_mesh_update_thread; - std::list m_media_fetch_threads; ClientEnvironment m_env; con::Connection m_con; IrrlichtDevice *m_device; @@ -514,14 +482,9 @@ private: bool m_access_denied; std::wstring m_access_denied_reason; Queue m_client_event_queue; - FileCache m_media_cache; - // Mapping from media file name to SHA1 checksum - std::map m_media_name_sha1_map; - bool m_media_receive_started; - u32 m_media_count; - u32 m_media_received_count; bool m_itemdef_received; bool m_nodedef_received; + ClientMediaDownloader *m_media_downloader; // time_of_day speed approximation for old protocol bool m_time_of_day_set; diff --git a/src/clientmedia.cpp b/src/clientmedia.cpp new file mode 100644 index 000000000..8260d5f5a --- /dev/null +++ b/src/clientmedia.cpp @@ -0,0 +1,656 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "clientmedia.h" +#include "httpfetch.h" +#include "client.h" +#include "clientserver.h" +#include "filecache.h" +#include "hex.h" +#include "sha1.h" +#include "debug.h" +#include "log.h" +#include "porting.h" +#include "settings.h" +#include "main.h" +#include "util/serialize.h" +#include "util/string.h" + +static std::string getMediaCacheDir() +{ + return porting::path_user + DIR_DELIM + "cache" + DIR_DELIM + "media"; +} + +/* + ClientMediaDownloader +*/ + +ClientMediaDownloader::ClientMediaDownloader(): + m_media_cache(getMediaCacheDir()) +{ + m_initial_step_done = false; + m_name_bound = ""; // works because "" is an invalid file name + m_uncached_count = 0; + m_uncached_received_count = 0; + m_httpfetch_caller = HTTPFETCH_DISCARD; + m_httpfetch_active = 0; + m_httpfetch_active_limit = 0; + m_httpfetch_next_id = 0; + m_httpfetch_timeout = 0; + m_outstanding_hash_sets = 0; +} + +ClientMediaDownloader::~ClientMediaDownloader() +{ + if (m_httpfetch_caller != HTTPFETCH_DISCARD) + httpfetch_caller_free(m_httpfetch_caller); + + for (std::map::iterator it = m_files.begin(); + it != m_files.end(); ++it) + delete it->second; + + for (u32 i = 0; i < m_remotes.size(); ++i) + delete m_remotes[i]; +} + +void ClientMediaDownloader::addFile(std::string name, std::string sha1) +{ + assert(!m_initial_step_done); + + // if name was already announced, ignore the new announcement + if (m_files.count(name) != 0) { + errorstream << "Client: ignoring duplicate media announcement " + << "sent by server: \"" << name << "\"" + << std::endl; + return; + } + + // if name is empty or contains illegal characters, ignore the file + if (name.empty() || !string_allowed(name, TEXTURENAME_ALLOWED_CHARS)) { + errorstream << "Client: ignoring illegal file name " + << "sent by server: \"" << name << "\"" + << std::endl; + return; + } + + // length of sha1 must be exactly 20 (160 bits), else ignore the file + if (sha1.size() != 20) { + errorstream << "Client: ignoring illegal SHA1 sent by server: " + << hex_encode(sha1) << " \"" << name << "\"" + << std::endl; + return; + } + + FileStatus *filestatus = new FileStatus; + filestatus->received = false; + filestatus->sha1 = sha1; + filestatus->current_remote = -1; + m_files.insert(std::make_pair(name, filestatus)); +} + +void ClientMediaDownloader::addRemoteServer(std::string baseurl) +{ + assert(!m_initial_step_done); + + #ifdef USE_CURL + + infostream << "Client: Adding remote server \"" + << baseurl << "\" for media download" << std::endl; + + RemoteServerStatus *remote = new RemoteServerStatus; + remote->baseurl = baseurl; + remote->active_count = 0; + remote->request_by_filename = false; + m_remotes.push_back(remote); + + #else + + infostream << "Client: Ignoring remote server \"" + << baseurl << "\" because cURL support is not compiled in" + << std::endl; + + #endif +} + +void ClientMediaDownloader::step(Client *client) +{ + if (!m_initial_step_done) { + initialStep(client); + m_initial_step_done = true; + } + + // Remote media: check for completion of fetches + if (m_httpfetch_active) { + bool fetched_something = false; + HTTPFetchResult fetchresult; + + while (httpfetch_async_get(m_httpfetch_caller, fetchresult)) { + m_httpfetch_active--; + fetched_something = true; + + // Is this a hashset (index.mth) or a media file? + if (fetchresult.request_id < m_remotes.size()) + remoteHashSetReceived(fetchresult); + else + remoteMediaReceived(fetchresult, client); + } + + if (fetched_something) + startRemoteMediaTransfers(); + + // Did all remote transfers end and no new ones can be started? + // If so, request still missing files from the minetest server + // (Or report that we have all files.) + if (m_httpfetch_active == 0) { + if (m_uncached_received_count < m_uncached_count) { + infostream << "Client: Failed to remote-fetch " + << (m_uncached_count-m_uncached_received_count) + << " files. Requesting them" + << " the usual way." << std::endl; + } + startConventionalTransfers(client); + } + } +} + +void ClientMediaDownloader::initialStep(Client *client) +{ + // Check media cache + m_uncached_count = m_files.size(); + for (std::map::iterator + it = m_files.begin(); + it != m_files.end(); ++it) { + std::string name = it->first; + FileStatus *filestatus = it->second; + const std::string &sha1 = filestatus->sha1; + + std::ostringstream tmp_os(std::ios_base::binary); + bool found_in_cache = m_media_cache.load(hex_encode(sha1), tmp_os); + + // If found in cache, try to load it from there + if (found_in_cache) { + bool success = checkAndLoad(name, sha1, + tmp_os.str(), true, client); + if (success) { + filestatus->received = true; + m_uncached_count--; + } + } + } + + assert(m_uncached_received_count == 0); + + // Create the media cache dir if we are likely to write to it + if (m_uncached_count != 0) { + bool did = fs::CreateAllDirs(getMediaCacheDir()); + if (!did) { + errorstream << "Client: " + << "Could not create media cache directory: " + << getMediaCacheDir() + << std::endl; + } + } + + // If we found all files in the cache, report this fact to the server. + // If the server reported no remote servers, immediately start + // conventional transfers. Note: if cURL support is not compiled in, + // m_remotes is always empty, so "!USE_CURL" is redundant but may + // reduce the size of the compiled code + if (!USE_CURL || m_uncached_count == 0 || m_remotes.empty()) { + startConventionalTransfers(client); + } + else { + // Otherwise start off by requesting each server's sha1 set + + // This is the first time we use httpfetch, so alloc a caller ID + m_httpfetch_caller = httpfetch_caller_alloc(); + m_httpfetch_timeout = g_settings->getS32("curl_timeout"); + + // Set the active fetch limit to curl_parallel_limit or 84, + // whichever is greater. This gives us some leeway so that + // inefficiencies in communicating with the httpfetch thread + // don't slow down fetches too much. (We still want some limit + // so that when the first remote server returns its hash set, + // not all files are requested from that server immediately.) + // One such inefficiency is that ClientMediaDownloader::step() + // is only called a couple times per second, while httpfetch + // might return responses much faster than that. + // Note that httpfetch strictly enforces curl_parallel_limit + // but at no inter-thread communication cost. This however + // doesn't help with the aforementioned inefficiencies. + // The signifance of 84 is that it is 2*6*9 in base 13. + m_httpfetch_active_limit = g_settings->getS32("curl_parallel_limit"); + m_httpfetch_active_limit = MYMAX(m_httpfetch_active_limit, 84); + + // Write a list of hashes that we need. This will be POSTed + // to the server using Content-Type: application/octet-stream + std::string required_hash_set = serializeRequiredHashSet(); + + // minor fixme: this loop ignores m_httpfetch_active_limit + + // another minor fixme, unlikely to matter in normal usage: + // these index.mth fetches do (however) count against + // m_httpfetch_active_limit when starting actual media file + // requests, so if there are lots of remote servers that are + // not responding, those will stall new media file transfers. + + for (u32 i = 0; i < m_remotes.size(); ++i) { + assert(m_httpfetch_next_id == i); + + RemoteServerStatus *remote = m_remotes[i]; + actionstream << "Client: Contacting remote server \"" + << remote->baseurl << "\"" << std::endl; + + HTTPFetchRequest fetchrequest; + fetchrequest.url = + remote->baseurl + MTHASHSET_FILE_NAME; + fetchrequest.caller = m_httpfetch_caller; + fetchrequest.request_id = m_httpfetch_next_id; // == i + fetchrequest.timeout = m_httpfetch_timeout; + fetchrequest.connect_timeout = m_httpfetch_timeout; + fetchrequest.post_fields = required_hash_set; + fetchrequest.extra_headers.push_back( + "Content-Type: application/octet-stream"); + httpfetch_async(fetchrequest); + + m_httpfetch_active++; + m_httpfetch_next_id++; + m_outstanding_hash_sets++; + } + } +} + +void ClientMediaDownloader::remoteHashSetReceived( + const HTTPFetchResult &fetchresult) +{ + u32 remote_id = fetchresult.request_id; + assert(remote_id < m_remotes.size()); + RemoteServerStatus *remote = m_remotes[remote_id]; + + m_outstanding_hash_sets--; + + if (fetchresult.succeeded) { + try { + // Server sent a list of file hashes that are + // available on it, try to parse the list + + std::set sha1_set; + deSerializeHashSet(fetchresult.data, sha1_set); + + // Parsing succeeded: For every file that is + // available on this server, add this server + // to the available_remotes array + + for(std::map::iterator + it = m_files.upper_bound(m_name_bound); + it != m_files.end(); ++it) { + FileStatus *f = it->second; + if (!f->received && sha1_set.count(f->sha1)) + f->available_remotes.push_back(remote_id); + } + } + catch (SerializationError &e) { + infostream << "Client: Remote server \"" + << remote->baseurl << "\" sent invalid hash set: " + << e.what() << std::endl; + } + } + + // For compatibility: If index.mth is not found, assume that the + // server contains files named like the original files (not their sha1) + + if (!fetchresult.succeeded && !fetchresult.timeout && + fetchresult.response_code == 404) { + infostream << "Client: Enabling compatibility mode for remote " + << "server \"" << remote->baseurl << "\"" << std::endl; + remote->request_by_filename = true; + + // Assume every file is available on this server + + for(std::map::iterator + it = m_files.upper_bound(m_name_bound); + it != m_files.end(); ++it) { + FileStatus *f = it->second; + if (!f->received) + f->available_remotes.push_back(remote_id); + } + } +} + +void ClientMediaDownloader::remoteMediaReceived( + const HTTPFetchResult &fetchresult, + Client *client) +{ + // Some remote server sent us a file. + // -> decrement number of active fetches + // -> mark file as received if fetch succeeded + // -> try to load media + + std::string name; + { + std::map::iterator it = + m_remote_file_transfers.find(fetchresult.request_id); + assert(it != m_remote_file_transfers.end()); + name = it->second; + m_remote_file_transfers.erase(it); + } + + assert(m_files.count(name) != 0); + + FileStatus *filestatus = m_files[name]; + assert(!filestatus->received); + assert(filestatus->current_remote >= 0); + + RemoteServerStatus *remote = m_remotes[filestatus->current_remote]; + + filestatus->current_remote = -1; + remote->active_count--; + + // If fetch succeeded, try to load media file + + if (fetchresult.succeeded) { + bool success = checkAndLoad(name, filestatus->sha1, + fetchresult.data, false, client); + if (success) { + filestatus->received = true; + assert(m_uncached_received_count < m_uncached_count); + m_uncached_received_count++; + } + } +} + +s32 ClientMediaDownloader::selectRemoteServer(FileStatus *filestatus) +{ + assert(filestatus != NULL); + assert(!filestatus->received); + assert(filestatus->current_remote < 0); + + if (filestatus->available_remotes.empty()) + return -1; + else { + // Of all servers that claim to provide the file (and haven't + // been unsuccessfully tried before), find the one with the + // smallest number of currently active transfers + + s32 best = 0; + s32 best_remote_id = filestatus->available_remotes[best]; + s32 best_active_count = m_remotes[best_remote_id]->active_count; + + for (u32 i = 1; i < filestatus->available_remotes.size(); ++i) { + s32 remote_id = filestatus->available_remotes[i]; + s32 active_count = m_remotes[remote_id]->active_count; + if (active_count < best_active_count) { + best = i; + best_remote_id = remote_id; + best_active_count = active_count; + } + } + + filestatus->available_remotes.erase( + filestatus->available_remotes.begin() + best); + + return best_remote_id; + } +} + +void ClientMediaDownloader::startRemoteMediaTransfers() +{ + bool changing_name_bound = true; + + for (std::map::iterator + files_iter = m_files.upper_bound(m_name_bound); + files_iter != m_files.end(); ++files_iter) { + + // Abort if active fetch limit is exceeded + if (m_httpfetch_active >= m_httpfetch_active_limit) + break; + + const std::string &name = files_iter->first; + FileStatus *filestatus = files_iter->second; + + if (!filestatus->received && filestatus->current_remote < 0) { + // File has not been received yet and is not currently + // being transferred. Choose a server for it. + s32 remote_id = selectRemoteServer(filestatus); + if (remote_id >= 0) { + // Found a server, so start fetching + RemoteServerStatus *remote = + m_remotes[remote_id]; + + std::string url = remote->baseurl + + (remote->request_by_filename ? name : + hex_encode(filestatus->sha1)); + verbosestream << "Client: " + << "Requesting remote media file " + << "\"" << name << "\" " + << "\"" << url << "\"" << std::endl; + + HTTPFetchRequest fetchrequest; + fetchrequest.url = url; + fetchrequest.caller = m_httpfetch_caller; + fetchrequest.request_id = m_httpfetch_next_id; + fetchrequest.timeout = 0; // no data timeout! + fetchrequest.connect_timeout = + m_httpfetch_timeout; + httpfetch_async(fetchrequest); + + m_remote_file_transfers.insert(std::make_pair( + m_httpfetch_next_id, + name)); + + filestatus->current_remote = remote_id; + remote->active_count++; + m_httpfetch_active++; + m_httpfetch_next_id++; + } + } + + if (filestatus->received || + (filestatus->current_remote < 0 && + !m_outstanding_hash_sets)) { + // If we arrive here, we conclusively know that we + // won't fetch this file from a remote server in the + // future. So update the name bound if possible. + if (changing_name_bound) + m_name_bound = name; + } + else + changing_name_bound = false; + } + +} + +void ClientMediaDownloader::startConventionalTransfers(Client *client) +{ + assert(m_httpfetch_active == 0); + + if (m_uncached_received_count == m_uncached_count) { + // In this case all media was found in the cache or + // has been downloaded from some remote server; + // report this fact to the server + client->received_media(); + } + else { + // Some media files have not been received yet, use the + // conventional slow method (minetest protocol) to get them + std::list file_requests; + for (std::map::iterator + it = m_files.begin(); + it != m_files.end(); ++it) { + if (!it->second->received) + file_requests.push_back(it->first); + } + assert((s32) file_requests.size() == + m_uncached_count - m_uncached_received_count); + client->request_media(file_requests); + } +} + +void ClientMediaDownloader::conventionalTransferDone( + const std::string &name, + const std::string &data, + Client *client) +{ + // Check that file was announced + std::map::iterator + file_iter = m_files.find(name); + if (file_iter == m_files.end()) { + errorstream << "Client: server sent media file that was" + << "not announced, ignoring it: \"" << name << "\"" + << std::endl; + return; + } + FileStatus *filestatus = file_iter->second; + assert(filestatus != NULL); + + // Check that file hasn't already been received + if (filestatus->received) { + errorstream << "Client: server sent media file that we already" + << "received, ignoring it: \"" << name << "\"" + << std::endl; + return; + } + + // Mark file as received, regardless of whether loading it works and + // whether the checksum matches (because at this point there is no + // other server that could send a replacement) + filestatus->received = true; + assert(m_uncached_received_count < m_uncached_count); + m_uncached_received_count++; + + // Check that received file matches announced checksum + // If so, load it + checkAndLoad(name, filestatus->sha1, data, false, client); +} + +bool ClientMediaDownloader::checkAndLoad( + const std::string &name, const std::string &sha1, + const std::string &data, bool is_from_cache, Client *client) +{ + const char *cached_or_received = is_from_cache ? "cached" : "received"; + const char *cached_or_received_uc = is_from_cache ? "Cached" : "Received"; + std::string sha1_hex = hex_encode(sha1); + + // Compute actual checksum of data + std::string data_sha1; + { + SHA1 data_sha1_calculator; + data_sha1_calculator.addBytes(data.c_str(), data.size()); + unsigned char *data_tmpdigest = data_sha1_calculator.getDigest(); + data_sha1.assign((char*) data_tmpdigest, 20); + free(data_tmpdigest); + } + + // Check that received file matches announced checksum + if (data_sha1 != sha1) { + std::string data_sha1_hex = hex_encode(data_sha1); + infostream << "Client: " + << cached_or_received_uc << " media file " + << sha1_hex << " \"" << name << "\" " + << "mismatches actual checksum " << data_sha1_hex + << std::endl; + return false; + } + + // Checksum is ok, try loading the file + bool success = client->loadMedia(data, name); + if (!success) { + infostream << "Client: " + << "Failed to load " << cached_or_received << " media: " + << sha1_hex << " \"" << name << "\"" + << std::endl; + return false; + } + + verbosestream << "Client: " + << "Loaded " << cached_or_received << " media: " + << sha1_hex << " \"" << name << "\"" + << std::endl; + + // Update cache (unless we just loaded the file from the cache) + if (!is_from_cache) + m_media_cache.update(sha1_hex, data); + + return true; +} + + +/* + Minetest Hashset File Format + + All values are stored in big-endian byte order. + [u32] signature: 'MTHS' + [u16] version: 1 + For each hash in set: + [u8*20] SHA1 hash + + Version changes: + 1 - Initial version +*/ + +std::string ClientMediaDownloader::serializeRequiredHashSet() +{ + std::ostringstream os(std::ios::binary); + + writeU32(os, MTHASHSET_FILE_SIGNATURE); // signature + writeU16(os, 1); // version + + // Write list of hashes of files that have not been + // received (found in cache) yet + for (std::map::iterator + it = m_files.begin(); + it != m_files.end(); ++it) { + if (!it->second->received) { + assert(it->second->sha1.size() == 20); + os << it->second->sha1; + } + } + + return os.str(); +} + +void ClientMediaDownloader::deSerializeHashSet(const std::string &data, + std::set &result) +{ + if (data.size() < 6 || data.size() % 20 != 6) { + throw SerializationError( + "ClientMediaDownloader::deSerializeHashSet: " + "invalid hash set file size"); + } + + const u8 *data_cstr = (const u8*) data.c_str(); + + u32 signature = readU32(&data_cstr[0]); + if (signature != MTHASHSET_FILE_SIGNATURE) { + throw SerializationError( + "ClientMediaDownloader::deSerializeHashSet: " + "invalid hash set file signature"); + } + + u16 version = readU16(&data_cstr[4]); + if (version != 1) { + throw SerializationError( + "ClientMediaDownloader::deSerializeHashSet: " + "unsupported hash set file version"); + } + + for (u32 pos = 6; pos < data.size(); pos += 20) { + result.insert(data.substr(pos, 20)); + } +} diff --git a/src/clientmedia.h b/src/clientmedia.h new file mode 100644 index 000000000..540044239 --- /dev/null +++ b/src/clientmedia.h @@ -0,0 +1,150 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef CLIENTMEDIA_HEADER +#define CLIENTMEDIA_HEADER + +#include "irrlichttypes.h" +#include "filecache.h" +#include +#include +#include +#include + +class Client; +struct HTTPFetchResult; + +#define MTHASHSET_FILE_SIGNATURE 0x4d544853 // 'MTHS' +#define MTHASHSET_FILE_NAME "index.mth" + +class ClientMediaDownloader +{ +public: + ClientMediaDownloader(); + ~ClientMediaDownloader(); + + float getProgress() const { + if (m_uncached_count >= 1) + return 1.0 * m_uncached_received_count / + m_uncached_count; + else + return 0.0; + } + + bool isStarted() const { + return m_initial_step_done; + } + + // If this returns true, the downloader is done and can be deleted + bool isDone() const { + return m_initial_step_done && + m_uncached_received_count == m_uncached_count; + } + + // Add a file to the list of required file (but don't fetch it yet) + void addFile(std::string name, std::string sha1); + + // Add a remote server to the list; ignored if not built with cURL + void addRemoteServer(std::string baseurl); + + // Steps the media downloader: + // - May load media into client by calling client->loadMedia() + // - May check media cache for files + // - May add files to media cache + // - May start remote transfers by calling httpfetch_async + // - May check for completion of current remote transfers + // - May start conventional transfers by calling client->request_media() + // - May inform server that all media has been loaded + // by calling client->received_media() + // After step has been called once, don't call addFile/addRemoteServer. + void step(Client *client); + + // Must be called for each file received through TOCLIENT_MEDIA + void conventionalTransferDone( + const std::string &name, + const std::string &data, + Client *client); + +private: + struct FileStatus { + bool received; + std::string sha1; + s32 current_remote; + std::vector available_remotes; + }; + + struct RemoteServerStatus { + std::string baseurl; + s32 active_count; + bool request_by_filename; + }; + + void initialStep(Client *client); + void remoteHashSetReceived(const HTTPFetchResult &fetchresult); + void remoteMediaReceived(const HTTPFetchResult &fetchresult, + Client *client); + s32 selectRemoteServer(FileStatus *filestatus); + void startRemoteMediaTransfers(); + void startConventionalTransfers(Client *client); + + bool checkAndLoad(const std::string &name, const std::string &sha1, + const std::string &data, bool is_from_cache, + Client *client); + + std::string serializeRequiredHashSet(); + static void deSerializeHashSet(const std::string &data, + std::set &result); + + // Maps filename to file status + std::map m_files; + + // Array of remote media servers + std::vector m_remotes; + + // Filesystem-based media cache + FileCache m_media_cache; + + // Has an attempt been made to load media files from the file cache? + // Have hash sets been requested from remote servers? + bool m_initial_step_done; + + // Total number of media files to load + s32 m_uncached_count; + + // Number of media files that have been received + s32 m_uncached_received_count; + + // Status of remote transfers + unsigned long m_httpfetch_caller; + unsigned long m_httpfetch_next_id; + long m_httpfetch_timeout; + s32 m_httpfetch_active; + s32 m_httpfetch_active_limit; + s32 m_outstanding_hash_sets; + std::map m_remote_file_transfers; + + // All files up to this name have either been received from a + // remote server or failed on all remote servers, so those files + // don't need to be looked at again + // (use m_files.upper_bound(m_name_bound) to get an iterator) + std::string m_name_bound; + +}; + +#endif // !CLIENTMEDIA_HEADER diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 662717c8a..a217fda40 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -139,7 +139,7 @@ void set_default_settings(Settings *settings) settings->setDefault("repeat_rightclick_time", "0.25"); settings->setDefault("enable_particles", "true"); - settings->setDefault("media_fetch_threads", "8"); + settings->setDefault("curl_timeout", "5000"); settings->setDefault("curl_parallel_limit", "8"); settings->setDefault("serverlist_url", "servers.minetest.net"); @@ -284,7 +284,6 @@ void set_default_settings(Settings *settings) settings->setDefault("mgmath_generator", "mandelbox"); - settings->setDefault("curl_timeout", "5000"); // IPv6 settings->setDefault("enable_ipv6", "true"); diff --git a/src/filecache.cpp b/src/filecache.cpp index c4de6cf82..33677cc83 100644 --- a/src/filecache.cpp +++ b/src/filecache.cpp @@ -23,12 +23,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "clientserver.h" #include "log.h" #include "filesys.h" -#include "hex.h" -#include "sha1.h" #include #include #include -#include #include bool FileCache::loadByPath(const std::string &path, std::ostream &os) @@ -85,36 +82,8 @@ bool FileCache::update(const std::string &name, const std::string &data) std::string path = m_dir + DIR_DELIM + name; return updateByPath(path, data); } -bool FileCache::update_sha1(const std::string &data) -{ - SHA1 sha1; - sha1.addBytes(data.c_str(), data.size()); - unsigned char *digest = sha1.getDigest(); - std::string sha1_raw((char*)digest, 20); - free(digest); - std::string sha1_hex = hex_encode(sha1_raw); - return update(sha1_hex, data); -} bool FileCache::load(const std::string &name, std::ostream &os) { std::string path = m_dir + DIR_DELIM + name; return loadByPath(path, os); } -bool FileCache::load_sha1(const std::string &sha1_raw, std::ostream &os) -{ - std::ostringstream tmp_os(std::ios_base::binary); - if(!load(hex_encode(sha1_raw), tmp_os)) - return false; - SHA1 sha1; - sha1.addBytes(tmp_os.str().c_str(), tmp_os.str().length()); - unsigned char *digest = sha1.getDigest(); - std::string sha1_real_raw((char*)digest, 20); - free(digest); - if(sha1_real_raw != sha1_raw){ - verbosestream<<"FileCache["< #include #include "util/directiontables.h" +#include "util/pointedthing.h" /* Text input system @@ -1207,7 +1208,7 @@ void the_game( server->step(dtime); // End condition - if(client.texturesReceived() && + if(client.mediaReceived() && client.itemdefReceived() && client.nodedefReceived()){ got_content = true; @@ -1422,7 +1423,7 @@ void the_game( bool invert_mouse = g_settings->getBool("invert_mouse"); bool respawn_menu_active = false; - bool update_wielded_item_trigger = false; + bool update_wielded_item_trigger = true; bool show_hud = true; bool show_chat = true; @@ -2290,10 +2291,6 @@ void the_game( delete(event.show_formspec.formspec); delete(event.show_formspec.formname); } - else if(event.type == CE_TEXTURES_UPDATED) - { - update_wielded_item_trigger = true; - } else if(event.type == CE_SPAWN_PARTICLE) { LocalPlayer* player = client.getEnv().getLocalPlayer(); diff --git a/src/server.cpp b/src/server.cpp index 2c38c66d3..9d51b794b 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2745,7 +2745,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) std::string datastring((char*)&data[2], datasize-2); std::istringstream is(datastring, std::ios_base::binary); - std::list tosend; + std::list tosend; u16 numfiles = readU16(is); infostream<<"Sending "< &tosend) + const std::list &tosend) { DSTACK(__FUNCTION_NAME); @@ -4470,17 +4470,19 @@ void Server::sendRequestedMedia(u16 peer_id, u32 file_size_bunch_total = 0; - for(std::list::const_iterator i = tosend.begin(); + for(std::list::const_iterator i = tosend.begin(); i != tosend.end(); ++i) { - if(m_media.find(i->name) == m_media.end()){ + const std::string &name = *i; + + if(m_media.find(name) == m_media.end()){ errorstream<<"Server::sendRequestedMedia(): Client asked for " - <<"unknown file \""<<(i->name)<<"\""<= bytes_per_bunch){ diff --git a/src/server.h b/src/server.h index 87a603533..e71a811ea 100644 --- a/src/server.h +++ b/src/server.h @@ -153,15 +153,6 @@ struct PrioritySortedBlockTransfer u16 peer_id; }; -struct MediaRequest -{ - std::string name; - - MediaRequest(const std::string &name_=""): - name(name_) - {} -}; - struct MediaInfo { std::string path; @@ -569,7 +560,7 @@ private: void fillMediaCache(); void sendMediaAnnouncement(u16 peer_id); void sendRequestedMedia(u16 peer_id, - const std::list &tosend); + const std::list &tosend); void sendDetachedInventory(const std::string &name, u16 peer_id); void sendDetachedInventoryToAll(const std::string &name); From 0a903e69fbd9b19d8d8da0593f31dec5807af566 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Thu, 29 Aug 2013 05:56:48 +0200 Subject: [PATCH 179/198] Implement urlencode and urldecode --- src/hex.h | 13 +++++++++++++ src/test.cpp | 4 ++++ src/util/string.cpp | 43 ++++++++++++++++++++++++++++++++++++++----- src/util/string.h | 3 ++- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/hex.h b/src/hex.h index 87a6aecb4..6f00a79bf 100644 --- a/src/hex.h +++ b/src/hex.h @@ -46,4 +46,17 @@ static inline std::string hex_encode(const std::string &data) return hex_encode(data.c_str(), data.size()); } +static inline bool hex_digit_decode(char hexdigit, unsigned char &value) +{ + if(hexdigit >= '0' && hexdigit <= '9') + value = hexdigit - '0'; + else if(hexdigit >= 'A' && hexdigit <= 'F') + value = hexdigit - 'A' + 10; + else if(hexdigit >= 'a' && hexdigit <= 'f') + value = hexdigit - 'a' + 10; + else + return false; + return true; +} + #endif diff --git a/src/test.cpp b/src/test.cpp index 5e025f2f5..c969c0951 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -171,6 +171,10 @@ struct TestUtilities: public TestBase UASSERT(removeStringEnd("bc", ends) == "b"); UASSERT(removeStringEnd("12c", ends) == "12"); UASSERT(removeStringEnd("foo", ends) == ""); + UASSERT(urlencode("\"Aardvarks lurk, OK?\"") + == "%22Aardvarks%20lurk%2C%20OK%3F%22"); + UASSERT(urldecode("%22Aardvarks%20lurk%2C%20OK%3F%22") + == "\"Aardvarks lurk, OK?\""); } }; diff --git a/src/util/string.cpp b/src/util/string.cpp index 39a14598b..925d0ea35 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -21,8 +21,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "pointer.h" #include "numeric.h" +#include +#include + #include "../sha1.h" #include "../base64.h" +#include "../hex.h" #include "../porting.h" std::wstring narrow_to_wide(const std::string& mbs) @@ -68,11 +72,40 @@ std::string translatePassword(std::string playername, std::wstring password) return pwd; } -size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata) { - std::ostringstream *stream = (std::ostringstream*)userdata; - size_t count = size * nmemb; - stream->write(ptr, count); - return count; +std::string urlencode(std::string str) +{ + // Encodes non-unreserved URI characters by a percent sign + // followed by two hex digits. See RFC 3986, section 2.3. + static const char url_hex_chars[] = "0123456789ABCDEF"; + std::ostringstream oss(std::ios::binary); + for (u32 i = 0; i < str.size(); i++) { + unsigned char c = str[i]; + if (isalnum(c) || c == '-' || c == '.' || c == '_' || c == '~') + oss << c; + else + oss << "%" + << url_hex_chars[(c & 0xf0) >> 4] + << url_hex_chars[c & 0x0f]; + } + return oss.str(); +} + +std::string urldecode(std::string str) +{ + // Inverse of urlencode + std::ostringstream oss(std::ios::binary); + for (u32 i = 0; i < str.size(); i++) { + unsigned char highvalue, lowvalue; + if (str[i] == '%' && + hex_digit_decode(str[i+1], highvalue) && + hex_digit_decode(str[i+2], lowvalue)) { + oss << (char) ((highvalue << 4) | lowvalue); + i += 2; + } + else + oss << str[i]; + } + return oss.str(); } u32 readFlagString(std::string str, FlagDesc *flagdesc) { diff --git a/src/util/string.h b/src/util/string.h index 81855962f..e5a60bc47 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -317,7 +317,8 @@ inline std::string unescape_string(std::string &s) } std::string translatePassword(std::string playername, std::wstring password); -size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata); +std::string urlencode(std::string str); +std::string urldecode(std::string str); u32 readFlagString(std::string str, FlagDesc *flagdesc); std::string writeFlagString(u32 flags, FlagDesc *flagdesc); char *mystrtok_r(char *s, const char *sep, char **lasts); From b03135548bbd9bcb73d14b067b96ec913404dd5f Mon Sep 17 00:00:00 2001 From: Kahrl Date: Thu, 29 Aug 2013 05:58:13 +0200 Subject: [PATCH 180/198] Use httpfetch_async in serverlist announce code --- src/httpfetch.cpp | 4 ++++ src/httpfetch.h | 3 +++ src/serverlist.cpp | 36 ++++++++++-------------------------- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 4342a8b2a..25474c725 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -206,6 +206,10 @@ struct HTTPFetchOngoing request.timeout); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, request.connect_timeout); + + if (request.useragent != "") + curl_easy_setopt(curl, CURLOPT_USERAGENT, request.useragent.c_str()); + // Set up a write callback that writes to the // ostringstream ongoing->oss, unless the data // is to be discarded diff --git a/src/httpfetch.h b/src/httpfetch.h index 56a198baf..6eb01fe79 100644 --- a/src/httpfetch.h +++ b/src/httpfetch.h @@ -54,6 +54,9 @@ struct HTTPFetchRequest // If not empty, should contain entries such as "Accept: text/html" std::vector extra_headers; + //useragent to use + std::string useragent; + HTTPFetchRequest() { url = ""; diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 7376bce99..204427f88 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -30,9 +30,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "json/json.h" #include "convert_json.h" -#if USE_CURL -#include -#endif +#include "httpfetch.h" +#include "util/string.h" namespace ServerList { @@ -189,11 +188,6 @@ std::string serializeJson(std::vector serverlist) #if USE_CURL -static size_t ServerAnnounceCallback(void *contents, size_t size, size_t nmemb, void *userp) -{ - //((std::string*)userp)->append((char*)contents, size * nmemb); - return size * nmemb; -} void sendAnnounce(std::string action, const std::vector & clients_names, double uptime, u32 game_time, std::string gameid, std::vector mods) { Json::Value server; if (action.size()) @@ -235,24 +229,14 @@ void sendAnnounce(std::string action, const std::vector & clients_n } Json::StyledWriter writer; - CURL *curl; - curl = curl_easy_init(); - if (curl) - { - CURLcode res; - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_URL, (g_settings->get("serverlist_url")+std::string("/announce?json=")+curl_easy_escape(curl, writer.write( server ).c_str(), 0)).c_str()); - curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ServerList::ServerAnnounceCallback); - //curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1); - curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1); - res = curl_easy_perform(curl); - if (res != CURLE_OK) - errorstream<<"Serverlist at url "<get("serverlist_url")<<" error ("<get("serverlist_url") + + std::string("/announce?json=") + + urlencode(writer.write(server)); + fetchrequest.useragent = std::string("Minetest ")+minetest_version_hash; + fetchrequest.caller = HTTPFETCH_DISCARD; + fetchrequest.timeout = g_settings->getS32("curl_timeout"); + httpfetch_async(fetchrequest); } #endif From 0d990bd189881a9a6c829e1c9ec17b2dc5ac12c8 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 9 Nov 2013 22:49:27 +0100 Subject: [PATCH 181/198] Replace any direct curl usage by httpfetch --- minetest.conf.example | 1 - src/convert_json.cpp | 54 +++++++++++++---------------------------- src/guiEngine.cpp | 53 ++++++++++++++++------------------------ src/guiFormSpecMenu.cpp | 14 +---------- src/httpfetch.cpp | 1 + src/httpfetch.h | 2 ++ 6 files changed, 42 insertions(+), 83 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index 59d8b32fb..f7dac6b7b 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -198,7 +198,6 @@ # - Media fetch if server uses remote_media setting # - Serverlist download and server announcement # - Downloads performed by main menu (e.g. mod manager) -# - Downloads performed by mods (minetest.httpfetch) # Only has an effect if compiled with cURL #curl_parallel_limit = 8 diff --git a/src/convert_json.cpp b/src/convert_json.cpp index 0b69f43a3..dbf0a82ac 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -28,58 +28,38 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "main.h" // for g_settings #include "settings.h" #include "version.h" - -#if USE_CURL -#include - -static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) -{ - ((std::string*)userp)->append((char*)contents, size * nmemb); - return size * nmemb; -} - -#endif +#include "httpfetch.h" Json::Value fetchJsonValue(const std::string url, struct curl_slist *chunk) { #if USE_CURL - std::string liststring; - CURL *curl; - curl = curl_easy_init(); - if (curl) - { - CURLcode res; + HTTPFetchRequest fetchrequest; + HTTPFetchResult fetchresult; + fetchrequest.url = url; + fetchrequest.useragent = std::string("Minetest ")+minetest_version_hash; + fetchrequest.timeout = g_settings->getS32("curl_timeout"); + fetchrequest.caller = HTTPFETCH_SYNC; - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring); - curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout")); - curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, g_settings->getS32("curl_timeout")); - curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); - - if (chunk != 0) - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); - - res = curl_easy_perform(curl); - if (res != CURLE_OK) - errorstream<<"Jsonreader: "<< url <<" not found (" << curl_easy_strerror(res) << ")" <data); + runptr = runptr->next; } + httpfetch_sync(fetchrequest,fetchresult); - Json::Value root; - Json::Reader reader; - std::istringstream stream(liststring); - if (!liststring.size()) { + if (!fetchresult.succeeded) { return Json::Value(); } + Json::Value root; + Json::Reader reader; + std::istringstream stream(fetchresult.data); if (!reader.parse( stream, root ) ) { errorstream << "URL: " << url << std::endl; errorstream << "Failed to parse json data " << reader.getFormattedErrorMessages(); - errorstream << "data: \"" << liststring << "\"" << std::endl; + errorstream << "data: \"" << fetchresult.data << "\"" << std::endl; return Json::Value(); } diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index d008b2568..0ec68e3ae 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "sound.h" #include "sound_openal.h" #include "clouds.h" +#include "httpfetch.h" #include #include @@ -507,51 +508,39 @@ bool GUIEngine::setTexture(texture_layer layer,std::string texturepath) { } /******************************************************************************/ -#if USE_CURL -static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) -{ - FILE* targetfile = (FILE*) userp; - fwrite(contents,size,nmemb,targetfile); - return size * nmemb; -} -#endif bool GUIEngine::downloadFile(std::string url,std::string target) { #if USE_CURL - //download file via curl - CURL *curl; + bool retval = true; - curl = curl_easy_init(); + FILE* targetfile = fopen(target.c_str(),"wb"); - if (curl) - { - CURLcode res; - bool retval = true; + if (targetfile) { + HTTPFetchRequest fetchrequest; + HTTPFetchResult fetchresult; + fetchrequest.url = url; + fetchrequest.useragent = std::string("Minetest ")+minetest_version_hash; + fetchrequest.timeout = g_settings->getS32("curl_timeout"); + fetchrequest.caller = HTTPFETCH_SYNC; + httpfetch_sync(fetchrequest,fetchresult); - FILE* targetfile = fopen(target.c_str(),"wb"); - - if (targetfile) { - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, targetfile); - curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); - res = curl_easy_perform(curl); - if (res != CURLE_OK) { - errorstream << "File at url \"" << url - <<"\" not found (" << curl_easy_strerror(res) << ")" <OnEvent(event) : false; } -static inline bool hex_digit_decode(char hexdigit, unsigned char &value) -{ - if(hexdigit >= '0' && hexdigit <= '9') - value = hexdigit - '0'; - else if(hexdigit >= 'A' && hexdigit <= 'F') - value = hexdigit - 'A' + 10; - else if(hexdigit >= 'a' && hexdigit <= 'f') - value = hexdigit - 'a' + 10; - else - return false; - return true; -} - bool GUIFormSpecMenu::parseColor(std::string &value, video::SColor &color, bool quiet) { const char *hexpattern = NULL; diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 25474c725..64e77bc54 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -280,6 +280,7 @@ struct HTTPFetchOngoing if (curl != NULL) { if (curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &result.response_code) != CURLE_OK) { + //we failed to get a return code make sure it is still 0 result.response_code = 0; } } diff --git a/src/httpfetch.h b/src/httpfetch.h index 6eb01fe79..f06c50e2c 100644 --- a/src/httpfetch.h +++ b/src/httpfetch.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., // Can be used in place of "caller" in asynchronous transfers to discard result // (used as default value of "caller") #define HTTPFETCH_DISCARD 0 +#define HTTPFETCH_SYNC 1 struct HTTPFetchRequest { @@ -96,6 +97,7 @@ struct HTTPFetchResult caller = fetchrequest.caller; request_id = fetchrequest.request_id; } + }; // Initializes the httpfetch module From e275b7099a68e32aac102bb9e4a9125b1dccf91c Mon Sep 17 00:00:00 2001 From: Kahrl Date: Fri, 13 Dec 2013 18:08:53 +0100 Subject: [PATCH 182/198] Don't call curl_global_init twice --- src/main.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 239d68246..480e885c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,10 +86,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "database-leveldb.h" #endif -#if USE_CURL -#include "curl/curl.h" -#endif - /* Settings. These are loaded from the config file. @@ -997,11 +993,6 @@ int main(int argc, char *argv[]) srand(time(0)); mysrand(time(0)); -#if USE_CURL - CURLcode res = curl_global_init(CURL_GLOBAL_DEFAULT); - assert(res == CURLE_OK); -#endif - // Initialize HTTP fetcher httpfetch_init(g_settings->getS32("curl_parallel_limit")); From 83853ccd413c06a4a37a3c91f8c2cb270e42109c Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 13 Dec 2013 12:58:32 -0500 Subject: [PATCH 183/198] Remove support for optdepends.txt --- doc/lua_api.txt | 7 ------- src/mods.cpp | 10 ---------- 2 files changed, 17 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index a8b671eb6..28d8b9cc8 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -129,13 +129,6 @@ screenshot.png: description.txt: File containing desctiption to be shown within mainmenu. -optdepends.txt: - An alternative way of specifying optional dependencies. - Like depends.txt, a single line contains a single modname. - - NOTE: This file exists for compatibility purposes only and - support for it will be removed from the engine by the end of 2013. - init.lua: The main Lua script. Running this script should register everything it wants to register. Subsequent execution depends on minetest calling the diff --git a/src/mods.cpp b/src/mods.cpp index bcdda01ef..90feee307 100644 --- a/src/mods.cpp +++ b/src/mods.cpp @@ -77,16 +77,6 @@ void parseModContents(ModSpec &spec) } } } - - // FIXME: optdepends.txt is deprecated - // remove this code at some point in the future - std::ifstream is2((spec.path+DIR_DELIM+"optdepends.txt").c_str()); - while(is2.good()){ - std::string dep; - std::set symbols; - if(parseDependsLine(is2, dep, symbols)) - spec.optdepends.insert(dep); - } } } From c3708b456e90bccf19e7c82c54a93c8cb7c8896c Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 14 Dec 2013 01:52:06 -0500 Subject: [PATCH 184/198] Add map feature generation notify Lua API --- doc/lua_api.txt | 10 ++ src/cavegen.cpp | 24 ++++ src/dungeongen.cpp | 199 +++++++++++++++----------------- src/dungeongen.h | 14 +-- src/emerge.cpp | 3 +- src/emerge.h | 2 + src/mapgen.cpp | 19 +++ src/mapgen.h | 55 ++++++--- src/mapgen_v6.cpp | 19 +-- src/mapgen_v7.cpp | 5 +- src/script/lua_api/l_mapgen.cpp | 50 ++++++-- src/script/lua_api/l_mapgen.h | 3 + 12 files changed, 252 insertions(+), 151 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 28d8b9cc8..abfb8f94b 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1289,6 +1289,10 @@ minetest.get_perlin(seeddiff, octaves, persistence, scale) ^ Return world-specific perlin noise (int(worldseed)+seeddiff) minetest.get_voxel_manip() ^ Return voxel manipulator object +minetest.set_gen_notify(flags) +^ Set the types of on-generate notifications that should be collected +^ flags is a comma-delimited combination of: +^ dungeon, temple, cave_begin, cave_end, large_cave_begin, large_cave_end minetest.get_mapgen_object(objectname) ^ Return requested mapgen object if available (see Mapgen objects) minetest.set_mapgen_params(MapgenParams) @@ -1894,6 +1898,12 @@ the current mapgen. Returns an array containing the humidity values of nodes in the most recently generated chunk by the current mapgen. +- gennotify + Returns a table mapping requested generation notification types to arrays of positions at which the +corresponding generated structures are located at within the current chunk. To set the capture of positions +of interest to be recorded on generate, use minetest.set_gen_notify(). +Possible fields of the table returned are: dungeon, temple, cave_begin, cave_end, large_cave_begin, large_cave_end + Registered entities -------------------- - Functions receive a "luaentity" as self: diff --git a/src/cavegen.cpp b/src/cavegen.cpp index f04c02db9..b32e140f8 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -110,9 +110,21 @@ void CaveV6::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) { (float)(ps->next() % ar.Z) + 0.5 ); + int notifytype = large_cave ? GENNOTIFY_LARGECAVE_BEGIN : GENNOTIFY_CAVE_BEGIN; + if (mg->gennotify & (1 << notifytype)) { + std::vector *nvec = mg->gen_notifications[notifytype]; + nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z)); + } + // Generate some tunnel starting from orp for (u16 j = 0; j < tunnel_routepoints; j++) makeTunnel(j % dswitchint == 0); + + notifytype = large_cave ? GENNOTIFY_LARGECAVE_END : GENNOTIFY_CAVE_END; + if (mg->gennotify & (1 << notifytype)) { + std::vector *nvec = mg->gen_notifications[notifytype]; + nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z)); + } } @@ -347,9 +359,21 @@ void CaveV7::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) { (float)(ps->next() % ar.Z) + 0.5 ); + int notifytype = large_cave ? GENNOTIFY_LARGECAVE_BEGIN : GENNOTIFY_CAVE_BEGIN; + if (mg->gennotify & (1 << notifytype)) { + std::vector *nvec = mg->gen_notifications[notifytype]; + nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z)); + } + // Generate some tunnel starting from orp for (u16 j = 0; j < tunnel_routepoints; j++) makeTunnel(j % dswitchint == 0); + + notifytype = large_cave ? GENNOTIFY_LARGECAVE_END : GENNOTIFY_CAVE_END; + if (mg->gennotify & (1 << notifytype)) { + std::vector *nvec = mg->gen_notifications[notifytype]; + nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z)); + } } diff --git a/src/dungeongen.cpp b/src/dungeongen.cpp index fee6f66c0..ff0a39e9e 100644 --- a/src/dungeongen.cpp +++ b/src/dungeongen.cpp @@ -42,11 +42,9 @@ NoiseParams nparams_dungeon_density = /////////////////////////////////////////////////////////////////////////////// -DungeonGen::DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel, - DungeonParams *dparams) { - this->ndef = ndef; - this->mapseed = seed; - this->water_level = waterlevel; +DungeonGen::DungeonGen(Mapgen *mapgen, DungeonParams *dparams) { + this->mg = mapgen; + this->vm = mapgen->vm; #ifdef DGEN_USE_TORCHES c_torch = ndef->getId("default:torch"); @@ -55,15 +53,16 @@ DungeonGen::DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel, if (dparams) { memcpy(&dp, dparams, sizeof(dp)); } else { - dp.c_water = ndef->getId("mapgen_water_source"); - dp.c_cobble = ndef->getId("mapgen_cobble"); - dp.c_moss = ndef->getId("mapgen_mossycobble"); - dp.c_stair = ndef->getId("mapgen_stair_cobble"); + dp.c_water = mg->ndef->getId("mapgen_water_source"); + dp.c_cobble = mg->ndef->getId("mapgen_cobble"); + dp.c_moss = mg->ndef->getId("mapgen_mossycobble"); + dp.c_stair = mg->ndef->getId("mapgen_stair_cobble"); dp.diagonal_dirs = false; - dp.mossratio = 3.0; - dp.holesize = v3s16(1, 2, 1); - dp.roomsize = v3s16(0,0,0); + dp.mossratio = 3.0; + dp.holesize = v3s16(1, 2, 1); + dp.roomsize = v3s16(0,0,0); + dp.notifytype = GENNOTIFY_DUNGEON; dp.np_rarity = nparams_dungeon_rarity; dp.np_wetness = nparams_dungeon_wetness; @@ -72,31 +71,29 @@ DungeonGen::DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel, } -void DungeonGen::generate(ManualMapVoxelManipulator *vm, u32 bseed, - v3s16 nmin, v3s16 nmax) { +void DungeonGen::generate(u32 bseed, v3s16 nmin, v3s16 nmax) { //TimeTaker t("gen dungeons"); - int approx_groundlevel = 10 + water_level; + int approx_groundlevel = 10 + mg->water_level; if ((nmin.Y + nmax.Y) / 2 >= approx_groundlevel || - NoisePerlin3D(&dp.np_rarity, nmin.X, nmin.Y, nmin.Z, mapseed) < 0.2) + NoisePerlin3D(&dp.np_rarity, nmin.X, nmin.Y, nmin.Z, mg->seed) < 0.2) return; - - this->vmanip = vm; + this->blockseed = bseed; random.seed(bseed + 2); // Dungeon generator doesn't modify places which have this set - vmanip->clearFlag(VMANIP_FLAG_DUNGEON_INSIDE | VMANIP_FLAG_DUNGEON_PRESERVE); + vm->clearFlag(VMANIP_FLAG_DUNGEON_INSIDE | VMANIP_FLAG_DUNGEON_PRESERVE); // Set all air and water to be untouchable to make dungeons open // to caves and open air for (s16 z = nmin.Z; z <= nmax.Z; z++) { for (s16 y = nmin.Y; y <= nmax.Y; y++) { - u32 i = vmanip->m_area.index(nmin.X, y, z); + u32 i = vm->m_area.index(nmin.X, y, z); for (s16 x = nmin.X; x <= nmax.X; x++) { - content_t c = vmanip->m_data[i].getContent(); + content_t c = vm->m_data[i].getContent(); if (c == CONTENT_AIR || c == dp.c_water) - vmanip->m_flags[i] |= VMANIP_FLAG_DUNGEON_PRESERVE; + vm->m_flags[i] |= VMANIP_FLAG_DUNGEON_PRESERVE; i++; } } @@ -109,13 +106,13 @@ void DungeonGen::generate(ManualMapVoxelManipulator *vm, u32 bseed, if (dp.mossratio != 0.0) { for (s16 z = nmin.Z; z <= nmax.Z; z++) for (s16 y = nmin.Y; y <= nmax.Y; y++) { - u32 i = vmanip->m_area.index(nmin.X, y, z); + u32 i = vm->m_area.index(nmin.X, y, z); for (s16 x = nmin.X; x <= nmax.X; x++) { - if (vmanip->m_data[i].getContent() == dp.c_cobble) { - float wetness = NoisePerlin3D(&dp.np_wetness, x, y, z, mapseed); + if (vm->m_data[i].getContent() == dp.c_cobble) { + float wetness = NoisePerlin3D(&dp.np_wetness, x, y, z, mg->seed); float density = NoisePerlin3D(&dp.np_density, x, y, z, blockseed); if (density < wetness / dp.mossratio) - vmanip->m_data[i].setContent(dp.c_moss); + vm->m_data[i].setContent(dp.c_moss); } i++; } @@ -128,7 +125,7 @@ void DungeonGen::generate(ManualMapVoxelManipulator *vm, u32 bseed, void DungeonGen::makeDungeon(v3s16 start_padding) { - v3s16 areasize = vmanip->m_area.getExtent(); + v3s16 areasize = vm->m_area.getExtent(); v3s16 roomsize; v3s16 roomplace; @@ -136,7 +133,7 @@ void DungeonGen::makeDungeon(v3s16 start_padding) Find place for first room */ bool fits = false; - for (u32 i = 0; i < 100; i++) + for (u32 i = 0; i < 100 && !fits; i++) { bool is_large_room = ((random.next() & 3) == 1); roomsize = is_large_room ? @@ -146,7 +143,7 @@ void DungeonGen::makeDungeon(v3s16 start_padding) // start_padding is used to disallow starting the generation of // a dungeon in a neighboring generation chunk - roomplace = vmanip->m_area.MinEdge + start_padding + v3s16( + roomplace = vm->m_area.MinEdge + start_padding + v3s16( random.range(0,areasize.X-roomsize.X-1-start_padding.X), random.range(0,areasize.Y-roomsize.Y-1-start_padding.Y), random.range(0,areasize.Z-roomsize.Z-1-start_padding.Z)); @@ -161,20 +158,13 @@ void DungeonGen::makeDungeon(v3s16 start_padding) for (s16 x = 1; x < roomsize.X - 1; x++) { v3s16 p = roomplace + v3s16(x, y, z); - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_INSIDE) - { - fits = false; - break; - } - if (vmanip->m_data[vi].getContent() == CONTENT_IGNORE) - { + u32 vi = vm->m_area.index(p); + if ((vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_INSIDE) || + vm->m_data[vi].getContent() == CONTENT_IGNORE) { fits = false; break; } } - if (fits) - break; } // No place found if (fits == false) @@ -194,10 +184,14 @@ void DungeonGen::makeDungeon(v3s16 start_padding) makeRoom(roomsize, roomplace); v3s16 room_center = roomplace + v3s16(roomsize.X / 2, 1, roomsize.Z / 2); + if (mg->gennotify & (1 << dp.notifytype)) { + std::vector *nvec = mg->gen_notifications[dp.notifytype]; + nvec->push_back(room_center); + } #ifdef DGEN_USE_TORCHES // Place torch at room center (for testing) - vmanip->m_data[vmanip->m_area.index(room_center)] = MapNode(c_torch); + vm->m_data[vm->m_area.index(room_center)] = MapNode(c_torch); #endif // Quit if last room @@ -210,12 +204,9 @@ void DungeonGen::makeDungeon(v3s16 start_padding) v3s16 walker_start_place; - if(start_in_last_room) - { + if (start_in_last_room) { walker_start_place = last_room_center; - } - else - { + } else { walker_start_place = room_center; // Store center of current room as the last one last_room_center = room_center; @@ -226,8 +217,7 @@ void DungeonGen::makeDungeon(v3s16 start_padding) v3s16 doordir; m_pos = walker_start_place; - bool r = findPlaceForDoor(doorplace, doordir); - if (r == false) + if (!findPlaceForDoor(doorplace, doordir)) return; if (random.range(0,1) == 0) @@ -248,8 +238,7 @@ void DungeonGen::makeDungeon(v3s16 start_padding) m_pos = corridor_end; m_dir = corridor_end_dir; - r = findPlaceForRoomDoor(roomsize, doorplace, doordir, roomplace); - if (r == false) + if (!findPlaceForRoomDoor(roomsize, doorplace, doordir, roomplace)) return; if (random.range(0,1) == 0) @@ -274,21 +263,21 @@ void DungeonGen::makeRoom(v3s16 roomsize, v3s16 roomplace) { { v3s16 p = roomplace + v3s16(0, y, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) continue; - vmanip->m_data[vi] = n_cobble; + vm->m_data[vi] = n_cobble; } { v3s16 p = roomplace + v3s16(roomsize.X - 1, y, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) continue; - vmanip->m_data[vi] = n_cobble; + vm->m_data[vi] = n_cobble; } } @@ -298,21 +287,21 @@ void DungeonGen::makeRoom(v3s16 roomsize, v3s16 roomplace) { { v3s16 p = roomplace + v3s16(x, y, 0); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) continue; - vmanip->m_data[vi] = n_cobble; + vm->m_data[vi] = n_cobble; } { v3s16 p = roomplace + v3s16(x, y, roomsize.Z - 1); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) continue; - vmanip->m_data[vi] = n_cobble; + vm->m_data[vi] = n_cobble; } } @@ -322,21 +311,21 @@ void DungeonGen::makeRoom(v3s16 roomsize, v3s16 roomplace) { { v3s16 p = roomplace + v3s16(x, 0, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) continue; - vmanip->m_data[vi] = n_cobble; + vm->m_data[vi] = n_cobble; } { v3s16 p = roomplace + v3s16(x,roomsize. Y - 1, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) continue; - vmanip->m_data[vi] = n_cobble; + vm->m_data[vi] = n_cobble; } } @@ -346,11 +335,11 @@ void DungeonGen::makeRoom(v3s16 roomsize, v3s16 roomplace) for (s16 x = 1; x < roomsize.X - 1; x++) { v3s16 p = roomplace + v3s16(x, y, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - vmanip->m_flags[vi] |= VMANIP_FLAG_DUNGEON_UNTOUCHABLE; - vmanip->m_data[vi] = n_air; + u32 vi = vm->m_area.index(p); + vm->m_flags[vi] |= VMANIP_FLAG_DUNGEON_UNTOUCHABLE; + vm->m_data[vi] = n_air; } } @@ -363,13 +352,13 @@ void DungeonGen::makeFill(v3s16 place, v3s16 size, for (s16 x = 0; x < size.X; x++) { v3s16 p = place + v3s16(x, y, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) continue; - u32 vi = vmanip->m_area.index(p); - if (vmanip->m_flags[vi] & avoid_flags) + u32 vi = vm->m_area.index(p); + if (vm->m_flags[vi] & avoid_flags) continue; - vmanip->m_flags[vi] |= or_flags; - vmanip->m_data[vi] = n; + vm->m_flags[vi] |= or_flags; + vm->m_data[vi] = n; } } @@ -387,7 +376,7 @@ void DungeonGen::makeDoor(v3s16 doorplace, v3s16 doordir) #ifdef DGEN_USE_TORCHES // Place torch (for testing) - vmanip->m_data[vmanip->m_area.index(doorplace)] = MapNode(c_torch); + vm->m_data[vm->m_area.index(doorplace)] = MapNode(c_torch); #endif } @@ -416,8 +405,8 @@ void DungeonGen::makeCorridor(v3s16 doorplace, if (partcount != 0) p.Y += make_stairs; - if (vmanip->m_area.contains(p) == true && - vmanip->m_area.contains(p + v3s16(0, 1, 0)) == true) { + if (vm->m_area.contains(p) == true && + vm->m_area.contains(p + v3s16(0, 1, 0)) == true) { if (make_stairs) { makeFill(p + v3s16(-1, -1, -1), dp.holesize + v3s16(2, 3, 2), VMANIP_FLAG_DUNGEON_UNTOUCHABLE, MapNode(dp.c_cobble), 0); @@ -434,13 +423,13 @@ void DungeonGen::makeCorridor(v3s16 doorplace, // rotate face 180 deg if making stairs backwards int facedir = dir_to_facedir(dir * make_stairs); - u32 vi = vmanip->m_area.index(p.X - dir.X, p.Y - 1, p.Z - dir.Z); - if (vmanip->m_data[vi].getContent() == dp.c_cobble) - vmanip->m_data[vi] = MapNode(dp.c_stair, 0, facedir); + u32 vi = vm->m_area.index(p.X - dir.X, p.Y - 1, p.Z - dir.Z); + if (vm->m_data[vi].getContent() == dp.c_cobble) + vm->m_data[vi] = MapNode(dp.c_stair, 0, facedir); - vi = vmanip->m_area.index(p.X, p.Y, p.Z); - if (vmanip->m_data[vi].getContent() == dp.c_cobble) - vmanip->m_data[vi] = MapNode(dp.c_stair, 0, facedir); + vi = vm->m_area.index(p.X, p.Y, p.Z); + if (vm->m_data[vi].getContent() == dp.c_cobble) + vm->m_data[vi] = MapNode(dp.c_stair, 0, facedir); } } else { makeFill(p + v3s16(-1, -1, -1), dp.holesize + v3s16(2, 2, 2), @@ -482,15 +471,15 @@ bool DungeonGen::findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir) { v3s16 p = m_pos + m_dir; v3s16 p1 = p + v3s16(0, 1, 0); - if (vmanip->m_area.contains(p) == false - || vmanip->m_area.contains(p1) == false + if (vm->m_area.contains(p) == false + || vm->m_area.contains(p1) == false || i % 4 == 0) { randomizeDir(); continue; } - if (vmanip->getNodeNoExNoEmerge(p).getContent() == dp.c_cobble - && vmanip->getNodeNoExNoEmerge(p1).getContent() == dp.c_cobble) + if (vm->getNodeNoExNoEmerge(p).getContent() == dp.c_cobble + && vm->getNodeNoExNoEmerge(p1).getContent() == dp.c_cobble) { // Found wall, this is a good place! result_place = p; @@ -503,18 +492,18 @@ bool DungeonGen::findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir) Determine where to move next */ // Jump one up if the actual space is there - if (vmanip->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == dp.c_cobble - && vmanip->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == CONTENT_AIR - && vmanip->getNodeNoExNoEmerge(p+v3s16(0,2,0)).getContent() == CONTENT_AIR) + if (vm->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == dp.c_cobble + && vm->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == CONTENT_AIR + && vm->getNodeNoExNoEmerge(p+v3s16(0,2,0)).getContent() == CONTENT_AIR) p += v3s16(0,1,0); // Jump one down if the actual space is there - if (vmanip->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == dp.c_cobble - && vmanip->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == CONTENT_AIR - && vmanip->getNodeNoExNoEmerge(p+v3s16(0,-1,0)).getContent() == CONTENT_AIR) + if (vm->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() == dp.c_cobble + && vm->getNodeNoExNoEmerge(p+v3s16(0,0,0)).getContent() == CONTENT_AIR + && vm->getNodeNoExNoEmerge(p+v3s16(0,-1,0)).getContent() == CONTENT_AIR) p += v3s16(0,-1,0); // Check if walking is now possible - if (vmanip->getNodeNoExNoEmerge(p).getContent() != CONTENT_AIR - || vmanip->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() != CONTENT_AIR) + if (vm->getNodeNoExNoEmerge(p).getContent() != CONTENT_AIR + || vm->getNodeNoExNoEmerge(p+v3s16(0,1,0)).getContent() != CONTENT_AIR) { // Cannot continue walking here randomizeDir(); @@ -571,12 +560,12 @@ bool DungeonGen::findPlaceForRoomDoor(v3s16 roomsize, v3s16 &result_doorplace, for (s16 x = 1; x < roomsize.X - 1; x++) { v3s16 p = roomplace + v3s16(x, y, z); - if (vmanip->m_area.contains(p) == false) + if (vm->m_area.contains(p) == false) { fits = false; break; } - if (vmanip->m_flags[vmanip->m_area.index(p)] + if (vm->m_flags[vm->m_area.index(p)] & VMANIP_FLAG_DUNGEON_INSIDE) { fits = false; diff --git a/src/dungeongen.h b/src/dungeongen.h index b2b28db3a..4a0bfcefd 100644 --- a/src/dungeongen.h +++ b/src/dungeongen.h @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., class ManualMapVoxelManipulator; class INodeDefManager; - +class Mapgen; v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs); v3s16 turn_xz(v3s16 olddir, int t); @@ -44,6 +44,7 @@ struct DungeonParams { content_t c_moss; content_t c_stair; + int notifytype; bool diagonal_dirs; float mossratio; v3s16 holesize; @@ -56,13 +57,11 @@ struct DungeonParams { class DungeonGen { public: + ManualMapVoxelManipulator *vm; + Mapgen *mg; u32 blockseed; - u64 mapseed; - ManualMapVoxelManipulator *vmanip; - INodeDefManager *ndef; PseudoRandom random; v3s16 csize; - s16 water_level; content_t c_torch; DungeonParams dp; @@ -71,9 +70,8 @@ public: v3s16 m_pos; v3s16 m_dir; - DungeonGen(INodeDefManager *ndef, u64 seed, s16 waterlevel, DungeonParams *dparams); - void generate(ManualMapVoxelManipulator *vm, u32 bseed, - v3s16 full_node_min, v3s16 full_node_max); + DungeonGen(Mapgen *mg, DungeonParams *dparams); + void generate(u32 bseed, v3s16 full_node_min, v3s16 full_node_max); void makeDungeon(v3s16 start_padding); void makeRoom(v3s16 roomsize, v3s16 roomplace); diff --git a/src/emerge.cpp b/src/emerge.cpp index 94b6464f6..f096bb874 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -105,8 +105,9 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { this->luaoverride_params_modified = 0; this->luaoverride_flagmask = 0; - mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info"); + this->gennotify = 0; + mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info"); int nthreads; if (g_settings->get("num_emerge_threads").empty()) { diff --git a/src/emerge.h b/src/emerge.h index ed982924b..d5bb72f85 100644 --- a/src/emerge.h +++ b/src/emerge.h @@ -94,6 +94,8 @@ public: u16 qlimit_diskonly; u16 qlimit_generate; + u32 gennotify; + MapgenParams *luaoverride_params; u32 luaoverride_params_modified; u32 luaoverride_flagmask; diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 20fc4459b..3d5c7b3cc 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -64,6 +64,16 @@ FlagDesc flagdesc_deco_schematic[] = { {NULL, 0} }; +FlagDesc flagdesc_gennotify[] = { + {"dungeon", 1 << GENNOTIFY_DUNGEON}, + {"temple", 1 << GENNOTIFY_TEMPLE}, + {"cave_begin", 1 << GENNOTIFY_CAVE_BEGIN}, + {"cave_end", 1 << GENNOTIFY_CAVE_END}, + {"large_cave_begin", 1 << GENNOTIFY_LARGECAVE_BEGIN}, + {"large_cave_end", 1 << GENNOTIFY_LARGECAVE_END}, + {NULL, 0} +}; + /////////////////////////////////////////////////////////////////////////////// @@ -896,6 +906,15 @@ Mapgen::Mapgen() { ndef = NULL; heightmap = NULL; biomemap = NULL; + + for (unsigned int i = 0; i != NUM_GEN_NOTIFY; i++) + gen_notifications[i] = new std::vector; +} + + +Mapgen::~Mapgen() { + for (unsigned int i = 0; i != NUM_GEN_NOTIFY; i++) + delete gen_notifications[i]; } diff --git a/src/mapgen.h b/src/mapgen.h index 47a7204bc..feec60e19 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -53,9 +53,16 @@ with this program; if not, write to the Free Software Foundation, Inc., #define DECO_PLACE_CENTER_Y 2 #define DECO_PLACE_CENTER_Z 4 +#define ORE_RANGE_ACTUAL 1 +#define ORE_RANGE_MIRROR 2 + +#define NUM_GEN_NOTIFY 6 + + extern FlagDesc flagdesc_mapgen[]; extern FlagDesc flagdesc_ore[]; extern FlagDesc flagdesc_deco_schematic[]; +extern FlagDesc flagdesc_gennotify[]; class BiomeDefManager; class Biome; @@ -67,6 +74,32 @@ struct BlockMakeData; class VoxelArea; class Map; + +enum MapgenObject { + MGOBJ_VMANIP, + MGOBJ_HEIGHTMAP, + MGOBJ_BIOMEMAP, + MGOBJ_HEATMAP, + MGOBJ_HUMIDMAP, + MGOBJ_GENNOTIFY +}; + +enum GenNotify { + GENNOTIFY_DUNGEON, + GENNOTIFY_TEMPLE, + GENNOTIFY_CAVE_BEGIN, + GENNOTIFY_CAVE_END, + GENNOTIFY_LARGECAVE_BEGIN, + GENNOTIFY_LARGECAVE_END +}; + +enum OreType { + ORE_SCATTER, + ORE_SHEET, + ORE_CLAYLIKE +}; + + struct MapgenParams { std::string mg_name; int chunksize; @@ -100,8 +133,11 @@ public: u8 *biomemap; v3s16 csize; + u32 gennotify; + std::vector *gen_notifications[NUM_GEN_NOTIFY]; + Mapgen(); - virtual ~Mapgen() {} + virtual ~Mapgen(); s16 findGroundLevelFull(v2s16 p2d); s16 findGroundLevel(v2s16 p2d, s16 ymin, s16 ymax); @@ -123,23 +159,6 @@ struct MapgenFactory { virtual ~MapgenFactory() {} }; -enum MapgenObject { - MGOBJ_VMANIP, - MGOBJ_HEIGHTMAP, - MGOBJ_BIOMEMAP, - MGOBJ_HEATMAP, - MGOBJ_HUMIDMAP -}; - -enum OreType { - ORE_SCATTER, - ORE_SHEET, - ORE_CLAYLIKE -}; - -#define ORE_RANGE_ACTUAL 1 -#define ORE_RANGE_MIRROR 2 - class Ore { public: std::string ore_name; diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index 11491b6b6..3e152861c 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -74,6 +74,7 @@ MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge) this->water_level = params->water_level; this->flags = params->flags; this->csize = v3s16(1, 1, 1) * params->chunksize * MAP_BLOCKSIZE; + this->gennotify = emerge->gennotify; this->freq_desert = params->freq_desert; this->freq_beach = params->freq_beach; @@ -456,22 +457,24 @@ void MapgenV6::makeChunk(BlockMakeData *data) { dp.c_stair = c_stair_cobble; dp.diagonal_dirs = false; - dp.mossratio = 3.0; - dp.holesize = v3s16(1, 2, 1); - dp.roomsize = v3s16(0, 0, 0); + dp.mossratio = 3.0; + dp.holesize = v3s16(1, 2, 1); + dp.roomsize = v3s16(0, 0, 0); + dp.notifytype = GENNOTIFY_DUNGEON; } else { dp.c_cobble = c_sandbrick; dp.c_moss = c_sandbrick; // should make this 'cracked sandstone' later dp.c_stair = c_stair_sandstone; dp.diagonal_dirs = true; - dp.mossratio = 0.0; - dp.holesize = v3s16(2, 3, 2); - dp.roomsize = v3s16(2, 5, 2); + dp.mossratio = 0.0; + dp.holesize = v3s16(2, 3, 2); + dp.roomsize = v3s16(2, 5, 2); + dp.notifytype = GENNOTIFY_TEMPLE; } - DungeonGen dgen(ndef, data->seed, water_level, &dp); - dgen.generate(vm, blockseed, full_node_min, full_node_max); + DungeonGen dgen(this, &dp); + dgen.generate(blockseed, full_node_min, full_node_max); } // Add top and bottom side of water to transforming_liquid queue diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp index 88da4fcd2..6d5c04900 100644 --- a/src/mapgen_v7.cpp +++ b/src/mapgen_v7.cpp @@ -73,6 +73,7 @@ MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge) this->seed = (int)params->seed; this->water_level = params->water_level; this->flags = params->flags | MGV7_MOUNTAINS | MGV7_RIDGES; + this->gennotify = emerge->gennotify; this->csize = v3s16(1, 1, 1) * params->chunksize * MAP_BLOCKSIZE; @@ -207,8 +208,8 @@ void MapgenV7::makeChunk(BlockMakeData *data) { generateCaves(stone_surface_max_y); if (flags & MG_DUNGEONS) { - DungeonGen dgen(ndef, data->seed, water_level, NULL); - dgen.generate(vm, blockseed, full_node_min, full_node_max); + DungeonGen dgen(this, NULL); + dgen.generate(blockseed, full_node_min, full_node_max); } for (size_t i = 0; i != emerge->decorations.size(); i++) { diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index fe7ac8dd6..5489531b6 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -54,6 +54,7 @@ struct EnumString ModApiMapgen::es_MapgenObject[] = {MGOBJ_BIOMEMAP, "biomemap"}, {MGOBJ_HEATMAP, "heatmap"}, {MGOBJ_HUMIDMAP, "humiditymap"}, + {MGOBJ_GENNOTIFY, "gennotify"}, {0, NULL}, }; @@ -95,8 +96,6 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) size_t maplen = mg->csize.X * mg->csize.Z; - int nargs = 1; - switch (mgobj) { case MGOBJ_VMANIP: { ManualMapVoxelManipulator *vm = mg->vm; @@ -113,9 +112,7 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) // emerged max pos push_v3s16(L, vm->m_area.MaxEdge); - nargs = 3; - - break; } + return 3; } case MGOBJ_HEIGHTMAP: { if (!mg->heightmap) return 0; @@ -125,7 +122,8 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) lua_pushinteger(L, mg->heightmap[i]); lua_rawseti(L, -2, i + 1); } - break; } + + return 1; } case MGOBJ_BIOMEMAP: { if (!mg->biomemap) return 0; @@ -135,7 +133,8 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) lua_pushinteger(L, mg->biomemap[i]); lua_rawseti(L, -2, i + 1); } - break; } + + return 1; } case MGOBJ_HEATMAP: { // Mapgen V7 specific objects case MGOBJ_HUMIDMAP: if (strcmp(emerge->params->mg_name.c_str(), "v7")) @@ -153,10 +152,32 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L) lua_pushnumber(L, arr[i]); lua_rawseti(L, -2, i + 1); } - break; } + + return 1; } + case MGOBJ_GENNOTIFY: { + lua_newtable(L); + for (int i = 0; flagdesc_gennotify[i].name; i++) { + if (!(emerge->gennotify & flagdesc_gennotify[i].flag)) + continue; + + std::vector *posvec = mg->gen_notifications[i]; + if (!posvec) + return 0; + + lua_newtable(L); + for (unsigned int j = 0; j != posvec->size(); j++) { + push_v3s16(L, (*posvec)[j]); + lua_rawseti(L, -2, j + 1); + } + lua_setfield(L, -2, flagdesc_gennotify[i].name); + + posvec->clear(); + } + + return 1; } } - return nargs; + return 0; } // minetest.set_mapgen_params(params) @@ -214,6 +235,16 @@ int ModApiMapgen::l_set_mapgen_params(lua_State *L) return 0; } +// set_gen_notify(string) +int ModApiMapgen::l_set_gen_notify(lua_State *L) +{ + if (lua_isstring(L, 1)) { + EmergeManager *emerge = getServer(L)->getEmergeManager(); + emerge->gennotify = readFlagString(lua_tostring(L, 1), flagdesc_gennotify); + } + return 0; +} + // register_biome({lots of stuff}) int ModApiMapgen::l_register_biome(lua_State *L) { @@ -581,6 +612,7 @@ void ModApiMapgen::Initialize(lua_State *L, int top) API_FCT(get_mapgen_object); API_FCT(set_mapgen_params); + API_FCT(set_gen_notify); API_FCT(register_biome); API_FCT(register_decoration); diff --git a/src/script/lua_api/l_mapgen.h b/src/script/lua_api/l_mapgen.h index d0da5bb13..43fd6a09f 100644 --- a/src/script/lua_api/l_mapgen.h +++ b/src/script/lua_api/l_mapgen.h @@ -32,6 +32,9 @@ private: // set mapgen parameters static int l_set_mapgen_params(lua_State *L); + // set_gen_notify(flagstring) + static int l_set_gen_notify(lua_State *L); + // register_biome({lots of stuff}) static int l_register_biome(lua_State *L); From 15c316765d2ee2a0b8aec78fd6b13d9367f3c91e Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 14 Dec 2013 01:59:16 -0500 Subject: [PATCH 185/198] Handle Lua errors in on_generate callbacks instead of throwing SIGABRT --- src/emerge.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emerge.cpp b/src/emerge.cpp index f096bb874..2f757a760 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -554,9 +554,11 @@ void *EmergeThread::Thread() { MapEditEventAreaIgnorer ign(&m_server->m_ignore_map_edit_events_area, VoxelArea(minp, maxp)); - { // takes about 90ms with -O1 on an e3-1230v2 + try { // takes about 90ms with -O1 on an e3-1230v2 m_server->getScriptIface()->environment_OnGenerated( minp, maxp, emerge->getBlockSeed(minp)); + } catch(LuaError &e) { + m_server->setAsyncFatalError(e.what()); } EMERGE_DBG_OUT("ended up with: " << analyze_block(block)); From 7a4c1e7327a19820ec1e943d031c0e6e057e0156 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 14 Dec 2013 10:49:20 -0500 Subject: [PATCH 186/198] Update mapgen params in ServerMap after Mapgen init --- src/emerge.cpp | 8 ++++---- src/map.h | 1 + src/server.cpp | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/emerge.cpp b/src/emerge.cpp index 2f757a760..6635a6518 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -91,11 +91,11 @@ public: EmergeManager::EmergeManager(IGameDef *gamedef) { //register built-in mapgens - registerMapgen("v6", new MapgenFactoryV6()); - registerMapgen("v7", new MapgenFactoryV7()); - registerMapgen("indev", new MapgenFactoryIndev()); + registerMapgen("v6", new MapgenFactoryV6()); + registerMapgen("v7", new MapgenFactoryV7()); + registerMapgen("indev", new MapgenFactoryIndev()); registerMapgen("singlenode", new MapgenFactorySinglenode()); - registerMapgen("math", new MapgenFactoryMath()); + registerMapgen("math", new MapgenFactoryMath()); this->ndef = gamedef->getNodeDefManager(); this->biomedef = new BiomeDefManager(); diff --git a/src/map.h b/src/map.h index d4656acc6..fa88109a3 100644 --- a/src/map.h +++ b/src/map.h @@ -496,6 +496,7 @@ public: u64 getSeed(){ return m_seed; } MapgenParams *getMapgenParams(){ return m_mgparams; } + void setMapgenParams(MapgenParams *mgparams){ m_mgparams = mgparams; } // Parameters fed to the Mapgen MapgenParams *m_mgparams; diff --git a/src/server.cpp b/src/server.cpp index 9d51b794b..1455de721 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -823,6 +823,7 @@ Server::Server( // Initialize mapgens m_emerge->initMapgens(mgparams); + servermap->setMapgenParams(m_emerge->params); // Give environment reference to scripting api m_script->initializeEnvironment(m_env); From 977232261388fa80bd6ab3bb849ae4d7a8ade73e Mon Sep 17 00:00:00 2001 From: BlockMen Date: Thu, 12 Dec 2013 21:02:09 +0100 Subject: [PATCH 187/198] Add alpha setting to font shadow --- minetest.conf.example | 3 +++ src/cguittfont/CGUITTFont.cpp | 5 +++-- src/cguittfont/CGUITTFont.h | 3 ++- src/defaultsettings.cpp | 2 ++ src/main.cpp | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index f7dac6b7b..b7f4b24a7 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -213,6 +213,8 @@ #font_size = 13 # Font shadow offset, if 0 then shadow will not be drawn. #font_shadow = 1 +# Font shadow alpha (opaqueness, between 0 and 255) +#font_shadow_alpha = 128 #mono_font_path = fonts/liberationmono.ttf #mono_font_size = 13 @@ -220,6 +222,7 @@ #fallback_font_path = fonts/DroidSansFallbackFull.ttf #fallback_font_size = 13 #fallback_font_shadow = 1 +#fallback_font_shadow_alpha = 128 # # Server stuff diff --git a/src/cguittfont/CGUITTFont.cpp b/src/cguittfont/CGUITTFont.cpp index b9c979090..9a702cad7 100644 --- a/src/cguittfont/CGUITTFont.cpp +++ b/src/cguittfont/CGUITTFont.cpp @@ -199,7 +199,7 @@ void SGUITTGlyph::unload() ////////////////////// -CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias, const bool transparency, const u32 shadow) +CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias, const bool transparency, const u32 shadow, const u32 shadow_alpha) { if (!c_libraryLoaded) { @@ -217,6 +217,7 @@ CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filen } font->shadow_offset = shadow; + font->shadow_alpha = shadow_alpha; return font; } @@ -631,7 +632,7 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect& position if (shadow_offset) { for (size_t i = 0; i < page->render_positions.size(); ++i) page->render_positions[i] += core::vector2di(shadow_offset, shadow_offset); - Driver->draw2DImageBatch(page->texture, page->render_positions, page->render_source_rects, clip, video::SColor(255, 0, 0, 0), true); + Driver->draw2DImageBatch(page->texture, page->render_positions, page->render_source_rects, clip, video::SColor(shadow_alpha,0,0,0), true); for (size_t i = 0; i < page->render_positions.size(); ++i) page->render_positions[i] -= core::vector2di(shadow_offset, shadow_offset); } diff --git a/src/cguittfont/CGUITTFont.h b/src/cguittfont/CGUITTFont.h index a58873da6..e24d8f18b 100644 --- a/src/cguittfont/CGUITTFont.h +++ b/src/cguittfont/CGUITTFont.h @@ -207,7 +207,7 @@ namespace gui //! \param antialias set the use_monochrome (opposite to antialias) flag //! \param transparency set the use_transparency flag //! \return Returns a pointer to a CGUITTFont. Will return 0 if the font failed to load. - static CGUITTFont* createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true, const u32 shadow = 0); + static CGUITTFont* createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true, const u32 shadow = 0, const u32 shadow_alpha = 255); static CGUITTFont* createTTFont(IrrlichtDevice *device, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); static CGUITTFont* create(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); static CGUITTFont* create(IrrlichtDevice *device, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true); @@ -370,6 +370,7 @@ namespace gui s32 GlobalKerningHeight; core::ustring Invisible; u32 shadow_offset; + u32 shadow_alpha; }; } // end namespace gui diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index a217fda40..e93c1d4c8 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -155,11 +155,13 @@ void set_default_settings(Settings *settings) settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "liberationsans.ttf")); settings->setDefault("font_size", "13"); settings->setDefault("font_shadow", "1"); + settings->setDefault("font_shadow_alpha", "128"); settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "liberationmono.ttf")); settings->setDefault("mono_font_size", "13"); settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf")); settings->setDefault("fallback_font_size", "13"); settings->setDefault("fallback_font_shadow", "1"); + settings->setDefault("fallback_font_shadow_alpha", "128"); #else settings->setDefault("freetype", "false"); settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "fontlucida.png")); diff --git a/src/main.cpp b/src/main.cpp index 480e885c2..8186e26c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1477,7 +1477,8 @@ int main(int argc, char *argv[]) u16 font_size = g_settings->getU16(fallback + "font_size"); font_path = g_settings->get(fallback + "font_path"); u32 font_shadow = g_settings->getU16(fallback + "font_shadow"); - font = gui::CGUITTFont::createTTFont(guienv, font_path.c_str(), font_size, true, true, font_shadow); + u32 font_shadow_alpha = g_settings->getU16(fallback + "font_shadow_alpha"); + font = gui::CGUITTFont::createTTFont(guienv, font_path.c_str(), font_size, true, true, font_shadow, font_shadow_alpha); } else { font = guienv->getFont(font_path.c_str()); } From e9e9fd7c3f12bc5119b567ad37527d777859dbc0 Mon Sep 17 00:00:00 2001 From: sapier Date: Tue, 3 Dec 2013 23:32:03 +0100 Subject: [PATCH 188/198] Replace SimpleThread by JThread now implementing same features --- src/client.cpp | 7 +++---- src/client.h | 2 +- src/connection.cpp | 4 ++-- src/connection.h | 8 ++++---- src/emerge.cpp | 25 ++++++++----------------- src/emerge.h | 2 +- src/httpfetch.cpp | 11 ++++------- src/server.cpp | 15 +++++++-------- src/util/thread.h | 44 -------------------------------------------- 9 files changed, 30 insertions(+), 88 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index ee63cf7c8..b3030991b 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -177,7 +177,7 @@ void * MeshUpdateThread::Thread() BEGIN_DEBUG_EXCEPTION_HANDLER - while(getRun()) + while(!StopRequested()) { /*// Wait for output queue to flush. // Allow 2 in queue, this makes less frametime jitter. @@ -302,9 +302,8 @@ Client::~Client() m_con.Disconnect(); } - m_mesh_update_thread.setRun(false); - while(m_mesh_update_thread.IsRunning()) - sleep_ms(100); + m_mesh_update_thread.Stop(); + m_mesh_update_thread.Wait(); while(!m_mesh_update_thread.m_queue_out.empty()) { MeshUpdateResult r = m_mesh_update_thread.m_queue_out.pop_front(); delete r.mesh; diff --git a/src/client.h b/src/client.h index 5969adc8e..a74668d5b 100644 --- a/src/client.h +++ b/src/client.h @@ -103,7 +103,7 @@ struct MeshUpdateResult } }; -class MeshUpdateThread : public SimpleThread +class MeshUpdateThread : public JThread { public: diff --git a/src/connection.cpp b/src/connection.cpp index 42262846f..8f83f6219 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -556,7 +556,7 @@ Connection::Connection(u32 protocol_id, u32 max_packet_size, float timeout, Connection::~Connection() { - stop(); + Stop(); // Delete peers for(std::map::iterator j = m_peers.begin(); @@ -578,7 +578,7 @@ void * Connection::Thread() u32 curtime = porting::getTimeMs(); u32 lasttime = curtime; - while(getRun()) + while(!StopRequested()) { BEGIN_DEBUG_EXCEPTION_HANDLER diff --git a/src/connection.h b/src/connection.h index a1d564849..56badc904 100644 --- a/src/connection.h +++ b/src/connection.h @@ -450,11 +450,11 @@ struct ConnectionEvent return "CONNEVENT_NONE"; case CONNEVENT_DATA_RECEIVED: return "CONNEVENT_DATA_RECEIVED"; - case CONNEVENT_PEER_ADDED: + case CONNEVENT_PEER_ADDED: return "CONNEVENT_PEER_ADDED"; - case CONNEVENT_PEER_REMOVED: + case CONNEVENT_PEER_REMOVED: return "CONNEVENT_PEER_REMOVED"; - case CONNEVENT_BIND_FAILED: + case CONNEVENT_BIND_FAILED: return "CONNEVENT_BIND_FAILED"; } return "Invalid ConnectionEvent"; @@ -544,7 +544,7 @@ struct ConnectionCommand } }; -class Connection: public SimpleThread +class Connection: public JThread { public: Connection(u32 protocol_id, u32 max_packet_size, float timeout, bool ipv6); diff --git a/src/emerge.cpp b/src/emerge.cpp index 6635a6518..ff00a0b62 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mapgen_math.h" -class EmergeThread : public SimpleThread +class EmergeThread : public JThread { public: Server *m_server; @@ -61,26 +61,17 @@ public: std::queue blockqueue; EmergeThread(Server *server, int ethreadid): - SimpleThread(), + JThread(), m_server(server), map(NULL), emerge(NULL), mapgen(NULL), + enable_mapgen_debug_info(false), id(ethreadid) { } void *Thread(); - - void trigger() - { - setRun(true); - if(IsRunning() == false) - { - Start(); - } - } - bool popBlockEmerge(v3s16 *pos, u8 *flags); bool getBlockOrStartGen(v3s16 p, MapBlock **b, BlockMakeData *data, bool allow_generate); @@ -137,9 +128,9 @@ EmergeManager::EmergeManager(IGameDef *gamedef) { EmergeManager::~EmergeManager() { for (unsigned int i = 0; i != emergethread.size(); i++) { - emergethread[i]->setRun(false); + emergethread[i]->Stop(); emergethread[i]->qevent.signal(); - emergethread[i]->stop(); + emergethread[i]->Wait(); delete emergethread[i]; delete mapgen[i]; } @@ -261,9 +252,9 @@ Mapgen *EmergeManager::getCurrentMapgen() { } -void EmergeManager::triggerAllThreads() { +void EmergeManager::startAllThreads() { for (unsigned int i = 0; i != emergethread.size(); i++) - emergethread[i]->trigger(); + emergethread[i]->Start(); } @@ -499,7 +490,7 @@ void *EmergeThread::Thread() { mapgen = emerge->mapgen[id]; enable_mapgen_debug_info = emerge->mapgen_debug_info; - while (getRun()) + while (!StopRequested()) try { if (!popBlockEmerge(&p, &flags)) { qevent.wait(); diff --git a/src/emerge.h b/src/emerge.h index d5bb72f85..b2b00adc9 100644 --- a/src/emerge.h +++ b/src/emerge.h @@ -119,7 +119,7 @@ public: Mapgen *createMapgen(std::string mgname, int mgid, MapgenParams *mgparams); MapgenParams *createMapgenParams(std::string mgname); - void triggerAllThreads(); + void startAllThreads(); bool enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate); void registerMapgen(std::string name, MapgenFactory *mgfactory); diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 64e77bc54..12e203ef2 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -319,7 +319,7 @@ struct HTTPFetchOngoing } }; -class CurlFetchThread : public SimpleThread +class CurlFetchThread : public JThread { protected: enum RequestType { @@ -539,7 +539,6 @@ protected: void * Thread() { - ThreadStarted(); log_register_thread("CurlFetchThread"); DSTACK(__FUNCTION_NAME); @@ -553,7 +552,7 @@ protected: assert(m_all_ongoing.empty()); - while (getRun()) { + while (!StopRequested()) { BEGIN_DEBUG_EXCEPTION_HANDLER /* @@ -641,9 +640,9 @@ void httpfetch_cleanup() { verbosestream<<"httpfetch_cleanup: cleaning up"<setRun(false); + g_httpfetch_thread->Stop(); g_httpfetch_thread->requestWakeUp(); - g_httpfetch_thread->stop(); + g_httpfetch_thread->Wait(); delete g_httpfetch_thread; curl_global_cleanup(); @@ -652,8 +651,6 @@ void httpfetch_cleanup() void httpfetch_async(const HTTPFetchRequest &fetchrequest) { g_httpfetch_thread->requestFetch(fetchrequest); - if (!g_httpfetch_thread->IsRunning()) - g_httpfetch_thread->Start(); } static void httpfetch_request_clear(unsigned long caller) diff --git a/src/server.cpp b/src/server.cpp index 1455de721..c1cedf0f3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -73,14 +73,14 @@ public: {} }; -class ServerThread : public SimpleThread +class ServerThread : public JThread { Server *m_server; public: ServerThread(Server *server): - SimpleThread(), + JThread(), m_server(server) { } @@ -98,7 +98,7 @@ void * ServerThread::Thread() BEGIN_DEBUG_EXCEPTION_HANDLER - while(getRun()) + while(!StopRequested()) { try{ //TimeTaker timer("AsyncRunStep() + Receive()"); @@ -963,14 +963,13 @@ void Server::start(unsigned short port) infostream<<"Starting server on port "<stop(); + m_thread->Stop(); // Initialize connection m_con.SetTimeoutMs(30); m_con.Serve(port); // Start thread - m_thread->setRun(true); m_thread->Start(); // ASCII art for the win! @@ -993,9 +992,9 @@ void Server::stop() infostream<<"Server: Stopping and waiting threads"<setRun(false); + m_thread->Stop(); //m_emergethread.setRun(false); - m_thread->stop(); + m_thread->Wait(); //m_emergethread.stop(); infostream<<"Server: Threads stopped"<triggerAllThreads(); + m_emerge->startAllThreads(); // Update m_enable_rollback_recording here too m_enable_rollback_recording = diff --git a/src/util/thread.h b/src/util/thread.h index 3f5ef1199..bb8e03317 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -59,53 +59,9 @@ private: JMutex m_mutex; }; -/* - A base class for simple background thread implementation -*/ - -class SimpleThread : public JThread -{ - bool run; - JMutex run_mutex; - -public: - - SimpleThread(): - JThread(), - run(true) - { - } - - virtual ~SimpleThread() - {} - - virtual void * Thread() = 0; - - bool getRun() - { - JMutexAutoLock lock(run_mutex); - return run; - } - void setRun(bool a_run) - { - JMutexAutoLock lock(run_mutex); - run = a_run; - } - - void stop() - { - setRun(false); - while(IsRunning()) - sleep_ms(100); - } -}; - /* A single worker thread - multiple client threads queue framework. */ - - - template class GetResult { From 848f80b2e53155c76f598c2f7e0ebaff1faea8dc Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 30 Jun 2013 18:17:14 +0300 Subject: [PATCH 189/198] Directional fog + horizon colors, based on sun & moon positions at sunrise / sunset --- src/game.cpp | 2 +- src/sky.cpp | 77 ++++++++++++++++++++++++++++++++++++++-------------- src/sky.h | 41 ++++++++++++++++++++++++++-- 3 files changed, 96 insertions(+), 24 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index e1424c9dd..cc5d3d81d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1318,7 +1318,7 @@ void the_game( */ Sky *sky = NULL; - sky = new Sky(smgr->getRootSceneNode(), smgr, -1); + sky = new Sky(smgr->getRootSceneNode(), smgr, -1, client.getEnv().getLocalPlayer()); /* A copy of the local inventory diff --git a/src/sky.cpp b/src/sky.cpp index e55dd1eb2..a9fb90122 100644 --- a/src/sky.cpp +++ b/src/sky.cpp @@ -8,16 +8,18 @@ #include "main.h" // g_profiler #include "profiler.h" #include "util/numeric.h" // MYMIN +#include //! constructor -Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id): +Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlayer* player): scene::ISceneNode(parent, mgr, id), m_first_update(true), m_brightness(0.5), m_cloud_brightness(0.5), m_bgcolor_bright_f(1,1,1,1), m_skycolor_bright_f(1,1,1,1), - m_cloudcolor_bright_f(1,1,1,1) + m_cloudcolor_bright_f(1,1,1,1), + m_player(player) { setAutomaticCulling(scene::EAC_OFF); Box.MaxEdge.set(0,0,0); @@ -431,7 +433,8 @@ void Sky::update(float time_of_day, float time_brightness, video::SColor(255, 240,240,255); //video::SColorf cloudcolor_bright_dawn_f(1.0, 0.591, 0.4); //video::SColorf cloudcolor_bright_dawn_f(1.0, 0.65, 0.44); - video::SColorf cloudcolor_bright_dawn_f(1.0, 0.7, 0.5); + //video::SColorf cloudcolor_bright_dawn_f(1.0, 0.7, 0.5); + video::SColorf cloudcolor_bright_dawn_f(1.0, 0.875, 0.75); float cloud_color_change_fraction = 0.95; if(sunlight_seen){ @@ -470,41 +473,73 @@ void Sky::update(float time_of_day, float time_brightness, } else { m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated( bgcolor_bright_indoor_f, color_change_fraction); - m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated( - cloudcolor_bright_normal_f, color_change_fraction); m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated( bgcolor_bright_indoor_f, color_change_fraction); + m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated( + cloudcolor_bright_normal_f, color_change_fraction); m_clouds_visible = false; } + + // Horizon coloring based on sun and moon direction during sunset and sunrise + video::SColor pointcolor = video::SColor(255, 255, 255, m_bgcolor.getAlpha()); + if (m_horizon_blend() != 0) + { + // calculate hemisphere value from yaw + f32 pointcolor_blend = wrapDegrees_0_360(m_player->getYaw() + 90); + if (pointcolor_blend > 180) + pointcolor_blend = 360 - pointcolor_blend; + pointcolor_blend /= 180; + // bound view angle to determine where transition starts and ends + pointcolor_blend = rangelim(1 - pointcolor_blend * 1.375, 0, 1 / 1.375) * 1.375; + // combine the colors when looking up or down, otherwise turning looks weird + pointcolor_blend += (0.5 - pointcolor_blend) * (1 - MYMIN((90 - std::abs(m_player->getPitch())) / 90 * 1.5, 1)); + // invert direction to match where the sun and moon are rising + if (m_time_of_day > 0.5) + pointcolor_blend = 1 - pointcolor_blend; + + // horizon colors of sun and moon + f32 pointcolor_light = rangelim(m_time_brightness * 3, 0.2, 1); + video::SColorf pointcolor_sun_f(1, 1, 1, 1); + pointcolor_sun_f.r = pointcolor_light * 1; + pointcolor_sun_f.b = pointcolor_light * (0.25 + (rangelim(m_time_brightness, 0.25, 0.75) - 0.25) * 2 * 0.75); + pointcolor_sun_f.g = pointcolor_light * (pointcolor_sun_f.b * 0.375 + (rangelim(m_time_brightness, 0.05, 0.15) - 0.05) * 10 * 0.625); + video::SColorf pointcolor_moon_f(0.5 * pointcolor_light, 0.6 * pointcolor_light, 0.8 * pointcolor_light, 1); + video::SColor pointcolor_sun = pointcolor_sun_f.toSColor(); + video::SColor pointcolor_moon = pointcolor_moon_f.toSColor(); + // calculate the blend color + pointcolor = m_mix_scolor(pointcolor_moon, pointcolor_sun, pointcolor_blend); + } + video::SColor bgcolor_bright = m_bgcolor_bright_f.toSColor(); m_bgcolor = video::SColor( - 255, - bgcolor_bright.getRed() * m_brightness, - bgcolor_bright.getGreen() * m_brightness, - bgcolor_bright.getBlue() * m_brightness); - + 255, + bgcolor_bright.getRed() * m_brightness, + bgcolor_bright.getGreen() * m_brightness, + bgcolor_bright.getBlue() * m_brightness); + m_bgcolor = m_mix_scolor(m_bgcolor, pointcolor, m_horizon_blend() * 0.5); + video::SColor skycolor_bright = m_skycolor_bright_f.toSColor(); m_skycolor = video::SColor( - 255, - skycolor_bright.getRed() * m_brightness, - skycolor_bright.getGreen() * m_brightness, - skycolor_bright.getBlue() * m_brightness); - + 255, + skycolor_bright.getRed() * m_brightness, + skycolor_bright.getGreen() * m_brightness, + skycolor_bright.getBlue() * m_brightness); + m_skycolor = m_mix_scolor(m_skycolor, pointcolor, m_horizon_blend() * 0.25); + float cloud_direct_brightness = 0; if(sunlight_seen){ - cloud_direct_brightness = time_brightness; - if(time_brightness >= 0.2 && time_brightness < 0.7) - cloud_direct_brightness *= 1.3; + cloud_direct_brightness = MYMIN(m_horizon_blend() * 0.15 + m_time_brightness, 1); } else { cloud_direct_brightness = direct_brightness; } m_cloud_brightness = m_cloud_brightness * cloud_color_change_fraction + cloud_direct_brightness * (1.0 - cloud_color_change_fraction); m_cloudcolor_f = video::SColorf( - m_cloudcolor_bright_f.getRed() * m_cloud_brightness, - m_cloudcolor_bright_f.getGreen() * m_cloud_brightness, - m_cloudcolor_bright_f.getBlue() * m_cloud_brightness, + m_cloudcolor_bright_f.r * m_cloud_brightness, + m_cloudcolor_bright_f.g * m_cloud_brightness, + m_cloudcolor_bright_f.b * m_cloud_brightness, 1.0); + m_cloudcolor_f = m_mix_scolorf(m_cloudcolor_f, video::SColorf(pointcolor), m_horizon_blend() * 0.75); } diff --git a/src/sky.h b/src/sky.h index 7b7295e4e..35c86db93 100644 --- a/src/sky.h +++ b/src/sky.h @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irrlichttypes_extrabloated.h" #include +#include "localplayer.h" #ifndef SKY_HEADER #define SKY_HEADER @@ -31,7 +32,7 @@ class Sky : public scene::ISceneNode { public: //! constructor - Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id); + Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlayer* player); virtual void OnRegisterSceneNode(); @@ -61,7 +62,42 @@ public: private: core::aabbox3d Box; video::SMaterial m_materials[SKY_MATERIAL_COUNT]; - + + // How much sun & moon transition should affect horizon color + float m_horizon_blend() + { + if (!m_sunlight_seen) + return 0; + float x; m_time_of_day >= 0.5 ? x = (1 - m_time_of_day) * 2 : x = m_time_of_day * 2; + if (x <= 0.3) + return 0; + if (x <= 0.4) // when the sun and moon are aligned + return (x - 0.3) * 10; + if (x <= 0.5) + return (0.5 - x) * 10; + return 0; + } + + // Mix two colors by a given amount + video::SColor m_mix_scolor(video::SColor col1, video::SColor col2, f32 factor) + { + video::SColor result = video::SColor( + col1.getAlpha() * (1 - factor) + col2.getAlpha() * factor, + col1.getRed() * (1 - factor) + col2.getRed() * factor, + col1.getGreen() * (1 - factor) + col2.getGreen() * factor, + col1.getBlue() * (1 - factor) + col2.getBlue() * factor); + return result; + } + video::SColorf m_mix_scolorf(video::SColorf col1, video::SColorf col2, f32 factor) + { + video::SColorf result = video::SColorf( + col1.r * (1 - factor) + col2.r * factor, + col1.g * (1 - factor) + col2.g * factor, + col1.b * (1 - factor) + col2.b * factor, + col1.a * (1 - factor) + col2.a * factor); + return result; + } + bool m_first_update; float m_time_of_day; float m_time_brightness; @@ -78,6 +114,7 @@ private: v3f m_stars[SKY_STAR_COUNT]; u16 m_star_indices[SKY_STAR_COUNT*4]; video::S3DVertex m_star_vertices[SKY_STAR_COUNT*4]; + LocalPlayer* m_player; }; #endif From c120ea57c992ff2faf2fbf9e94846e912994e06f Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 15 Dec 2013 15:30:02 +0100 Subject: [PATCH 190/198] Add setting to disable direction dependent fog and sky colors --- minetest.conf.example | 19 +++++----- src/defaultsettings.cpp | 3 +- src/sky.cpp | 78 +++++++++++++++++++++++++---------------- src/sky.h | 1 + 4 files changed, 61 insertions(+), 40 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index b7f4b24a7..fbbec2301 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -22,16 +22,15 @@ # Client and server # - # Name of player; on a server this is the main admin -#name = +#name = # # Client stuff # # Port to connect to (UDP) -#remote_port = +#remote_port = # Key mappings # See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3 #keymap_forward = KEY_KEY_W @@ -83,7 +82,7 @@ #vsync = false #fov = 72 # Address to connect to (#blank = start local server) -#address = +#address = # Enable random user input, for testing #random_input = false # Timeout for client to remove unused map data from memory @@ -116,7 +115,7 @@ # disable for speed or for different looks. #smooth_lighting = true # Path to texture directory. All textures are first searched from here. -#texture_path = +#texture_path = # Video back-end. # Possible values: null, software, burningsvideo, direct3d8, direct3d9, opengl #video_driver = opengl @@ -190,6 +189,8 @@ # The time in seconds it takes between repeated # right clicks when holding the right mouse button #repeat_rightclick_time = 0.25 +# Make fog and sky colors depend on daytime (dawn/sunset) and view direction +#directional_colored_fog = true # Default timeout for cURL, in milliseconds # Only has an effect if compiled with cURL @@ -228,7 +229,7 @@ # Server stuff # # Network port to listen (UDP) -#port = +#port = # Name of server #server_name = Minetest server # Description of server @@ -262,7 +263,7 @@ # Gives some stuff to players at the beginning #give_initial_stuff = false # New users need to input this password -#default_password = +#default_password = # Available privileges: interact, shout, teleport, settime, privs, ... # See /privs in game for a full list on your server and mod configuration. #default_privs = interact, shout @@ -278,7 +279,7 @@ #disable_anticheat = false # If true, actions are recorded for rollback #enable_rollback_recording = false -# If true, blocks are cached (and generated if not before) before a player is spawned. +# If true, blocks are cached (and generated if not before) before a player is spawned. #cache_block_before_spawn = true # Defines the maximum height a player can spawn in a map, above water level #max_spawn_height = 50 @@ -342,7 +343,7 @@ #emergequeue_limit_diskonly = # Maximum number of blocks to be queued that are to be generated. # Leave blank for an appropriate amount to be chosen automatically. -#emergequeue_limit_generate = +#emergequeue_limit_generate = # Number of emerge threads to use. Make this field blank, or increase this number, to use multiple threads. # On multiprocessor systems, this will improve mapgen speed greatly, at the cost of slightly buggy caves. #num_emerge_threads = 1 diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index e93c1d4c8..5a1dabebf 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -59,6 +59,7 @@ void set_default_settings(Settings *settings) settings->setDefault("aux1_descends", "false"); settings->setDefault("doubletap_jump", "false"); settings->setDefault("always_fly_fast", "true"); + settings->setDefault("directional_colored_fog", "true"); // Some (temporary) keys for debugging settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P"); @@ -268,7 +269,7 @@ void set_default_settings(Settings *settings) settings->setDefault("mgv7_np_terrain_alt", "4, 25, (600, 600, 600), 5934, 5, 0.6"); settings->setDefault("mgv7_np_terrain_persist", "0.6, 0.1, (500, 500, 500), 539, 3, 0.6"); settings->setDefault("mgv7_np_height_select", "-0.5, 1, (250, 250, 250), 4213, 5, 0.69"); - settings->setDefault("mgv7_np_filler_depth", "0, 1.2, (150, 150, 150), 261, 4, 0.7"); + settings->setDefault("mgv7_np_filler_depth", "0, 1.2, (150, 150, 150), 261, 4, 0.7"); settings->setDefault("mgv7_np_mount_height", "100, 30, (500, 500, 500), 72449, 4, 0.6"); settings->setDefault("mgv7_np_ridge_uwater", "0, 1, (500, 500, 500), 85039, 4, 0.6"); settings->setDefault("mgv7_np_mountain", "0, 1, (250, 350, 250), 5333, 5, 0.68"); diff --git a/src/sky.cpp b/src/sky.cpp index a9fb90122..efc3cc3c7 100644 --- a/src/sky.cpp +++ b/src/sky.cpp @@ -9,6 +9,7 @@ #include "profiler.h" #include "util/numeric.h" // MYMIN #include +#include "settings.h" //! constructor Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlayer* player): @@ -56,6 +57,8 @@ Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlay ); m_stars[i].normalize(); } + + m_directional_colored_fog = g_settings->getBool("directional_colored_fog"); } void Sky::OnRegisterSceneNode() @@ -482,32 +485,34 @@ void Sky::update(float time_of_day, float time_brightness, // Horizon coloring based on sun and moon direction during sunset and sunrise video::SColor pointcolor = video::SColor(255, 255, 255, m_bgcolor.getAlpha()); - if (m_horizon_blend() != 0) - { - // calculate hemisphere value from yaw - f32 pointcolor_blend = wrapDegrees_0_360(m_player->getYaw() + 90); - if (pointcolor_blend > 180) - pointcolor_blend = 360 - pointcolor_blend; - pointcolor_blend /= 180; - // bound view angle to determine where transition starts and ends - pointcolor_blend = rangelim(1 - pointcolor_blend * 1.375, 0, 1 / 1.375) * 1.375; - // combine the colors when looking up or down, otherwise turning looks weird - pointcolor_blend += (0.5 - pointcolor_blend) * (1 - MYMIN((90 - std::abs(m_player->getPitch())) / 90 * 1.5, 1)); - // invert direction to match where the sun and moon are rising - if (m_time_of_day > 0.5) - pointcolor_blend = 1 - pointcolor_blend; + if (m_directional_colored_fog) { + if (m_horizon_blend() != 0) + { + // calculate hemisphere value from yaw + f32 pointcolor_blend = wrapDegrees_0_360(m_player->getYaw() + 90); + if (pointcolor_blend > 180) + pointcolor_blend = 360 - pointcolor_blend; + pointcolor_blend /= 180; + // bound view angle to determine where transition starts and ends + pointcolor_blend = rangelim(1 - pointcolor_blend * 1.375, 0, 1 / 1.375) * 1.375; + // combine the colors when looking up or down, otherwise turning looks weird + pointcolor_blend += (0.5 - pointcolor_blend) * (1 - MYMIN((90 - std::abs(m_player->getPitch())) / 90 * 1.5, 1)); + // invert direction to match where the sun and moon are rising + if (m_time_of_day > 0.5) + pointcolor_blend = 1 - pointcolor_blend; - // horizon colors of sun and moon - f32 pointcolor_light = rangelim(m_time_brightness * 3, 0.2, 1); - video::SColorf pointcolor_sun_f(1, 1, 1, 1); - pointcolor_sun_f.r = pointcolor_light * 1; - pointcolor_sun_f.b = pointcolor_light * (0.25 + (rangelim(m_time_brightness, 0.25, 0.75) - 0.25) * 2 * 0.75); - pointcolor_sun_f.g = pointcolor_light * (pointcolor_sun_f.b * 0.375 + (rangelim(m_time_brightness, 0.05, 0.15) - 0.05) * 10 * 0.625); - video::SColorf pointcolor_moon_f(0.5 * pointcolor_light, 0.6 * pointcolor_light, 0.8 * pointcolor_light, 1); - video::SColor pointcolor_sun = pointcolor_sun_f.toSColor(); - video::SColor pointcolor_moon = pointcolor_moon_f.toSColor(); - // calculate the blend color - pointcolor = m_mix_scolor(pointcolor_moon, pointcolor_sun, pointcolor_blend); + // horizon colors of sun and moon + f32 pointcolor_light = rangelim(m_time_brightness * 3, 0.2, 1); + video::SColorf pointcolor_sun_f(1, 1, 1, 1); + pointcolor_sun_f.r = pointcolor_light * 1; + pointcolor_sun_f.b = pointcolor_light * (0.25 + (rangelim(m_time_brightness, 0.25, 0.75) - 0.25) * 2 * 0.75); + pointcolor_sun_f.g = pointcolor_light * (pointcolor_sun_f.b * 0.375 + (rangelim(m_time_brightness, 0.05, 0.15) - 0.05) * 10 * 0.625); + video::SColorf pointcolor_moon_f(0.5 * pointcolor_light, 0.6 * pointcolor_light, 0.8 * pointcolor_light, 1); + video::SColor pointcolor_sun = pointcolor_sun_f.toSColor(); + video::SColor pointcolor_moon = pointcolor_moon_f.toSColor(); + // calculate the blend color + pointcolor = m_mix_scolor(pointcolor_moon, pointcolor_sun, pointcolor_blend); + } } video::SColor bgcolor_bright = m_bgcolor_bright_f.toSColor(); @@ -516,7 +521,9 @@ void Sky::update(float time_of_day, float time_brightness, bgcolor_bright.getRed() * m_brightness, bgcolor_bright.getGreen() * m_brightness, bgcolor_bright.getBlue() * m_brightness); - m_bgcolor = m_mix_scolor(m_bgcolor, pointcolor, m_horizon_blend() * 0.5); + if (m_directional_colored_fog) { + m_bgcolor = m_mix_scolor(m_bgcolor, pointcolor, m_horizon_blend() * 0.5); + } video::SColor skycolor_bright = m_skycolor_bright_f.toSColor(); m_skycolor = video::SColor( @@ -524,11 +531,20 @@ void Sky::update(float time_of_day, float time_brightness, skycolor_bright.getRed() * m_brightness, skycolor_bright.getGreen() * m_brightness, skycolor_bright.getBlue() * m_brightness); - m_skycolor = m_mix_scolor(m_skycolor, pointcolor, m_horizon_blend() * 0.25); + if (m_directional_colored_fog) { + m_skycolor = m_mix_scolor(m_skycolor, pointcolor, m_horizon_blend() * 0.25); + } float cloud_direct_brightness = 0; - if(sunlight_seen){ - cloud_direct_brightness = MYMIN(m_horizon_blend() * 0.15 + m_time_brightness, 1); + if(sunlight_seen) { + if (!m_directional_colored_fog) { + cloud_direct_brightness = time_brightness; + if(time_brightness >= 0.2 && time_brightness < 0.7) + cloud_direct_brightness *= 1.3; + } + else { + cloud_direct_brightness = MYMIN(m_horizon_blend() * 0.15 + m_time_brightness, 1); + } } else { cloud_direct_brightness = direct_brightness; } @@ -539,7 +555,9 @@ void Sky::update(float time_of_day, float time_brightness, m_cloudcolor_bright_f.g * m_cloud_brightness, m_cloudcolor_bright_f.b * m_cloud_brightness, 1.0); - m_cloudcolor_f = m_mix_scolorf(m_cloudcolor_f, video::SColorf(pointcolor), m_horizon_blend() * 0.75); + if (m_directional_colored_fog) { + m_cloudcolor_f = m_mix_scolorf(m_cloudcolor_f, video::SColorf(pointcolor), m_horizon_blend() * 0.75); + } } diff --git a/src/sky.h b/src/sky.h index 35c86db93..9de9d9947 100644 --- a/src/sky.h +++ b/src/sky.h @@ -105,6 +105,7 @@ private: float m_brightness; float m_cloud_brightness; bool m_clouds_visible; + bool m_directional_colored_fog; video::SColorf m_bgcolor_bright_f; video::SColorf m_skycolor_bright_f; video::SColorf m_cloudcolor_bright_f; From 5fd92d67d5c2239dca0808069c53b92d2d113b70 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 15 Dec 2013 19:15:25 +0100 Subject: [PATCH 191/198] Remove an unused function and include from client.cpp --- src/client.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index b3030991b..09c940a7a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -51,15 +51,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/pointedthing.h" #include "version.h" -#if USE_CURL -#include -#endif - -static std::string getMediaCacheDir() -{ - return porting::path_user + DIR_DELIM + "cache" + DIR_DELIM + "media"; -} - /* QueuedMeshUpdate */ From 3946d2a504fd1b4c11f11205ef9f60f40f52942b Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 16 Dec 2013 00:16:06 +0100 Subject: [PATCH 192/198] Reduce cloud coloring for colored fog and cloud mode --- src/sky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sky.cpp b/src/sky.cpp index efc3cc3c7..e8fd3a1d8 100644 --- a/src/sky.cpp +++ b/src/sky.cpp @@ -556,7 +556,7 @@ void Sky::update(float time_of_day, float time_brightness, m_cloudcolor_bright_f.b * m_cloud_brightness, 1.0); if (m_directional_colored_fog) { - m_cloudcolor_f = m_mix_scolorf(m_cloudcolor_f, video::SColorf(pointcolor), m_horizon_blend() * 0.75); + m_cloudcolor_f = m_mix_scolorf(m_cloudcolor_f, video::SColorf(pointcolor), m_horizon_blend() * 0.25); } } From c9ac9992c7a8addc4839fdcc379cc2a757c60fc0 Mon Sep 17 00:00:00 2001 From: BlockMen Date: Mon, 16 Dec 2013 01:13:08 +0100 Subject: [PATCH 193/198] Fix MSVC compiling issue --- src/httpfetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 12e203ef2..6c073c8e6 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -17,6 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "socket.h" // for select() #include "httpfetch.h" #include #include @@ -30,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "util/container.h" #include "util/thread.h" -#include "socket.h" // for select() JMutex g_httpfetch_mutex; std::map > g_httpfetch_results; From 54dbd78f90543c22ad2c37c7117a50575b62301d Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 16 Dec 2013 23:31:56 +0100 Subject: [PATCH 194/198] Fix broken httpfetch due to SimpleThread removal --- src/httpfetch.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 6c073c8e6..b48d00764 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -539,6 +539,7 @@ protected: void * Thread() { + ThreadStarted(); log_register_thread("CurlFetchThread"); DSTACK(__FUNCTION_NAME); @@ -651,6 +652,8 @@ void httpfetch_cleanup() void httpfetch_async(const HTTPFetchRequest &fetchrequest) { g_httpfetch_thread->requestFetch(fetchrequest); + if (!g_httpfetch_thread->IsRunning()) + g_httpfetch_thread->Start(); } static void httpfetch_request_clear(unsigned long caller) From 38d112033b3ba0ea0360fced334a279576aafc5d Mon Sep 17 00:00:00 2001 From: BlockMen Date: Tue, 17 Dec 2013 01:13:16 +0100 Subject: [PATCH 195/198] Fix formspec field labels --- src/guiFormSpecMenu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index eb0e63806..6f98b3d4f 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -843,7 +843,7 @@ void GUIFormSpecMenu::parsePwdField(parserData* data,std::string element) { Environment->setFocus(e); } - if (label.length() > 1) + if (label.length() >= 1) { rect.UpperLeftCorner.Y -= 15; rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 15; @@ -934,7 +934,7 @@ void GUIFormSpecMenu::parseSimpleField(parserData* data,std::vector evt.KeyInput.PressedDown = true; e->OnEvent(evt); - if (label.length() > 1) + if (label.length() >= 1) { rect.UpperLeftCorner.Y -= 15; rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 15; @@ -1026,7 +1026,7 @@ void GUIFormSpecMenu::parseTextArea(parserData* data,std::vector& p e->OnEvent(evt); } - if (label.length() > 1) + if (label.length() >= 1) { rect.UpperLeftCorner.Y -= 15; rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 15; From 49cec3f78240ed6310a9b5dd05ce09a79ed5a12e Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 18 Dec 2013 16:35:55 -0500 Subject: [PATCH 196/198] Handle LuaErrors in Lua -> C++ calls on LuaJIT --- src/cmake_config.h.in | 1 + src/config.h | 3 + src/exceptions.h | 115 ++++++++++------------------- src/game.cpp | 10 +-- src/script/common/c_content.cpp | 2 +- src/script/common/c_internal.cpp | 12 +++ src/script/common/c_internal.h | 1 + src/script/common/c_types.cpp | 8 +- src/script/common/c_types.h | 5 +- src/script/cpp_api/s_base.cpp | 11 +++ src/script/cpp_api/s_inventory.cpp | 6 +- src/script/cpp_api/s_nodemeta.cpp | 6 +- src/script/cpp_api/s_server.cpp | 12 +-- src/script/lua_api/l_base.h | 2 +- src/script/lua_api/l_craft.cpp | 28 +++---- src/script/lua_api/l_item.cpp | 4 +- src/script/lua_api/l_noise.cpp | 4 +- src/server.h | 17 ----- 18 files changed, 113 insertions(+), 134 deletions(-) diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index 7cc2fb99e..75e448f79 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -12,6 +12,7 @@ #define CMAKE_USE_FREETYPE @USE_FREETYPE@ #define CMAKE_STATIC_SHAREDIR "@SHAREDIR@" #define CMAKE_USE_LEVELDB @USE_LEVELDB@ +#define CMAKE_USE_LUAJIT @USE_LUAJIT@ #ifdef NDEBUG #define CMAKE_BUILD_TYPE "Release" diff --git a/src/config.h b/src/config.h index 652c9008a..1c0aac4f2 100644 --- a/src/config.h +++ b/src/config.h @@ -14,6 +14,7 @@ #define USE_FREETYPE 0 #define STATIC_SHAREDIR "" #define USE_LEVELDB 0 +#define USE_LUAJIT 0 #ifdef USE_CMAKE_CONFIG_H #include "cmake_config.h" @@ -33,6 +34,8 @@ #define STATIC_SHAREDIR CMAKE_STATIC_SHAREDIR #undef USE_LEVELDB #define USE_LEVELDB CMAKE_USE_LEVELDB + #undef USE_LUAJIT + #define USE_LUAJIT CMAKE_USE_LUAJIT #endif #endif diff --git a/src/exceptions.h b/src/exceptions.h index 085b42417..6fb97f3ed 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -21,132 +21,99 @@ with this program; if not, write to the Free Software Foundation, Inc., #define EXCEPTIONS_HEADER #include +#include + class BaseException : public std::exception { public: - BaseException(const char *s) + BaseException(const std::string s) throw() { m_s = s; } + ~BaseException() throw() {} virtual const char * what() const throw() { - return m_s; + return m_s.c_str(); } - const char *m_s; +protected: + std::string m_s; }; -class AsyncQueuedException : public BaseException -{ +class AsyncQueuedException : public BaseException { public: - AsyncQueuedException(const char *s): - BaseException(s) - {} + AsyncQueuedException(std::string s): BaseException(s) {} }; -class NotImplementedException : public BaseException -{ +class NotImplementedException : public BaseException { public: - NotImplementedException(const char *s): - BaseException(s) - {} + NotImplementedException(std::string s): BaseException(s) {} }; -class AlreadyExistsException : public BaseException -{ +class AlreadyExistsException : public BaseException { public: - AlreadyExistsException(const char *s): - BaseException(s) - {} + AlreadyExistsException(std::string s): BaseException(s) {} }; -class VersionMismatchException : public BaseException -{ +class VersionMismatchException : public BaseException { public: - VersionMismatchException(const char *s): - BaseException(s) - {} + VersionMismatchException(std::string s): BaseException(s) {} }; -class FileNotGoodException : public BaseException -{ +class FileNotGoodException : public BaseException { public: - FileNotGoodException(const char *s): - BaseException(s) - {} + FileNotGoodException(std::string s): BaseException(s) {} }; -class SerializationError : public BaseException -{ +class SerializationError : public BaseException { public: - SerializationError(const char *s): - BaseException(s) - {} + SerializationError(std::string s): BaseException(s) {} }; -class LoadError : public BaseException -{ +class LoadError : public BaseException { public: - LoadError(const char *s): - BaseException(s) - {} + LoadError(std::string s): BaseException(s) {} }; -class ContainerFullException : public BaseException -{ +class ContainerFullException : public BaseException { public: - ContainerFullException(const char *s): - BaseException(s) - {} + ContainerFullException(std::string s): BaseException(s) {} }; -class SettingNotFoundException : public BaseException -{ +class SettingNotFoundException : public BaseException { public: - SettingNotFoundException(const char *s): - BaseException(s) - {} + SettingNotFoundException(std::string s): BaseException(s) {} }; -class InvalidFilenameException : public BaseException -{ +class InvalidFilenameException : public BaseException { public: - InvalidFilenameException(const char *s): - BaseException(s) - {} + InvalidFilenameException(std::string s): BaseException(s) {} }; -class ProcessingLimitException : public BaseException -{ +class ProcessingLimitException : public BaseException { public: - ProcessingLimitException(const char *s): - BaseException(s) - {} + ProcessingLimitException(std::string s): BaseException(s) {} }; -class CommandLineError : public BaseException -{ +class CommandLineError : public BaseException { public: - CommandLineError(const char *s): - BaseException(s) - {} + CommandLineError(std::string s): BaseException(s) {} }; -class ItemNotFoundException : public BaseException -{ +class ItemNotFoundException : public BaseException { public: - ItemNotFoundException(const char *s): - BaseException(s) - {} + ItemNotFoundException(std::string s): BaseException(s) {} +}; + +class ServerError : public BaseException { +public: + ServerError(std::string s): BaseException(s) {} }; // Only used on Windows (SEH) -class FatalSystemException : public BaseException -{ +class FatalSystemException : public BaseException { public: - FatalSystemException(const char *s): - BaseException(s) - {} + FatalSystemException(std::string s): BaseException(s) {} }; /* @@ -159,7 +126,7 @@ public: InvalidPositionException(): BaseException("Somebody tried to get/set something in a nonexistent position.") {} - InvalidPositionException(const char *s): + InvalidPositionException(std::string s): BaseException(s) {} }; diff --git a/src/game.cpp b/src/game.cpp index cc5d3d81d..6f48870ad 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3438,14 +3438,12 @@ void the_game( L" running a different version of Minetest."; errorstream< +#include "exceptions.h" + struct EnumString { int num; @@ -50,7 +52,7 @@ public: } }; -class LuaError : public std::exception +class LuaError : public ServerError { public: LuaError(lua_State *L, const std::string &s); @@ -61,7 +63,6 @@ public: { return m_s.c_str(); } - std::string m_s; }; diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index b957dc64f..898271743 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -29,6 +29,9 @@ with this program; if not, write to the Free Software Foundation, Inc., extern "C" { #include "lualib.h" +#if USE_LUAJIT + #include "luajit.h" +#endif } #include @@ -73,6 +76,14 @@ ScriptApiBase::ScriptApiBase() lua_pushlightuserdata(m_luastack, this); lua_setfield(m_luastack, LUA_REGISTRYINDEX, "scriptapi"); + // If we are using LuaJIT add a C++ wrapper function to catch + // exceptions thrown in Lua -> C++ calls +#if USE_LUAJIT + lua_pushlightuserdata(m_luastack, (void*) script_exception_wrapper); + luaJIT_setmode(m_luastack, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON); + lua_pop(m_luastack, 1); +#endif + m_server = 0; m_environment = 0; m_guiengine = 0; diff --git a/src/script/cpp_api/s_inventory.cpp b/src/script/cpp_api/s_inventory.cpp index 4ee6e4be0..8542f0292 100644 --- a/src/script/cpp_api/s_inventory.cpp +++ b/src/script/cpp_api/s_inventory.cpp @@ -54,7 +54,7 @@ int ScriptApiDetached::detached_inventory_AllowMove( if(lua_pcall(L, 7, 1, errorhandler)) scriptError(); if(!lua_isnumber(L, -1)) - throw LuaError(L, "allow_move should return a number"); + throw LuaError(NULL, "allow_move should return a number"); int ret = luaL_checkinteger(L, -1); lua_pop(L, 2); // Pop integer and error handler return ret; @@ -86,7 +86,7 @@ int ScriptApiDetached::detached_inventory_AllowPut( if(lua_pcall(L, 5, 1, errorhandler)) scriptError(); if(!lua_isnumber(L, -1)) - throw LuaError(L, "allow_put should return a number"); + throw LuaError(NULL, "allow_put should return a number"); int ret = luaL_checkinteger(L, -1); lua_pop(L, 2); // Pop integer and error handler return ret; @@ -118,7 +118,7 @@ int ScriptApiDetached::detached_inventory_AllowTake( if(lua_pcall(L, 5, 1, errorhandler)) scriptError(); if(!lua_isnumber(L, -1)) - throw LuaError(L, "allow_take should return a number"); + throw LuaError(NULL, "allow_take should return a number"); int ret = luaL_checkinteger(L, -1); lua_pop(L, 2); // Pop integer and error handler return ret; diff --git a/src/script/cpp_api/s_nodemeta.cpp b/src/script/cpp_api/s_nodemeta.cpp index 1f04383f1..d8fd4dcfe 100644 --- a/src/script/cpp_api/s_nodemeta.cpp +++ b/src/script/cpp_api/s_nodemeta.cpp @@ -61,7 +61,7 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowMove(v3s16 p, scriptError(); lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) - throw LuaError(L, "allow_metadata_inventory_move should return a number"); + throw LuaError(NULL, "allow_metadata_inventory_move should return a number"); int num = luaL_checkinteger(L, -1); lua_pop(L, 1); // Pop integer return num; @@ -99,7 +99,7 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowPut(v3s16 p, scriptError(); lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) - throw LuaError(L, "allow_metadata_inventory_put should return a number"); + throw LuaError(NULL, "allow_metadata_inventory_put should return a number"); int num = luaL_checkinteger(L, -1); lua_pop(L, 1); // Pop integer return num; @@ -137,7 +137,7 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p, scriptError(); lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) - throw LuaError(L, "allow_metadata_inventory_take should return a number"); + throw LuaError(NULL, "allow_metadata_inventory_take should return a number"); int num = luaL_checkinteger(L, -1); lua_pop(L, 1); // Pop integer return num; diff --git a/src/script/cpp_api/s_server.cpp b/src/script/cpp_api/s_server.cpp index 4baf90636..98320b578 100644 --- a/src/script/cpp_api/s_server.cpp +++ b/src/script/cpp_api/s_server.cpp @@ -33,7 +33,7 @@ bool ScriptApiServer::getAuth(const std::string &playername, getAuthHandler(); lua_getfield(L, -1, "get_auth"); if(lua_type(L, -1) != LUA_TFUNCTION) - throw LuaError(L, "Authentication handler missing get_auth"); + throw LuaError(NULL, "Authentication handler missing get_auth"); lua_pushstring(L, playername.c_str()); if(lua_pcall(L, 1, 1, errorhandler)) scriptError(); @@ -48,13 +48,13 @@ bool ScriptApiServer::getAuth(const std::string &playername, std::string password; bool found = getstringfield(L, -1, "password", password); if(!found) - throw LuaError(L, "Authentication handler didn't return password"); + throw LuaError(NULL, "Authentication handler didn't return password"); if(dst_password) *dst_password = password; lua_getfield(L, -1, "privileges"); if(!lua_istable(L, -1)) - throw LuaError(L, "Authentication handler didn't return privilege table"); + throw LuaError(NULL, "Authentication handler didn't return privilege table"); if(dst_privs) readPrivileges(-1, *dst_privs); lua_pop(L, 1); @@ -74,7 +74,7 @@ void ScriptApiServer::getAuthHandler() } lua_remove(L, -2); // Remove minetest if(lua_type(L, -1) != LUA_TTABLE) - throw LuaError(L, "Authentication handler table not valid"); + throw LuaError(NULL, "Authentication handler table not valid"); } void ScriptApiServer::readPrivileges(int index, std::set &result) @@ -108,7 +108,7 @@ void ScriptApiServer::createAuth(const std::string &playername, lua_getfield(L, -1, "create_auth"); lua_remove(L, -2); // Remove auth handler if(lua_type(L, -1) != LUA_TFUNCTION) - throw LuaError(L, "Authentication handler missing create_auth"); + throw LuaError(NULL, "Authentication handler missing create_auth"); lua_pushstring(L, playername.c_str()); lua_pushstring(L, password.c_str()); if(lua_pcall(L, 2, 0, errorhandler)) @@ -128,7 +128,7 @@ bool ScriptApiServer::setPassword(const std::string &playername, lua_getfield(L, -1, "set_password"); lua_remove(L, -2); // Remove auth handler if(lua_type(L, -1) != LUA_TFUNCTION) - throw LuaError(L, "Authentication handler missing set_password"); + throw LuaError(NULL, "Authentication handler missing set_password"); lua_pushstring(L, playername.c_str()); lua_pushstring(L, password.c_str()); if(lua_pcall(L, 2, 1, errorhandler)) diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h index 808043bd4..694ce5a1e 100644 --- a/src/script/lua_api/l_base.h +++ b/src/script/lua_api/l_base.h @@ -48,7 +48,7 @@ protected: ScriptApiBase *scriptIface = getScriptApiBase(L); T *scriptIfaceDowncast = dynamic_cast(scriptIface); if (!scriptIfaceDowncast) { - throw LuaError(L, "Requested unavailable ScriptApi - core engine bug!"); + throw LuaError(NULL, "Requested unavailable ScriptApi - core engine bug!"); } return scriptIfaceDowncast; } diff --git a/src/script/lua_api/l_craft.cpp b/src/script/lua_api/l_craft.cpp index 035abb78d..ef13aa82c 100644 --- a/src/script/lua_api/l_craft.cpp +++ b/src/script/lua_api/l_craft.cpp @@ -150,16 +150,16 @@ int ModApiCraft::l_register_craft(lua_State *L) if(type == "shaped"){ std::string output = getstringfield_default(L, table, "output", ""); if(output == "") - throw LuaError(L, "Crafting definition is missing an output"); + throw LuaError(NULL, "Crafting definition is missing an output"); int width = 0; std::vector recipe; lua_getfield(L, table, "recipe"); if(lua_isnil(L, -1)) - throw LuaError(L, "Crafting definition is missing a recipe" + throw LuaError(NULL, "Crafting definition is missing a recipe" " (output=\"" + output + "\")"); if(!readCraftRecipeShaped(L, -1, width, recipe)) - throw LuaError(L, "Invalid crafting recipe" + throw LuaError(NULL, "Invalid crafting recipe" " (output=\"" + output + "\")"); CraftReplacements replacements; @@ -167,7 +167,7 @@ int ModApiCraft::l_register_craft(lua_State *L) if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) - throw LuaError(L, "Invalid replacements" + throw LuaError(NULL, "Invalid replacements" " (output=\"" + output + "\")"); } @@ -181,17 +181,17 @@ int ModApiCraft::l_register_craft(lua_State *L) else if(type == "shapeless"){ std::string output = getstringfield_default(L, table, "output", ""); if(output == "") - throw LuaError(L, "Crafting definition (shapeless)" + throw LuaError(NULL, "Crafting definition (shapeless)" " is missing an output"); std::vector recipe; lua_getfield(L, table, "recipe"); if(lua_isnil(L, -1)) - throw LuaError(L, "Crafting definition (shapeless)" + throw LuaError(NULL, "Crafting definition (shapeless)" " is missing a recipe" " (output=\"" + output + "\")"); if(!readCraftRecipeShapeless(L, -1, recipe)) - throw LuaError(L, "Invalid crafting recipe" + throw LuaError(NULL, "Invalid crafting recipe" " (output=\"" + output + "\")"); CraftReplacements replacements; @@ -199,7 +199,7 @@ int ModApiCraft::l_register_craft(lua_State *L) if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) - throw LuaError(L, "Invalid replacements" + throw LuaError(NULL, "Invalid replacements" " (output=\"" + output + "\")"); } @@ -224,12 +224,12 @@ int ModApiCraft::l_register_craft(lua_State *L) else if(type == "cooking"){ std::string output = getstringfield_default(L, table, "output", ""); if(output == "") - throw LuaError(L, "Crafting definition (cooking)" + throw LuaError(NULL, "Crafting definition (cooking)" " is missing an output"); std::string recipe = getstringfield_default(L, table, "recipe", ""); if(recipe == "") - throw LuaError(L, "Crafting definition (cooking)" + throw LuaError(NULL, "Crafting definition (cooking)" " is missing a recipe" " (output=\"" + output + "\")"); @@ -240,7 +240,7 @@ int ModApiCraft::l_register_craft(lua_State *L) if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) - throw LuaError(L, "Invalid replacements" + throw LuaError(NULL, "Invalid replacements" " (cooking output=\"" + output + "\")"); } @@ -254,7 +254,7 @@ int ModApiCraft::l_register_craft(lua_State *L) else if(type == "fuel"){ std::string recipe = getstringfield_default(L, table, "recipe", ""); if(recipe == "") - throw LuaError(L, "Crafting definition (fuel)" + throw LuaError(NULL, "Crafting definition (fuel)" " is missing a recipe"); float burntime = getfloatfield_default(L, table, "burntime", 1.0); @@ -264,7 +264,7 @@ int ModApiCraft::l_register_craft(lua_State *L) if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) - throw LuaError(L, "Invalid replacements" + throw LuaError(NULL, "Invalid replacements" " (fuel recipe=\"" + recipe + "\")"); } @@ -274,7 +274,7 @@ int ModApiCraft::l_register_craft(lua_State *L) } else { - throw LuaError(L, "Unknown crafting definition type: \"" + type + "\""); + throw LuaError(NULL, "Unknown crafting definition type: \"" + type + "\""); } lua_pop(L, 1); diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp index 512cd7398..4b5c89792 100644 --- a/src/script/lua_api/l_item.cpp +++ b/src/script/lua_api/l_item.cpp @@ -470,7 +470,7 @@ int ModApiItemMod::l_register_item_raw(lua_State *L) name = lua_tostring(L, -1); verbosestream<<"register_item_raw: "<set(f.name, f); if(id > MAX_REGISTERED_CONTENT){ - throw LuaError(L, "Number of registerable nodes (" + throw LuaError(NULL, "Number of registerable nodes (" + itos(MAX_REGISTERED_CONTENT+1) + ") exceeded (" + name + ")"); } diff --git a/src/script/lua_api/l_noise.cpp b/src/script/lua_api/l_noise.cpp index 4b0c7932d..4ca9992af 100644 --- a/src/script/lua_api/l_noise.cpp +++ b/src/script/lua_api/l_noise.cpp @@ -330,10 +330,10 @@ int LuaPseudoRandom::l_next(lua_State *L) max = luaL_checkinteger(L, 3); if(max < min){ errorstream<<"PseudoRandom.next(): max="< 32767/5) - throw LuaError(L, "PseudoRandom.next() max-min is not 32767" + throw LuaError(NULL, "PseudoRandom.next() max-min is not 32767" " and is > 32768/5. This is disallowed due to" " the bad random distribution the" " implementation would otherwise make."); diff --git a/src/server.h b/src/server.h index e71a811ea..28678f59c 100644 --- a/src/server.h +++ b/src/server.h @@ -55,23 +55,6 @@ class ServerEnvironment; struct SimpleSoundSpec; -class ServerError : public std::exception -{ -public: - ServerError(const std::string &s) - { - m_s = "ServerError: "; - m_s += s; - } - virtual ~ServerError() throw() - {} - virtual const char * what() const throw() - { - return m_s.c_str(); - } - std::string m_s; -}; - /* Some random functions */ From 1ed90c90c304c6cc9cfddb722e4d15a1221d0177 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 18 Dec 2013 16:46:53 -0500 Subject: [PATCH 197/198] Add 'minetest.write_json' --- doc/lua_api.txt | 11 +++++++- src/script/common/c_content.cpp | 49 +++++++++++++++++++++++++++++++++ src/script/common/c_content.h | 3 ++ src/script/lua_api/l_util.cpp | 27 ++++++++++++++++++ src/script/lua_api/l_util.h | 3 ++ 5 files changed, 92 insertions(+), 1 deletion(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index abfb8f94b..135e2cfcd 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1530,7 +1530,16 @@ minetest.parse_json(string[, nullvalue]) -> something ^ nullvalue: returned in place of the JSON null; defaults to nil ^ On success returns a table, a string, a number, a boolean or nullvalue ^ On failure outputs an error message and returns nil -^ Example: parse_json("[10, {\"a\":false}]") -> {[1] = 10, [2] = {a = false}} +^ Example: parse_json("[10, {\"a\":false}]") -> {10, {a = false}} +minetest.write_json(data[, styled]) -> string +^ Convert a Lua table into a JSON string +^ styled: Outputs in a human-readable format if this is set, defaults to false +^ Un-serializable things like functions and userdata are saved as null. +^ Warning: JSON is more strict than the Lua table format. + 1. You can only use strings and positive integers of at least one as keys. + 2. You can not mix string and integer keys. + This is due to the fact that Javascript has two distinct array and object values. +^ Example: write_json({10, {a = false}}) -> "[10, {\"a\": false}]" minetest.serialize(table) -> string ^ Convert a table containing tables, strings, numbers, booleans and nils into string form readable by minetest.deserialize diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index cf9f28d30..8eb57ba41 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -1081,3 +1081,52 @@ bool push_json_value(lua_State *L, const Json::Value &value, int nullindex) else return false; } + +// Converts Lua table --> JSON +void get_json_value(lua_State *L, Json::Value &root, int index) +{ + int type = lua_type(L, index); + if (type == LUA_TBOOLEAN) { + root = (bool) lua_toboolean(L, index); + } else if (type == LUA_TNUMBER) { + root = lua_tonumber(L, index); + } else if (type == LUA_TSTRING) { + size_t len; + const char *str = lua_tolstring(L, index, &len); + root = std::string(str, len); + } else if (type == LUA_TTABLE) { + lua_pushnil(L); + while (lua_next(L, index)) { + // Key is at -2 and value is at -1 + Json::Value value; + get_json_value(L, value, lua_gettop(L)); + + Json::ValueType roottype = root.type(); + int keytype = lua_type(L, -1); + if (keytype == LUA_TNUMBER) { + lua_Number key = lua_tonumber(L, -1); + if (roottype != Json::nullValue && roottype != Json::arrayValue) { + throw LuaError(NULL, "Can't mix array and object values in JSON"); + } else if (key < 1) { + throw LuaError(NULL, "Can't use zero-based or negative indexes in JSON"); + } else if (floor(key) != key) { + throw LuaError(NULL, "Can't use indexes with a fractional part in JSON"); + } + root[(Json::ArrayIndex) key - 1] = value; + } else if (keytype == LUA_TSTRING) { + if (roottype != Json::nullValue && roottype != Json::objectValue) { + throw LuaError(NULL, "Can't mix array and object values in JSON"); + } + root[lua_tostring(L, -1)] = value; + } else { + throw LuaError(NULL, "Lua key to convert to JSON is not a string or number"); + } + } + } else if (type == LUA_TNIL) { + root = Json::nullValue; + } else { + throw LuaError(NULL, "Can only store booleans, numbers, strings, objects, arrays, and null in JSON"); + } + lua_pop(L, 1); // Pop value +} + diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 27019e29e..3b85e5403 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -150,6 +150,9 @@ void luaentity_get (lua_State *L,u16 id); bool push_json_value (lua_State *L, const Json::Value &value, int nullindex); +void get_json_value (lua_State *L, + Json::Value &root, + int index); extern struct EnumString es_TileAnimationType[]; diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index fe10e4f57..9fa6fcb77 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -179,6 +179,32 @@ int ModApiUtil::l_parse_json(lua_State *L) return 1; } +// write_json(data[, styled]) -> string +int ModApiUtil::l_write_json(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + + bool styled = false; + if (!lua_isnone(L, 2)) { + styled = lua_toboolean(L, 2); + lua_pop(L, 1); + } + + Json::Value root; + get_json_value(L, root, 1); + + std::string out; + if (styled) { + Json::StyledWriter writer; + out = writer.write(root); + } else { + Json::FastWriter writer; + out = writer.write(root); + } + lua_pushlstring(L, out.c_str(), out.size()); + return 1; +} + // get_dig_params(groups, tool_capabilities[, time_from_last_punch]) int ModApiUtil::l_get_dig_params(lua_State *L) { @@ -249,6 +275,7 @@ void ModApiUtil::Initialize(lua_State *L, int top) API_FCT(setting_save); API_FCT(parse_json); + API_FCT(write_json); API_FCT(get_dig_params); API_FCT(get_hit_params); diff --git a/src/script/lua_api/l_util.h b/src/script/lua_api/l_util.h index d91c880cf..13357587a 100644 --- a/src/script/lua_api/l_util.h +++ b/src/script/lua_api/l_util.h @@ -64,6 +64,9 @@ private: // parse_json(str[, nullvalue]) static int l_parse_json(lua_State *L); + // write_json(data[, styled]) + static int l_write_json(lua_State *L); + // get_dig_params(groups, tool_capabilities[, time_from_last_punch]) static int l_get_dig_params(lua_State *L); From ba8fa0bd42b5a4a0e3658a5e784ee6a885dcc891 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Wed, 18 Dec 2013 22:57:33 +0100 Subject: [PATCH 198/198] Log guilty node name when allow_metadata_inventory_move/put/take fails --- src/script/cpp_api/s_nodemeta.cpp | 33 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/script/cpp_api/s_nodemeta.cpp b/src/script/cpp_api/s_nodemeta.cpp index d8fd4dcfe..e15abd40f 100644 --- a/src/script/cpp_api/s_nodemeta.cpp +++ b/src/script/cpp_api/s_nodemeta.cpp @@ -45,8 +45,8 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowMove(v3s16 p, return 0; // Push callback function on stack - if(!getItemCallback(ndef->get(node).name.c_str(), - "allow_metadata_inventory_move")) + std::string nodename = ndef->get(node).name; + if(!getItemCallback(nodename.c_str(), "allow_metadata_inventory_move")) return count; // function(pos, from_list, from_index, to_list, to_index, count, player) @@ -61,7 +61,8 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowMove(v3s16 p, scriptError(); lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) - throw LuaError(NULL, "allow_metadata_inventory_move should return a number"); + throw LuaError(NULL, "allow_metadata_inventory_move should" + " return a number, guilty node: " + nodename); int num = luaL_checkinteger(L, -1); lua_pop(L, 1); // Pop integer return num; @@ -85,8 +86,8 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowPut(v3s16 p, return 0; // Push callback function on stack - if(!getItemCallback(ndef->get(node).name.c_str(), - "allow_metadata_inventory_put")) + std::string nodename = ndef->get(node).name; + if(!getItemCallback(nodename.c_str(), "allow_metadata_inventory_put")) return stack.count; // Call function(pos, listname, index, stack, player) @@ -99,7 +100,8 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowPut(v3s16 p, scriptError(); lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) - throw LuaError(NULL, "allow_metadata_inventory_put should return a number"); + throw LuaError(NULL, "allow_metadata_inventory_put should" + " return a number, guilty node: " + nodename); int num = luaL_checkinteger(L, -1); lua_pop(L, 1); // Pop integer return num; @@ -123,8 +125,8 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p, return 0; // Push callback function on stack - if(!getItemCallback(ndef->get(node).name.c_str(), - "allow_metadata_inventory_take")) + std::string nodename = ndef->get(node).name; + if(!getItemCallback(nodename.c_str(), "allow_metadata_inventory_take")) return stack.count; // Call function(pos, listname, index, count, player) @@ -137,7 +139,8 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p, scriptError(); lua_remove(L, errorhandler); // Remove error handler if(!lua_isnumber(L, -1)) - throw LuaError(NULL, "allow_metadata_inventory_take should return a number"); + throw LuaError(NULL, "allow_metadata_inventory_take should" + " return a number, guilty node: " + nodename); int num = luaL_checkinteger(L, -1); lua_pop(L, 1); // Pop integer return num; @@ -162,8 +165,8 @@ void ScriptApiNodemeta::nodemeta_inventory_OnMove(v3s16 p, return; // Push callback function on stack - if(!getItemCallback(ndef->get(node).name.c_str(), - "on_metadata_inventory_move")) + std::string nodename = ndef->get(node).name; + if(!getItemCallback(nodename.c_str(), "on_metadata_inventory_move")) return; // function(pos, from_list, from_index, to_list, to_index, count, player) @@ -197,8 +200,8 @@ void ScriptApiNodemeta::nodemeta_inventory_OnPut(v3s16 p, return; // Push callback function on stack - if(!getItemCallback(ndef->get(node).name.c_str(), - "on_metadata_inventory_put")) + std::string nodename = ndef->get(node).name; + if(!getItemCallback(nodename.c_str(), "on_metadata_inventory_put")) return; // Call function(pos, listname, index, stack, player) @@ -230,8 +233,8 @@ void ScriptApiNodemeta::nodemeta_inventory_OnTake(v3s16 p, return; // Push callback function on stack - if(!getItemCallback(ndef->get(node).name.c_str(), - "on_metadata_inventory_take")) + std::string nodename = ndef->get(node).name; + if(!getItemCallback(nodename.c_str(), "on_metadata_inventory_take")) return; // Call function(pos, listname, index, stack, player)