summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-07 23:32:25 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-07 23:32:25 +0300
commit0d9e625499c18a4eaf79d38dfb1ef6abf0c553bd (patch)
tree1e4c29a0de3697946060410e41910f88bcc5b979 /src/net
parentb6cd136e3edf9d5c0eaaef47118ff1a72d7b0c75 (diff)
downloadmanaverse-0d9e625499c18a4eaf79d38dfb1ef6abf0c553bd.tar.gz
manaverse-0d9e625499c18a4eaf79d38dfb1ef6abf0c553bd.tar.bz2
manaverse-0d9e625499c18a4eaf79d38dfb1ef6abf0c553bd.tar.xz
manaverse-0d9e625499c18a4eaf79d38dfb1ef6abf0c553bd.zip
Add support for set new pincode.
Add pincode dialog and widget.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/charserverhandler.h3
-rw-r--r--src/net/eathena/charserverhandler.cpp11
-rw-r--r--src/net/eathena/charserverhandler.h3
-rw-r--r--src/net/eathena/charserverrecv.cpp8
-rw-r--r--src/net/tmwa/charserverhandler.h3
5 files changed, 15 insertions, 13 deletions
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index 8c41db2ad..56728a58f 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -87,7 +87,8 @@ class CharServerHandler notfinal
virtual void clear() const = 0;
- virtual void setNewPincode(const std::string &pin) const = 0;
+ virtual void setNewPincode(const BeingId accountId,
+ const std::string &pin) const = 0;
virtual void changeSlot(const int oldSlot,
const int newSlot) const = 0;
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index e98f963e4..a62c79c3b 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -198,13 +198,12 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *const window)
mCharCreateDialog->setDefaultGender(token.sex);
}
-void CharServerHandler::setNewPincode(const std::string &pin A_UNUSED) const
+void CharServerHandler::setNewPincode(const BeingId accountId,
+ const std::string &pin) const
{
-// here need ecript pin with mPinSeed and pin values.
-
-// createOutPacket(CMSG_CHAR_CREATE_PIN);
-// outMsg.writeBeingId(mPinAccountId, "account id");
-// outMsg.writeString(pin, 4, "encrypted pin");
+ createOutPacket(CMSG_CHAR_CREATE_PIN);
+ outMsg.writeBeingId(accountId, "account id");
+ outMsg.writeString(pin, 4, "encrypted pin");
}
void CharServerHandler::renameCharacter(const BeingId id,
diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h
index e86e03721..9e02dce1f 100644
--- a/src/net/eathena/charserverhandler.h
+++ b/src/net/eathena/charserverhandler.h
@@ -62,7 +62,8 @@ class CharServerHandler final : public Ea::CharServerHandler
void connect() const override final;
- void setNewPincode(const std::string &pin) const override final;
+ void setNewPincode(const BeingId accountId,
+ const std::string &pin) const override final;
/**
* Sets the character create dialog. The handler will clean up this
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp
index 3e69005e3..6d5fd63ca 100644
--- a/src/net/eathena/charserverrecv.cpp
+++ b/src/net/eathena/charserverrecv.cpp
@@ -347,7 +347,7 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg)
void CharServerRecv::processPincodeStatus(Net::MessageIn &msg)
{
- pincodeManager.setSeed(msg.readInt32("pincode seed"));
+ pincodeManager.setSeed(msg.readUInt32("pincode seed"));
pincodeManager.setAccountId(msg.readBeingId("account id"));
const uint16_t state = CAST_U16(msg.readInt16("state"));
switch (state)
@@ -356,16 +356,16 @@ void CharServerRecv::processPincodeStatus(Net::MessageIn &msg)
pincodeManager.pinOk();
break;
case 1: // ask for pin
- pincodeManager.askPin();
+ pincodeManager.setState(PincodeState::Ask);
break;
case 2: // create new pin
case 4: // create new pin?
{
- pincodeManager.createNewPin();
+ pincodeManager.setState(PincodeState::Create);
break;
}
case 3: // pin must be changed
- pincodeManager.changePin();
+ pincodeManager.setState(PincodeState::Change);
break;
case 8: // pincode was incorrect
case 5: // client show error?
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index 6d2051a63..51bf08b84 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -62,7 +62,8 @@ class CharServerHandler final : public Ea::CharServerHandler
void connect() const override final;
- void setNewPincode(const std::string &pin A_UNUSED) const
+ void setNewPincode(const BeingId accountId A_UNUSED,
+ const std::string &pin A_UNUSED) const
override final
{ }