summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-13 00:06:37 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-13 00:06:37 +0200
commit591527d8787b6dfaafd2113bc001fe892b3eb0fb (patch)
tree8c6391f41af9b027779329c8ce68358099a781cc /src/server.cpp
parent82073025ccc551c2fd205cc1dc6fcecac61cc7ea (diff)
downloadminetest-591527d8787b6dfaafd2113bc001fe892b3eb0fb.tar.gz
minetest-591527d8787b6dfaafd2113bc001fe892b3eb0fb.tar.bz2
minetest-591527d8787b6dfaafd2113bc001fe892b3eb0fb.zip
World creation button and dialog and functionality
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 63bf794ab..cb4813ed8 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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);