1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Split settings into seperate source and header files

This also cleans up settings a bit
This commit is contained in:
ShadowNinja 2014-09-11 18:22:05 -04:00
parent 2ae5d3f3ab
commit 6bc4cad0ed
27 changed files with 996 additions and 941 deletions

View file

@ -3065,37 +3065,25 @@ void ServerMap::loadMapMeta()
{
DSTACK(__FUNCTION_NAME);
/*infostream<<"ServerMap::loadMapMeta(): Loading map metadata"
<<std::endl;*/
std::string fullpath = m_savedir + DIR_DELIM + "map_meta.txt";
std::string fullpath = m_savedir + DIR_DELIM "map_meta.txt";
std::ifstream is(fullpath.c_str(), std::ios_base::binary);
if(is.good() == false)
{
infostream<<"ERROR: ServerMap::loadMapMeta(): "
<<"could not open"<<fullpath<<std::endl;
if (!is.good()) {
errorstream << "ServerMap::loadMapMeta(): "
<< "could not open" << fullpath << std::endl;
throw FileNotGoodException("Cannot open map metadata");
}
Settings params;
for(;;)
{
if(is.eof())
throw SerializationError
("ServerMap::loadMapMeta(): [end_of_params] not found");
std::string line;
std::getline(is, line);
std::string trimmedline = trim(line);
if(trimmedline == "[end_of_params]")
break;
params.parseConfigLine(line);
if (!params.parseConfigLines(is, "[end_of_params]")) {
throw SerializationError("ServerMap::loadMapMeta(): "
"[end_of_params] not found!");
}
m_emerge->loadParamsFromSettings(&params);
verbosestream<<"ServerMap::loadMapMeta(): seed="
<< m_emerge->params.seed<<std::endl;
verbosestream << "ServerMap::loadMapMeta(): seed="
<< m_emerge->params.seed << std::endl;
}
void ServerMap::saveSectorMeta(ServerMapSector *sector)