feat(server): save economy hardening and CH5 continuation work

This commit is contained in:
shen
2026-10-22 06:22:23 -07:00
parent c979b53762
commit 5b7442ea37
142 changed files with 5850 additions and 1682 deletions
+4 -19
View File
@@ -1,19 +1,4 @@
-- Metin2 64-bit Gold Rollback Script
-- Target: player database (player, safebox, guild)
-- Restores gold column to INT(11) with clamp to 2,000,000,000 to prevent data truncation errors
USE `player`;
-- 1. Clamp values exceeding 2,000,000,000 before downcasting
UPDATE `player` SET `gold` = 2000000000 WHERE `gold` > 2000000000;
UPDATE `safebox` SET `gold` = 2000000000 WHERE `gold` > 2000000000;
UPDATE `guild` SET `gold` = 2000000000 WHERE `gold` > 2000000000;
-- 2. Restore player.gold to INT(11) NOT NULL DEFAULT 0
ALTER TABLE `player` MODIFY COLUMN `gold` INT(11) NOT NULL DEFAULT 0;
-- 3. Restore safebox.gold to INT(11) NOT NULL DEFAULT 0
ALTER TABLE `safebox` MODIFY COLUMN `gold` INT(11) NOT NULL DEFAULT 0;
-- 4. Restore guild.gold to INT(11) NOT NULL DEFAULT 0
ALTER TABLE `guild` MODIFY COLUMN `gold` INT(11) NOT NULL DEFAULT 0;
-- Asset-preserving rollback: keep the expanded schema and every balance.
-- Deploy a compatible binary that reads/writes BIGINT while disabling new features.
-- An automatic downgrade to INT is intentionally prohibited.
SELECT 'Keep BIGINT balances; use the compatible rollback binary' AS rollback_policy;