1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

World creation button and dialog and functionality

This commit is contained in:
Perttu Ahola 2012-03-13 00:06:37 +02:00
parent 82073025cc
commit 591527d878
11 changed files with 492 additions and 87 deletions

View file

@ -907,14 +907,9 @@ Server::Server(
infostream<<"- mods: "<<modspath<<std::endl;
}
// Create world.mt if does not already exist
std::string worldmt_path = m_path_world + DIR_DELIM + "world.mt";
if(!fs::PathExists(worldmt_path)){
infostream<<"Creating world.mt ("<<worldmt_path<<")"<<std::endl;
fs::CreateAllDirs(m_path_world);
std::ofstream of(worldmt_path.c_str(), std::ios::binary);
of<<"gameid = "<<m_gamespec.id<<"\n";
}
// Create world if it doesn't exist
if(!initializeWorld(m_path_world, m_gamespec.id))
throw ServerError("Failed to initialize world");
// Lock environment
JMutexAutoLock envlock(m_env_mutex);