diff options
author | Rogier Polak <rogier.l.a.polak@gmail.com> | 2007-03-05 03:32:59 +0000 |
---|---|---|
committer | Rogier Polak <rogier.l.a.polak@gmail.com> | 2007-03-05 03:32:59 +0000 |
commit | d811a539474a6eeb4439a4204f3d96551a5b7c1e (patch) | |
tree | 66b2482085965598845a0e58fa04d1bcdb6dd5a1 /src/account-server/dalstoragesql.hpp | |
parent | f0d969eba1840362daad9debc93907c270b22ea5 (diff) | |
download | manaserv-d811a539474a6eeb4439a4204f3d96551a5b7c1e.tar.gz manaserv-d811a539474a6eeb4439a4204f3d96551a5b7c1e.tar.bz2 manaserv-d811a539474a6eeb4439a4204f3d96551a5b7c1e.tar.xz manaserv-d811a539474a6eeb4439a4204f3d96551a5b7c1e.zip |
Added an abstrart base class for characterdata, in order to use the same serialize and deserialize functions on both the accountserver and the gameserver.
Diffstat (limited to 'src/account-server/dalstoragesql.hpp')
-rw-r--r-- | src/account-server/dalstoragesql.hpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/account-server/dalstoragesql.hpp b/src/account-server/dalstoragesql.hpp index 1511e20b..655cbac6 100644 --- a/src/account-server/dalstoragesql.hpp +++ b/src/account-server/dalstoragesql.hpp @@ -129,7 +129,7 @@ const std::string SQL_CHARACTERS_TABLE( "x SMALLINT UNSIGNED NOT NULL," "y SMALLINT UNSIGNED NOT NULL," "map_id TINYINT NOT NULL," - // stats + // attributes "str SMALLINT UNSIGNED NOT NULL," "agi SMALLINT UNSIGNED NOT NULL," "vit SMALLINT UNSIGNED NOT NULL," @@ -154,7 +154,7 @@ const std::string SQL_CHARACTERS_TABLE( "x INTEGER NOT NULL," "y INTEGER NOT NULL," "map_id INTEGER NOT NULL," - // stats + // attributes "str INTEGER NOT NULL," "agi INTEGER NOT NULL," "vit INTEGER NOT NULL," @@ -177,7 +177,7 @@ const std::string SQL_CHARACTERS_TABLE( "x INTEGER NOT NULL," "y INTEGER NOT NULL," "map_id INTEGER NOT NULL," - // stats + // attributes "str INTEGER NOT NULL," "agi INTEGER NOT NULL," "vit INTEGER NOT NULL," @@ -277,25 +277,26 @@ const std::string INVENTORIES_TBL_NAME("tmw_inventories"); const std::string SQL_INVENTORIES_TABLE( "CREATE TABLE tmw_inventories (" #if defined (MYSQL_SUPPORT) - "id SMALLINT NOT NULL," + "id INTEGER PRIMARY KEY AUTO_INCREMENT," "owner_id INTEGER NOT NULL," + "class_id INTEGER NOT NULL," "amount SMALLINT NOT NULL," "equipped TINYINT NOT NULL," - "FOREIGN KEY (id) REFERENCES tmw_items(id)," "FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)" + "INDEX (id)" #elif defined (SQLITE_SUPPORT) - "id INTEGER NOT NULL," + "id INTEGER PRIMARY KEY," "owner_id INTEGER NOT NULL," + "class_id INTEGER NOT NULL," "amount INTEGER NOT NULL," "equipped INTEGER NOT NULL," - "FOREIGN KEY (id) REFERENCES tmw_items(id)," "FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)" #elif defined (POSTGRESQL_SUPPORT) - "id INTEGER NOT NULL," + "id SERIAL PRIMARY KEY," "owner_id INTEGER NOT NULL," + "class_id INTEGER NOT NULL," "amount INTEGER NOT NULL," "equipped INTEGER NOT NULL," - "FOREIGN KEY (id) REFERENCES tmw_items(id)," "FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)" #endif ");" |