summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-13 23:30:13 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-13 23:36:55 +0300
commitd589fe649959239c268b1affddee8a453f96e969 (patch)
tree5cf63f44ad5191df439564919dafdf72145d16de /src/client.cpp
parent7ad6bc89291c198122f087a11fd9ab585ea87034 (diff)
downloadManaVerse-d589fe649959239c268b1affddee8a453f96e969.tar.gz
ManaVerse-d589fe649959239c268b1affddee8a453f96e969.tar.bz2
ManaVerse-d589fe649959239c268b1affddee8a453f96e969.tar.xz
ManaVerse-d589fe649959239c268b1affddee8a453f96e969.zip
Add support for temp dir.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 5d43afbf5..1d1fdeaa5 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -295,6 +295,7 @@ void Client::testsInit()
{
logger = new Logger;
initLocalDataDir();
+ initTempDir();
initConfigDir();
}
}
@@ -1635,6 +1636,7 @@ void Client::initRootDir()
void Client::initHomeDir()
{
initLocalDataDir();
+ initTempDir();
initConfigDir();
}
@@ -1666,7 +1668,18 @@ void Client::initLocalDataDir()
if (mkdir_r(mLocalDataDir.c_str()))
{
logger->error(strprintf(_("%s doesn't exist and can't be created! "
- "Exiting."), mLocalDataDir.c_str()));
+ "Exiting."), mLocalDataDir.c_str()));
+ }
+}
+
+void Client::initTempDir()
+{
+ mTempDir = mLocalDataDir + PHYSFS_getDirSeparator() + "temp";
+
+ if (mkdir_r(mTempDir.c_str()))
+ {
+ logger->error(strprintf(_("%s doesn't exist and can't be created! "
+ "Exiting."), mTempDir.c_str()));
}
}