aboutsummaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-06-21 18:32:28 +0000
committerPilzAdam <pilzadam@minetest.net>2013-06-22 21:39:47 +0000
commit130464c2688fc2c9cd39d16568c12f17c105cb89 (patch)
treefec63cbebc26e220d25bdc7d1f7a4f7c6e42b13a /src/environment.cpp
parent4d77781ce7cba571701e731b1f442af691933720 (diff)
downloadminetest-130464c2688fc2c9cd39d16568c12f17c105cb89.tar.xz
Print playername when failing to read playerfile and ignore files starting with .
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 99da5190c..4b785998b 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -399,7 +399,7 @@ void ServerEnvironment::serializePlayers(const std::string &savedir)
std::vector<fs::DirListNode> player_files = fs::GetDirListing(players_path);
for(u32 i=0; i<player_files.size(); i++)
{
- if(player_files[i].dir)
+ if(player_files[i].dir || player_files[i].name[0] == '.')
continue;
// Full path to this file
@@ -417,7 +417,7 @@ void ServerEnvironment::serializePlayers(const std::string &savedir)
infostream<<"Failed to read "<<path<<std::endl;
continue;
}
- testplayer.deSerialize(is);
+ testplayer.deSerialize(is, player_files[i].name);
}
//infostream<<"Loaded test player with name "<<testplayer.getName()<<std::endl;
@@ -529,7 +529,7 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir)
infostream<<"Failed to read "<<path<<std::endl;
continue;
}
- testplayer.deSerialize(is);
+ testplayer.deSerialize(is, player_files[i].name);
}
if(!string_allowed(testplayer.getName(), PLAYERNAME_ALLOWED_CHARS))
@@ -563,7 +563,7 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir)
infostream<<"Failed to read "<<path<<std::endl;
continue;
}
- player->deSerialize(is);
+ player->deSerialize(is, player_files[i].name);
}
if(newplayer)