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/clif.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/clif.c')
-rw-r--r-- | src/map/clif.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index a9214a137..4844f0ac5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -116,23 +116,23 @@ static void clif_hpmeter_single(int fd, struct map_session_data *sd); int clif_setip(const char* ip) { char ip_str[16]; - map_ip = resolve_hostbyname(ip,NULL,ip_str); + map_ip = host2ip(ip); if (!map_ip) { ShowWarning("Failed to Resolve Map Server Address! (%s)\n", ip); return 0; } strncpy(map_ip_str, ip, sizeof(map_ip_str)); - ShowInfo("Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip_str); + ShowInfo("Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(map_ip, ip_str)); return 1; } void clif_setbindip(const char* ip) { - unsigned char ip_str[4]; - bind_ip = resolve_hostbyname(ip,ip_str,NULL); + char ip_str[16]; + bind_ip = host2ip(ip); if (bind_ip) { - ShowInfo("Map Server Bind IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'.\n", ip, ip_str[0], ip_str[1], ip_str[2], ip_str[3]); + ShowInfo("Map Server Bind IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(bind_ip, ip_str)); } else { ShowWarning("Failed to Resolve Map Server Address! (%s)\n", ip); } @@ -162,12 +162,12 @@ unsigned long clif_getip_long(void) return (unsigned long)map_ip; } -//Refreshes map_server ip, returns the new ip if the ip changed, otherwise it -//returns 0. -unsigned long clif_refresh_ip(void) { +//Refreshes map_server ip, returns the new ip if the ip changed, otherwise it returns 0. +unsigned long clif_refresh_ip(void) +{ in_addr_t new_ip; - new_ip = resolve_hostbyname(map_ip_str, NULL, NULL); + new_ip = host2ip(map_ip_str); if (new_ip && new_ip != map_ip) { map_ip = new_ip; ShowInfo("Updating IP resolution of [%s].\n",map_ip_str); |