diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/charserverhandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 11 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 8 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.h | 3 |
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 { } |