Commit Graph

40 Commits

Author SHA1 Message Date
Bob G
69480cfa3e Speed up property model viewer: on-demand rendering, shared UGC caches, validators and gzip (#134)
* Speed up property model viewer loading

- Render the viewer on demand (load completion, camera change, resize)
  instead of every animation frame
- Share the UGC brick geometry cache and parsed Materials.xml across all
  UGC models on the converter
- Serve model and ldddb files with strong ETag/Last-Modified validators
  and conditional requests so repeat visits get 304s
- Gzip model and ldddb responses (COMPRESS_MODEL_RESPONSES), optionally
  storing .gz copies on disk (CACHE_COMPRESSED_MODELS)

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

* Add configurable redraw behaviour while property models load

PROPERTY_VIEWER_LOAD_REDRAW ('none' or 'interval') and
PROPERTY_VIEWER_REDRAW_INTERVAL_MS control whether the property viewer
redraws as individual models finish loading. A final draw always happens
once all loads complete or fail, and a loading indicator is shown
meanwhile. Also wrap long lines added by this branch for flake8.

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

* Show model loading progress in the property viewer

Replace the static 'Loading models...' badge in the upper-left corner with
a progress indicator, e.g. 'Loading models: 42% (89/203)', counting loaded
and failed models out of the total. When everything is done it shows
'Loaded 100% (203/203)' (with '(N failed)' if any), turns green (orange on
failures) and fades to a faint badge after a few seconds.

The indicator is a DOM element updated at most once per animation frame,
so it does not trigger canvas redraws in either redraw mode.

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

* Make the loading progress badge more opaque and readable

Use a ~93% opaque background for all states (dark while loading, darker
green when done, orange on failures), bold white text with a subtle text
shadow, border and drop shadow, and only fade to 70% opacity after
completion so it stays legible over colourful models.

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

* Batch UGC models and load the viewer's brick data asynchronously

Brick-built (UGC) models used to be loaded with synchronous XHRs on the
main thread: one request per model's LXFML plus one per brick primitive
file, strictly one after another, with the page frozen meanwhile. On a
remote server every request costs a network round trip, so a property
with 654 UGC models took about two minutes to load.

- New route properties.get_ugc_models/<property id> (login required, like
  get_model) returns all UGC LXFML of a property as one JSON object
  ({content id: lxfml}) from a single DB query. It is gzip-encoded per
  COMPRESS_MODEL_RESPONSES and has an ETag over the whole set, so repeat
  loads get a 304. The per-model get_model route keeps working.
- The viewer lists the brick database, fetches the LXFML (batched on
  view_models, per model with bounded concurrency otherwise) and then each
  needed brick primitive exactly once with at most 8 requests in flight,
  all with async fetch. Meshes are then built in short slices so the page
  stays responsive. The progress badge counts brick-built models as they
  are built and shows the fetch stage (e.g. 'bricks 120/385').
- Loading finishes once both the loading manager (pre-built models,
  ground texture) and the brick-built models are done; redraw modes are
  unchanged ('none' draws once at the end, 'interval' at most every N ms).
- get_model for a UGC model only decompresses the LXFML when it has to
  send a body (a matching If-None-Match skips it).

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

* Show the prebuilt material stage on the loading badge

While prebuilt models load, the badge now shows how many MTL files have
arrived (e.g. 'materials 120/203'), so progress moves from the start on
prebuilt-heavy properties instead of sitting at 0% until the first OBJ
loads.

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

* Show a rendering state on the badge before the final render

The final full render can block the main thread for a second or more on
large properties, which made the badge look frozen. Once all loads are
done the badge now shows 'Rendering N parts…' with a CSS spinner (a
transform animation the compositor keeps running), waits two animation
frames so it is painted, then renders and shows the Loaded state.

Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>

---------

Co-authored-by: bob-g-code <346622190+bob-g-code@users.noreply.github.com>
Co-authored-by: HailStorm32 <demetriv.s.7@gmail.com>
2026-11-01 07:20:48 -06:00
Bob G
f510931666 Make brick cache unpacking safe across concurrent workers (#133)
With several gunicorn workers and an empty cache, every worker ran the
brickdb unpack at once and workers crashed with FileExistsError on
app/cache/brickprimitives. Serialize it with a file lock, extract to a temp
dir and move into place, and mark completion with a marker file.

Co-authored-by: bob-g-code <bob-g-code@users.noreply.github.com>
2026-10-27 15:48:49 -05:00
aronwk-aaron
823ec2008f util command to get mission/ach awards that aren't in honor accollade 2024-05-26 22:49:32 -05:00
aronwk-aaron
abc8af89c5 update packages 2023-11-17 22:51:12 -06:00
aronwk-aaron
7633053490 it works 2023-11-17 16:38:01 -06:00
aronwk-aaron
e6c452d000 feat: add recaptcha support 2023-11-17 00:55:18 -06:00
aronwk-aaron
a578f8a53c register test command 2023-11-09 23:56:32 -06:00
aronwk-aaron
ee65f67fe3 actually fix mail port 2023-02-14 16:13:27 -06:00
aronwk-aaron
5d1b79334a force mail_port to be int
resolves #62
2023-02-14 13:39:44 -06:00
aronwk-aaron
ae46e6d382 remove analytics
add note about securing it
2022-12-29 15:10:36 -06:00
aronwk-aaron
e44872e523 delete temporary imports 2022-12-17 01:55:55 -06:00
aronwk-aaron
785357475d use cache more modified files
so that the client dir never has to be written to
2022-12-17 01:47:10 -06:00
aronwk-aaron
0fea032938 fix config defaults 2022-12-17 01:21:39 -06:00
aronwk-aaron
708fbfb9db fix icon rendering stuff 2022-12-17 00:59:47 -06:00
aronwk-aaron
53dda2fd8a move css to subfolder 2022-12-16 22:57:05 -06:00
aronwk-aaron
24fc6a0826 move logs to folder 2022-12-16 22:50:43 -06:00
aronwk-aaron
3fa8bd4651 fix handling new flag 2022-10-23 17:39:20 -05:00
aronwk-aaron
dce4466487 hacky charxml uploader until i do it the right way 2022-10-16 22:14:12 -05:00
Aaron Kimbre
44689aad36 remove gm req on bug get endpoint 2022-04-03 11:56:15 -05:00
Aaron Kimbre
f1d79f1e90 cleanup and fixes 2022-04-03 11:35:53 -05:00
Aaron Kimbre
70aed00d97 added command to fix legacy property issues 2022-04-02 16:33:23 -05:00
Aaron Kimbre
7f992a5dfa Add property reputation handling 2022-03-31 18:05:28 -05:00
Aaron Kimbre
be80d7b2ab uncomment error handler 2022-03-28 13:52:01 -05:00
Aaron Kimbre
b6905c9235 fix play key times used on view page
Added early API listener enpionts
2022-03-28 11:01:46 -05:00
Aaron Kimbre
179ea43cb8 remove check, let flask handle the failure 2022-03-14 18:47:19 -05:00
Aaron Kimbre
1566df65cb better sanity checking 2022-03-14 18:42:49 -05:00
Aaron Kimbre
24e98190fe graphs
Resolves #21
2022-03-13 22:10:07 -05:00
Aaron Kimbre
6606f1558e fix config sanity check
add chartjs
2022-03-13 19:39:16 -05:00
Aaron Kimbre
f0faa4c53b fallback to example settings
if no setting file is given
2022-03-13 19:27:23 -05:00
Aaron Kimbre
418c81944b make active useful
Readme update
parity between setting and env settings
2022-03-13 15:09:34 -05:00
Aaron Kimbre
7cb0b94972 fix exception 2022-03-13 06:24:41 -05:00
Aaron Kimbre
1cb64f7594 adjust init an settings to line up with file 2022-03-12 20:38:24 -06:00
Aaron Kimbre
5ce9ac85bc syntax/linting fixes 2022-03-12 20:09:35 -06:00
Aaron Kimbre
de698f86fa Added Audit logs for everything 2022-02-11 23:05:00 -06:00
Aaron Kimbre
8aec4a45d2 General Logging
some extra logging around problem areas
2022-02-11 20:31:57 -06:00
Aaron Kimbre
8646c40943 lod differentiation
pre-gen commands
2022-02-10 12:01:51 -06:00
Aaron Kimbre
cf359e2c6b apparently some skills have no icon
add jinja debug helper
restrict char_xml to gm 9
strip quoted from local desc
2022-02-03 16:37:34 -06:00
Aaron Kimbre
7194a04c5d Property importing, maybe
fix issue with color fallback
2022-01-26 23:11:49 -06:00
Aaron Kimbre
6197f630e9 Analytics to Matomo 2022-01-17 21:55:48 -06:00
Aaron Kimbre
53ffe927f3 Move Code into repo 2022-01-16 12:22:00 -06:00