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/char_sql/char.c | |
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/char_sql/char.c')
-rw-r--r-- | src/char_sql/char.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 4c8d7e29f..22e1f78e1 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -89,11 +89,11 @@ char server_name[20]; char wisp_server_name[24] = "Server"; int login_ip_set_ = 0; char login_ip_str[128]; -int login_ip; +in_addr_t login_ip; int login_port = 6900; int char_ip_set_ = 0; char char_ip_str[128]; -int char_ip; +in_addr_t char_ip; int char_port = 6121; int char_maintenance; int char_new; @@ -3305,16 +3305,13 @@ int do_init(int argc, char **argv){ printf("set terminate function -> do_final().....\n"); set_termfunc(do_final); - printf("open port %d.....\n",char_port); - char_fd = make_listen_port(char_port); - if ((naddr_ != 0) && (login_ip_set_ == 0 || char_ip_set_ == 0)) { // The char server should know what IP address it is running on // - MouseJstr int localaddr = ntohl(addr_[0]); unsigned char *ptr = (unsigned char *) &localaddr; char buf[16]; - sprintf(buf, "%d.%d.%d.%d", ptr[0], ptr[1], ptr[2], ptr[3]);; + sprintf(buf, "%d.%d.%d.%d", ptr[0], ptr[1], ptr[2], ptr[3]); if (naddr_ != 1) printf("Multiple interfaces detected.. using %s as our IP address\n", buf); else @@ -3331,6 +3328,10 @@ int do_init(int argc, char **argv){ login_ip = inet_addr(login_ip_str); char_ip = inet_addr(char_ip_str); + printf("open port %d.....\n",char_port); + //char_fd = make_listen_port(char_port); + char_fd = make_listen_bind(char_ip,char_port); + // send ALIVE PING to login server. printf("add interval tic (check_connect_login_server)....\n"); i = add_timer_interval(gettick() + 10, check_connect_login_server, 0, 0, 10 * 1000); |