summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-06 01:13:31 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-06 01:13:31 +0000
commit72a1ab426e87e8cc4fcb5dd4659e67a9e47feb3c (patch)
treee582d93b434c29ccfecd38afb62b714fb93dc5ce
parentf180cda1a2d7a0315508d9ff8f4c1f3196229207 (diff)
downloadhercules-72a1ab426e87e8cc4fcb5dd4659e67a9e47feb3c.tar.gz
hercules-72a1ab426e87e8cc4fcb5dd4659e67a9e47feb3c.tar.bz2
hercules-72a1ab426e87e8cc4fcb5dd4659e67a9e47feb3c.tar.xz
hercules-72a1ab426e87e8cc4fcb5dd4659e67a9e47feb3c.zip
didn't finsih bind code, now it's finished but export code isn't
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1048 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt2
-rw-r--r--src/login/login.c2
-rw-r--r--src/login_sql/login.c4
-rw-r--r--src/map/map.c16
4 files changed, 18 insertions, 6 deletions
diff --git a/Changelog.txt b/Changelog.txt
index c312faff4..9875243c9 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,6 +1,8 @@
Date Added
02/05
+ * Map server now actually reads bind_ip [1048: Ajarn]
+ Side note: login reads bind_ip, but doesn't use login_ip now.
* Made eA compile under AMD64 64-bit native [1047: MouseJstr]
* Changed interface binding to use a bind_ip instead of using
the login_ip, char_ip, or map_ip. This lets you still be
diff --git a/src/login/login.c b/src/login/login.c
index 187111f1a..698aae0b8 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -3427,7 +3427,7 @@ int login_config_read(const char *cfgName) {
//bind_ip_set_ = 1;
h = gethostbyname (w2);
if (h != NULL) {
- printf("Login server IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
+ printf("Login server binding IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
sprintf(bind_ip_str, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
} else
memcpy(bind_ip_str,w2,16);
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 97e25a3a3..a0c3ae1f2 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -1597,10 +1597,10 @@ int login_config_read(const char *cfgName){
if(i!=2)
continue;
else if (strcmpi(w1, "bind_ip") == 0) {
- //login_ip_set_ = 1;
+ //bind_ip_set_ = 1;
h = gethostbyname (w2);
if (h != NULL) {
- printf("Login server IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
+ printf("Login server binding IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
sprintf(bind_ip_str, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
} else
memcpy(bind_ip_str,w2,16);
diff --git a/src/map/map.c b/src/map/map.c
index 3a0b816c1..493a243ff 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1091,7 +1091,7 @@ int map_quit(struct map_session_data *sd) {
numdb_erase(charid_db,sd->status.char_id);
free(p);
}
- }
+ }
strdb_erase(nick_db,sd->status.name);
numdb_erase(charid_db,sd->status.char_id);
numdb_erase(id_db,sd->bl.id);
@@ -1421,7 +1421,7 @@ int map_getcellp(struct map_data* m,int x,int y,cell_t cellchk)
return m->gat[j];
default:
return 0;
- }
+ }
}
/*==========================================
@@ -1701,7 +1701,7 @@ static int map_cache_write(struct map_data *m)
len_new = m->xs * m->ys;
write_buf = (char *) m->gat;
map_cache.map[i].compressed = 0;
- map_cache.map[i].compressed_len = 0;
+ map_cache.map[i].compressed_len = 0;
}
if(len_new <= len_old) {
// サイズが同じか小さくなったので場所は変わらない
@@ -2133,6 +2133,7 @@ int map_delmap(char *mapname) {
static int map_ip_set_ = 0;
static int char_ip_set_ = 0;
+//static int bind_ip_set_ = 0;
/*==========================================
* Console Command Parser [Wizputer]
@@ -2261,6 +2262,15 @@ int map_config_read(char *cfgName) {
sprintf(w2, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
}
clif_setip(w2);
+ } else if (strcmpi(w1, "bind_ip") == 0) {
+ //bind_ip_set_ = 1;
+ h = gethostbyname (w2);
+ if (h != NULL) {
+ snprintf(tmp_output,sizeof(tmp_output),"Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'.\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
+ ShowInfo(tmp_output);
+ sprintf(w2, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
+ }
+ clif_setbindip(w2);
} else if (strcmpi(w1, "map_port") == 0) {
clif_setport(atoi(w2));
map_port = (atoi(w2));