mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-26 00:47:57 +03:00
* docs: migrate from mkdocs to mdbook - Rename old mkdocs docs/ to old-docs/ for reference - Set up new docs/ with mdbook (book.toml + src/ tree) - Mirror full nav structure from mkdocs.yml into SUMMARY.md - Add Justfile-docs with docs-serve, docs-build, docs-check, docs-install recipes - Import Justfile-docs from root Justfile - Rewrite .github/workflows/docs.yml: build step uses taiki-e/install-action to install mdbook, split into separate build + deploy jobs, PR builds run the check step too * ci(docs): pin actions to SHAs, install mdbook via release binary * ci(docs): install mdbook from apt instead of curling a release binary * dev: replace mkdocs python stack with mdbook in dev image * ci(docs): apt only works on Debian; restore release binary install for Ubuntu CI * docs: fix duplicate file entries in SUMMARY.md * docs: remove docs-install recipe * docs: remove site-url from book.toml to fix asset loading * dev: install mdbook from upstream release binary, not Debian apt The Debian package (0.4.x+ds) strips bundled font assets, leaving the built site without fonts/fonts.css. Use the upstream tarball (same as CI) so the theme is complete. Handles x86_64 and aarch64. * docs: vendor mdbook tarballs in dev/mdbook/, install from there Dockerfile.dev uses COPY + tar to install the right arch at build time. CI extracts the x86_64 tarball directly from the checkout. No network access required for either — and no stripped-fonts Debian package. * fix: unwritten
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
# Sessions
|
|
|
|
This page documents how Sessions are constructed.
|
|
For a humanised explaination of sessions, see
|
|
[this page](../../wiki/features.md#sessions).
|
|
|
|
*****
|
|
|
|
## Creating New Sessions
|
|
|
|
Scores are sorted on the time they were achieved. Scores
|
|
without timestamps are discarded from any session processing.
|
|
|
|
Scores are then grouped into buckets of two hours, in pseudocode:
|
|
|
|
```ts
|
|
let lastTimestamp = 0;
|
|
|
|
for (score of scores) {
|
|
if (score.timestamp > lastTimestamp + TWO_HOURS) {
|
|
CloseBucket();
|
|
CreateNewBucketWithThisScore();
|
|
}
|
|
else {
|
|
AppendToBucket();
|
|
}
|
|
|
|
lastTimestamp = score.timestamp;
|
|
}
|
|
```
|
|
|
|
This means that if there was more than two hours between
|
|
any two successive scores, the session is marked as terminated
|
|
and a new bucket of scores is created.
|
|
|
|
Once we have gotten all the scores we
|
|
can create a session from them. We need to generate a random
|
|
name (we have some stuff in `src/datasets` for this).
|
|
|
|
We also need to calculate statistics for this session,
|
|
this is dependent on the game + playtype being used.
|
|
|
|
## Appending To Sessions
|
|
|
|
If a score within 2 hours of an existing session,
|
|
then that score is appended to the session.
|
|
|
|
!!! bug
|
|
Sessions do not currently conjoin if a user was to
|
|
get a score between two sessions such that
|
|
there was now less than two hours between the first
|
|
sessions last score and the second sessions first score.
|
|
|
|
This is so difficult to properly resolve that Tachi simply
|
|
makes no attempt to stop it.
|