summaryrefslogtreecommitdiff
path: root/src/account-server/dalstorage.hpp
diff options
context:
space:
mode:
authorAndreas Habel <mail@exceptionfault.de>2008-11-05 13:40:13 +0000
committerAndreas Habel <mail@exceptionfault.de>2008-11-05 13:40:13 +0000
commit1af60893e6737942c2079c794d53a4e21cf87c58 (patch)
tree53bf04c21499adc8c2f23d40351d0525753c648a /src/account-server/dalstorage.hpp
parent94bf187c196769b87fbbfa9a9c083f94def82ccf (diff)
downloadmanaserv-1af60893e6737942c2079c794d53a4e21cf87c58.tar.gz
manaserv-1af60893e6737942c2079c794d53a4e21cf87c58.tar.bz2
manaserv-1af60893e6737942c2079c794d53a4e21cf87c58.tar.xz
manaserv-1af60893e6737942c2079c794d53a4e21cf87c58.zip
* Account server now loads item database on startup and synchronizes tmw_items table in the database.
* Added method to DataProvider to escape quotes in strings so that they can be used in SQL statements.
Diffstat (limited to 'src/account-server/dalstorage.hpp')
-rw-r--r--src/account-server/dalstorage.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/account-server/dalstorage.hpp b/src/account-server/dalstorage.hpp
index 5a879bf6..638e4d27 100644
--- a/src/account-server/dalstorage.hpp
+++ b/src/account-server/dalstorage.hpp
@@ -336,7 +336,8 @@ class DALStorage
*
* @return Version of the item database.
*/
- unsigned int getItemDatabaseVersion(void);
+ unsigned int getItemDatabaseVersion(void) const
+ { return mItemDbVersion; }
private:
/**
@@ -371,7 +372,18 @@ class DALStorage
*/
Character *getCharacterBySQL(std::string const &query, Account *owner);
+ /**
+ * Synchronizes the base data in the connected SQL database with the xml
+ * files like items.xml.
+ * This method is called once after initialization of DALStorage.
+ * Probably this function should be called if a gm requests an online
+ * reload of the xml files to load new items or monsters without server
+ * restart.
+ */
+ void SyncDatabase(void);
+
dal::DataProvider *mDb; /**< the data provider */
+ unsigned int mItemDbVersion; /**< Version of the item database. */
};
extern DALStorage *storage;