summaryrefslogtreecommitdiff
path: root/src/login_sql/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r--src/login_sql/login.c17
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");