summaryrefslogtreecommitdiff
path: root/src/game-server/character.cpp
diff options
context:
space:
mode:
authorAndreas Habel <mail@exceptionfault.de>2008-11-30 12:08:57 +0100
committerAndreas Habel <mail@exceptionfault.de>2008-11-30 12:08:57 +0100
commit4abae69f1180ffe6a4dbd2db60dfa76b6ef41ebb (patch)
tree4b2e3eb8e5c35e65ec18996060a5daac9bff1938 /src/game-server/character.cpp
parent6d263b7550468306018934ad1dc9928b57b8f129 (diff)
downloadmanaserv-4abae69f1180ffe6a4dbd2db60dfa76b6ef41ebb.tar.gz
manaserv-4abae69f1180ffe6a4dbd2db60dfa76b6ef41ebb.tar.bz2
manaserv-4abae69f1180ffe6a4dbd2db60dfa76b6ef41ebb.tar.xz
manaserv-4abae69f1180ffe6a4dbd2db60dfa76b6ef41ebb.zip
Add sync Buffer according to mantis #550
The game server buffers all changes made to a character in a sync buffer. The buffer is sent to the account server if the buffer contains more then 20 message, reaches size of 1kb or at least every 10 seconds. ATM Character attributes, corr points and attribute points and skills are synchronized. TODO: items, location, money...
Diffstat (limited to 'src/game-server/character.cpp')
-rw-r--r--src/game-server/character.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index 8ae2e85d..780a142b 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -26,6 +26,7 @@
#include "game-server/character.hpp"
#include "defines.h"
+#include "game-server/accountconnection.hpp"
#include "game-server/attackzone.hpp"
#include "game-server/buysell.hpp"
#include "game-server/eventlistener.hpp"
@@ -341,6 +342,10 @@ void Character::receiveExperience(size_t skill, int experience)
mExperience.at(skill - CHAR_SKILL_BEGIN) = newExp;
mModifiedExperience.insert(skill - CHAR_SKILL_BEGIN);
+ // inform account server
+ accountHandler->updateExperience(getDatabaseID(),
+ skill - CHAR_SKILL_BEGIN, newExp);
+
// check for skill levelup
while (newExp >= Character::expForLevel(getAttribute(skill) + 1))
{