Переглянути джерело

didn't finsih bind code, now it's finished but export code isn't

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1048 54d463be-8e91-2dee-dedb-b68131a5f0ec
(no author) 20 роки тому
батько
коміт
9d2846d50d
4 змінених файлів з 18 додано та 6 видалено
  1. 2 0
      Changelog.txt
  2. 1 1
      src/login/login.c
  3. 2 2
      src/login_sql/login.c
  4. 13 3
      src/map/map.c

+ 2 - 0
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

+ 1 - 1
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);

+ 2 - 2
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);

+ 13 - 3
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));