1
0

AString logging fix 2

git-svn-id: http://mc-server.googlecode.com/svn/trunk@218 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-02-01 14:08:12 +00:00
parent ef196ec22f
commit cb1ce14169
7 changed files with 27 additions and 21 deletions

View File

@@ -799,7 +799,7 @@ bool cPlayer::LoadFromDisk()
std::auto_ptr<char> buffer(new char[FileSize]);
if (f.Read(buffer.get(), FileSize) != FileSize)
{
LOGERROR("ERROR READING FROM FILE \"%s\"", SourceFile);
LOGERROR("ERROR READING FROM FILE \"%s\"", SourceFile.c_str());
return false;
}
f.Close();
@@ -808,7 +808,7 @@ bool cPlayer::LoadFromDisk()
Json::Reader reader;
if (!reader.parse(buffer.get(), root, false))
{
LOGERROR("ERROR WHILE PARSING JSON FROM FILE %s", SourceFile);
LOGERROR("ERROR WHILE PARSING JSON FROM FILE %s", SourceFile.c_str());
}
buffer.reset();
@@ -882,12 +882,12 @@ bool cPlayer::SaveToDisk()
cFile f;
if (!f.Open(SourceFile, cFile::fmWrite))
{
LOGERROR("ERROR WRITING PLAYER \"%s\" TO FILE \"%s\" - cannot open file", m_pState->PlayerName.c_str(), SourceFile);
LOGERROR("ERROR WRITING PLAYER \"%s\" TO FILE \"%s\" - cannot open file", m_pState->PlayerName.c_str(), SourceFile.c_str());
return false;
}
if (f.Write(JsonData.c_str(), JsonData.size()) != JsonData.size())
{
LOGERROR("ERROR WRITING PLAYER JSON TO FILE \"%s\"", SourceFile);
LOGERROR("ERROR WRITING PLAYER JSON TO FILE \"%s\"", SourceFile.c_str());
return false;
}
return true;