summaryrefslogtreecommitdiff
path: root/src/game-server/accountconnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/accountconnection.cpp')
-rw-r--r--src/game-server/accountconnection.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp
index 8a03bb24..b351890b 100644
--- a/src/game-server/accountconnection.cpp
+++ b/src/game-server/accountconnection.cpp
@@ -29,6 +29,7 @@
#include "game-server/map.hpp"
#include "game-server/mapcomposite.hpp"
#include "game-server/mapmanager.hpp"
+#include "game-server/quest.hpp"
#include "game-server/state.hpp"
#include "net/messagein.hpp"
#include "net/messageout.hpp"
@@ -94,6 +95,14 @@ void AccountConnection::processMessage(MessageIn &msg)
gameHandler->completeServerChange(id, token, address, port);
} break;
+ case AGMSG_GET_QUEST_RESPONSE:
+ {
+ int id = msg.readLong();
+ std::string name = msg.readString();
+ std::string value = msg.readString();
+ recoveredQuestVar(id, name, value);
+ } break;
+
// The client should directly talk with the chat server and not go through the game server.
#if 0
case AGMSG_GUILD_CREATE_RESPONSE:
@@ -216,15 +225,33 @@ void AccountConnection::processMessage(MessageIn &msg)
}
}
-void AccountConnection::playerReconnectAccount(int id, const std::string magic_token)
+void AccountConnection::playerReconnectAccount(int id, std::string const &magic_token)
{
- LOG_INFO("Send GAMSG_PLAYER_RECONNECT.");
+ LOG_DEBUG("Send GAMSG_PLAYER_RECONNECT.");
MessageOut msg(GAMSG_PLAYER_RECONNECT);
msg.writeLong(id);
msg.writeString(magic_token, MAGIC_TOKEN_LENGTH);
send(msg);
}
+void AccountConnection::requestQuestVar(Character *ch, std::string const &name)
+{
+ MessageOut msg(GAMSG_GET_QUEST);
+ msg.writeLong(ch->getDatabaseID());
+ msg.writeString(name);
+ send(msg);
+}
+
+void AccountConnection::updateQuestVar(Character *ch, std::string const &name,
+ std::string const &value)
+{
+ MessageOut msg(GAMSG_SET_QUEST);
+ msg.writeLong(ch->getDatabaseID());
+ msg.writeString(name);
+ msg.writeString(value);
+ send(msg);
+}
+
#if 0
void AccountConnection::playerCreateGuild(int id, const std::string &guildName)
{