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/manaserv_protocol.h | |
parent | bc5a0495ba7fbf992a1733850cbbe1cfb14c7c8d (diff) | |
download | manaserv-54d5f7e577db0639e42b18beae4b5c87af6d6843.tar.gz 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/manaserv_protocol.h')
-rw-r--r-- | src/manaserv_protocol.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/manaserv_protocol.h b/src/manaserv_protocol.h index 76b5f34..5090873 100644 --- a/src/manaserv_protocol.h +++ b/src/manaserv_protocol.h @@ -225,17 +225,23 @@ enum { // Inter-server GAMSG_REGISTER = 0x0500, // S address, W port, S password, D items db revision, { W map id }* - AGMSG_REGISTER_RESPONSE = 0x0501, // C item version, C password response - AGMSG_ACTIVE_MAP = 0x0502, // W map id + AGMSG_REGISTER_RESPONSE = 0x0501, // C item version, C password response, { S globalvar_key, S globalvar_value } + AGMSG_ACTIVE_MAP = 0x0502, // W map id, { S mapvar_key, S mapvar_value } AGMSG_PLAYER_ENTER = 0x0510, // B*32 token, D id, S name, serialised character data GAMSG_PLAYER_DATA = 0x0520, // D id, serialised character data GAMSG_REDIRECT = 0x0530, // D id AGMSG_REDIRECT_RESPONSE = 0x0531, // D id, B*32 token, S game address, W game port GAMSG_PLAYER_RECONNECT = 0x0532, // D id, B*32 token GAMSG_PLAYER_SYNC = 0x0533, // serialised sync data - GAMSG_SET_QUEST = 0x0540, // D id, S name, S value - GAMSG_GET_QUEST = 0x0541, // D id, S name - AGMSG_GET_QUEST_RESPONSE = 0x0542, // D id, S name, S value + GAMSG_SET_VAR_CHR = 0x0540, // D id, S name, S value + GAMSG_GET_VAR_CHR = 0x0541, // D id, S name + AGMSG_GET_VAR_CHR_RESPONSE = 0x0542, // D id, S name, S value + //reserved GAMSG_SET_VAR_ACC = 0x0543, // D charid, S name, S value + //reserved GAMSG_GET_VAR_ACC = 0x0544, // D charid, S name + //reserved AGMSG_GET_VAR_ACC_RESPONSE = 0x0545, // D charid, S name, S value + GAMSG_SET_VAR_MAP = 0x0546, // D mapid, S name, S value + GAMSG_SET_VAR_WORLD = 0x0547, // S name, S value + AGMSG_SET_VAR_WORLD = 0x0548, // S name, S value GAMSG_BAN_PLAYER = 0x0550, // D id, W duration GAMSG_CHANGE_PLAYER_LEVEL = 0x0555, // D id, W level GAMSG_CHANGE_ACCOUNT_LEVEL = 0x0556, // D id, W level |