feat: implement CH5 cube renewal, SQL fence routing, and transactional crafting

This commit is contained in:
shen
2026-10-23 20:17:22 -07:00
parent 6924dc9b49
commit b5e06c9a43
135 changed files with 8493 additions and 56 deletions
+27
View File
@@ -0,0 +1,27 @@
-- Optional deferred positive-gold-intent candidate, version 2. Install only in
-- coordinated maintenance with matched Cube code; never applied at startup.
-- Base Cube remains schema v2. This does not enable a producer or crafting.
CREATE TABLE IF NOT EXISTS port_cube_gold_version (
id INT UNSIGNED PRIMARY KEY, version INT UNSIGNED NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS port_cube_gold_intents (
event CHAR(32) CHARACTER SET ascii COLLATE ascii_bin PRIMARY KEY,
request CHAR(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
seq INT UNSIGNED NOT NULL, account INT UNSIGNED NOT NULL, pid INT UNSIGNED NOT NULL,
body VARBINARY(129) NOT NULL,
state ENUM('QUEUED','APPLIED') NOT NULL,
before_gold BIGINT UNSIGNED NOT NULL DEFAULT 0,
after_gold BIGINT UNSIGNED NOT NULL DEFAULT 0,
UNIQUE KEY batch_sequence(request,seq), INDEX player_pending(pid,state)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS port_cube_gold_sources (
request CHAR(32) CHARACTER SET ascii COLLATE ascii_bin PRIMARY KEY,
account INT UNSIGNED NOT NULL, pid INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
owner CHAR(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
session BIGINT UNSIGNED NOT NULL, cookie INT UNSIGNED NOT NULL, handle INT UNSIGNED NOT NULL,
manifest VARBINARY(32772) NOT NULL,
INDEX player_source(pid)
) ENGINE=InnoDB;
INSERT INTO port_cube_gold_version(id,version) VALUES(1,2)
ON DUPLICATE KEY UPDATE version=version;