bdo-toolkit 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bdo_toolkit/__init__.py +87 -0
- bdo_toolkit/_async_sessions.py +651 -0
- bdo_toolkit/_capture_backend.py +194 -0
- bdo_toolkit/_capture_options.py +68 -0
- bdo_toolkit/_capture_runtime.py +626 -0
- bdo_toolkit/_deposit_origin.py +1599 -0
- bdo_toolkit/_engine.py +327 -0
- bdo_toolkit/_framing.py +904 -0
- bdo_toolkit/_profile_runtime.py +157 -0
- bdo_toolkit/_protocol.py +386 -0
- bdo_toolkit/_reassembly.py +654 -0
- bdo_toolkit/_specs.py +285 -0
- bdo_toolkit/_storage_destination_validation.py +167 -0
- bdo_toolkit/_storage_hydration.py +241 -0
- bdo_toolkit/_version.py +3 -0
- bdo_toolkit/calibration.py +3223 -0
- bdo_toolkit/capture.py +1713 -0
- bdo_toolkit/character_state.py +3506 -0
- bdo_toolkit/cli.py +948 -0
- bdo_toolkit/diagnostics.py +51 -0
- bdo_toolkit/events.py +214 -0
- bdo_toolkit/filters.py +105 -0
- bdo_toolkit/item_state.py +48 -0
- bdo_toolkit/origin_learning.py +779 -0
- bdo_toolkit/profiles.py +370 -0
- bdo_toolkit/py.typed +1 -0
- bdo_toolkit/remote_profiles.py +358 -0
- bdo_toolkit/solare/__init__.py +50 -0
- bdo_toolkit/solare/_constants.py +94 -0
- bdo_toolkit/solare/_detail_learning.py +1437 -0
- bdo_toolkit/solare/_details.py +796 -0
- bdo_toolkit/solare/_discovery.py +1212 -0
- bdo_toolkit/solare/_live_tracker.py +472 -0
- bdo_toolkit/solare/_replay_capture.py +182 -0
- bdo_toolkit/solare/_result.py +441 -0
- bdo_toolkit/solare/_scanner.py +203 -0
- bdo_toolkit/solare/_validation.py +11 -0
- bdo_toolkit/solare/async_session.py +444 -0
- bdo_toolkit/solare/models.py +806 -0
- bdo_toolkit/solare/replay.py +62 -0
- bdo_toolkit/solare/session.py +1051 -0
- bdo_toolkit/writers.py +30 -0
- bdo_toolkit-1.0.0.dist-info/METADATA +143 -0
- bdo_toolkit-1.0.0.dist-info/RECORD +48 -0
- bdo_toolkit-1.0.0.dist-info/WHEEL +5 -0
- bdo_toolkit-1.0.0.dist-info/entry_points.txt +2 -0
- bdo_toolkit-1.0.0.dist-info/licenses/LICENSE +21 -0
- bdo_toolkit-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Public offline replay API for Arena of Solare leaderboard captures."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Iterable
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from bdo_toolkit._capture_backend import iter_pcap_file
|
|
9
|
+
from bdo_toolkit._protocol import DEFAULT_SERVER_PORTS
|
|
10
|
+
|
|
11
|
+
from ._live_tracker import LiveSolareDiscoveryTracker
|
|
12
|
+
from ._replay_capture import SolareFrameCollector
|
|
13
|
+
from ._result import build_solare_result
|
|
14
|
+
from ._validation import validate_retain_raw_extensions
|
|
15
|
+
from .models import SolareCaptureResult
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def replay_solare(
|
|
19
|
+
path: str | Path,
|
|
20
|
+
*,
|
|
21
|
+
ports: Iterable[int] = DEFAULT_SERVER_PORTS,
|
|
22
|
+
retain_raw_extensions: bool = False,
|
|
23
|
+
) -> SolareCaptureResult:
|
|
24
|
+
"""Replay a pcap/pcapng file and discover one Solare leaderboard snapshot.
|
|
25
|
+
|
|
26
|
+
Classification is based on the relationships among ranked, class-balanced,
|
|
27
|
+
and overall tables. Opcode values are retained only as diagnostic evidence
|
|
28
|
+
and are never supplied as classifier inputs.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
retain_raw_extensions = validate_retain_raw_extensions(
|
|
32
|
+
retain_raw_extensions
|
|
33
|
+
)
|
|
34
|
+
tracker = LiveSolareDiscoveryTracker(lambda _update: None)
|
|
35
|
+
collector = SolareFrameCollector(
|
|
36
|
+
ports,
|
|
37
|
+
on_frame=tracker.observe,
|
|
38
|
+
retain_frames=False,
|
|
39
|
+
)
|
|
40
|
+
saved_packets = 0
|
|
41
|
+
for _ in iter_pcap_file(Path(path), collector):
|
|
42
|
+
saved_packets += 1
|
|
43
|
+
collector.finish()
|
|
44
|
+
tracker.refresh()
|
|
45
|
+
frames = tracker.confirmed_frames or tracker.retained_frames
|
|
46
|
+
return build_solare_result(
|
|
47
|
+
frames,
|
|
48
|
+
collector.health(
|
|
49
|
+
saved_packets=saved_packets,
|
|
50
|
+
retained_large_messages=tracker.observed_frame_count,
|
|
51
|
+
candidate_messages_observed=tracker.observed_frame_count,
|
|
52
|
+
candidate_frames_retained=tracker.retained_frame_count,
|
|
53
|
+
candidate_bytes_retained=tracker.retained_bytes,
|
|
54
|
+
peak_candidate_frames=tracker.peak_retained_frame_count,
|
|
55
|
+
peak_candidate_bytes=tracker.peak_retained_bytes,
|
|
56
|
+
candidate_frames_evicted=tracker.evicted_frame_count,
|
|
57
|
+
candidate_bytes_evicted=tracker.evicted_bytes,
|
|
58
|
+
candidate_history_rolled_over=tracker.history_rolled_over,
|
|
59
|
+
),
|
|
60
|
+
retain_raw_extensions=retain_raw_extensions,
|
|
61
|
+
_discovery=tracker.result,
|
|
62
|
+
)
|