mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
feat: store each named pet's LOT in pet_names
pet_names gets a pet_lot column (mysql 80, sqlite 63). The world writes it whenever it saves a pet name, from the pet entity's LOT, and fills it in for older rows when the owner loads into a world (from the pets the game loads for that character, only where it is still missing). The dashboard's pet name tables read pet_lot instead of scanning the owner's character XML; pets without it yet show as Unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
7
migrations/dlu/mysql/80_pet_name_lot.sql
Normal file
7
migrations/dlu/mysql/80_pet_name_lot.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
/* Which kind of pet (its LOT) each named pet is, written by the game when the name is set and filled in for older
|
||||
rows when the owner next loads into a world. NULL or 0: not known yet. Only added when it is not there yet. */
|
||||
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE pet_names ADD COLUMN pet_lot INT NULL DEFAULT NULL', 'DO 0') FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE() AND table_name = 'pet_names' AND column_name = 'pet_lot');
|
||||
PREPARE dlu_column_stmt FROM @dlu_column;
|
||||
EXECUTE dlu_column_stmt;
|
||||
DEALLOCATE PREPARE dlu_column_stmt;
|
||||
2
migrations/dlu/sqlite/63_pet_name_lot.sql
Normal file
2
migrations/dlu/sqlite/63_pet_name_lot.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Which kind of pet (its LOT) each named pet is. See the MySQL migration. */
|
||||
ALTER TABLE pet_names ADD COLUMN pet_lot INTEGER NULL DEFAULT NULL;
|
||||
Reference in New Issue
Block a user