From 4abae69f1180ffe6a4dbd2db60dfa76b6ef41ebb Mon Sep 17 00:00:00 2001 From: Andreas Habel Date: Sun, 30 Nov 2008 12:08:57 +0100 Subject: 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... --- src/game-server/state.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game-server/state.cpp') diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp index 61829a57..3b6dd624 100644 --- a/src/game-server/state.cpp +++ b/src/game-server/state.cpp @@ -450,10 +450,16 @@ void GameState::update(int worldTime) for (CharacterIterator p(map->getWholeMapIterator()); p; ++p) { informPlayer(map, *p); + /* + sending the whole character is overhead for the database, it should + be replaced by a syncbuffer. see: game-server/accountconnection: + AccountConnection::syncChanges() + if (worldTime % 2000 == 0) { accountHandler->sendCharacterData(*p); } + */ } for (ObjectIterator i(map->getWholeMapIterator()); i; ++i) -- cgit v1.2.3-60-g2f50