summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-31 16:53:06 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:54 +0300
commit8ad8da325107ef1b33bd6c3ed985859e7edb78ae (patch)
tree3dd76adef5e6dbe7da8db925ffa42ebbf21eb638 /src/net
parent8cc52b6e9cf46643cc6300df844e70b8dcb85212 (diff)
downloadmanaplus-8ad8da325107ef1b33bd6c3ed985859e7edb78ae.tar.gz
manaplus-8ad8da325107ef1b33bd6c3ed985859e7edb78ae.tar.bz2
manaplus-8ad8da325107ef1b33bd6c3ed985859e7edb78ae.tar.xz
manaplus-8ad8da325107ef1b33bd6c3ed985859e7edb78ae.zip
add basic implimentation for set pincode.
For now it not sending pincode to server.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/charserverhandler.h2
-rw-r--r--src/net/eathena/charserverhandler.cpp18
-rw-r--r--src/net/eathena/charserverhandler.h7
-rw-r--r--src/net/tmwa/charserverhandler.h3
4 files changed, 26 insertions, 4 deletions
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index 8f78905c6..6a0125e1d 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -73,6 +73,8 @@ class CharServerHandler notfinal
virtual void clear() = 0;
+ virtual bool isNeedCreatePin() const = 0;
+
protected:
CharServerHandler() :
mCharacters(),
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index af3c012dd..7d6e2e74c 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -28,6 +28,8 @@
#include "being/attributes.h"
+#include "gui/windows/editdialog.h"
+
#include "net/character.h"
#include "net/logindata.h"
#include "net/net.h"
@@ -45,6 +47,9 @@
#include "resources/db/itemdb.h"
#include "utils/dtor.h"
+#include "utils/gettext.h"
+
+#include "listeners/pincodelistener.h"
#include "debug.h"
@@ -58,7 +63,9 @@ extern ServerInfo mapServer;
CharServerHandler::CharServerHandler() :
MessageHandler(),
- Ea::CharServerHandler()
+ Ea::CharServerHandler(),
+ mPinSeed(0),
+ mNeedCreatePin(false)
{
static const uint16_t _messages[] =
{
@@ -378,7 +385,7 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg)
void CharServerHandler::processPincodeStatus(Net::MessageIn &msg)
{
- msg.readInt32("pincode seed");
+ const uint32_t seed = msg.readInt32("pincode seed");
msg.readInt32("account id");
const uint16_t state = static_cast<uint16_t>(msg.readInt16("state"));
switch (state)
@@ -388,11 +395,14 @@ void CharServerHandler::processPincodeStatus(Net::MessageIn &msg)
case 1: // ask for pin
break;
case 2: // create new pin
+ case 4: // create new pin?
+ {
+ mPinSeed = seed;
+ mNeedCreatePin = true;
break;
+ }
case 3: // pin must be changed
break;
- case 4: // create new pin?
- break;
case 5: // client show error?
break;
case 6: // Unable to use your KSSN number
diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h
index 9a58a50e7..e647a6d60 100644
--- a/src/net/eathena/charserverhandler.h
+++ b/src/net/eathena/charserverhandler.h
@@ -63,12 +63,19 @@ class CharServerHandler final : public MessageHandler,
void processChangeMapServer(Net::MessageIn &msg);
+ bool isNeedCreatePin() const A_WARN_UNUSED
+ { return mNeedCreatePin; }
+
protected:
void readPlayerData(Net::MessageIn &msg,
Net::Character *const character,
const bool) const override final;
void processPincodeStatus(Net::MessageIn &msg);
+
+ private:
+ uint32_t mPinSeed;
+ bool mNeedCreatePin;
};
} // namespace EAthena
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index 062360800..35a4585e3 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -63,6 +63,9 @@ class CharServerHandler final : public MessageHandler,
void processChangeMapServer(Net::MessageIn &msg);
+ bool isNeedCreatePin() const
+ { return false; }
+
protected:
void readPlayerData(Net::MessageIn &msg,
Net::Character *const character,