summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/elogin/init.c7
-rw-r--r--src/elogin/parse.c23
-rw-r--r--src/elogin/parse.h4
3 files changed, 17 insertions, 17 deletions
diff --git a/src/elogin/init.c b/src/elogin/init.c
index 7094321..caebf5d 100644
--- a/src/elogin/init.c
+++ b/src/elogin/init.c
@@ -14,6 +14,7 @@
#include "common/strlib.h"
#include "common/timer.h"
#include "common/mapindex.h"
+#include "login/lclif.h"
#include "login/login.h"
#include "ecommon/init.h"
@@ -38,10 +39,10 @@ HPExport void plugin_init (void)
addPacket(0x7530, 22, login_parse_version, hpParse_Login);
addPacket(0x027c, 91, elogin_parse_client_login2, hpParse_Login);
addPacket(0x5000, 54, elogin_parse_change_paassword, hpParse_FromChar);
- addHookPre("login->parse_client_login", elogin_parse_client_login_pre);
+ addHookPre("login->client_login", elogin_client_login_pre);
addHookPre("login->check_password", elogin_check_password);
- addHookPre("login->parse_ping", elogin_parse_ping);
- addHookPost("login->parse_client_login", elogin_parse_client_login_post);
+ addHookPre("lclif->p->parse_CA_CONNECT_INFO_CHANGED", elogin_parse_ping);
+ addHookPost("login->client_login", elogin_client_login_post);
}
HPExport void server_preinit (void)
diff --git a/src/elogin/parse.c b/src/elogin/parse.c
index 5253d9b..3140615 100644
--- a/src/elogin/parse.c
+++ b/src/elogin/parse.c
@@ -14,6 +14,7 @@
#include "common/strlib.h"
#include "common/timer.h"
#include "login/account.h"
+#include "login/lclif.h"
#include "login/login.h"
#include "elogin/config.h"
@@ -33,7 +34,7 @@ void login_parse_version(int fd)
if (clientVersion < 2)
{
- login->login_error(fd, 5);
+ lclif->login_error(fd, 5);
return;
}
@@ -41,15 +42,14 @@ void login_parse_version(int fd)
send_server_version(fd);
}
-int elogin_parse_client_login_pre(int *fdPtr,
- struct login_session_data* sd __attribute__ ((unused)),
- const char *const ip __attribute__ ((unused)))
+int elogin_client_login_pre(int *fdPtr,
+ struct login_session_data* sd __attribute__ ((unused)))
{
int fd = *fdPtr;
uint16 command = RFIFOW(fd,0);
if (command != 0x64)
{
- login->login_error(fd, 3);
+ lclif->login_error(fd, 3);
hookStop();
return 1;
}
@@ -58,13 +58,13 @@ int elogin_parse_client_login_pre(int *fdPtr,
int len = safestrnlen(username, NAME_LENGTH);
if (clientVersion < 2)
{
- login->login_error(fd, 5);
+ lclif->login_error(fd, 5);
hookStop();
return 1;
}
else if (len >= 2 && username[len - 2] == '_' && memchr("FfMm", username[len - 1], 4))
{
- login->login_error(fd, 3);
+ lclif->login_error(fd, 3);
hookStop();
return 1;
}
@@ -75,9 +75,8 @@ int elogin_parse_client_login_pre(int *fdPtr,
return 0;
}
-int elogin_parse_client_login_post(int retVal, int *fdPtr,
- struct login_session_data* sd,
- const char *const ip __attribute__ ((unused)))
+int elogin_client_login_post(int retVal, int *fdPtr,
+ struct login_session_data* sd)
{
sd = (struct login_session_data*)sockt->session[*fdPtr]->session_data;
if (sd)
@@ -98,7 +97,7 @@ void elogin_parse_client_login2(int fd)
int len = safestrnlen(username, NAME_LENGTH);
if (len < 2 || !(username[len - 2] == '_') || !memchr("FfMm", username[len - 1], 4))
{
- login->login_error(fd, 3);
+ lclif->login_error(fd, 3);
return;
}
@@ -123,7 +122,7 @@ void elogin_parse_client_login2(int fd)
if (e_mail_check(email) == 0)
{
ShowNotice("Attempt to create an e-mail REFUSED - e-mail is invalid (ip: %s)\n", ip);
- login->login_error(fd, 11);
+ lclif->login_error(fd, 11);
return;
}
diff --git a/src/elogin/parse.h b/src/elogin/parse.h
index b9ae5e7..97f66d4 100644
--- a/src/elogin/parse.h
+++ b/src/elogin/parse.h
@@ -5,8 +5,8 @@
#define EVOL_LOGIN_PARSE
void login_parse_version(int fd);
-int elogin_parse_client_login_pre(int *fd, struct login_session_data* sd, const char *const ip);
-int elogin_parse_client_login_post(int retVal, int *fd, struct login_session_data* sd, const char *const ip);
+int elogin_client_login_pre(int *fd, struct login_session_data* sd);
+int elogin_client_login_post(int retVal, int *fd, struct login_session_data* sd);
void elogin_parse_client_login2(int fd);
void elogin_parse_ping(int *fd, struct login_session_data* sd);
void elogin_parse_change_paassword(int fd);