mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-22 04:32:49 +00:00
feat(dashboard): UGC lists paged with totals, prefix search and sorting; car and rocket assemblies
IUgcLookup::ListUgc pages either kind with the UGC search's matching, a state and a sort, and counts the matches (MySQL and SQLite share the SQL). The UGC server records each model's bricks and triangles (new ugc columns) so models can be sorted by size. Cars and rockets are listed as assemblies, one per combination of modules, with their build type, module names and how many builds use them; filters for type, state, module and owner. Each assembly's builds (with where they are) are paged, and a build's assembly can be looked up for links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
13
migrations/dlu/mysql/88_ugc_model_stats.sql
Normal file
13
migrations/dlu/mysql/88_ugc_model_stats.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
/* UGC server: ugc.brick_count and ugc.triangle_count are what it counted when it made a model (the bricks, and the
|
||||
triangles of the made mesh's most detailed level; 0 until it has), so the dashboard can sort models by size. */
|
||||
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc ADD COLUMN brick_count INT UNSIGNED NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE() AND table_name = 'ugc' AND column_name = 'brick_count');
|
||||
PREPARE dlu_column_stmt FROM @dlu_column;
|
||||
EXECUTE dlu_column_stmt;
|
||||
DEALLOCATE PREPARE dlu_column_stmt;
|
||||
|
||||
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc ADD COLUMN triangle_count INT UNSIGNED NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE() AND table_name = 'ugc' AND column_name = 'triangle_count');
|
||||
PREPARE dlu_column_stmt FROM @dlu_column;
|
||||
EXECUTE dlu_column_stmt;
|
||||
DEALLOCATE PREPARE dlu_column_stmt;
|
||||
3
migrations/dlu/sqlite/71_ugc_model_stats.sql
Normal file
3
migrations/dlu/sqlite/71_ugc_model_stats.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
/* UGC server: the bricks and triangles it counted when it made a model. See the MySQL migration. */
|
||||
ALTER TABLE ugc ADD COLUMN brick_count INTEGER NOT NULL DEFAULT 0;
|
||||
ALTER TABLE ugc ADD COLUMN triangle_count INTEGER NOT NULL DEFAULT 0;
|
||||
Reference in New Issue
Block a user