Release beta 1.1.1 stacked scan boosts

This commit is contained in:
JWeBot Contributors
2026-10-16 17:31:45 +08:00
parent 35ef82f14f
commit 522e349491
20 changed files with 72 additions and 65 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "jwebot-config"
version = "1.1.0b1+1016"
version = "1.1.1b1+1016"
description = "Profile-based configuration compiler for JWeBot"
requires-python = ">=3.9"
dependencies = [
@@ -36,4 +36,4 @@ __all__ = [
"write_default_profile",
]
__version__ = "1.1.0b1+1016"
__version__ = "1.1.1b1+1016"
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
[project]
name = "jwebot-extension-host"
version = "1.1.0b1+1016"
version = "1.1.1b1+1016"
description = "Single-release, single-invocation process host for JWeBot extensions"
requires-python = ">=3.9"
dependencies = [
"jwebot-sdk==1.1.0b1+1016",
"jwebot-kernel==1.1.0b1+1016",
"jwebot-sdk==1.1.1b1+1016",
"jwebot-kernel==1.1.1b1+1016",
]
[project.scripts]
@@ -16,4 +16,4 @@ __all__ = [
"process_request",
]
__version__ = "1.1.0b1+1016"
__version__ = "1.1.1b1+1016"
+4 -4
View File
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
[project]
name = "jwebot-kernel"
version = "1.1.0b1+1016"
version = "1.1.1b1+1016"
description = "Stable routing and extension authority for JWeBot"
requires-python = ">=3.9"
dependencies = [
"jwebot-config==1.1.0b1+1016",
"jwebot-sdk==1.1.0b1+1016",
"jwebot-official-extensions==1.1.0b1+1016",
"jwebot-config==1.1.1b1+1016",
"jwebot-sdk==1.1.1b1+1016",
"jwebot-official-extensions==1.1.1b1+1016",
"tomli>=2; python_version < '3.11'",
]
@@ -107,4 +107,4 @@ __all__ = [
"verify_installed_release_signature",
]
__version__ = "1.1.0b1+1016"
__version__ = "1.1.1b1+1016"
@@ -2909,7 +2909,6 @@ class Ledger:
group_fingerprint: str,
slot_key: str,
) -> bool:
consume_boost_key = ""
with self.lock, self.connection:
row = self.connection.execute(
"""
@@ -2950,9 +2949,6 @@ class Ledger:
utc_now(),
),
)
consume_boost_key = person_key
if consume_boost_key:
self.consume_scan_boost(group_fingerprint, consume_boost_key)
return True
def fail_clock_broadcast(
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
[project]
name = "jwebot-official-extensions"
version = "1.1.0b1+1016"
version = "1.1.1b1+1016"
description = "Reviewed local command adapters and broker implementation for JWeBot"
requires-python = ">=3.9"
dependencies = [
"jwebot-sdk==1.1.0b1+1016",
"jwebot-sdk==1.1.1b1+1016",
]
[tool.setuptools.packages.find]
@@ -90,4 +90,4 @@ __all__ = [
"render_feature_list",
]
__version__ = "1.1.0b1+1016"
__version__ = "1.1.1b1+1016"
@@ -32,8 +32,10 @@ PRIMOGEM_MORA_VALUE = 3600
PRIMOGEM_EVENT_LIMIT = 50
PRIMOGEM_EVENT_DISPLAY_LIMIT = 5
WISH_HISTORY_LIMIT = 30
SCAN_BOOST_USES = 24
SCAN_BOOST_WEIGHT = 4
SCAN_BOOST_HOURS = 24
SCAN_BOOST_SECONDS = SCAN_BOOST_HOURS * 60 * 60
SCAN_BOOST_WEIGHT = 5
SCAN_BOOST_LIMIT = 200
TAFFY_SAY_CREDITS_PER_PRIMOGEM = 2
TAFFY_SAY_MAX_CHARS = 160
WISH_MORA_TABLE = (
@@ -331,31 +333,34 @@ def normalize_player_account(account: dict[str, Any]) -> dict[str, Any]:
if not isinstance(boosts, list):
boosts = []
normalized_boosts = []
current_time = time.time()
for boost in boosts:
if not isinstance(boost, dict):
continue
target_key = str(boost.get("target_person_key", "")).strip()
target_name = str(boost.get("target_display_name", "")).strip()
remaining = boost.get("remaining", 0)
weight = boost.get("weight", 0)
created_at = float(boost.get("created_at", current_time) or current_time)
expires_at = boost.get("expires_at")
if not isinstance(expires_at, (int, float)):
expires_at = created_at + SCAN_BOOST_SECONDS
if (
target_key
and target_name
and type(remaining) is int
and remaining > 0
and type(weight) is int
and weight > 0
and float(expires_at) > current_time
):
normalized_boosts.append(
{
"target_person_key": target_key[:128],
"target_display_name": target_name[:120],
"remaining": min(remaining, 10_000),
"weight": min(weight, 100),
"created_at": float(boost.get("created_at", 0) or 0),
"weight": min(max(weight, SCAN_BOOST_WEIGHT), 100),
"created_at": created_at,
"expires_at": float(expires_at),
}
)
account["scan_boosts"] = normalized_boosts[-20:]
account["scan_boosts"] = normalized_boosts[-SCAN_BOOST_LIMIT:]
return account
@@ -883,24 +888,21 @@ class PlayerGames:
f"{player_label}:没有扫码概率券,原石也不足;"
f"当前原石 {account['primogems']} 个"
)
boosts = [
item
for item in account["scan_boosts"]
if item["target_person_key"] != target["person_key"]
]
now = time.time()
boosts = list(account["scan_boosts"])
boosts.append(
{
"target_person_key": str(target["person_key"]),
"target_display_name": target_label,
"remaining": SCAN_BOOST_USES,
"weight": SCAN_BOOST_WEIGHT,
"created_at": time.time(),
"created_at": now,
"expires_at": now + SCAN_BOOST_SECONDS,
}
)
account["scan_boosts"] = boosts[-20:]
account["scan_boosts"] = boosts[-SCAN_BOOST_LIMIT:]
return (
f"{player_label}:已给 {target_label} 增加整点扫码权重;"
f"{cost_text};未来 {SCAN_BOOST_USES} 次送达扫码播报中,"
f"{cost_text};未来 {SCAN_BOOST_HOURS} 小时内,"
f"{target_label} 额外 +{SCAN_BOOST_WEIGHT} 权重"
)
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "jwebot-sdk"
version = "1.1.0b1+1016"
version = "1.1.1b1+1016"
description = "Typed, capability-limited extension API for JWeBot plugins"
requires-python = ">=3.9"
dependencies = []
@@ -38,4 +38,4 @@ __all__ = [
"SingleGroupContext",
]
__version__ = "1.1.0b1+1016"
__version__ = "1.1.1b1+1016"