summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
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
commitd8776648ff6e6b3cb4922025b12c9cc42974b4db (patch)
tree5d2de15f0f2057dc0d6fc034ccc4e76a0ee353c5 /src/char/char.c
parentb91405aa5454bab5eeacd29d28a773812ef55b29 (diff)
downloadhercules-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/char.c')
-rw-r--r--src/char/char.c15
1 files changed, 10 insertions, 5 deletions
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");