diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-04-23 22:00:00 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2024-04-27 20:14:02 +0200 |
commit | 1757e42c58b105722a8c49253d3fc63576a93502 (patch) | |
tree | 0373197d52e7515a7de8132ac40058b8744c4bb7 /src/net | |
parent | f74de2c2762999be3c2c37749313746a9ae948c3 (diff) | |
download | mv-1757e42c58b105722a8c49253d3fc63576a93502.tar.gz mv-1757e42c58b105722a8c49253d3fc63576a93502.tar.bz2 mv-1757e42c58b105722a8c49253d3fc63576a93502.tar.xz mv-1757e42c58b105722a8c49253d3fc63576a93502.zip |
deduplicate branches
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/tmwa/loginrecv.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/net/tmwa/loginrecv.cpp b/src/net/tmwa/loginrecv.cpp index 25341889a..aa9b89fb9 100644 --- a/src/net/tmwa/loginrecv.cpp +++ b/src/net/tmwa/loginrecv.cpp @@ -62,28 +62,23 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg) const uint8_t b2 = msg.readUInt8("b2"); const uint8_t b3 = msg.readUInt8("b3"); msg.readUInt8("b4"); + const unsigned int options = msg.readInt32("options"); + + Ea::LoginRecv::mRegistrationEnabled = + ((options & FLAG_REGISTRATION) != 0U); + + serverVersion = 0; + if (b1 == 255) { // old TMWA - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0U); - serverVersion = 0; tmwServerVersion = 0; } else if (b1 >= 0x0d) { // new TMWA - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0U); - serverVersion = 0; tmwServerVersion = (b1 << 16) | (b2 << 8) | b3; } else { // eAthena - const unsigned int options = msg.readInt32("options"); - Ea::LoginRecv::mRegistrationEnabled = - ((options & FLAG_REGISTRATION) != 0U); - serverVersion = 0; tmwServerVersion = 0; } |