mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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>
8 lines
573 B
SQL
8 lines
573 B
SQL
/* 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;
|