diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-08 06:07:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-08 06:07:15 +0300 |
commit | fc1ca42ed5a1b2d83a1dc8f94709a057b8e28e9d (patch) | |
tree | f7f8af4849bc214a27ea8205410568b76ce5ec30 /src/net/eathena | |
parent | 6b3b81988ea37207eeeb2994761e307c6b6fb340 (diff) | |
download | plus-fc1ca42ed5a1b2d83a1dc8f94709a057b8e28e9d.tar.gz plus-fc1ca42ed5a1b2d83a1dc8f94709a057b8e28e9d.tar.bz2 plus-fc1ca42ed5a1b2d83a1dc8f94709a057b8e28e9d.tar.xz plus-fc1ca42ed5a1b2d83a1dc8f94709a057b8e28e9d.zip |
Add support for change pin code by server request.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.h | 4 | ||||
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 71bf6aeee..630dca675 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -214,6 +214,16 @@ void CharServerHandler::sendCheckPincode(const BeingId accountId, outMsg.writeString(pin, 4, "encrypted pin"); } +void CharServerHandler::changePincode(const BeingId accountId, + const std::string &oldPin, + const std::string &newPin) const +{ + createOutPacket(CMSG_CHAR_PIN_CHANGE); + outMsg.writeBeingId(accountId, "account id"); + outMsg.writeString(oldPin, 4, "old encrypted pin"); + outMsg.writeString(newPin, 4, "new encrypted pin"); +} + void CharServerHandler::renameCharacter(const BeingId id, const std::string &newName) const { diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h index f41b14a79..a712c5a56 100644 --- a/src/net/eathena/charserverhandler.h +++ b/src/net/eathena/charserverhandler.h @@ -68,6 +68,10 @@ class CharServerHandler final : public Ea::CharServerHandler void sendCheckPincode(const BeingId accountId, const std::string &pin) const override final; + void changePincode(const BeingId accountId, + const std::string &oldPin, + const std::string &newPin) const override final; + /** * Sets the character create dialog. The handler will clean up this * dialog when a new character is successfully created, and will unlock diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index 6d5fd63ca..ece603ac2 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -370,7 +370,7 @@ void CharServerRecv::processPincodeStatus(Net::MessageIn &msg) case 8: // pincode was incorrect case 5: // client show error? pincodeManager.wrongPin(); - break; + return; case 6: // Unable to use your KSSN number break; case 7: // char select window shows a button @@ -379,6 +379,8 @@ void CharServerRecv::processPincodeStatus(Net::MessageIn &msg) UNIMPLEMENTEDPACKET; break; } + if (client) + client->updatePinState(); } void CharServerRecv::processCharCreate(Net::MessageIn &msg) |