diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-02 13:46:11 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-02 13:46:11 +0000 |
commit | 37cc17c1b9a2dd29e1623a46cfc332e1aeb76751 (patch) | |
tree | 6f8dd05942422f043ef2df9e9364dd954a826bb3 /src/map/chrif.c | |
parent | 5758d3649f0bf74677b3f470acb4e17a98910100 (diff) | |
download | hercules-37cc17c1b9a2dd29e1623a46cfc332e1aeb76751.tar.gz hercules-37cc17c1b9a2dd29e1623a46cfc332e1aeb76751.tar.bz2 hercules-37cc17c1b9a2dd29e1623a46cfc332e1aeb76751.tar.xz hercules-37cc17c1b9a2dd29e1623a46cfc332e1aeb76751.zip |
* Some source code cleaning
- Fixed the badly worded messages during mapserver startup
- Cleaned up socket config reading
- Split resolve_hostbyname() into 2 separate functions for clarity
- Moved the probably obsolete LOWER/UPPER macros to db.c (TODO: remove)
- Moved the badly placed compare_item() function to storage.c (see r779)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10119 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r-- | src/map/chrif.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 403cfdcb1..d432320d3 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -143,17 +143,16 @@ void chrif_checkdefaultlogin(void) * *------------------------------------------ */ -int chrif_setip(char *ip) +int chrif_setip(const char *ip) { char ip_str[16]; - char_ip = resolve_hostbyname(ip,NULL,ip_str); - + char_ip = host2ip(ip); if (!char_ip) { ShowWarning("Failed to Resolve Char Server Address! (%s)\n", ip); return 0; } strncpy(char_ip_str, ip, sizeof(char_ip_str)); - ShowInfo("Char Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip_str); + ShowInfo("Char Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(char_ip, ip_str)); return 1; } @@ -1418,10 +1417,11 @@ int chrif_disconnect(int fd) { return 0; } -void chrif_update_ip(int fd){ +void chrif_update_ip(int fd) +{ unsigned long new_ip; WFIFOHEAD(fd, 6); - new_ip = resolve_hostbyname(char_ip_str, NULL, NULL); + new_ip = host2ip(char_ip_str); if (new_ip && new_ip != char_ip) char_ip = new_ip; //Update char_ip |