summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-09-10 16:43:26 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-09-10 16:43:26 -0700
commit8f4e4e9a92f6af89820a358ab99b990697117502 (patch)
treecb312b5367c71dfe89543a5463be9555177c6445 /src/char
parentf841b6fdcc802e73d52da0e67ee192c0c2c1c7e1 (diff)
parent2c863c0d99aa3df9ef2eb4ceb112c4d946520f0a (diff)
downloadtmwa-8f4e4e9a92f6af89820a358ab99b990697117502.tar.gz
tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.tar.bz2
tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.tar.xz
tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.zip
Merge commit '2c863c0d99aa3df9ef2eb4ceb112c4d946520f0a'
Diffstat (limited to 'src/char')
-rw-r--r--src/char/GNUmakefile7
-rw-r--r--src/char/Makefile16
-rw-r--r--src/char/char.c193
-rw-r--r--src/char/int_guild.c96
-rw-r--r--src/char/int_guild.h4
-rw-r--r--src/char/int_party.c41
-rw-r--r--src/char/int_party.h4
-rw-r--r--src/char/int_storage.c12
-rw-r--r--src/char/int_storage.h8
-rw-r--r--src/char/inter.c18
-rw-r--r--src/char/inter.h2
11 files changed, 171 insertions, 230 deletions
diff --git a/src/char/GNUmakefile b/src/char/GNUmakefile
new file mode 100644
index 0000000..cd7ad57
--- /dev/null
+++ b/src/char/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. char-server
+clean:
+ rm -r ../../obj/char/
+%::
+ make -C ../.. obj/char/$@
diff --git a/src/char/Makefile b/src/char/Makefile
deleted file mode 100644
index c448627..0000000
--- a/src/char/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-include ../../make.defs
-
-all: char
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/mt_rand.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/db.h ../common/lock.h ../common/timer.h ../common/mt_rand.h
-char: char.o inter.o int_party.o int_guild.o int_storage.o $(COMMON_OBJ)
-
-char.o: char.c char.h inter.h $(COMMON_H) ../common/version.h
-inter.o: inter.c inter.h int_party.h int_guild.h int_storage.h char.h $(COMMON_H)
-int_party.o: int_party.c int_party.h inter.h char.h $(COMMON_H)
-int_guild.o: int_guild.c int_guild.h int_storage.h inter.h char.h $(COMMON_H)
-int_storage.o: int_storage.c int_storage.h int_guild.h inter.h char.h $(COMMON_H)
-
-clean:
- rm -f *.o char
diff --git a/src/char/char.c b/src/char/char.c
index 59dea17..2a46283 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -133,7 +133,7 @@ int char_log (char *fmt, ...)
if (logfp)
{
if (fmt[0] == '\0') // jump a line if no message
- fprintf (logfp, RETCODE);
+ fprintf (logfp, "\n");
else
{
gettimeofday (&tv, NULL);
@@ -246,7 +246,7 @@ int mmo_char_tostr (char *str, struct mmo_charstatus *p)
}
str_p += sprintf (str_p, "%d\t%d,%d\t%s\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d" "\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d" "\t%s,%d,%d\t%s,%d,%d,%d\t", p->char_id, p->account_id, p->char_num, p->name, //
- p->class, p->base_level, p->job_level, p->base_exp, p->job_exp, p->zeny, p->hp, p->max_hp, p->sp, p->max_sp, p->str, p->agi, p->vit, p->int_, p->dex, p->luk, p->status_point, p->skill_point, p->option, p->karma, p->manner, //
+ p->pc_class, p->base_level, p->job_level, p->base_exp, p->job_exp, p->zeny, p->hp, p->max_hp, p->sp, p->max_sp, p->str, p->agi, p->vit, p->int_, p->dex, p->luk, p->status_point, p->skill_point, p->option, p->karma, p->manner, //
p->party_id, p->guild_id, 0, p->hair, p->hair_color, p->clothes_color, p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom, p->last_point.map, p->last_point.x, p->last_point.y, //
p->save_point.map, p->save_point.x, p->save_point.y,
p->partner_id);
@@ -364,7 +364,7 @@ int mmo_char_fromstr (char *str, struct mmo_charstatus *p)
p->char_id = tmp_int[0];
p->account_id = tmp_int[1];
p->char_num = tmp_int[2];
- p->class = tmp_int[3];
+ p->pc_class = tmp_int[3];
p->base_level = tmp_int[4];
p->job_level = tmp_int[5];
p->base_exp = tmp_int[6];
@@ -437,8 +437,8 @@ int mmo_char_fromstr (char *str, struct mmo_charstatus *p)
printf
(" Character readed. Suggestion: change the wisp server name.\n");
char_log
- ("mmo_auth_init: ******WARNING: character name has wisp server name: Character name '%s' = wisp server name '%s'."
- RETCODE, p->name, wisp_server_name);
+ ("mmo_auth_init: ******WARNING: character name has wisp server name: Character name '%s' = wisp server name '%s'.\n",
+ p->name, wisp_server_name);
}
if (str[next] == '\n' || str[next] == '\r')
@@ -603,8 +603,8 @@ int mmo_char_init (void)
if (fp == NULL)
{
printf ("Characters file not found: %s.\n", char_txt);
- char_log ("Characters file not found: %s." RETCODE, char_txt);
- char_log ("Id for the next created character: %d." RETCODE,
+ char_log ("Characters file not found: %s.\n", char_txt);
+ char_log ("Id for the next created character: %d.\n",
char_id_count);
return 0;
}
@@ -653,43 +653,35 @@ int mmo_char_init (void)
{
case -1:
char_log
- ("Duplicate character id in the next character line (character not readed):"
- RETCODE);
+ ("Duplicate character id in the next character line (character not readed):\n");
break;
case -2:
char_log
- ("Duplicate character name in the next character line (character not readed):"
- RETCODE);
+ ("Duplicate character name in the next character line (character not readed):\n");
break;
case -3:
char_log
- ("Invalid memo point structure in the next character line (character not readed):"
- RETCODE);
+ ("Invalid memo point structure in the next character line (character not readed):\n");
break;
case -4:
char_log
- ("Invalid inventory item structure in the next character line (character not readed):"
- RETCODE);
+ ("Invalid inventory item structure in the next character line (character not readed):\n");
break;
case -5:
char_log
- ("Invalid cart item structure in the next character line (character not readed):"
- RETCODE);
+ ("Invalid cart item structure in the next character line (character not readed):\n");
break;
case -6:
char_log
- ("Invalid skill structure in the next character line (character not readed):"
- RETCODE);
+ ("Invalid skill structure in the next character line (character not readed):\n");
break;
case -7:
char_log
- ("Invalid register structure in the next character line (character not readed):"
- RETCODE);
+ ("Invalid register structure in the next character line (character not readed):\n");
break;
default: // 0
char_log
- ("Unabled to get a character in the next line - Basic structure of line (before inventory) is incorrect (character not readed):"
- RETCODE);
+ ("Unabled to get a character in the next line - Basic structure of line (before inventory) is incorrect (character not readed):\n");
break;
}
char_log ("%s", line);
@@ -700,23 +692,23 @@ int mmo_char_init (void)
if (char_num == 0)
{
printf ("mmo_char_init: No character found in %s.\n", char_txt);
- char_log ("mmo_char_init: No character found in %s." RETCODE,
+ char_log ("mmo_char_init: No character found in %s.\n",
char_txt);
}
else if (char_num == 1)
{
printf ("mmo_char_init: 1 character read in %s.\n", char_txt);
- char_log ("mmo_char_init: 1 character read in %s." RETCODE, char_txt);
+ char_log ("mmo_char_init: 1 character read in %s.\n", char_txt);
}
else
{
printf ("mmo_char_init: %d characters read in %s.\n", char_num,
char_txt);
- char_log ("mmo_char_init: %d characters read in %s." RETCODE,
+ char_log ("mmo_char_init: %d characters read in %s.\n",
char_num, char_txt);
}
- char_log ("Id for the next created character: %d." RETCODE,
+ char_log ("Id for the next created character: %d.\n",
char_id_count);
return 0;
@@ -757,7 +749,7 @@ void mmo_char_sync (void)
if (fp == NULL)
{
printf ("WARNING: Server can't not save characters.\n");
- char_log ("WARNING: Server can't not save characters." RETCODE);
+ char_log ("WARNING: Server can't not save characters.\n");
}
else
{
@@ -765,9 +757,9 @@ void mmo_char_sync (void)
{
// create only once the line, and save it in the 2 files (it's speeder than repeat twice the loop and create twice the line)
mmo_char_tostr (line, &char_dat[id[i]]); // use of sorted index
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
- fprintf (fp, "%d\t%%newid%%" RETCODE, char_id_count);
+ fprintf (fp, "%d\t%%newid%%\n", char_id_count);
lock_fclose (fp, char_txt, &lock);
}
@@ -780,17 +772,16 @@ void mmo_char_sync (void)
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);
+ ("WARNING: Server can't not create backup of characters file.\n");
return;
}
for (i = 0; i < char_num; i++)
{
// create only once the line, and save it in the 2 files (it's speeder than repeat twice the loop and create twice the line)
mmo_char_tostr (line, &char_dat[id[i]]); // use of sorted index
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
- fprintf (fp, "%d\t%%newid%%" RETCODE, char_id_count);
+ fprintf (fp, "%d\t%%newid%%\n", char_id_count);
lock_fclose (fp, backup_txt, &lock);
}
@@ -857,17 +848,15 @@ static void remove_prefix_blanks (char *name)
int make_new_char (int fd, unsigned char *dat)
{
int i, j;
- struct char_session_data *sd;
-
- sd = session[fd]->session_data;
+ struct char_session_data *sd = (struct char_session_data *)session[fd]->session_data;
// remove control characters from the name
dat[23] = '\0';
if (remove_control_chars (dat))
{
char_log
- ("Make new char error (control char received in the name): (connection #%d, account: %d)."
- RETCODE, fd, sd->account_id);
+ ("Make new char error (control char received in the name): (connection #%d, account: %d).\n",
+ fd, sd->account_id);
return -1;
}
@@ -879,8 +868,8 @@ int make_new_char (int fd, unsigned char *dat)
if (strlen (dat) < 4)
{
char_log
- ("Make new char error (character name too small): (connection #%d, account: %d, name: '%s')."
- RETCODE, fd, sd->account_id, dat);
+ ("Make new char error (character name too small): (connection #%d, account: %d, name: '%s').\n",
+ fd, sd->account_id, dat);
return -1;
}
@@ -891,8 +880,8 @@ int make_new_char (int fd, unsigned char *dat)
if (strchr (char_name_letters, dat[i]) == NULL)
{
char_log
- ("Make new char error (invalid letter in the name): (connection #%d, account: %d), name: %s, invalid letter: %c."
- RETCODE, fd, sd->account_id, dat, dat[i]);
+ ("Make new char error (invalid letter in the name): (connection #%d, account: %d), name: %s, invalid letter: %c.\n",
+ fd, sd->account_id, dat, dat[i]);
return -1;
}
}
@@ -902,8 +891,8 @@ int make_new_char (int fd, unsigned char *dat)
if (strchr (char_name_letters, dat[i]) != NULL)
{
char_log
- ("Make new char error (invalid letter in the name): (connection #%d, account: %d), name: %s, invalid letter: %c."
- RETCODE, fd, sd->account_id, dat, dat[i]);
+ ("Make new char error (invalid letter in the name): (connection #%d, account: %d), name: %s, invalid letter: %c.\n",
+ fd, sd->account_id, dat, dat[i]);
return -1;
}
} // else, all letters/symbols are authorised (except control char removed before)
@@ -914,8 +903,8 @@ int make_new_char (int fd, unsigned char *dat)
dat[31] >= 12)
{ // hair color (dat[31] can not be negativ)
char_log
- ("Make new char error (invalid values): (connection #%d, account: %d) slot %d, name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d"
- RETCODE, fd, sd->account_id, dat[30], dat, dat[24], dat[25],
+ ("Make new char error (invalid values): (connection #%d, account: %d) slot %d, name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d\n",
+ fd, sd->account_id, dat[30], dat, dat[24], dat[25],
dat[26], dat[27], dat[28], dat[29],
dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29],
dat[33], dat[31]);
@@ -928,8 +917,8 @@ int make_new_char (int fd, unsigned char *dat)
if (dat[i] < 1 || dat[i] > 9)
{
char_log
- ("Make new char error (invalid stat value: not between 1 to 9): (connection #%d, account: %d) slot %d, name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d"
- RETCODE, fd, sd->account_id, dat[30], dat, dat[24], dat[25],
+ ("Make new char error (invalid stat value: not between 1 to 9): (connection #%d, account: %d) slot %d, name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d\n",
+ fd, sd->account_id, dat[30], dat, dat[24], dat[25],
dat[26], dat[27], dat[28], dat[29],
dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29],
dat[33], dat[31]);
@@ -944,8 +933,8 @@ int make_new_char (int fd, unsigned char *dat)
&& strcasecmp (char_dat[i].name, dat) == 0))
{
char_log
- ("Make new char error (name already exists): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %s), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d."
- RETCODE, fd, sd->account_id, dat[30], dat, char_dat[i].name,
+ ("Make new char error (name already exists): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %s), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d.\n",
+ fd, sd->account_id, dat[30], dat, char_dat[i].name,
dat[24], dat[25], dat[26], dat[27], dat[28], dat[29],
dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29],
dat[33], dat[31]);
@@ -955,8 +944,8 @@ int make_new_char (int fd, unsigned char *dat)
&& char_dat[i].char_num == dat[30])
{
char_log
- ("Make new char error (slot already used): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %s), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d."
- RETCODE, fd, sd->account_id, dat[30], dat, char_dat[i].name,
+ ("Make new char error (slot already used): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %s), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d.\n",
+ fd, sd->account_id, dat[30], dat, char_dat[i].name,
dat[24], dat[25], dat[26], dat[27], dat[28], dat[29],
dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29],
dat[33], dat[31]);
@@ -967,8 +956,8 @@ int make_new_char (int fd, unsigned char *dat)
if (strcmp (wisp_server_name, dat) == 0)
{
char_log
- ("Make new char error (name used is wisp name for server): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %d), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d."
- RETCODE, fd, sd->account_id, dat[30], dat, char_dat[i].name,
+ ("Make new char error (name used is wisp name for server): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %d), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d.\n",
+ fd, sd->account_id, dat[30], dat, char_dat[i].name,
dat[24], dat[25], dat[26], dat[27], dat[28], dat[29],
dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29],
dat[33], dat[31]);
@@ -991,8 +980,8 @@ int make_new_char (int fd, unsigned char *dat)
sin_addr[3]);
char_log
- ("Creation of New Character: (connection #%d, account: %d) slot %d, character Name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d. [%s]"
- RETCODE, fd, sd->account_id, dat[30], dat, dat[24], dat[25], dat[26],
+ ("Creation of New Character: (connection #%d, account: %d) slot %d, character Name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d. [%s]\n",
+ fd, sd->account_id, dat[30], dat, dat[24], dat[25], dat[26],
dat[27], dat[28], dat[29],
dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29], dat[33],
dat[31], ip);
@@ -1003,7 +992,7 @@ int make_new_char (int fd, unsigned char *dat)
char_dat[i].account_id = sd->account_id;
char_dat[i].char_num = dat[30];
strcpy (char_dat[i].name, dat);
- char_dat[i].class = 0;
+ char_dat[i].pc_class = 0;
char_dat[i].base_level = 1;
char_dat[i].job_level = 1;
char_dat[i].base_exp = 0;
@@ -1054,9 +1043,9 @@ int make_new_char (int fd, unsigned char *dat)
//----------------------------------------------------
// This function return the name of the job (by [Yor])
//----------------------------------------------------
-char *job_name (int class)
+char *job_name (int pc_class)
{
- switch (class)
+ switch (pc_class)
{
case 0:
return "Novice";
@@ -1217,7 +1206,7 @@ void create_online_files (void)
if (online_display_option == 0) // we display nothing, so return
return;
- //char_log("Creation of online players files." RETCODE);
+ //char_log("Creation of online players files.\n");
// Get number of online players, id of each online players
players = 0;
@@ -1278,13 +1267,13 @@ void create_online_files (void)
break;
case 4: // by job (and job level)
for (j = 0; j < players; j++)
- if (char_dat[i].class < char_dat[id[j]].class ||
+ if (char_dat[i].pc_class < char_dat[id[j]].pc_class ||
// if same job, we sort by job level.
- (char_dat[i].class == char_dat[id[j]].class &&
+ (char_dat[i].pc_class == char_dat[id[j]].pc_class &&
char_dat[i].job_level <
char_dat[id[j]].job_level) ||
// if same job and job level, we sort by job exp.
- (char_dat[i].class == char_dat[id[j]].class &&
+ (char_dat[i].pc_class == char_dat[id[j]].pc_class &&
char_dat[i].job_level ==
char_dat[id[j]].job_level
&& char_dat[i].job_exp <
@@ -1459,7 +1448,7 @@ void create_online_files (void)
// displaying of the job
if (online_display_option & 6)
{
- char *jobname = job_name (char_dat[j].class);
+ char *jobname = job_name (char_dat[j].pc_class);
if ((online_display_option & 6) == 6)
{
fprintf (fp2, " <td>%s %d/%d</td>\n",
@@ -1638,7 +1627,7 @@ int mmo_char_send006b (int fd, struct char_session_data *sd)
WFIFOW (fd, j + 46) = (p->sp > 0x7fff) ? 0x7fff : p->sp;
WFIFOW (fd, j + 48) = (p->max_sp > 0x7fff) ? 0x7fff : p->max_sp;
WFIFOW (fd, j + 50) = DEFAULT_WALK_SPEED; // p->speed;
- WFIFOW (fd, j + 52) = p->class;
+ WFIFOW (fd, j + 52) = p->pc_class;
WFIFOW (fd, j + 54) = p->hair;
// WFIFOW(fd,j+56) = p->weapon; // dont send weapon since TMW does not support it
WFIFOW (fd, j + 56) = 0;
@@ -1790,7 +1779,7 @@ int disconnect_player (int accound_id)
// disconnect player if online on char-server
for (i = 0; i < fd_max; i++)
{
- if (session[i] && (sd = session[i]->session_data))
+ if (session[i] && (sd = (struct char_session_data*)session[i]->session_data))
{
if (sd->account_id == accound_id)
{
@@ -1849,7 +1838,7 @@ void parse_tologin (int fd)
return;
}
- sd = session[fd]->session_data;
+ sd = (struct char_session_data*)session[fd]->session_data;
while (RFIFOREST (fd) >= 2)
{
@@ -1892,7 +1881,7 @@ void parse_tologin (int fd)
// printf("parse_tologin 2713 : %d\n", RFIFOB(fd,6));
for (i = 0; i < fd_max; i++)
{
- if (session[i] && (sd = session[i]->session_data)
+ if (session[i] && (sd = (struct char_session_data*)session[i]->session_data)
&& sd->account_id == RFIFOL (fd, 2))
{
if (RFIFOB (fd, 6) != 0)
@@ -1935,7 +1924,7 @@ void parse_tologin (int fd)
return;
for (i = 0; i < fd_max; i++)
{
- if (session[i] && (sd = session[i]->session_data))
+ if (session[i] && (sd = (struct char_session_data*)session[i]->session_data))
{
if (sd->account_id == RFIFOL (fd, 2))
{
@@ -1979,7 +1968,7 @@ void parse_tologin (int fd)
{
if (char_dat[i].account_id == acc)
{
- int jobclass = char_dat[i].class;
+ int jobclass = char_dat[i].pc_class;
char_dat[i].sex = sex;
// auth_fifo[i].sex = sex;
if (jobclass == 19 || jobclass == 20 ||
@@ -1989,18 +1978,18 @@ void parse_tologin (int fd)
// job modification
if (jobclass == 19 || jobclass == 20)
{
- char_dat[i].class = (sex) ? 19 : 20;
+ char_dat[i].pc_class = (sex) ? 19 : 20;
}
else if (jobclass == 4020
|| jobclass == 4021)
{
- char_dat[i].class =
+ char_dat[i].pc_class =
(sex) ? 4020 : 4021;
}
else if (jobclass == 4042
|| jobclass == 4043)
{
- char_dat[i].class =
+ char_dat[i].pc_class =
(sex) ? 4042 : 4043;
}
}
@@ -2034,8 +2023,7 @@ void parse_tologin (int fd)
return;
if (RFIFOL (fd, 4) < 1)
char_log
- ("Receiving a message for broadcast, but message is void."
- RETCODE);
+ ("Receiving a message for broadcast, but message is void.\n");
else
{
// at least 1 map-server
@@ -2044,8 +2032,7 @@ void parse_tologin (int fd)
break;
if (i == MAX_MAP_SERVERS)
char_log
- ("'ladmin': Receiving a message for broadcast, but no map-server is online."
- RETCODE);
+ ("'ladmin': Receiving a message for broadcast, but no map-server is online.\n");
else
{
char buf[128];
@@ -2063,23 +2050,22 @@ void parse_tologin (int fd)
// if message is only composed of spaces
if (p[0] == '\0')
char_log
- ("Receiving a message for broadcast, but message is only a lot of spaces."
- RETCODE);
+ ("Receiving a message for broadcast, but message is only a lot of spaces.\n");
// else send message to all map-servers
else
{
if (RFIFOW (fd, 2) == 0)
{
char_log
- ("'ladmin': Receiving a message for broadcast (message (in yellow): %s)"
- RETCODE, message);
+ ("'ladmin': Receiving a message for broadcast (message (in yellow): %s)\n",
+ message);
lp = 4;
}
else
{
char_log
- ("'ladmin': Receiving a message for broadcast (message (in blue): %s)"
- RETCODE, message);
+ ("'ladmin': Receiving a message for broadcast (message (in blue): %s)\n",
+ message);
lp = 8;
}
// split message to max 80 char
@@ -2216,7 +2202,7 @@ void parse_tologin (int fd)
for (j = 0; j < fd_max; j++)
{
if (session[j]
- && (sd2 = session[j]->session_data)
+ && (sd2 = (struct char_session_data*)session[j]->session_data)
&& sd2->account_id ==
char_dat[char_num - 1].account_id)
{
@@ -2290,8 +2276,8 @@ void parse_tologin (int fd)
("From login-server: receiving of %d GM accounts information.\n",
GM_num);
char_log
- ("From login-server: receiving of %d GM accounts information."
- RETCODE, GM_num);
+ ("From login-server: receiving of %d GM accounts information.\n",
+ GM_num);
create_online_files (); // update online players files (perhaps some online players change of GM level)
// send new gm acccounts level to map-servers
memcpy (buf, RFIFOP (fd, 0), RFIFOW (fd, 2));
@@ -2311,7 +2297,7 @@ void parse_tologin (int fd)
for (i = 0; i < fd_max; i++)
{
- if (session[i] && (sd = session[i]->session_data))
+ if (session[i] && (sd = (struct char_session_data*)session[i]->session_data))
{
if (sd->account_id == acc)
{
@@ -2353,8 +2339,8 @@ void map_anti_freeze_system (timer_id tid, tick_t tick, custom_id_t id, custom_d
("Map-server anti-freeze system: char-server #%d is freezed -> disconnection.\n",
i);
char_log
- ("Map-server anti-freeze system: char-server #%d is freezed -> disconnection."
- RETCODE, i);
+ ("Map-server anti-freeze system: char-server #%d is freezed -> disconnection.\n",
+ i);
session[server_fd[i]]->eof = 1;
}
}
@@ -2423,8 +2409,8 @@ void parse_frommap (int fd)
id, j, p[0], p[1], p[2], p[3], server[id].port);
printf ("Map-server %d loading complete.\n", id);
char_log
- ("Map-Server %d connected: %d maps, from IP %d.%d.%d.%d port %d. Map-server %d loading complete."
- RETCODE, id, j, p[0], p[1], p[2], p[3],
+ ("Map-Server %d connected: %d maps, from IP %d.%d.%d.%d port %d. Map-server %d loading complete.\n",
+ id, j, p[0], p[1], p[2], p[3],
server[id].port, id);
}
WFIFOW (fd, 0) = 0x2afb;
@@ -2437,8 +2423,8 @@ void parse_frommap (int fd)
if (j == 0)
{
printf ("WARNING: Map-Server %d have NO map.\n", id);
- char_log ("WARNING: Map-Server %d have NO map."
- RETCODE, id);
+ char_log ("WARNING: Map-Server %d have NO map.\n",
+ id);
// Transmitting maps information to the other map-servers
}
else
@@ -2963,7 +2949,7 @@ void parse_char (int fd)
return;
}
- sd = session[fd]->session_data;
+ sd = (struct char_session_data*)session[fd]->session_data;
while (RFIFOREST (fd) >= 2)
{
@@ -3113,8 +3099,8 @@ void parse_char (int fd)
if (ch != 9)
{
char_log
- ("Character Selected, Account ID: %d, Character Slot: %d, Character Name: %s [%s]"
- RETCODE, sd->account_id, RFIFOB (fd, 2),
+ ("Character Selected, Account ID: %d, Character Slot: %d, Character Name: %s [%s]\n",
+ sd->account_id, RFIFOB (fd, 2),
char_dat[sd->found_char[ch]].name, ip);
// searching map server
i = search_mapserver (char_dat
@@ -3290,7 +3276,7 @@ void parse_char (int fd)
(char_dat[i].max_sp >
0x7fff) ? 0x7fff : char_dat[i].max_sp;
WFIFOW (fd, 2 + 50) = DEFAULT_WALK_SPEED; // char_dat[i].speed;
- WFIFOW (fd, 2 + 52) = char_dat[i].class;
+ WFIFOW (fd, 2 + 52) = char_dat[i].pc_class;
WFIFOW (fd, 2 + 54) = char_dat[i].hair;
WFIFOW (fd, 2 + 58) = char_dat[i].base_level;
@@ -3412,7 +3398,7 @@ void parse_char (int fd)
for (j = 0; j < fd_max; j++)
{
if (session[j]
- && (sd2 =
+ && (sd2 = (struct char_session_data*)
session[j]->session_data)
&& sd2->account_id ==
char_dat[char_num - 1].account_id)
@@ -4027,8 +4013,7 @@ void term_func (void)
delete_session (login_fd);
delete_session (char_fd);
- char_log ("----End of char-server (normal end with closing of all files)."
- RETCODE);
+ char_log ("----End of char-server (normal end with closing of all files).\n");
}
int do_init (int argc, char **argv)
@@ -4037,7 +4022,7 @@ int do_init (int argc, char **argv)
// a newline in the log...
char_log ("");
- char_log ("The char-server starting..." RETCODE);
+ char_log ("The char-server starting...\n");
char_config_read ((argc < 2) ? CHAR_CONF_NAME : argv[1]);
lan_config_read ((argc > 1) ? argv[1] : LOGIN_LAN_CONF_NAME);
@@ -4080,8 +4065,8 @@ int do_init (int argc, char **argv)
i = add_timer_interval (gettick () + 1000, map_anti_freeze_system, 0, 0, ANTI_FREEZE_INTERVAL * 1000); // checks every X seconds user specifies
}
- char_log ("The char-server is ready (Server is listening on the port %d)."
- RETCODE, char_port);
+ char_log ("The char-server is ready (Server is listening on the port %d).\n",
+ char_port);
printf
("The char-server is \033[1;32mready\033[0m (Server is listening on the port %d).\n\n",
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 9715700..05aae6b 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -49,7 +49,7 @@ int inter_guild_tostr (char *str, struct guild *g)
len += sprintf (str + len, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\t%s\t",
m->account_id, m->char_id,
m->hair, m->hair_color, m->gender,
- m->class, m->lv, m->exp, m->exp_payper, m->position,
+ m->pc_class, m->lv, m->exp, m->exp_payper, m->position,
((m->account_id > 0) ? m->name : "-"));
}
// 役職
@@ -154,7 +154,7 @@ int inter_guild_fromstr (char *str, struct guild *g)
m->hair = tmp_int[2];
m->hair_color = tmp_int[3];
m->gender = tmp_int[4];
- m->class = tmp_int[5];
+ m->pc_class = tmp_int[5];
m->lv = tmp_int[6];
m->exp = tmp_int[7];
m->exp_payper = tmp_int[8];
@@ -398,7 +398,7 @@ int inter_guildcastle_fromstr (char *str, struct guild_castle *gc)
}
// ギルド関連データベース読み込み
-int inter_guild_readdb ()
+int inter_guild_readdb (void)
{
int i;
FILE *fp;
@@ -424,7 +424,7 @@ int inter_guild_readdb ()
}
// ギルドデータの読み込み
-int inter_guild_init ()
+int inter_guild_init (void)
{
char line[16384];
struct guild *g;
@@ -535,9 +535,7 @@ int inter_guild_init ()
struct guild *inter_guild_search (int guild_id)
{
- struct guild *g;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
return g;
}
@@ -550,7 +548,7 @@ void inter_guild_save_sub (db_key_t key, db_val_t data, va_list ap)
inter_guild_tostr (line, (struct guild *) data);
fp = va_arg (ap, FILE *);
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
// ギルド城データのセーブ用
@@ -561,11 +559,11 @@ void inter_castle_save_sub (db_key_t key, db_val_t data, va_list ap)
inter_guildcastle_tostr (line, (struct guild_castle *) data);
fp = va_arg (ap, FILE *);
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
// ギルドデータのセーブ
-int inter_guild_save ()
+int inter_guild_save (void)
{
FILE *fp;
int lock;
@@ -839,7 +837,7 @@ int mapif_guild_memberinfoshort (struct guild *g, int idx)
WBUFL (buf, 10) = 0 /*g->member[idx].char_id*/;
WBUFB (buf, 14) = g->member[idx].online;
WBUFW (buf, 15) = g->member[idx].lv;
- WBUFW (buf, 17) = g->member[idx].class;
+ WBUFW (buf, 17) = g->member[idx].pc_class;
mapif_sendall (buf, 19);
return 0;
}
@@ -1082,7 +1080,7 @@ int mapif_parse_CreateGuild (int fd, int account_id, char *name,
mapif_guild_created (fd, account_id, g);
mapif_guild_info (fd, g);
- inter_log ("guild %s (id=%d) created by master %s (id=%d)" RETCODE,
+ inter_log ("guild %s (id=%d) created by master %s (id=%d)\n",
name, g->guild_id, master->name, master->account_id);
return 0;
@@ -1091,9 +1089,7 @@ int mapif_parse_CreateGuild (int fd, int account_id, char *name,
// ギルド情報要求
int mapif_parse_GuildInfo (int fd, int guild_id)
{
- struct guild *g;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g != NULL)
{
guild_calcinfo (g);
@@ -1108,17 +1104,14 @@ int mapif_parse_GuildInfo (int fd, int guild_id)
// ギルドメンバ追加要求
int mapif_parse_GuildAddMember (int fd, int guild_id, struct guild_member *m)
{
- struct guild *g;
- int i;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
{
mapif_guild_memberadded (fd, guild_id, m->account_id, 0 /*char_id*/, 1);
return 0;
}
- for (i = 0; i < g->max_member; i++)
+ for (int i = 0; i < g->max_member; i++)
{
if (g->member[i].account_id == 0)
{
@@ -1140,13 +1133,10 @@ int mapif_parse_GuildAddMember (int fd, int guild_id, struct guild_member *m)
int mapif_parse_GuildLeave (int fd, int guild_id, int account_id, int char_id,
int flag, const char *mes)
{
- struct guild *g = NULL;
- int i, j;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g != NULL)
{
- for (i = 0; i < MAX_GUILD; i++)
+ for (int i = 0; i < MAX_GUILD; i++)
{
if (g->member[i].account_id == account_id)
{
@@ -1154,7 +1144,9 @@ int mapif_parse_GuildLeave (int fd, int guild_id, int account_id, int char_id,
// printf("%d %s\n", i, g->member[i].name);
if (flag)
- { // 追放の場合追放リストに入れる
+ {
+ int j;
+ // 追放の場合追放リストに入れる
for (j = 0; j < MAX_GUILDEXPLUSION; j++)
{
if (g->explusion[j].account_id == 0)
@@ -1191,26 +1183,23 @@ int mapif_parse_GuildLeave (int fd, int guild_id, int account_id, int char_id,
// オンライン/Lv更新
int mapif_parse_GuildChangeMemberInfoShort (int fd, int guild_id,
int account_id, int char_id,
- int online, int lv, int class)
+ int online, int lv, int pc_class)
{
- struct guild *g;
- int i, alv, c;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
return 0;
g->connect_member = 0;
- alv = 0;
- c = 0;
- for (i = 0; i < MAX_GUILD; i++)
+ int alv = 0;
+ int c = 0;
+ for (int i = 0; i < MAX_GUILD; i++)
{
if (g->member[i].account_id == account_id)
{
g->member[i].online = online;
g->member[i].lv = lv;
- g->member[i].class = class;
+ g->member[i].pc_class = pc_class;
mapif_guild_memberinfoshort (g, i);
}
if (g->member[i].account_id > 0)
@@ -1244,9 +1233,7 @@ void guild_break_sub (db_key_t key, db_val_t data, va_list ap)
// ギルド解散要求
int mapif_parse_BreakGuild (int fd, int guild_id)
{
- struct guild *g;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
return 0;
@@ -1255,7 +1242,7 @@ int mapif_parse_BreakGuild (int fd, int guild_id)
inter_guild_storage_delete (guild_id);
mapif_guild_broken (guild_id, 0);
- inter_log ("guild %s (id=%d) broken" RETCODE, g->name, guild_id);
+ inter_log ("guild %s (id=%d) broken\n", g->name, guild_id);
free (g);
return 0;
@@ -1272,10 +1259,9 @@ int mapif_parse_GuildMessage (int fd, int guild_id, int account_id, char *mes,
int mapif_parse_GuildBasicInfoChange (int fd, int guild_id, int type,
const char *data, int len)
{
- struct guild *g;
short dw = *((short *) data);
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
return 0;
@@ -1307,9 +1293,7 @@ int mapif_parse_GuildMemberInfoChange (int fd, int guild_id, int account_id,
const char *data, int len)
{
int i;
- struct guild *g;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
return 0;
@@ -1351,7 +1335,7 @@ int mapif_parse_GuildMemberInfoChange (int fd, int guild_id, int account_id,
int mapif_parse_GuildPosition (int fd, int guild_id, int idx,
struct guild_position *p)
{
- struct guild *g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL || idx < 0 || idx >= MAX_GUILDPOSITION)
{
@@ -1368,7 +1352,7 @@ int mapif_parse_GuildPosition (int fd, int guild_id, int idx,
int mapif_parse_GuildSkillUp (int fd, int guild_id, int skill_num,
int account_id)
{
- struct guild *g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
int idx = skill_num - 10000;
if (g == NULL || skill_num < 10000)
@@ -1394,8 +1378,8 @@ int mapif_parse_GuildAlliance (int fd, int guild_id1, int guild_id2,
struct guild *g[2];
int j, i;
- g[0] = numdb_search (guild_db, guild_id1);
- g[1] = numdb_search (guild_db, guild_id2);
+ g[0] = (struct guild *)numdb_search (guild_db, guild_id1);
+ g[1] = (struct guild *)numdb_search (guild_db, guild_id2);
if (g[0] == NULL || g[1] == NULL)
return 0;
@@ -1436,9 +1420,7 @@ int mapif_parse_GuildAlliance (int fd, int guild_id1, int guild_id2,
int mapif_parse_GuildNotice (int fd, int guild_id, const char *mes1,
const char *mes2)
{
- struct guild *g;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
return 0;
memcpy (g->mes1, mes1, 60);
@@ -1451,9 +1433,7 @@ int mapif_parse_GuildNotice (int fd, int guild_id, const char *mes1,
int mapif_parse_GuildEmblem (int fd, int len, int guild_id, int dummy,
const char *data)
{
- struct guild *g;
-
- g = numdb_search (guild_db, guild_id);
+ struct guild *g = (struct guild *)numdb_search (guild_db, guild_id);
if (g == NULL)
return 0;
memcpy (g->emblem_data, data, len);
@@ -1465,7 +1445,7 @@ int mapif_parse_GuildEmblem (int fd, int len, int guild_id, int dummy,
int mapif_parse_GuildCastleDataLoad (int fd, int castle_id, int index)
{
- struct guild_castle *gc = numdb_search (castle_db, castle_id);
+ struct guild_castle *gc = (struct guild_castle *)numdb_search (castle_db, castle_id);
if (gc == NULL)
{
@@ -1560,7 +1540,7 @@ int mapif_parse_GuildCastleDataLoad (int fd, int castle_id, int index)
int mapif_parse_GuildCastleDataSave (int fd, int castle_id, int index,
int value)
{
- struct guild_castle *gc = numdb_search (castle_db, castle_id);
+ struct guild_castle *gc = (struct guild_castle *)numdb_search (castle_db, castle_id);
if (gc == NULL)
{
@@ -1572,8 +1552,8 @@ int mapif_parse_GuildCastleDataSave (int fd, int castle_id, int index,
if (gc->guild_id != value)
{
int gid = (value) ? value : gc->guild_id;
- struct guild *g = numdb_search (guild_db, gid);
- inter_log ("guild %s (id=%d) %s castle id=%d" RETCODE,
+ struct guild *g = (struct guild *)numdb_search (guild_db, gid);
+ inter_log ("guild %s (id=%d) %s castle id=%d\n",
(g) ? g->name : "??", gid,
(value) ? "occupy" : "abandon", index);
}
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 954addf..5ac9a51 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -2,8 +2,8 @@
#ifndef _INT_GUILD_H_
#define _INT_GUILD_H_
-int inter_guild_init ();
-int inter_guild_save ();
+int inter_guild_init (void);
+int inter_guild_save (void);
int inter_guild_parse_frommap (int fd);
struct guild *inter_guild_search (int guild_id);
int inter_guild_mapif_init (int fd);
diff --git a/src/char/int_party.c b/src/char/int_party.c
index b728b1e..6f8d023 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -87,7 +87,7 @@ int inter_party_fromstr (char *str, struct party *p)
}
// パーティデータのロード
-int inter_party_init ()
+int inter_party_init (void)
{
char line[8192];
struct party *p;
@@ -140,11 +140,11 @@ void inter_party_save_sub (db_key_t key, db_val_t data, va_list ap)
inter_party_tostr (line, (struct party *) data);
fp = va_arg (ap, FILE *);
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
// パーティーデータのセーブ
-int inter_party_save ()
+int inter_party_save (void)
{
FILE *fp;
int lock;
@@ -460,9 +460,7 @@ int mapif_parse_CreateParty (int fd, int account_id, char *name, char *nick,
// パーティ情報要求
int mapif_parse_PartyInfo (int fd, int party_id)
{
- struct party *p;
-
- p = numdb_search (party_db, party_id);
+ struct party *p = (struct party *)numdb_search (party_db, party_id);
if (p != NULL)
mapif_party_info (fd, p);
else
@@ -475,17 +473,14 @@ int mapif_parse_PartyInfo (int fd, int party_id)
int mapif_parse_PartyAddMember (int fd, int party_id, int account_id,
char *nick, char *map, int lv)
{
- struct party *p;
- int i;
-
- p = numdb_search (party_db, party_id);
+ struct party *p = (struct party *)numdb_search (party_db, party_id);
if (p == NULL)
{
mapif_party_memberadded (fd, party_id, account_id, 1);
return 0;
}
- for (i = 0; i < MAX_PARTY; i++)
+ for (int i = 0; i < MAX_PARTY; i++)
{
if (p->member[i].account_id == 0)
{
@@ -519,14 +514,12 @@ int mapif_parse_PartyAddMember (int fd, int party_id, int account_id,
int mapif_parse_PartyChangeOption (int fd, int party_id, int account_id,
int exp, int item)
{
- struct party *p;
- int flag = 0;
-
- p = numdb_search (party_db, party_id);
+ struct party *p = (struct party *)numdb_search (party_db, party_id);
if (p == NULL)
return 0;
p->exp = exp;
+ int flag = 0;
if (exp > 0 && !party_check_exp_share (p))
{
flag |= 0x01;
@@ -542,13 +535,10 @@ int mapif_parse_PartyChangeOption (int fd, int party_id, int account_id,
// パーティ脱退要求
int mapif_parse_PartyLeave (int fd, int party_id, int account_id)
{
- struct party *p;
- int i;
-
- p = numdb_search (party_db, party_id);
+ struct party *p = (struct party *)numdb_search (party_db, party_id);
if (p != NULL)
{
- for (i = 0; i < MAX_PARTY; i++)
+ for (int i = 0; i < MAX_PARTY; i++)
{
if (p->member[i].account_id == account_id)
{
@@ -569,14 +559,11 @@ int mapif_parse_PartyLeave (int fd, int party_id, int account_id)
int mapif_parse_PartyChangeMap (int fd, int party_id, int account_id,
char *map, int online, int lv)
{
- struct party *p;
- int i;
-
- p = numdb_search (party_db, party_id);
+ struct party *p = (struct party *)numdb_search (party_db, party_id);
if (p == NULL)
return 0;
- for (i = 0; i < MAX_PARTY; i++)
+ for (int i = 0; i < MAX_PARTY; i++)
{
if (p->member[i].account_id == account_id)
{
@@ -604,9 +591,7 @@ int mapif_parse_PartyChangeMap (int fd, int party_id, int account_id,
// パーティ解散要求
int mapif_parse_BreakParty (int fd, int party_id)
{
- struct party *p;
-
- p = numdb_search (party_db, party_id);
+ struct party *p = (struct party *)numdb_search (party_db, party_id);
if (p == NULL)
return 0;
diff --git a/src/char/int_party.h b/src/char/int_party.h
index 738b624..2007ed5 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -2,8 +2,8 @@
#ifndef _INT_PARTY_H_
#define _INT_PARTY_H_
-int inter_party_init ();
-int inter_party_save ();
+int inter_party_init (void);
+int inter_party_save (void);
int inter_party_parse_frommap (int fd);
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 99af725..e565572 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -248,7 +248,7 @@ struct guild_storage *guild2storage (int guild_id)
//---------------------------------------------------------
// 倉庫データを読み込む
-int inter_storage_init ()
+int inter_storage_init (void)
{
char line[65536];
int c = 0, tmp_int;
@@ -328,7 +328,7 @@ void guild_storage_db_final (db_key_t k, db_val_t data, va_list ap)
free (p);
}
-void inter_storage_final ()
+void inter_storage_final (void)
{
numdb_final (storage_db, storage_db_final);
numdb_final (guild_storage_db, guild_storage_db_final);
@@ -342,12 +342,12 @@ void inter_storage_save_sub (db_key_t key, db_val_t data, va_list ap)
storage_tostr (line, (struct storage *) data);
fp = va_arg (ap, FILE *);
if (*line)
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
//---------------------------------------------------------
// 倉庫データを書き込む
-int inter_storage_save ()
+int inter_storage_save (void)
{
FILE *fp;
int lock;
@@ -378,13 +378,13 @@ void inter_guild_storage_save_sub (db_key_t key, db_val_t data, va_list ap)
guild_storage_tostr (line, (struct guild_storage *) data);
fp = va_arg (ap, FILE *);
if (*line)
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
}
//---------------------------------------------------------
// 倉庫データを書き込む
-int inter_guild_storage_save ()
+int inter_guild_storage_save (void)
{
FILE *fp;
int lock;
diff --git a/src/char/int_storage.h b/src/char/int_storage.h
index 5036600..f1859c6 100644
--- a/src/char/int_storage.h
+++ b/src/char/int_storage.h
@@ -2,10 +2,10 @@
#ifndef _INT_STORAGE_H_
#define _INT_STORAGE_H_
-int inter_storage_init ();
-void inter_storage_final ();
-int inter_storage_save ();
-int inter_guild_storage_save ();
+int inter_storage_init (void);
+void inter_storage_final (void);
+int inter_storage_save (void);
+int inter_guild_storage_save (void);
int inter_storage_delete (int account_id);
int inter_guild_storage_delete (int guild_id);
struct storage *account2storage (int account_id);
diff --git a/src/char/inter.c b/src/char/inter.c
index f563931..e886bf6 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -106,7 +106,7 @@ int inter_accreg_fromstr (const char *str, struct accreg *reg)
}
// アカウント変数の読み込み
-int inter_accreg_init ()
+int inter_accreg_init (void)
{
char line[8192];
FILE *fp;
@@ -150,12 +150,12 @@ void inter_accreg_save_sub (db_key_t key, db_val_t data, va_list ap)
{
inter_accreg_tostr (line, reg);
fp = va_arg (ap, FILE *);
- fprintf (fp, "%s" RETCODE, line);
+ fprintf (fp, "%s\n", line);
}
}
// アカウント変数のセーブ
-int inter_accreg_save ()
+int inter_accreg_save (void)
{
FILE *fp;
int lock;
@@ -262,7 +262,7 @@ int inter_log (char *fmt, ...)
}
// セーブ
-int inter_save ()
+int inter_save (void)
{
inter_party_save ();
inter_guild_save ();
@@ -358,7 +358,7 @@ int mapif_account_reg (int fd, unsigned char *src)
// アカウント変数要求返信
int mapif_account_reg_reply (int fd, int account_id)
{
- struct accreg *reg = numdb_search (accreg_db, account_id);
+ struct accreg *reg = (struct accreg *)numdb_search (accreg_db, account_id);
WFIFOW (fd, 0) = 0x3804;
WFIFOL (fd, 4) = account_id;
@@ -395,7 +395,7 @@ void check_ttl_wisdata_sub (db_key_t key, db_val_t data, va_list ap)
wis_dellist[wis_delnum++] = wd->id;
}
-int check_ttl_wisdata ()
+int check_ttl_wisdata (void)
{
unsigned long tick = gettick ();
int i;
@@ -406,7 +406,7 @@ int check_ttl_wisdata ()
numdb_foreach (wis_db, check_ttl_wisdata_sub, tick);
for (i = 0; i < wis_delnum; i++)
{
- struct WisData *wd = numdb_search (wis_db, wis_dellist[i]);
+ struct WisData *wd = (struct WisData *)numdb_search (wis_db, wis_dellist[i]);
printf ("inter: wis data id=%d time out : from %s to %s\n",
wd->id, wd->src, wd->dst);
// removed. not send information after a timeout. Just no answer for the player
@@ -499,7 +499,7 @@ int mapif_parse_WisRequest (int fd)
int mapif_parse_WisReply (int fd)
{
int id = RFIFOL (fd, 2), flag = RFIFOB (fd, 6);
- struct WisData *wd = numdb_search (wis_db, id);
+ struct WisData *wd = (struct WisData *)numdb_search (wis_db, id);
if (wd == NULL)
return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server
@@ -530,7 +530,7 @@ int mapif_parse_WisToGM (int fd)
int mapif_parse_AccReg (int fd)
{
int j, p;
- struct accreg *reg = numdb_search (accreg_db, (numdb_key_t)RFIFOL (fd, 4));
+ struct accreg *reg = (struct accreg*)numdb_search (accreg_db, (numdb_key_t)RFIFOL (fd, 4));
if (reg == NULL)
{
diff --git a/src/char/inter.h b/src/char/inter.h
index 7ad7d08..219f195 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -3,7 +3,7 @@
#define _INTER_H_
int inter_init (const char *file);
-int inter_save ();
+int inter_save (void);
int inter_parse_frommap (int fd);
int inter_mapif_init (int fd);