summaryrefslogtreecommitdiff
path: root/src/net/eathena/charserverrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-05 20:41:48 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-05 20:41:48 +0300
commit8032eb0f2345ed6b9097277034d94066af66f4fd (patch)
tree6e4490564a53cd1ac3e80a8d60e63906ce4e6e67 /src/net/eathena/charserverrecv.cpp
parent55c9a94d904bb7fb6351f55e652ad241c079cf96 (diff)
downloadplus-8032eb0f2345ed6b9097277034d94066af66f4fd.tar.gz
plus-8032eb0f2345ed6b9097277034d94066af66f4fd.tar.bz2
plus-8032eb0f2345ed6b9097277034d94066af66f4fd.tar.xz
plus-8032eb0f2345ed6b9097277034d94066af66f4fd.zip
Add empty pincode manager.
Diffstat (limited to 'src/net/eathena/charserverrecv.cpp')
-rw-r--r--src/net/eathena/charserverrecv.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp
index abae9b0e1..3e69005e3 100644
--- a/src/net/eathena/charserverrecv.cpp
+++ b/src/net/eathena/charserverrecv.cpp
@@ -24,6 +24,7 @@
#include "client.h"
#include "configuration.h"
+#include "pincodemanager.h"
#include "settings.h"
#include "gui/windows/charcreatedialog.h"
@@ -65,10 +66,7 @@ extern ServerInfo mapServer;
namespace CharServerRecv
{
std::string mNewName;
- uint32_t mPinSeed = 0;
- BeingId mPinAccountId = BeingId_zero;
BeingId mRenameId = BeingId_zero;
- bool mNeedCreatePin = false;
} // namespace CharServerRecv
// callers must count each packet size by self
@@ -349,31 +347,34 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg)
void CharServerRecv::processPincodeStatus(Net::MessageIn &msg)
{
- mPinSeed = msg.readInt32("pincode seed");
- mPinAccountId = msg.readBeingId("account id");
+ pincodeManager.setSeed(msg.readInt32("pincode seed"));
+ pincodeManager.setAccountId(msg.readBeingId("account id"));
const uint16_t state = CAST_U16(msg.readInt16("state"));
switch (state)
{
case 0: // pin ok
+ pincodeManager.pinOk();
break;
case 1: // ask for pin
+ pincodeManager.askPin();
break;
case 2: // create new pin
case 4: // create new pin?
{
- mNeedCreatePin = true;
+ pincodeManager.createNewPin();
break;
}
case 3: // pin must be changed
+ pincodeManager.changePin();
break;
+ case 8: // pincode was incorrect
case 5: // client show error?
+ pincodeManager.wrongPin();
break;
case 6: // Unable to use your KSSN number
break;
case 7: // char select window shows a button
break;
- case 8: // pincode was incorrect
- break;
default:
UNIMPLEMENTEDPACKET;
break;