From 50bbf032335da529778f1b288b298ebb4ae141ef Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:08:28 +0530 Subject: [PATCH] lb limit count and attempt case insensitive --- src/Leaderboards.hx | 2 +- src/fs/TorqueFileSystem.hx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Leaderboards.hx b/src/Leaderboards.hx index 19908966..18c97020 100644 --- a/src/Leaderboards.hx +++ b/src/Leaderboards.hx @@ -49,7 +49,7 @@ class Leaderboards { public static function getScores(mission:String, kind:LeaderboardsKind, cb:Array->Void) { if (!StringTools.startsWith(mission, "data/")) mission = "data/" + mission; - return Http.get('${host}/api/scores?mission=${StringTools.urlEncode(mission)}&game=${game}&view=${kind}', (b) -> { + return Http.get('${host}/api/scores?mission=${StringTools.urlEncode(mission)}&game=${game}&view=${kind}&count=10', (b) -> { var s = b.toString(); var scores:Array = Json.parse(s).scores; cb(scores); diff --git a/src/fs/TorqueFileSystem.hx b/src/fs/TorqueFileSystem.hx index 698bfe1d..bb882a6a 100644 --- a/src/fs/TorqueFileSystem.hx +++ b/src/fs/TorqueFileSystem.hx @@ -54,7 +54,7 @@ class TorqueFileSystem extends LocalFileSystem { override function checkPath(path:String) { // make sure the file is loaded with correct case ! var baseDir = new haxe.io.Path(path).dir; - var c = directoryCache.get(baseDir.toLowerCase()); + var c = directoryCache.get(baseDir); var isNew = false; if (c == null) { isNew = true; @@ -63,13 +63,13 @@ class TorqueFileSystem extends LocalFileSystem { sys.FileSystem.readDirectory(baseDir) catch (e:Dynamic) []) - c.set(f.toLowerCase(), true); - directoryCache.set(baseDir.toLowerCase(), c); + c.set(f, true); + directoryCache.set(baseDir, c); } - if (!c.exists(path.substr(baseDir.length + 1).toLowerCase())) { + if (!c.exists(path.substr(baseDir.length + 1))) { // added since then? if (!isNew) { - directoryCache.remove(baseDir.toLowerCase()); + directoryCache.remove(baseDir); return checkPath(path); } return false;