diff options
author | Philipp Sehmisch <mana@crushnet.org> | 2011-03-04 18:35:17 +0100 |
---|---|---|
committer | Philipp Sehmisch <mana@crushnet.org> | 2011-03-04 18:36:17 +0100 |
commit | 54d5f7e577db0639e42b18beae4b5c87af6d6843 (patch) | |
tree | 2a667f208be4191a54d08131d7c3984cdfd74132 /src/game-server/accountconnection.h | |
parent | bc5a0495ba7fbf992a1733850cbbe1cfb14c7c8d (diff) | |
download | manaserv-54d5f7e577db0639e42b18beae4b5c87af6d6843.tar.gz manaserv-54d5f7e577db0639e42b18beae4b5c87af6d6843.tar.bz2 manaserv-54d5f7e577db0639e42b18beae4b5c87af6d6843.tar.xz manaserv-54d5f7e577db0639e42b18beae4b5c87af6d6843.zip |
Implemented persistent world and map variables
The gameserver now receive a copy of all world state variables when
they are accepted by the accountserver and receive a copy of all
map state variables of a map when they register it successfully.
Implemented LUA script bindings for getting and setting these variables.
When such a variable is set, the accountserver is notified about this
change. Changes to world state variables are then propagated to all
gameservers by the accountserver.
Be aware that when a gameserver is updating a map, there is no check if
it is actually responsible for said map. But I consider this not a
security flaw, because authenticated game servers are considered to be
trustworthy in a lot of other situations, too.
Also renamed "quest" to "character variable" in the sourcecode.
Reviewed-by: Bertram
Diffstat (limited to 'src/game-server/accountconnection.h')
-rw-r--r-- | src/game-server/accountconnection.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/game-server/accountconnection.h b/src/game-server/accountconnection.h index c0bbc5cd..37033389 100644 --- a/src/game-server/accountconnection.h +++ b/src/game-server/accountconnection.h @@ -25,6 +25,7 @@ #include "net/connection.h" class Character; +class MapComposite; /** \fn void AccountConnection::syncChanges(bool force = false) * @@ -75,14 +76,26 @@ class AccountConnection : public Connection void playerReconnectAccount(int id, const std::string &magic_token); /** - * Requests the value of a quest variable from the database. + * Requests the value of a character-bound variable from the database. */ - void requestQuestVar(Character *, const std::string &); + void requestCharacterVar(Character *, const std::string &); /** - * Pushes a new quest value to the database. + * Pushes a new character-bound value to the database. */ - void updateQuestVar(Character *, const std::string &name, + void updateCharacterVar(Character *, const std::string &name, + const std::string &value); + + /** + * Pushes a new value of a map variable to the account server. + */ + void updateMapVar(MapComposite *, const std::string &name, + const std::string &value); + + /** + * Pushes a new value of a world variable to the account server. + */ + void updateWorldVar(const std::string &name, const std::string &value); /** |