up version

This commit is contained in:
2019-09-09 21:44:29 +03:00
parent 77ddd78d84
commit 112cd7ba2f
3 changed files with 243 additions and 260 deletions

View File

@@ -12,7 +12,7 @@ class ServerLevelBundle implements ILevelBundle {
public function new() {}
public function get(id:PackId):LevelPack {
var path = FileSystem.absolutePath('./levels/${id}.zip');
var path = FileSystem.absolutePath('./resources/level/${id}.zip');
var bytes = File.getBytes(path);
return {
id: id,
@@ -22,4 +22,12 @@ class ServerLevelBundle implements ILevelBundle {
}),
};
}
public function list():Array<PackId> {
var result = [];
for (path in FileSystem.readDirectory("./resources/level")) {
result.push(PackId.fromString(path.split("/").pop().split(".").shift()));
}
return result;
}
}