diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-09 17:19:43 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-09 17:19:43 +0000 |
commit | 4bb106036bb644e33fe41340b3ae8f7b603c1210 (patch) | |
tree | c8342fee4adbdb925ef60607882273441ef04200 /src/login_sql/login.c | |
parent | 4d1b09949d8dfb0e111a2070486c79bb5ffbf971 (diff) | |
download | hercules-4bb106036bb644e33fe41340b3ae8f7b603c1210.tar.gz hercules-4bb106036bb644e33fe41340b3ae8f7b603c1210.tar.bz2 hercules-4bb106036bb644e33fe41340b3ae8f7b603c1210.tar.xz hercules-4bb106036bb644e33fe41340b3ae8f7b603c1210.zip |
small fix to the server's packet parsing code to display server IPs correctly.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11876 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r-- | src/login_sql/login.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 20be31a7b..2037ef463 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -440,8 +440,7 @@ int mmo_auth(struct mmo_account* account, int fd) char* data; char ip[16]; - uint8* sin_addr = (uint8*)&session[fd]->client_addr; - sprintf(ip, "%u.%u.%u.%u", sin_addr[3], sin_addr[2], sin_addr[1], sin_addr[0]); + ip2str(session[fd]->client_addr, ip); // DNS Blacklist check if( login_config.use_dnsbl ) @@ -450,6 +449,7 @@ int mmo_auth(struct mmo_account* account, int fd) char ip_dnsbl[256]; char* dnsbl_serv; bool matched = false; + uint8* sin_addr = (uint8*)&session[fd]->client_addr; sprintf(r_ip, "%u.%u.%u.%u", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]); @@ -605,10 +605,8 @@ static int online_db_setoffline(DBKey key, void* data, va_list ap) int parse_fromchar(int fd) { int i, id; - - uint32 ipl = session[fd]->client_addr; + uint32 ipl; char ip[16]; - ip2str(ipl, ip); ARR_FIND( 0, MAX_SERVERS, id, server[id].fd == fd ); if( id == MAX_SERVERS ) @@ -630,6 +628,9 @@ int parse_fromchar(int fd) return 0; } + ipl = server[id].ip; + ip2str(ipl, ip); + while( RFIFOREST(fd) >= 2 ) { uint16 command = RFIFOW(fd,0); @@ -1216,7 +1217,7 @@ int parse_login(int fd) char esc_userid[NAME_LENGTH*2+1];// escaped username struct mmo_account account; int result, i; - uint32 ipl = session[fd]->client_addr; + uint32 ipl; char ip[16]; if( session[fd]->eof ) @@ -1225,6 +1226,7 @@ int parse_login(int fd) return 0; } + ipl = login_config.login_ip; ip2str(ipl, ip); while( RFIFOREST(fd) >= 2 ) |