summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-07-27 14:46:41 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-07-27 14:46:41 +0200
commit8aaa341a8ee51853737eabf52fe369f75be07e93 (patch)
tree2fe6df6d53955da0f06d175db303df40751faa84 /src/sql
parent006a213747eb8063ad543211b9776caba027ea4a (diff)
downloadmanaserv-8aaa341a8ee51853737eabf52fe369f75be07e93.tar.gz
manaserv-8aaa341a8ee51853737eabf52fe369f75be07e93.tar.xz
manaserv-8aaa341a8ee51853737eabf52fe369f75be07e93.zip
Begun Applying the new equipment slot handling design.
now, the equipment slots are independant from the inventory slots according to the inventory and equipment data. This will permit to avoid checking the equipment each time one touches the inventory and vice versa, and make the former delayed mode useless. Also, note that equipped items will be removed from inventory and readded once unequipped. The design will permit the following, even if not implemented yet: - To make equipment items stackable again, if wanted. - Have more than one item with the same id equipped on different slots using the itemInstance field. Note: I didn't add the database structure updates yet, to see whether other changes may later go along with those.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/mysql/createTables.sql6
-rw-r--r--src/sql/sqlite/createTables.sql3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 9e1e31a..d017cee 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -184,11 +184,11 @@ AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `mana_char_equips` (
`id` int(10) unsigned NOT NULL auto_increment,
`owner_id` int(10) unsigned NOT NULL,
- `slot_type` tinyint(3) unsigned NOT NULL,
- `inventory_slot` tinyint(3) unsigned NOT NULL,
+ `slot_type` int(10) unsigned NOT NULL,
+ `item_id` int(10) unsigned NOT NULL,
+ `item_instance` int(10) unsigned NOT NULL,
--
PRIMARY KEY (`id`),
- UNIQUE KEY `owner_id` (`owner_id`, `inventory_slot`),
FOREIGN KEY (`owner_id`) REFERENCES `mana_characters` (`id`)
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index b366606..1027b58 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -178,7 +178,8 @@ CREATE TABLE mana_char_equips
id INTEGER PRIMARY KEY,
owner_id INTEGER NOT NULL,
slot_type INTEGER NOT NULL,
- inventory_slot INTEGER NOT NULL,
+ item_id INTEGER NOT NULL,
+ item_instance INTEGER NOT NULL,
--
FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
);