aboutsummaryrefslogtreecommitdiffstats
path: root/util/datamanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r--util/datamanager.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 71c0fe86..2f5be002 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)