summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-09-15 13:23:34 +0200
committerHaru <haru@dotalux.com>2015-10-11 00:24:21 +0200
commit437dc70ac6a19fe9a32c095ada8205dce173beb3 (patch)
tree7a8fc2106458439fc283a22157f6b0ed8ee31f8a /src/login
parentf17add758aa067f3b643e008dc42ec918b358528 (diff)
downloadhercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.tar.gz
hercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.tar.bz2
hercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.tar.xz
hercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.zip
Changed HPM->packets[] into an array of VECTOR
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/login')
-rw-r--r--src/login/login.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 572bd594f..1d8ef489a 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -768,7 +768,7 @@ void login_fromchar_parse_accinfo(int fd)
//--------------------------------
int login_parse_fromchar(int fd)
{
- int j, id;
+ int id;
uint32 ipl;
char ip[16];
@@ -795,11 +795,12 @@ int login_parse_fromchar(int fd)
while( RFIFOREST(fd) >= 2 ) {
uint16 command = RFIFOW(fd,0);
- if( HPM->packetsc[hpParse_FromChar] ) {
- if( (j = HPM->parse_packets(fd,hpParse_FromChar)) ) {
- if( j == 1 ) continue;
- if( j == 2 ) return 0;
- }
+ if (VECTOR_LENGTH(HPM->packets[hpParse_FromChar]) > 0) {
+ int result = HPM->parse_packets(fd,hpParse_FromChar);
+ if (result == 1)
+ continue;
+ if (result == 2)
+ return 0;
}
switch( command ) {
@@ -1574,7 +1575,6 @@ void login_parse_request_connection(int fd, struct login_session_data* sd, const
int login_parse_login(int fd)
{
struct login_session_data* sd = (struct login_session_data*)sockt->session[fd]->session_data;
- int result;
char ip[16];
uint32 ipl = sockt->session[fd]->client_addr;
@@ -1608,11 +1608,12 @@ int login_parse_login(int fd)
while( RFIFOREST(fd) >= 2 ) {
uint16 command = RFIFOW(fd,0);
- if( HPM->packetsc[hpParse_Login] ) {
- if( (result = HPM->parse_packets(fd,hpParse_Login)) ) {
- if( result == 1 ) continue;
- if( result == 2 ) return 0;
- }
+ if (VECTOR_LENGTH(HPM->packets[hpParse_Login]) > 0) {
+ int result = HPM->parse_packets(fd,hpParse_Login);
+ if (result == 1)
+ continue;
+ if (result == 2)
+ return 0;
}
switch( command ) {