diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | data/builtin.lua | 2 | ||||
-rw-r--r-- | data/mods/default/init.lua | 3 | ||||
-rw-r--r-- | data/mods/experimental/init.lua | 1 | ||||
-rw-r--r-- | doc/minetest.6 | 67 | ||||
-rw-r--r-- | doc/minetestserver.6 | 55 | ||||
-rw-r--r-- | minetest.conf.example | 6 | ||||
-rw-r--r-- | src/main.cpp | 27 | ||||
-rw-r--r-- | src/scriptapi.cpp | 9 | ||||
-rw-r--r-- | src/server.h | 2 | ||||
-rw-r--r-- | src/servermain.cpp | 18 |
12 files changed, 183 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore index 654e3ceaf..1d89854f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ map/* world/* CMakeFiles/* diff --git a/CMakeLists.txt b/CMakeLists.txt index ef9016526..feefa58c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,13 +63,22 @@ elseif(UNIX) # Linux, BSD etc set(DATADIR "share/${PROJECT_NAME}") set(BINDIR "bin") set(DOCDIR "share/doc/${PROJECT_NAME}") + set(MANDIR "share/man") set(EXAMPLE_CONF_DIR "share/doc/${PROJECT_NAME}") + set(XDG_APPS_DIR "share/applications") + set(ICONDIR "share/icons") endif() install(FILES "README.txt" DESTINATION "${DOCDIR}") install(FILES "doc/changelog.txt" DESTINATION "${DOCDIR}") install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}") +if(UNIX) + install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6") + install(FILES "misc/minetest.desktop" DESTINATION "${XDG_APPS_DIR}") + install(FILES "minetest-icon.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps") +endif() + # # Subdirectories # Be sure to add all relevant definitions above this diff --git a/data/builtin.lua b/data/builtin.lua index b8891c066..eba5b429e 100644 --- a/data/builtin.lua +++ b/data/builtin.lua @@ -106,7 +106,7 @@ function minetest.get_pointed_thing_position(pointed_thing, above) return pointed_thing.under end elseif pointed_thing.type == "object" then - obj = pointed.thing.ref + obj = pointed_thing.ref if obj ~= nil then return obj:getpos() else diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua index 76c07d825..7f63d9a7c 100644 --- a/data/mods/default/init.lua +++ b/data/mods/default/init.lua @@ -118,6 +118,9 @@ -- {type="node", pos={x=, y=, z=}} -- minetest.get_current_modname() -> string -- minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname" +-- ^ Useful for loading additional .lua modules or static data from mod +-- minetest.get_worldpath(modname) -> eg. "/home/user/.minetest/world" +-- ^ Useful for storing custom data -- -- minetest.debug(line) -- ^ Goes to dstream diff --git a/data/mods/experimental/init.lua b/data/mods/experimental/init.lua index 9a8f8868d..ddc89f92c 100644 --- a/data/mods/experimental/init.lua +++ b/data/mods/experimental/init.lua @@ -540,5 +540,6 @@ minetest.register_abm({ print("experimental modname="..dump(minetest.get_current_modname())) print("experimental modpath="..dump(minetest.get_modpath("experimental"))) +print("experimental worldpath="..dump(minetest.get_worldpath())) -- END diff --git a/doc/minetest.6 b/doc/minetest.6 new file mode 100644 index 000000000..ef425a6df --- /dev/null +++ b/doc/minetest.6 @@ -0,0 +1,67 @@ +.\" Minetest man page +.TH minetest 6 "29 January 2012" "" "" + +.SH NAME +minetest \- Multiplayer infinite-world block sandbox + +.SH SYNOPSIS +.B minetest +[ OPTION ... ] + +.SH DESCRIPTION +.B Minetest +is one of the first InfiniMiner/Minecraft(/whatever) inspired games (started October 2010), with a goal of taking the survival multiplayer gameplay to a slightly different direction. +.PP +The main design philosophy is to keep it technically simple, stable and portable. It will be kept lightweight enough to run on fairly old hardware. + +.SH OPTIONS +.TP +\-\-address <value> +Address to connect to +.TP +\-\-config <value> +Load configuration from specified file +.TP +\-\-disable\-unittests +Disable unit tests +.TP +\-\-enable\-unittests +Enable unit tests +.TP +\-\-help +Show allowed options +.TP +\-\-info\-on\-stderr +Print debug information to console +.TP +\-\-map\-dir <value> +Map directory (where everything in the world is stored) +.TP +\-\-port <value> +Set network port to connect to +.TP +\-\-random\-input +Enable random user input, for testing +.TP +\-\-server +Run server directly +.TP +\-\-speedtests +Run speed tests + +.SH BUGS +Please report all bugs to Perttu Ahola <celeron55@gmail.com>. + +.SH AUTHOR +.PP +Perttu Ahola <celeron55@gmail.com> +and contributors. +.PP +This man page was written by +Juhani Numminen <juhaninumminen0@gmail.com>. + +.SH WWW +http://c55.me/minetest/ + +.SH "SEE ALSO" +.BR minetestserver(6)
\ No newline at end of file diff --git a/doc/minetestserver.6 b/doc/minetestserver.6 new file mode 100644 index 000000000..9540e2c42 --- /dev/null +++ b/doc/minetestserver.6 @@ -0,0 +1,55 @@ +.\" Minetestserver man page +.TH minetestserver 6 "29 January 2012" "" "" + +.SH NAME +minetestserver \- Minetest server + +.SH SYNOPSIS +.B minetestserver +[ OPTION ... ] + +.SH DESCRIPTION +.B Minetest +is one of the first InfiniMiner/Minecraft(/whatever) inspired games (started October 2010), with a goal of taking the survival multiplayer gameplay to a slightly different direction. +.PP +The main design philosophy is to keep it technically simple, stable and portable. It will be kept lightweight enough to run on fairly old hardware. + +.SH OPTIONS +.TP +\-\-config <value> +Load configuration from specified file +.TP +\-\-disable\-unittests +Disable unit tests +.TP +\-\-enable\-unittests +Enable unit tests +.TP +\-\-help +Show allowed options +.TP +\-\-info\-on\-stderr +Print debug information to console +.TP +\-\-map\-dir <value> +Map directory (where everything in the world is stored) +.TP +\-\-port <value> +Set network port (UDP) to use + +.SH BUGS +Please report all bugs to Perttu Ahola <celeron55@gmail.com>. + +.SH AUTHOR +.PP +Perttu Ahola <celeron55@gmail.com> +and contributors. +.PP +This man page was written by +Juhani Numminen <juhaninumminen0@gmail.com>. + +.SH WWW +http://c55.me/minetest/ + +.SH "SEE ALSO" +.BR minetest(6)
\ No newline at end of file diff --git a/minetest.conf.example b/minetest.conf.example index 83519e145..fbc7249d2 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -139,14 +139,18 @@ # Profiler data print interval. #0 = disable. #profiler_print_interval = 0 #enable_mapgen_debug_info = false +# from how far client knows about objects #active_object_send_range_blocks = 3 +# how large area of blocks are subject to the active block stuff (active = objects are loaded and ABMs run) #active_block_range = 2 +# how many blocks are flying in the wire simultaneously per client #max_simultaneous_block_sends_per_client = 2 +# how many blocks are flying in the wire simultaneously per server #max_simultaneous_block_sends_server_total = 8 #max_block_send_distance = 7 #max_block_generate_distance = 5 #time_send_interval = 20 -# Length of day/night cycle. 72=20min, 360=4min, 1=24hour +# Length of day/night cycle. 72=20min, 360=4min, 1=24hour, 0=day/night/whatever stays unchanged #time_speed = 72 #server_unload_unused_data_timeout = 29 #server_map_save_interval = 5.3 diff --git a/src/main.cpp b/src/main.cpp index 6cb9cf984..2875474f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1085,22 +1085,31 @@ int main(int argc, char *argv[]) // List all allowed options core::map<std::string, ValueSpec> allowed_options; - allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG)); + allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG, + "Show allowed options")); allowed_options.insert("server", ValueSpec(VALUETYPE_FLAG, "Run server directly")); allowed_options.insert("config", ValueSpec(VALUETYPE_STRING, "Load configuration from specified file")); - allowed_options.insert("port", ValueSpec(VALUETYPE_STRING)); - allowed_options.insert("address", ValueSpec(VALUETYPE_STRING)); - allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG)); - allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG)); - allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG)); - allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING)); + allowed_options.insert("port", ValueSpec(VALUETYPE_STRING, + "Set network port to connect to")); + allowed_options.insert("address", ValueSpec(VALUETYPE_STRING, + "Address to connect to")); + allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG, + "Enable random user input, for testing")); + allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG, + "Disable unit tests")); + allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG, + "Enable unit tests")); + allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING, + "Map directory (where everything in the world is stored)")); #ifdef _WIN32 allowed_options.insert("dstream-on-stderr", ValueSpec(VALUETYPE_FLAG)); #endif - allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG)); - allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG)); + allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG, + "Run speed tests")); + allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG, + "Print debug information to console")); Settings cmd_args; diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index a064cd688..8350c75f1 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -3560,6 +3560,14 @@ static int l_get_modpath(lua_State *L) return 1; } +// get_worldpath() +static int l_get_worldpath(lua_State *L) +{ + std::string worldpath = get_server(L)->getWorldPath(); + lua_pushstring(L, worldpath.c_str()); + return 1; +} + static const struct luaL_Reg minetest_f [] = { {"debug", l_debug}, {"log", l_log}, @@ -3576,6 +3584,7 @@ static const struct luaL_Reg minetest_f [] = { {"get_hitting_properties", l_get_hitting_properties}, {"get_current_modname", l_get_current_modname}, {"get_modpath", l_get_modpath}, + {"get_worldpath", l_get_worldpath}, {NULL, NULL} }; diff --git a/src/server.h b/src/server.h index 40f0fe582..04bd61a87 100644 --- a/src/server.h +++ b/src/server.h @@ -525,6 +525,8 @@ public: IWritableCraftDefManager* getWritableCraftDefManager(); const ModSpec* getModSpec(const std::string &modname); + + std::string getWorldPath(){ return m_mapsavedir; } private: diff --git a/src/servermain.cpp b/src/servermain.cpp index 3ef1d9479..7a05bb964 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -203,14 +203,20 @@ int main(int argc, char *argv[]) // List all allowed options core::map<std::string, ValueSpec> allowed_options; - allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG)); + allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG, + "Show allowed options")); allowed_options.insert("config", ValueSpec(VALUETYPE_STRING, "Load configuration from specified file")); - allowed_options.insert("port", ValueSpec(VALUETYPE_STRING)); - allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG)); - allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG)); - allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING)); - allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG)); + allowed_options.insert("port", ValueSpec(VALUETYPE_STRING, + "Set network port (UDP) to use")); + allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG, + "Disable unit tests")); + allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG, + "Enable unit tests")); + allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING, + "Map directory (where everything in the world is stored)")); + allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG, + "Print debug information to console")); Settings cmd_args; |