Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
mods.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2018 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
4
5#pragma once
6
8#include <memory>
9
10class ServerScripting;
11
18{
20
21public:
22
27 ServerModManager(const std::string &worldpath);
28
33 explicit ServerModManager(std::nullptr_t) {};
34
35 void loadMods(ServerScripting &script);
36 const ModSpec *getModSpec(const std::string &modname) const;
37 void getModNames(std::vector<std::string> &modlist) const;
38
39 inline const std::vector<ModSpec> &getMods() const {
40 return configuration.getMods();
41 }
42
43 inline const std::vector<ModSpec> &getUnsatisfiedMods() const {
45 }
46
47 inline bool isConsistent() const {
49 }
50
51 inline std::string getUnsatisfiedModsError() const {
53 }
54
63 void getModsMediaPaths(std::vector<std::string> &paths) const;
64};
ModConfiguration is a subset of installed mods.
Definition mod_configuration.h:18
const std::vector< ModSpec > & getUnsatisfiedMods() const
Definition mod_configuration.h:25
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:37
std::string getUnsatisfiedModsError() const
Definition mod_configuration.cpp:15
bool isConsistent() const
Definition mod_configuration.h:23
Manages server mods.
Definition mods.h:18
const std::vector< ModSpec > & getUnsatisfiedMods() const
Definition mods.h:43
std::string getUnsatisfiedModsError() const
Definition mods.h:51
const ModSpec * getModSpec(const std::string &modname) const
Definition mods.cpp:62
void loadMods(ServerScripting &script)
Definition mods.cpp:38
ModConfiguration configuration
Definition mods.h:19
ServerModManager(std::nullptr_t)
Creates an empty ServerModManager.
Definition mods.h:33
bool isConsistent() const
Definition mods.h:47
const std::vector< ModSpec > & getMods() const
Definition mods.h:39
ServerModManager(const std::string &worldpath)
Creates a ServerModManager which targets worldpath.
Definition mods.cpp:22
void getModNames(std::vector< std::string > &modlist) const
Definition mods.cpp:72
void getModsMediaPaths(std::vector< std::string > &paths) const
Recursively gets all paths of mod folders that can contain media files.
Definition mods.cpp:78
Definition scripting_server.h:33
Definition mods.h:25