Game Preferences Update (#13936)

This commit is contained in:
AffectedArc07
2020-10-09 19:53:59 +01:00
committed by GitHub
parent 44431ff0b5
commit a50f656d8d
42 changed files with 227 additions and 222 deletions
+1 -6
View File
@@ -255,20 +255,15 @@ CREATE TABLE `player` (
`be_role` mediumtext,
`default_slot` smallint(4) DEFAULT '1',
`toggles` int(8) DEFAULT '383',
`toggles_2` int(8) DEFAULT '14',
`sound` mediumint(8) DEFAULT '31',
`randomslot` tinyint(1) DEFAULT '0',
`volume` smallint(4) DEFAULT '100',
`nanoui_fancy` smallint(4) DEFAULT '1',
`show_ghostitem_attack` smallint(4) DEFAULT '1',
`lastchangelog` varchar(32) NOT NULL DEFAULT '0',
`windowflashing` smallint(4) DEFAULT '1',
`ghost_anonsay` tinyint(1) NOT NULL DEFAULT '0',
`exp` mediumtext,
`clientfps` smallint(4) DEFAULT '0',
`atklog` smallint(4) DEFAULT '0',
`fuid` bigint(20) NULL DEFAULT NULL,
`fupdate` smallint(4) NULL DEFAULT '0',
`afk_watch` tinyint(1) NOT NULL DEFAULT '0',
`parallax` tinyint(1) DEFAULT '8',
PRIMARY KEY (`id`),
UNIQUE KEY `ckey` (`ckey`)
+1 -6
View File
@@ -254,20 +254,15 @@ CREATE TABLE `SS13_player` (
`be_role` mediumtext,
`default_slot` smallint(4) DEFAULT '1',
`toggles` int(8) DEFAULT '383',
`toggles_2` int(8) DEFAULT '14',
`sound` mediumint(8) DEFAULT '31',
`randomslot` tinyint(1) DEFAULT '0',
`volume` smallint(4) DEFAULT '100',
`nanoui_fancy` smallint(4) DEFAULT '1',
`show_ghostitem_attack` smallint(4) DEFAULT '1',
`lastchangelog` varchar(32) NOT NULL DEFAULT '0',
`windowflashing` smallint(4) DEFAULT '1',
`ghost_anonsay` tinyint(1) NOT NULL DEFAULT '0',
`exp` mediumtext,
`clientfps` smallint(4) DEFAULT '0',
`atklog` smallint(4) DEFAULT '0',
`fuid` bigint(20) NULL DEFAULT NULL,
`fupdate` smallint(4) NULL DEFAULT '0',
`afk_watch` tinyint(1) NOT NULL DEFAULT '0',
`parallax` tinyint(1) DEFAULT '8',
PRIMARY KEY (`id`),
UNIQUE KEY `ckey` (`ckey`)
+22
View File
@@ -0,0 +1,22 @@
#Updating the SQL from version 12 to version 13. -AffectedArc07
#Modifying the player table to remove old columns and add a new bitflag column for toggles
#Includes conversion from old to new
ALTER TABLE `player` ADD COLUMN `toggles_2` INT NULL DEFAULT '0' AFTER `toggles`;
# The following lines will update the new toggles_2 column based on existing data
UPDATE `player` SET `toggles_2` = `toggles_2` + 1 WHERE `randomslot` = 1;
UPDATE `player` SET `toggles_2` = `toggles_2` + 2 WHERE `nanoui_fancy` = 1;
UPDATE `player` SET `toggles_2` = `toggles_2` + 4 WHERE `show_ghostitem_attack` = 1;
UPDATE `player` SET `toggles_2` = `toggles_2` + 8 WHERE `windowflashing` = 1;
UPDATE `player` SET `toggles_2` = `toggles_2` + 16 WHERE `ghost_anonsay` = 1;
UPDATE `player` SET `toggles_2` = `toggles_2` + 32 WHERE `afk_watch` = 1;
# Remove the old columns
ALTER TABLE `player`
DROP COLUMN `randomslot`,
DROP COLUMN `nanoui_fancy`,
DROP COLUMN `show_ghostitem_attack`,
DROP COLUMN `windowflashing`,
DROP COLUMN `ghost_anonsay`,
DROP COLUMN `afk_watch`;