summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/manaserv_protocol.h2
-rw-r--r--src/game-server/mapreader.cpp2
-rw-r--r--src/sql/mysql/createTables.sql4
-rw-r--r--src/sql/mysql/updates/update_15_to_16.sql7
-rw-r--r--src/sql/sqlite/createTables.sql2
-rw-r--r--src/sql/sqlite/updates/update_15_to_16.sql7
6 files changed, 19 insertions, 5 deletions
diff --git a/src/common/manaserv_protocol.h b/src/common/manaserv_protocol.h
index e1e1f885..56319b69 100644
--- a/src/common/manaserv_protocol.h
+++ b/src/common/manaserv_protocol.h
@@ -26,7 +26,7 @@ namespace ManaServ {
enum {
PROTOCOL_VERSION = 1,
- SUPPORTED_DB_VERSION = 15
+ SUPPORTED_DB_VERSION = 16
};
/**
diff --git a/src/game-server/mapreader.cpp b/src/game-server/mapreader.cpp
index 0fe5a53b..8438c82c 100644
--- a/src/game-server/mapreader.cpp
+++ b/src/game-server/mapreader.cpp
@@ -198,7 +198,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
}
else if (utils::compareStrI(objType, "SPAWN") == 0)
{
- MonsterClass *monster;
+ MonsterClass *monster = 0;
int maxBeings = 10; // Default value
int spawnRate = 10; // Default value
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 0c562359..f6365031 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `mana_characters` (
-- location on the map
`x` smallint(5) unsigned NOT NULL,
`y` smallint(5) unsigned NOT NULL,
- `map_id` int(10) unsigned NOT NULL,
+ `map_id` smallint(5) unsigned NOT NULL,
`slot` smallint(5) unsigned NOT NULL,
--
PRIMARY KEY (`id`),
@@ -421,7 +421,7 @@ AUTO_INCREMENT=0 ;
INSERT INTO mana_world_states VALUES('accountserver_startup',NULL,NULL, NOW());
INSERT INTO mana_world_states VALUES('accountserver_version',NULL,NULL, NOW());
-INSERT INTO mana_world_states VALUES('database_version', NULL,'15', NOW());
+INSERT INTO mana_world_states VALUES('database_version', NULL,'16', NOW());
-- all known transaction codes
diff --git a/src/sql/mysql/updates/update_15_to_16.sql b/src/sql/mysql/updates/update_15_to_16.sql
new file mode 100644
index 00000000..df94f995
--- /dev/null
+++ b/src/sql/mysql/updates/update_15_to_16.sql
@@ -0,0 +1,7 @@
+ALTER TABLE mana_characters CHANGE map_id map_id smallint(5);
+
+-- Update database version.
+UPDATE mana_world_states
+SET value = '16',
+moddate = UNIX_TIMESTAMP()
+WHERE state_name = 'database_version';
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index 2b4f7aa6..f353b8e1 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -407,7 +407,7 @@ AS
INSERT INTO mana_world_states VALUES('accountserver_startup',NULL,NULL, strftime('%s','now'));
INSERT INTO mana_world_states VALUES('accountserver_version',NULL,NULL, strftime('%s','now'));
-INSERT INTO mana_world_states VALUES('database_version', NULL,'15', strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('database_version', NULL,'16', strftime('%s','now'));
-- all known transaction codes
diff --git a/src/sql/sqlite/updates/update_15_to_16.sql b/src/sql/sqlite/updates/update_15_to_16.sql
new file mode 100644
index 00000000..aa5d4646
--- /dev/null
+++ b/src/sql/sqlite/updates/update_15_to_16.sql
@@ -0,0 +1,7 @@
+-- No changes required. It was only an issue with mysql.
+
+-- Update the database version, and set date of update
+UPDATE mana_world_states
+ SET value = '16',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';