mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix bugs
This commit is contained in:
parent
7de8e8469f
commit
e46b10b5cc
2 changed files with 27 additions and 14 deletions
|
|
@ -31,8 +31,10 @@ class Analytics {
|
|||
|
||||
public static function trackLevelPlay(levelName:String, levelFile:String) {
|
||||
var p = payload("level-play", {
|
||||
name: levelName,
|
||||
file: levelFile
|
||||
level: {
|
||||
name: levelName,
|
||||
file: levelFile
|
||||
}
|
||||
});
|
||||
var json = Json.stringify(p);
|
||||
Http.post(umami, json, (b) -> {
|
||||
|
|
@ -44,12 +46,14 @@ class Analytics {
|
|||
|
||||
public static function trackLevelScore(levelName:String, levelFile:String, time:Int, oobs:Int, respawns:Int, rewind:Bool) {
|
||||
var p = payload("level-score", {
|
||||
name: levelName,
|
||||
file: levelFile,
|
||||
time: time,
|
||||
oobs: oobs,
|
||||
respawns: respawns,
|
||||
rewind: rewind
|
||||
level_play: Json.stringify({
|
||||
name: levelName,
|
||||
file: levelFile,
|
||||
time: time,
|
||||
oobs: oobs,
|
||||
respawns: respawns,
|
||||
rewind: rewind
|
||||
})
|
||||
});
|
||||
var json = Json.stringify(p);
|
||||
Http.post(umami, json, (b) -> {
|
||||
|
|
@ -61,12 +65,14 @@ class Analytics {
|
|||
|
||||
public static function trackLevelQuit(levelName:String, levelFile:String, time:Int, oobs:Int, respawns:Int, rewind:Bool) {
|
||||
var p = payload("level-quit", {
|
||||
name: levelName,
|
||||
file: levelFile,
|
||||
time: time,
|
||||
oobs: oobs,
|
||||
respawns: respawns,
|
||||
rewind: rewind
|
||||
level_quit: Json.stringify({
|
||||
name: levelName,
|
||||
file: levelFile,
|
||||
time: time,
|
||||
oobs: oobs,
|
||||
respawns: respawns,
|
||||
rewind: rewind
|
||||
})
|
||||
});
|
||||
var json = Json.stringify(p);
|
||||
Http.post(umami, json, (b) -> {
|
||||
|
|
|
|||
|
|
@ -291,6 +291,13 @@ class MarbleGame {
|
|||
var missionType = world.mission.type;
|
||||
var isNotCustom = !world.mission.isClaMission && !world.mission.isCustom;
|
||||
world.setCursorLock(false);
|
||||
if (!Settings.levelStatistics.exists(world.mission.path)) {
|
||||
Settings.levelStatistics.set(world.mission.path, {
|
||||
oobs: 0,
|
||||
respawns: 0,
|
||||
totalTime: 0,
|
||||
});
|
||||
}
|
||||
var stats = Settings.levelStatistics[world.mission.path];
|
||||
Analytics.trackLevelQuit(world.mission.title, world.mission.path, Std.int(world.timeState.timeSinceLoad * 1000), stats.oobs, stats.respawns,
|
||||
Settings.optionsSettings.rewindEnabled);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue