Commit Graph

39 Commits

Author SHA1 Message Date
Andrew Ward 71b2570f09
Load dependencies and description from mod.conf 2018-03-28 22:14:16 +01:00
Loïc Blot 6c184947c3
Server: delegate mod management & config to ServerModConfiguration (#7131)
* Server: delegate mod management & config to ServerModConfiguration (rename it to ServerModManager)

* Use c++11 range based loops
* Add unittests + experimental/default mod as a test case to permit testing mod loading in future tests
2018-03-16 08:41:33 +01:00
Loïc Blot f35236afea
mods.cpp/h: little performance improvement in getModsInPath (+ codestyle) (#7108)
* mods.cpp/h: little performance improvement in getModsInPath
2018-03-08 20:03:43 +01:00
Loïc Blot 50423d8c72 Update JsonCPP to 1.8.3 (#6466)
* Update JsonCPP to 1.8.3

* Fix deprecated functions

Json::FastWriter, Json::StyledWriter and Json::Reader are marked deprecated since 1.1 and are deprecated in 0.8 but not shown at compilation time.

Use new methods to serialize/deserialize
2017-09-26 20:30:14 +02:00
Greg 45a7dd1ec4 Fix addModsFormConfig typo (#6420) 2017-09-16 18:40:19 +02:00
Loic Blot d382483fa7
Code modernization: src/m* (part 3)
* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* remove some unused headers in some cpp variable
2017-08-19 09:29:55 +02:00
Loïc Blot c427533389 Modernize various files (src/m*) (#6267)
* Modernize various files (src/m*)

* range-based for loops
* code style
* C++ headers instead of C headers
* Default operators
* empty function

Thanks to clang-tidy
2017-08-18 18:18:25 +02:00
Elijah Duffy dc3ca09e0e Remove remaining modstore code (#6120) 2017-07-14 20:37:58 +02:00
Loïc Blot 4faaadc8d5 Cpp11 patchset 11: continue working on constructor style migration (#6004) 2017-06-18 19:55:15 +02:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
Loïc Blot 90808a4f34 Real control fix (#5787)
* Allow enabling and disabling mods.

* Re-fix 605599b6f1

This breaks some chars like € in chat.

Instead verify is char is a non control char -> iswcntrl
2017-05-20 22:29:15 +02:00
Loïc Blot cf37a55690 Fix various variables passed by copy instead of const ref (#5610)
Pointed by cppcheck
2017-04-19 00:36:30 +02:00
Loïc Blot 92b45b2a18 [CSM] implement client side mod loading (#5123)
* client side mods are located in clientmods/
* move builtin/preview.lua to clientmods/preview/init.lua as a preview mod
* refactor ModConfiguration class to work properly with client and server using child objects
* move some Server constructor mod load code to ModConfiguration to reduce code duplication between client and server
* remove mods.{cpp,h} unused functions
* use UNORDERED_SET instead of std::set in some modspec storages
2017-03-13 23:56:05 +01:00
Loïc Blot ef6feca501 Add ModMetadata API (#5131)
* mod can create a ModMetadata object where store its values and retrieve it.
* Modmetadata object can only be fetched at mod loading
* Save when modified using same time as map interval or at server stop
* add helper function to get mod storage path
* ModMetadata has exactly same calls than all every other Metadata
2017-02-08 00:15:55 +01:00
ShadowNinja 93887043d9 Clean up Strfnd
Changes:
  * Fix indentation.
  * Pass strings by const reference.
  * Merge Strfnd and WStrfnd into one class instead of copying them.
  * Remove trailing spaces.
  * Fix variable names.
  * Move to util.
  * Other miscellaneous style fixes.
2016-03-19 21:27:57 -04:00
ShadowNinja 9269a0ecc7 Fix server crashing on Lua errors
Previously, the server called FATAL_ERROR when a Lua error occured.
This caused a (mostly useless) core dump.
The server now simply throws an exception, which is caught and printed before
exiting with a non-zero return value.
This also fixes a number of instances where errors were logged multiple times.
2015-10-31 13:28:58 -04:00
ShadowNinja 96cc5b34fe Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
Craig Robbins 9527984dbc Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
kaeza c5defe7a11 Add mod.conf file support This new file only permits to specify a mod name for now 2015-02-21 18:18:06 +01:00
kwolekr 0118c111e8 Fix some MSVC-specific warnings and add debug path as an MSVC directory 2015-02-02 02:01:13 -05:00
ShadowNinja 86a3c8ce56 Reduce indentation of HTTPFetchOngoing
Also clean up some related things.
2014-09-18 21:54:22 -04:00
sapier 8af44f8163 Remove ugly curl struct pointer from jsonFetchValue signature 2014-06-19 21:24:53 +02:00
ShadowNinja 83853ccd41 Remove support for optdepends.txt 2013-12-13 13:10:24 -05:00
PilzAdam 4e5a45952a Remove support for common mods 2013-07-16 01:46:59 +02:00
sapier 967121a34b Replace C++ mainmenu by formspec powered one 2013-07-02 19:58:20 -04:00
Kahrl 4a9fe1a1d5 Log non-fatal mod name conflict to actionstream instead of errorstream 2013-05-21 14:56:43 +02:00
PilzAdam b2253e5b42 Write mods that are not in world.mt into it at world startup 2013-05-19 19:52:29 +02:00
PilzAdam dcd0b63f64 Dont load mods that have no entry in world.mt 2013-05-19 19:46:50 +02:00
Kahrl 969d2b3eb1 Optional dependencies and properly handle mod name conflicts again 2013-05-03 23:58:22 +02:00
Perttu Ahola 306d1ab866 Common mods support
Implement "common mods", includeable from
  {$user,$share}/games/common/$modname
by using the game.conf setting
  common_mods = $modname,$modname2,...
2013-03-21 18:56:42 +02:00
Sfan5 6d0ea26c2d Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam 497ff1ecd6 Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
Jürgen Doser 26a0efae23 Improve behaviour for empty modpacks and when no mods at all are installed:
Only show enable all / disable all buttons for all add-ons when at
least one add-on is installed. When no add-on ist installed, don't
show any buttons or checkboxes.

Added is_modpack flag to ModSpec to distinguish empty modpacks from
normal mods and check this flag in mod selection gui so that empty
modpacks are not treated like mods that can be enabled or disabled.
2013-01-22 19:05:28 +01:00
Jürgen Doser 6af8a34d91 Basic support for configuring which mods to load for each world
settings.h: added function to return all keys used in settings, and a
function to remove a setting

mods.{h,cpp}: added class ModConfiguration that represents a subset of the installed mods.

server.{h,cpp}: server does not load add-on mods that are disabled in
the world.mt file. mods are disabled by a setting of the form
"load_mod_<modname> = false". if no load_mod_<modname> = ... setting
is found, the mod is loaded anyways for backwards compatibilty. server
also complains to errorstream about mods with unstatisfied
dependencies and about mods that are not installed.

guiConfigureWorld.{h,cpp}: shows a treeview of installed add-on mods
and modpacks with little icons in front of their name indicating their
status: a checkmark for enabled mods, a cross for disabled mods, a
question mark for "new" mods

Mods can be enabled/disabled by a checkbox. Mods also show a list of
dependencies and reverse dependencies. double-click on a mod in
dependency or reverse dependency listbox selects the corresponding
mod. Enabling a mod also enables all its dependencies. Disabling a mod
also disables all its reverse dependencies.

For modpacks, show buttons to enable/disable all mods (recursively,
including their dependencies) in it.

Button "Save" saves the current settings to the world.mt file and
returns to the main menu. Button "Cancel" returns to main menu without
saving.

basic keyboard controls (if the proper widget has keyboard focus):

up/down: scroll through tree of mods
left/right: collaps/expand a modpack
space: enable/disable the selected mod
2013-01-21 17:31:50 +02:00
Matthew I 6cf87e1d23 Ignore directories beginning with a "." when searching for mods
This is not a problem on POSIX systems (these directories are
ignored by the POSIX implementation of fs::GetDirListing() in
filesys.cpp), but these directories still are reported on Windows
systems.  This becomes a problem when mod authors use version
control systems that create directories like ".git" or ".svn"
and collectMods() picks up on them.  It has also been suggested
that ignoring such directories would allow for the easily disabling
mods by inserting a "." in front of their name.

This quick fix simply makes collectMods() ignore directories
beginning with a ".".
2012-11-30 21:41:50 +02:00
Perttu Ahola 037b259197 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Perttu Ahola 747ff7daf8 Add support for putting modpacks directly into mod directories 2012-05-21 19:49:35 +03:00
Perttu Ahola 6b2023dc3e Properly handle mod name conflicts 2011-12-03 03:32:30 +02:00
Perttu Ahola 2f4a92d701 Better mod loading error handling 2011-12-03 03:23:14 +02:00