billing: improve playlimit calculation

This commit is contained in:
Dniel97
2026-07-10 21:43:05 +02:00
parent 297abf4e54
commit c90f5115de
+1 -4
View File
@@ -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)