summaryrefslogtreecommitdiff
path: root/src/account-server/storage.hpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-10-30 10:00:32 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-10-30 10:00:32 +0200
commita84572c5449c74d9107a9c725a5feb32e439843e (patch)
tree180f2b3b0c1bb0ae17f099849fba4d7cde86f304 /src/account-server/storage.hpp
parente411f5ce26d6175affab0288e97a6ead8990ee61 (diff)
downloadmanaserv-a84572c5449c74d9107a9c725a5feb32e439843e.tar.gz
manaserv-a84572c5449c74d9107a9c725a5feb32e439843e.tar.bz2
manaserv-a84572c5449c74d9107a9c725a5feb32e439843e.tar.xz
manaserv-a84572c5449c74d9107a9c725a5feb32e439843e.zip
Use a transaction when handling a GAMSG_PLAYER_SYNC message
This message can contain a lot of small database updates, which at least on my system are way more efficient when performed in a transaction (now it takes no more than 1 second vs. about 14 seconds before). Not saying this is normal, my guess is that it's due to using full partition encryption. I've also prevented the thing from entering an infinite loop in the case of a wrong message, and corrected some variable names.
Diffstat (limited to 'src/account-server/storage.hpp')
-rw-r--r--src/account-server/storage.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/account-server/storage.hpp b/src/account-server/storage.hpp
index 0024fbc6..8651d20e 100644
--- a/src/account-server/storage.hpp
+++ b/src/account-server/storage.hpp
@@ -129,6 +129,11 @@ class Storage
std::vector<Transaction> getTransactions(unsigned int num);
std::vector<Transaction> getTransactions(time_t date);
+ /**
+ * Provides direct access to the database. Use with care!
+ */
+ dal::DataProvider *database() const { return mDb; }
+
private:
// Prevent copying
Storage(const Storage &rhs);