mirror of
https://gitea.tendokyu.moe/Dniel97/artemis.git
synced 2026-09-22 22:28:25 +03:00
billing: improve playlimit calculation
This commit is contained in:
+1
-4
@@ -711,7 +711,6 @@ class BillingServlet:
|
||||
"messages": []
|
||||
}
|
||||
playhist = "000000/0:000000/0:000000/0"
|
||||
total_playcount = req.playcnt
|
||||
|
||||
if machine is not None:
|
||||
if self.config.allnet.save_billing:
|
||||
@@ -732,8 +731,6 @@ class BillingServlet:
|
||||
|
||||
plays = await self.data.arcade.billing_get_playcount_3mo(machine['id'], req.gameid)
|
||||
if plays:
|
||||
total_playcount = sum(p['playct'] for p in plays)
|
||||
|
||||
playhist = ":".join(
|
||||
f"{p['year']:04d}{p['month']:02d}/{p['playct']}"
|
||||
for p in reversed(plays)
|
||||
@@ -820,7 +817,7 @@ class BillingServlet:
|
||||
return PlainTextResponse("result=6&waittime=0&linelimit=20\r\n")
|
||||
|
||||
playlimit = req.playlimit
|
||||
while total_playcount > playlimit:
|
||||
while req.playcnt >= playlimit - req.nearfull:
|
||||
playlimit += 1024
|
||||
|
||||
nearfull = req.nearfull | (req.billingtype.value << 16)
|
||||
|
||||
Reference in New Issue
Block a user