Implemented Capture The Flag

This commit is contained in:
2019-06-16 03:14:12 +10:00
parent 3917aca276
commit c85f9a55a1
10 changed files with 111 additions and 41 deletions
+2
View File
@@ -118,6 +118,8 @@ CREATE TABLE IF NOT EXISTS pastCombat (
attackerCasualties INTEGER,
flagCaptured BOOLEAN NOT NULL DEFAULT FALSE,
CONSTRAINT FOREIGN KEY fk_attackerId(attackerId) REFERENCES accounts(id) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT FOREIGN KEY fk_defenderId(defenderId) REFERENCES accounts(id) ON UPDATE CASCADE ON DELETE CASCADE
);
+15 -12
View File
@@ -1,16 +1,19 @@
ALTER TABLE
signups
ADD COLUMN
promotions BOOLEAN DEFAULT FALSE
AFTER
hash
;
ALTER TABLE
accounts
ADD COLUMN
promotions BOOLEAN DEFAULT FALSE
AFTER
hash
pastCombat
ADD
flagCaptured BOOLEAN NOT NULL DEFAULT FALSE
;
#initialize the server's flag
INSERT INTO badges (accountId, name) VALUES (1, "Capture The Flag"); #my account ID
#move the badge between accounts
#INSERT INTO badges
# (id, accountId)
#VALUES
# (?, ?)
#ON DUPLICATE KEY UPDATE
# accountId = VALUES(accountId)
#;