mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-21 17:34:46 -05:00
Fix saving score incorrectly while the first play for BeatStream.
This commit is contained in:
parent
c2e321e298
commit
e64542f233
|
|
@ -1,6 +1,6 @@
|
|||
# BeatStream
|
||||
|
||||
Plugin Version: **v1.0.0**
|
||||
Plugin Version: **v1.0.1**
|
||||
|
||||
Supported Versions:
|
||||
|
||||
|
|
|
|||
|
|
@ -111,12 +111,13 @@ export namespace Bst2HandlersCommon {
|
|||
} while ((await DB.Find<IBst2Account>(null, { collection: "bst.bst2.player.account", userId: userId })).length > 0)
|
||||
oldAccount = fromMap(Bst2AccountMap)
|
||||
oldAccount.userId = userId
|
||||
} else {
|
||||
oldAccount.playCount++
|
||||
if (!isToday(toBigInt(oldAccount.standardTime))) {
|
||||
oldAccount.dayCount++
|
||||
oldAccount.playCountToday = 1
|
||||
} else oldAccount.playCountToday++
|
||||
}
|
||||
oldAccount.playCount++
|
||||
if (!isToday(toBigInt(oldAccount.standardTime))) {
|
||||
oldAccount.dayCount++
|
||||
oldAccount.playCountToday = 1
|
||||
} else oldAccount.playCountToday++
|
||||
oldAccount.standardTime = BigIntProxy(BigInt(Date.now()))
|
||||
opm.upsert<IBst2Account>(refid, { collection: "bst.bst2.player.account" }, oldAccount)
|
||||
if (player.pdata.base) opm.upsert<IBst2Base>(refid, { collection: "bst.bst2.player.base" }, player.pdata.base)
|
||||
|
|
@ -130,7 +131,7 @@ export namespace Bst2HandlersCommon {
|
|||
if (player.pdata.playLog?.crysis?.length > 0) for (let c of player.pdata.playLog.crysis) opm.upsert<IBst2CrysisLog>(refid, { collection: "bst.bst2.player.event.crysis", id: c.id, stageId: c.stageId }, c)
|
||||
|
||||
await DBM.operate(opm)
|
||||
send.object({ uid: K.ITEM("s32", 0) })
|
||||
send.object({ uid: K.ITEM("s32", oldAccount.userId) })
|
||||
}
|
||||
|
||||
export const WriteStageLog: EPR = async (_, data, send) => {
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@
|
|||
let bst2HighestRank = -1
|
||||
for (let r of bst2Course) if ((r.courseId > bst2HighestRank) && (r.medal >= 3)) bst2HighestRank = r.courseId
|
||||
function getClearTypeDetails(record) {
|
||||
if (record.medal == 5) return { title: "Perfect", abbr: "P", color: "#FF3860", badge: "mdi mdi-weather-sunny mdi-48px" }
|
||||
if (record.medal == 5) return { title: "Perfect", abbr: "P", color: "#FF3860; text-shadow: 0 0 5px #FFFFFF9F;", badge: "mdi mdi-decagram mdi-48px" }
|
||||
else if (record.medal == 4) return { title: "Full Combo", abbr: "FC", color: "gold", badge: "mdi mdi-cog mdi-48px" }
|
||||
else if (record.medal == 3) return { title: "Clear", abbr: "C", color: "#35F2BE", badge: "mdi mdi-star-circle-outline mdi-48px"}
|
||||
else if (record.medal == 3) return { title: "Clear", abbr: "C", color: "#33E7AD", badge: "mdi mdi-star-circle-outline mdi-48px"}
|
||||
else if ((record.medal == 2) || (record.medal == 1)) return { title: "Failed", abbr: "F", color: "#837E8D", badge: "mdi mdi-close-circle-outline mdi-48px"}
|
||||
else return null
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user