diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-11 15:04:50 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-11 15:04:50 +0200 |
commit | 6a1b6d03442153aa1a73e3e55d89915bf11a085c (patch) | |
tree | 4c2c612391150d335b965c6285ec5c0e6538c774 | |
parent | 7f7fb9750df3aceec48f65cee657e15364e0a911 (diff) | |
download | minetest-6a1b6d03442153aa1a73e3e55d89915bf11a085c.tar.gz minetest-6a1b6d03442153aa1a73e3e55d89915bf11a085c.tar.bz2 minetest-6a1b6d03442153aa1a73e3e55d89915bf11a085c.zip |
world.mt creation
-rw-r--r-- | src/server.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp index 7b34e3554..f68672456 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -867,7 +867,7 @@ Server::Server( if(!gamespec.isValid()) throw ServerError("Supplied invalid gamespec"); - + // Figure out some paths // share/server m_path_share = porting::path_share + DIR_DELIM + "server"; @@ -899,6 +899,15 @@ 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"; + } + // Lock environment JMutexAutoLock envlock(m_env_mutex); JMutexAutoLock conlock(m_con_mutex); |