aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/datamanager.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index be63673e..adc320a9 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -56,7 +56,13 @@ local function simplesave (f, o)
------- API -------------
function getpath(username, host, datastore)
- return format("data/%s/%s/%s.dat", encode(host), datastore, encode(username));
+ if username then
+ return format("data/%s/%s/%s.dat", encode(host), datastore, encode(username));
+ elseif host then
+ return format("data/%s/%s.dat", encode(host), datastore);
+ else
+ return format("data/%s.dat", datastore);
+ end
end
function load(username, host, datastore)