diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-05 02:07:30 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-05 02:07:30 +0000 |
commit | d8776648ff6e6b3cb4922025b12c9cc42974b4db (patch) | |
tree | 5d2de15f0f2057dc0d6fc034ccc4e76a0ee353c5 /src/login_sql | |
parent | b91405aa5454bab5eeacd29d28a773812ef55b29 (diff) | |
download | hercules-d8776648ff6e6b3cb4922025b12c9cc42974b4db.tar.gz hercules-d8776648ff6e6b3cb4922025b12c9cc42974b4db.tar.bz2 hercules-d8776648ff6e6b3cb4922025b12c9cc42974b4db.tar.xz hercules-d8776648ff6e6b3cb4922025b12c9cc42974b4db.zip |
Servers can bind to single IP addresses now, and added buffer.(c/h)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1033 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql')
-rw-r--r-- | src/login_sql/login.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index c4c8bdafc..e11138c30 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -81,6 +81,8 @@ void Gettimeofday(struct timeval *timenow) int account_id_count = START_ACCOUNT_NUM; int server_num; int new_account_flag = 0; +char login_ip_str[16]; +in_addr_t login_ip; int login_port = 6900; char lan_char_ip[128]; // Lan char ip added by kashy int subnetmaski[4]; // Subnetmask added by kashy @@ -1591,7 +1593,15 @@ int login_config_read(const char *cfgName){ if(i!=2) continue; - else if(strcmpi(w1,"login_port")==0){ + } else if (strcmpi(w1, "login_ip") == 0) { + //login_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]); + sprintf(login_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(login_ip_str,w2,16); + } else if(strcmpi(w1,"login_port")==0){ login_port=atoi(w2); printf ("set login_port : %s\n",w2); } @@ -1804,7 +1814,10 @@ int do_init(int argc,char **argv){ printf ("set max servers complete\n"); //server port open & binding - login_fd=make_listen_port(login_port); + login_ip = inet_addr(login_ip_str); + + //login_fd=make_listen_port(login_port); + login_fd=make_listen_bind(login_ip,login_port); //Auth start printf ("Running mmo_auth_sqldb_init()\n"); |