From d8776648ff6e6b3cb4922025b12c9cc42974b4db Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Sat, 5 Feb 2005 02:07:30 +0000 Subject: 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 --- src/char/char.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/char') diff --git a/src/char/char.c b/src/char/char.c index 45eb48389..caae3c143 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -49,11 +49,11 @@ char server_name[20]; char wisp_server_name[24] = "Server"; int login_ip_set_ = 0; char login_ip_str[16]; -int login_ip; +in_addr_t login_ip; int login_port = 6900; int char_ip_set_ = 0; char char_ip_str[16]; -int char_ip; +in_addr_t char_ip; int char_port = 6121; int char_maintenance; int char_new; @@ -769,7 +769,8 @@ void mmo_char_sync(void) { int i, j, k; int lock; FILE *fp,*f_fp; - int *id = (int *) aMalloc(sizeof(int) * char_num); + //int *id = (int *) aMalloc(sizeof(int) * char_num); + CREATE_BUFFER(id, int, char_num); // Sorting before save (by [Yor]) for(i = 0; i < char_num; i++) { @@ -808,6 +809,8 @@ void mmo_char_sync(void) { if (fp == NULL) { printf("WARNING: Server can't not create backup of characters file.\n"); char_log("WARNING: Server can't not create backup of characters file." RETCODE); + //aFree(id); // free up the memory before leaving -.- [Ajarn] + DELETE_BUFFER(id); return; } for(i = 0; i < char_num; i++) { @@ -828,7 +831,8 @@ void mmo_char_sync(void) { lock_fclose(f_fp, friends_txt, &lock); - aFree(id); + //aFree(id); + DELETE_BUFFER(id); return; } @@ -3431,7 +3435,8 @@ int do_init(int argc, char **argv) { set_termfunc(do_final); set_defaultparse(parse_char); - char_fd = make_listen_port(char_port); + //char_fd = make_listen_port(char_port); + char_fd = make_listen_bind(char_ip,char_port); add_timer_func_list(check_connect_login_server, "check_connect_login_server"); add_timer_func_list(send_users_tologin, "send_users_tologin"); -- cgit v1.2.3-70-g09d2