 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
41 for (
const auto &file :
files) {
43 if (loader->willLoad(file)) {
59 char full_path[PATH_MAX];
60 std::vector<std::string> names[2];
63 dp =
opendir(directory.c_str());
70 if (
d->d_name[0] == 0 ||
d->d_name[0] ==
'.' || strcmp(
d->d_name,
"dev") == 0 || strcmp(
d->d_name,
"trashbin") == 0)
73 snprintf(full_path,
sizeof(full_path),
"%s/%s", directory.c_str(),
d->d_name);
75 type = S_ISDIR(sb.st_mode) ? 0 : 1;
76 names[
type].push_back(full_path);
81 std::sort(names[
type].begin(), names[
type].end());
86 for (
const auto &dir : names[0]) {
93 if (loader->willLoad(filename)) {
94 loader->load(reader, filename);
@ llevError
Error, serious thing.
virtual void load(BufferReader *reader, const std::string &filename) override
Load assets from the specified reader.
void bufferreader_destroy(BufferReader *br)
Destroy a BufferReader.
Abstract buffer handler, processing a BufferReader.
std::vector< AssetLoader * > m_loaders
Registered loaders.
void collect(const std::string &directory)
Recurse in the specified directory, finding all files and calling loaders to process them.
BufferReader * m_reader
Reader used to load files.
AssetCollector()
Constructor.
BufferReader * bufferreader_init_from_file(BufferReader *br, const char *filepath, const char *failureMessage, LogLevel failureLevel)
Initialize or create a BufferReader from a file path.
DIR * opendir(const char *)
the server will also quite happily load unpacked files as long as they have the right file which is convenient if you want to edit your maps and archetypes live It also contains a few files
void processFiles(const std::vector< std::string > &files)
Process a list of files.
struct dirent * readdir(DIR *)
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for d
virtual ~AssetCollector()
Destructor.
BufferReader * bufferreader_create()
Create a new BufferReader.