- Added define MAX_CHARS so you can easily mod the server to support a different amount of characters per account (however, there is still the issue of hexing the client to support this change)

- Updated msg_athena.conf so it no longer uses broken english on several entries. Thanks to Scerez for the updated file.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10044 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex
2007-03-21 14:52:23 +00:00
parent b67cf18abd
commit cc6a222a11
6 changed files with 78 additions and 70 deletions

View File

@@ -128,7 +128,7 @@ static int online_check = 1; //If one, it won't let players connect when their a
struct char_session_data{
int account_id, login_id1, login_id2,sex;
int found_char[9];
int found_char[MAX_CHARS];
char email[40]; // e-mail (default: a@a.com) by [Yor]
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
};
@@ -1298,7 +1298,7 @@ int make_new_char_sql(int fd, unsigned char *dat) {
//check stat error
if ((dat[24]+dat[25]+dat[26]+dat[27]+dat[28]+dat[29]!=6*5 ) || // stats
(dat[30] >= 9) || // slots (dat[30] can not be negativ)
(dat[30] >= MAX_CHARS) || // slots (dat[30] can not be negativ)
(dat[33] <= 0) || (dat[33] >= 24) || // hair style
(dat[31] >= 9)) { // hair color (dat[31] can not be negativ)
if (log_char) {
@@ -1746,7 +1746,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
set_char_online(-1, 99,sd->account_id);
//search char.
sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_num` < '9'",char_db, sd->account_id);
sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_num` < '%d'",char_db, sd->account_id, MAX_CHARS);
if (mysql_query(&mysql_handle, tmp_sql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
@@ -1763,7 +1763,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
mysql_free_result(sql_res);
}
for(i = found_num; i < 9; i++)
for(i = found_num; i < MAX_CHARS; i++)
sd->found_char[i] = -1;
if (save_log)
@@ -3442,7 +3442,7 @@ int parse_char(int fd) {
RFIFOSKIP(fd, 37);
}
//to do
for(ch = 0; ch < 9; ch++) {
for(ch = 0; ch < MAX_CHARS; ch++) {
if (sd->found_char[ch] == -1) {
sd->found_char[ch] = char_dat.char_id;
break;
@@ -3470,17 +3470,17 @@ int parse_char(int fd) {
break;
}
for(i = 0; i < 9; i++) {
for(i = 0; i < MAX_CHARS; i++) {
if (sd->found_char[i] == cid) {
for(ch = i; ch < 9-1; ch++)
for(ch = i; ch < MAX_CHARS-1; ch++)
sd->found_char[ch] = sd->found_char[ch+1];
sd->found_char[8] = -1;
sd->found_char[MAX_CHARS-1] = -1;
break;
}
}
/* Such a character does not exist in the account */
/* If so, you are so screwed. */
if (i == 9) {
if (i == MAX_CHARS) {
WFIFOW(fd, 0) = 0x70;
WFIFOB(fd, 2) = 0;
WFIFOSET(fd, 3);

View File

@@ -31,7 +31,7 @@
#define GUILD_ALLIANCE_TYPE_MASK 0x01
#define GUILD_ALLIANCE_REMOVE 0x08
static char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
static const char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
#ifndef TXT_SQL_CONVERT
//Guild cache