summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/charserverhandler.h2
-rw-r--r--src/net/eathena/charserverhandler.cpp15
-rw-r--r--src/net/eathena/charserverhandler.h3
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/tmwa/charserverhandler.h3
6 files changed, 22 insertions, 4 deletions
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index 6a0125e1d..df3d806a0 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -75,6 +75,8 @@ class CharServerHandler notfinal
virtual bool isNeedCreatePin() const = 0;
+ virtual void setNewPincode(const std::string &pin) = 0;
+
protected:
CharServerHandler() :
mCharacters(),
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 7d6e2e74c..39ebe52e2 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -65,6 +65,7 @@ CharServerHandler::CharServerHandler() :
MessageHandler(),
Ea::CharServerHandler(),
mPinSeed(0),
+ mPinAccountId(0),
mNeedCreatePin(false)
{
static const uint16_t _messages[] =
@@ -385,8 +386,8 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg)
void CharServerHandler::processPincodeStatus(Net::MessageIn &msg)
{
- const uint32_t seed = msg.readInt32("pincode seed");
- msg.readInt32("account id");
+ mPinSeed = msg.readInt32("pincode seed");
+ mPinAccountId = msg.readInt32("account id");
const uint16_t state = static_cast<uint16_t>(msg.readInt16("state"));
switch (state)
{
@@ -397,7 +398,6 @@ void CharServerHandler::processPincodeStatus(Net::MessageIn &msg)
case 2: // create new pin
case 4: // create new pin?
{
- mPinSeed = seed;
mNeedCreatePin = true;
break;
}
@@ -418,4 +418,13 @@ void CharServerHandler::processPincodeStatus(Net::MessageIn &msg)
}
}
+void CharServerHandler::setNewPincode(const std::string &pin)
+{
+// here need ecript pin with mPinSeed and pin values.
+
+// MessageOut outMsg(CMSG_CHAR_CREATE_PIN);
+// outMsg.writeInt32(mPinAccountId, "account id");
+// outMsg.writeString(pin, 4, "encrypted pin");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h
index e647a6d60..1f9cbbcfb 100644
--- a/src/net/eathena/charserverhandler.h
+++ b/src/net/eathena/charserverhandler.h
@@ -66,6 +66,8 @@ class CharServerHandler final : public MessageHandler,
bool isNeedCreatePin() const A_WARN_UNUSED
{ return mNeedCreatePin; }
+ void setNewPincode(const std::string &pin) override final;
+
protected:
void readPlayerData(Net::MessageIn &msg,
Net::Character *const character,
@@ -75,6 +77,7 @@ class CharServerHandler final : public MessageHandler,
private:
uint32_t mPinSeed;
+ uint32_t mPinAccountId;
bool mNeedCreatePin;
};
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 72ae89dfe..b4f36b722 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -228,7 +228,7 @@ int16_t packet_lengths[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 10, 0, 0, 0, 0, 0,
// #0x08C0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index a716d8a6e..60a10dbac 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -197,6 +197,7 @@
#define CMSG_CHAR_SELECT 0x0066
#define CMSG_CHAR_CREATE 0x0970
#define CMSG_CHAR_DELETE 0x0068
+#define CMSG_CHAR_CREATE_PIN 0x08ba
#define CMSG_MAP_SERVER_CONNECT 0x0072
#define CMSG_CLIENT_PING 0x007e /**< Send to server with tick */
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index 35a4585e3..757474c4c 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -66,6 +66,9 @@ class CharServerHandler final : public MessageHandler,
bool isNeedCreatePin() const
{ return false; }
+ void setNewPincode(const std::string &pin A_UNUSED) override final
+ { }
+
protected:
void readPlayerData(Net::MessageIn &msg,
Net::Character *const character,