summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-05 18:04:35 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-05 18:12:39 +0300
commit2977a6e00056647c1637db79ae51a151086203cf (patch)
treeb00906b3266b9ec61bb84082ee49a41357d8be16 /src/net
parent4c41a3eaa82e2e11f2ee4da3513f25e1095c3a12 (diff)
downloadmanaverse-2977a6e00056647c1637db79ae51a151086203cf.tar.gz
manaverse-2977a6e00056647c1637db79ae51a151086203cf.tar.bz2
manaverse-2977a6e00056647c1637db79ae51a151086203cf.tar.xz
manaverse-2977a6e00056647c1637db79ae51a151086203cf.zip
Add packet SMSG_LOGIN_DATA 0x0ac4.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/loginrecv.cpp43
-rw-r--r--src/net/ea/loginrecv.h1
-rw-r--r--src/net/eathena/loginrecv.cpp61
-rw-r--r--src/net/eathena/loginrecv.h1
-rw-r--r--src/net/eathena/packetsin.inc8
-rw-r--r--src/net/tmwa/loginrecv.cpp47
-rw-r--r--src/net/tmwa/loginrecv.h1
-rw-r--r--src/net/tmwa/packetsin.inc2
8 files changed, 116 insertions, 48 deletions
diff --git a/src/net/ea/loginrecv.cpp b/src/net/ea/loginrecv.cpp
index 6c6e1bad1..10316a978 100644
--- a/src/net/ea/loginrecv.cpp
+++ b/src/net/ea/loginrecv.cpp
@@ -23,9 +23,6 @@
#include "net/ea/loginrecv.h"
#include "client.h"
-#include "configuration.h"
-
-#include "being/being.h"
#include "fs/paths.h"
@@ -67,46 +64,6 @@ void LoginRecv::processUpdateHost(Net::MessageIn &msg)
mUpdateHost.c_str());
}
-void LoginRecv::processLoginData(Net::MessageIn &msg)
-{
- msg.readInt16("len");
-
- loginHandler->clearWorlds();
-
- const int worldCount = (msg.getLength() - 47) / 32;
-
- mToken.session_ID1 = msg.readInt32("session id1");
- mToken.account_ID = msg.readBeingId("accound id");
- mToken.session_ID2 = msg.readInt32("session id2");
- msg.readInt32("old ip");
- loginData.lastLogin = msg.readString(24, "last login");
- msg.readInt16("unused");
-
- // reserve bits for future usage
- mToken.sex = Being::intToGender(CAST_U8(
- msg.readUInt8("gender") & 3U));
-
- for (int i = 0; i < worldCount; i++)
- {
- WorldInfo *const world = new WorldInfo;
-
- world->address = msg.readInt32("ip address");
- world->port = msg.readInt16("port");
- world->name = msg.readString(20, "name");
- world->online_users = msg.readInt16("online number");
- config.setValue("updatehost", mUpdateHost);
- world->updateHost = mUpdateHost;
- msg.readInt16("maintenance");
- msg.readInt16("new");
-
- logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
- ipToString(world->address), world->port);
-
- mWorlds.push_back(world);
- }
- client->setState(State::WORLD_SELECT);
-}
-
void LoginRecv::processLoginError(Net::MessageIn &msg)
{
const uint8_t code = msg.readUInt8("error");
diff --git a/src/net/ea/loginrecv.h b/src/net/ea/loginrecv.h
index 239fb3bbd..80ac08e44 100644
--- a/src/net/ea/loginrecv.h
+++ b/src/net/ea/loginrecv.h
@@ -43,7 +43,6 @@ namespace Ea
extern bool mRegistrationEnabled;
void processUpdateHost(Net::MessageIn &msg);
- void processLoginData(Net::MessageIn &msg);
void processLoginError(Net::MessageIn &msg);
} // namespace LoginRecv
} // namespace Ea
diff --git a/src/net/eathena/loginrecv.cpp b/src/net/eathena/loginrecv.cpp
index 11b0086bf..92de540da 100644
--- a/src/net/eathena/loginrecv.cpp
+++ b/src/net/eathena/loginrecv.cpp
@@ -23,15 +23,20 @@
#include "net/eathena/loginrecv.h"
#include "client.h"
+#include "configuration.h"
+
+#include "being/being.h"
#include "fs/paths.h"
#include "gui/windows/logindialog.h"
#include "net/logindata.h"
-
+#include "net/loginhandler.h"
#include "net/messagein.h"
+#include "net/ea/loginrecv.h"
+
#include "net/eathena/updateprotocol.h"
#include "utils/gettext.h"
@@ -213,4 +218,58 @@ void LoginRecv::processCharPasswordResponse(Net::MessageIn &msg)
}
}
+void LoginRecv::processLoginData(Net::MessageIn &msg)
+{
+ msg.readInt16("len");
+
+ loginHandler->clearWorlds();
+
+ const int worldCount = (msg.getLength() - 47) / 32;
+
+ Ea::LoginRecv::mToken.session_ID1 = msg.readInt32("session id1");
+ Ea::LoginRecv::mToken.account_ID = msg.readBeingId("accound id");
+ Ea::LoginRecv::mToken.session_ID2 = msg.readInt32("session id2");
+ msg.readInt32("old ip");
+ loginData.lastLogin = msg.readString(24, "last login");
+ msg.readInt16("unused");
+
+ // reserve bits for future usage
+ Ea::LoginRecv::mToken.sex = Being::intToGender(CAST_U8(
+ msg.readUInt8("gender") & 3U));
+
+ if (msg.getVersion() >= 20170315)
+ {
+ msg.readInt32("unused1");
+ msg.readInt32("unused1");
+ msg.readInt32("unused1");
+ msg.readInt32("unused1");
+ msg.readUInt8("unused1");
+ }
+
+ for (int i = 0; i < worldCount; i++)
+ {
+ WorldInfo *const world = new WorldInfo;
+
+ world->address = msg.readInt32("ip address");
+ world->port = msg.readInt16("port");
+ world->name = msg.readString(20, "name");
+ world->online_users = msg.readInt16("online number");
+ config.setValue("updatehost", Ea::LoginRecv::mUpdateHost);
+ world->updateHost = Ea::LoginRecv::mUpdateHost;
+ msg.readInt16("maintenance");
+ msg.readInt16("new");
+ if (msg.getVersion() >= 20170315)
+ {
+ for(int f = 0; f < 32; f ++)
+ msg.readUInt8("unused2");
+ }
+
+ logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
+ ipToString(world->address), world->port);
+
+ Ea::LoginRecv::mWorlds.push_back(world);
+ }
+ client->setState(State::WORLD_SELECT);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/loginrecv.h b/src/net/eathena/loginrecv.h
index 64a9df7cd..2e070d584 100644
--- a/src/net/eathena/loginrecv.h
+++ b/src/net/eathena/loginrecv.h
@@ -37,6 +37,7 @@ namespace EAthena
void processServerVersion(Net::MessageIn &msg);
void processCondingKey(Net::MessageIn &msg);
void processCharPasswordResponse(Net::MessageIn &msg);
+ void processLoginData(Net::MessageIn &msg);
} // namespace LoginRecv
} // namespace EAthena
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index 57c6add4a..6360b0e24 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -67,7 +67,7 @@ packet(SMSG_RANKS_LIST, 0x0000, 0, nullptr,
packet(SMSG_CHAR_CHARACTERS, 0x0000, 0, nullptr, 0);
// login server, unknown version
-packet(SMSG_LOGIN_DATA, 0x0069, -1, &Ea::LoginRecv::processLoginData, 0);
+packet(SMSG_LOGIN_DATA, 0x0069, -1, &LoginRecv::processLoginData, 0);
packet(SMSG_LOGIN_CODING_KEY, 0x01dc, -1, &LoginRecv::processCondingKey, 0);
packet(SMSG_LOGIN_ERROR, 0x006a, 23, &Ea::LoginRecv::processLoginError, 0);
@@ -887,6 +887,12 @@ if (packetVersion >= 20160330)
packet(SMSG_MAP_LOGIN_SUCCESS, 0x02eb, 13, &GameRecv::processMapLogin, 20080102);
}
+// 20170315
+if (packetVersion >= 20170315)
+{
+ packet(SMSG_LOGIN_DATA, 0x0ac4, -1, &LoginRecv::processLoginData, 20170315);
+}
+
// 20170329
if (packetVersion >= 20170329)
{
diff --git a/src/net/tmwa/loginrecv.cpp b/src/net/tmwa/loginrecv.cpp
index 401b18f97..050bd68c1 100644
--- a/src/net/tmwa/loginrecv.cpp
+++ b/src/net/tmwa/loginrecv.cpp
@@ -23,12 +23,17 @@
#include "net/tmwa/loginrecv.h"
#include "client.h"
+#include "configuration.h"
#include "logger.h"
-#include "net/ea/loginrecv.h"
+#include "being/being.h"
+#include "net/logindata.h"
+#include "net/loginhandler.h"
#include "net/messagein.h"
+#include "net/ea/loginrecv.h"
+
#include "net/tmwa/updateprotocol.h"
#include "utils/gettext.h"
@@ -124,4 +129,44 @@ void LoginRecv::processCharPasswordResponse(Net::MessageIn &msg)
}
}
+void LoginRecv::processLoginData(Net::MessageIn &msg)
+{
+ msg.readInt16("len");
+
+ loginHandler->clearWorlds();
+
+ const int worldCount = (msg.getLength() - 47) / 32;
+
+ Ea::LoginRecv::mToken.session_ID1 = msg.readInt32("session id1");
+ Ea::LoginRecv::mToken.account_ID = msg.readBeingId("accound id");
+ Ea::LoginRecv::mToken.session_ID2 = msg.readInt32("session id2");
+ msg.readInt32("old ip");
+ loginData.lastLogin = msg.readString(24, "last login");
+ msg.readInt16("unused");
+
+ // reserve bits for future usage
+ Ea::LoginRecv::mToken.sex = Being::intToGender(CAST_U8(
+ msg.readUInt8("gender") & 3U));
+
+ for (int i = 0; i < worldCount; i++)
+ {
+ WorldInfo *const world = new WorldInfo;
+
+ world->address = msg.readInt32("ip address");
+ world->port = msg.readInt16("port");
+ world->name = msg.readString(20, "name");
+ world->online_users = msg.readInt16("online number");
+ config.setValue("updatehost", Ea::LoginRecv::mUpdateHost);
+ world->updateHost = Ea::LoginRecv::mUpdateHost;
+ msg.readInt16("maintenance");
+ msg.readInt16("new");
+
+ logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
+ ipToString(world->address), world->port);
+
+ Ea::LoginRecv::mWorlds.push_back(world);
+ }
+ client->setState(State::WORLD_SELECT);
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/loginrecv.h b/src/net/tmwa/loginrecv.h
index aa79eb942..d9bae56dc 100644
--- a/src/net/tmwa/loginrecv.h
+++ b/src/net/tmwa/loginrecv.h
@@ -34,6 +34,7 @@ namespace TmwAthena
{
void processServerVersion(Net::MessageIn &msg);
void processCharPasswordResponse(Net::MessageIn &msg);
+ void processLoginData(Net::MessageIn &msg);
} // namespace LoginRecv
} // namespace TmwAthena
diff --git a/src/net/tmwa/packetsin.inc b/src/net/tmwa/packetsin.inc
index 150028a41..633c2b1ad 100644
--- a/src/net/tmwa/packetsin.inc
+++ b/src/net/tmwa/packetsin.inc
@@ -55,7 +55,7 @@ packet(SMSG_ITEM_DROPPED, 0x009e, 17, &ItemRecv::processItemDr
packet(SMSG_ITEM_REMOVE, 0x00a1, 6, &Ea::ItemRecv::processItemRemove, 0);
packet(SMSG_ITEM_USE_RESPONSE, 0x00a8, 7, &Ea::InventoryRecv::processItemUseResponse, 0);
packet(SMSG_ITEM_VISIBLE, 0x009d, 17, &ItemRecv::processItemVisible, 0);
-packet(SMSG_LOGIN_DATA, 0x0069, -1, &Ea::LoginRecv::processLoginData, 0);
+packet(SMSG_LOGIN_DATA, 0x0069, -1, &LoginRecv::processLoginData, 0);
packet(SMSG_LOGIN_ERROR, 0x006a, 23, &Ea::LoginRecv::processLoginError, 0);
packet(SMSG_MAP_LOGIN_SUCCESS, 0x0073, 11, &GameRecv::processMapLogin, 0);
packet(SMSG_MAP_MUSIC, 0x0227, -1, &Ea::PlayerRecv::processMapMusic, 0);