Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
mods.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2018 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
23#include <memory>
24
25class ServerScripting;
26
33{
35
36public:
37
42 ServerModManager(const std::string &worldpath);
43
48 explicit ServerModManager(std::nullptr_t) {};
49
50 void loadMods(ServerScripting &script);
51 const ModSpec *getModSpec(const std::string &modname) const;
52 void getModNames(std::vector<std::string> &modlist) const;
53
54 inline const std::vector<ModSpec> &getMods() const {
55 return configuration.getMods();
56 }
57
58 inline const std::vector<ModSpec> &getUnsatisfiedMods() const {
60 }
61
62 inline bool isConsistent() const {
64 }
65
66 inline std::string getUnsatisfiedModsError() const {
68 }
69
78 void getModsMediaPaths(std::vector<std::string> &paths) const;
79};
ModConfiguration is a subset of installed mods.
Definition: mod_configuration.h:33
const std::vector< ModSpec > & getUnsatisfiedMods() const
Definition: mod_configuration.h:40
const std::vector< ModSpec > & getMods() const
List of mods sorted such that they can be loaded in the given order with all dependencies being fulfi...
Definition: mod_configuration.h:52
std::string getUnsatisfiedModsError() const
Definition: mod_configuration.cpp:28
bool isConsistent() const
Definition: mod_configuration.h:38
Manages server mods.
Definition: mods.h:33
const std::vector< ModSpec > & getUnsatisfiedMods() const
Definition: mods.h:58
std::string getUnsatisfiedModsError() const
Definition: mods.h:66
const ModSpec * getModSpec(const std::string &modname) const
Definition: mods.cpp:77
void loadMods(ServerScripting &script)
Definition: mods.cpp:53
ModConfiguration configuration
Definition: mods.h:34
ServerModManager(std::nullptr_t)
Creates an empty ServerModManager.
Definition: mods.h:48
bool isConsistent() const
Definition: mods.h:62
const std::vector< ModSpec > & getMods() const
Definition: mods.h:54
void getModNames(std::vector< std::string > &modlist) const
Definition: mods.cpp:87
void getModsMediaPaths(std::vector< std::string > &paths) const
Recursively gets all paths of mod folders that can contain media files.
Definition: mods.cpp:93
Definition: scripting_server.h:48
Definition: mods.h:40