mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
lb limit count and attempt case insensitive
This commit is contained in:
parent
5d61ee091c
commit
07bff7724d
2 changed files with 6 additions and 6 deletions
|
|
@ -49,7 +49,7 @@ class Leaderboards {
|
||||||
public static function getScores(mission:String, kind:LeaderboardsKind, cb:Array<LBScore>->Void) {
|
public static function getScores(mission:String, kind:LeaderboardsKind, cb:Array<LBScore>->Void) {
|
||||||
if (!StringTools.startsWith(mission, "data/"))
|
if (!StringTools.startsWith(mission, "data/"))
|
||||||
mission = "data/" + mission;
|
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 s = b.toString();
|
||||||
var scores:Array<LBScore> = Json.parse(s).scores;
|
var scores:Array<LBScore> = Json.parse(s).scores;
|
||||||
cb(scores);
|
cb(scores);
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class TorqueFileSystem extends LocalFileSystem {
|
||||||
override function checkPath(path:String) {
|
override function checkPath(path:String) {
|
||||||
// make sure the file is loaded with correct case !
|
// make sure the file is loaded with correct case !
|
||||||
var baseDir = new haxe.io.Path(path).dir;
|
var baseDir = new haxe.io.Path(path).dir;
|
||||||
var c = directoryCache.get(baseDir.toLowerCase());
|
var c = directoryCache.get(baseDir);
|
||||||
var isNew = false;
|
var isNew = false;
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
isNew = true;
|
isNew = true;
|
||||||
|
|
@ -62,13 +62,13 @@ class TorqueFileSystem extends LocalFileSystem {
|
||||||
sys.FileSystem.readDirectory(baseDir)
|
sys.FileSystem.readDirectory(baseDir)
|
||||||
catch (e:Dynamic)
|
catch (e:Dynamic)
|
||||||
[])
|
[])
|
||||||
c.set(f.toLowerCase(), true);
|
c.set(f, true);
|
||||||
directoryCache.set(baseDir.toLowerCase(), c);
|
directoryCache.set(baseDir, c);
|
||||||
}
|
}
|
||||||
if (!c.exists(path.substr(baseDir.length + 1).toLowerCase())) {
|
if (!c.exists(path.substr(baseDir.length + 1))) {
|
||||||
// added since then?
|
// added since then?
|
||||||
if (!isNew) {
|
if (!isNew) {
|
||||||
directoryCache.remove(baseDir.toLowerCase());
|
directoryCache.remove(baseDir);
|
||||||
return checkPath(path);
|
return checkPath(path);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue