mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
feat(ugc): icon light matched to the game, debounce, shared car icons, purge, icon editor
Brighter icons: a world light, a fill from the camera, a highlight, exposure and contrast; with the defaults the icons' mean luminance matches the game's own model icons (118 against 120 on a scratch set). Every icon parameter is listed once (UgcIconParams: key, setting, range, default); the settings, the dashboard's settings entries and the icon editor come from that list. Presets per kind (player models, each car or rocket build type from ModularBuildComponent) and overrides per model or module combination are in ugc_icon_settings. Saved models wait ugc_debounce_seconds (sharedconfig) after the owner's last save before they're made (ugc.process_after); a client asking for one, the owner leaving the world or a reset ends the wait. Cars and rockets: one icon per combination of modules (sorted LOTs), shared by every build of it; builds of a combination made already are marked made right away, the client's per-blueprint downloads serve the shared files. The dashboard can delete one item's files, purge by filter or all, preview icons with any values on the UGC server (/admin routes, master password), save presets and overrides, and draw a kind's icons again (icons only). Migrations dlu/mysql/86 and dlu/sqlite/69. Not done yet: the dashboard editor's lighting controls in the page script (routes are there), docs for it, the empty-model state, /ugc?item= links, the shared fetch helper; the storage size and property loading bugs are next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
15
migrations/dlu/mysql/86_ugc_debounce_icon_settings.sql
Normal file
15
migrations/dlu/mysql/86_ugc_debounce_icon_settings.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
/* UGC server: ugc.process_after is the Unix time before which a saved model isn't made (the quiet period after a
|
||||
save, so a model the owner keeps editing isn't made for every save; 0: right away). ugc_icon_settings holds
|
||||
icon framing and lighting set on the dashboard: presets per kind ("kind:model", "kind:build6") and overrides for one
|
||||
model ("model:<id>") or one combination of car or rocket modules ("combo:<key>"). See docs/UgcServer.md. */
|
||||
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc ADD COLUMN process_after BIGINT NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE() AND table_name = 'ugc' AND column_name = 'process_after');
|
||||
PREPARE dlu_column_stmt FROM @dlu_column;
|
||||
EXECUTE dlu_column_stmt;
|
||||
DEALLOCATE PREPARE dlu_column_stmt;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ugc_icon_settings (
|
||||
target VARCHAR(191) NOT NULL PRIMARY KEY,
|
||||
params TEXT NOT NULL,
|
||||
updated_at BIGINT NOT NULL DEFAULT 0
|
||||
);
|
||||
8
migrations/dlu/sqlite/69_ugc_debounce_icon_settings.sql
Normal file
8
migrations/dlu/sqlite/69_ugc_debounce_icon_settings.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
/* UGC server: the quiet period after a save, and icon settings presets and overrides. See the MySQL migration. */
|
||||
ALTER TABLE ugc ADD COLUMN process_after BIGINT NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ugc_icon_settings (
|
||||
target TEXT NOT NULL PRIMARY KEY,
|
||||
params TEXT NOT NULL,
|
||||
updated_at BIGINT NOT NULL DEFAULT 0
|
||||
);
|
||||
Reference in New Issue
Block a user