summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 21:11:50 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 21:11:50 +0000
commit792b211d40f10e938b1041974b04e911bd5e4ba4 (patch)
tree9dcb8e7613cc5e28e4f7bc12d4f85e773d3dc2b3 /src/char_sql
parentb8cecabe98a2d0762d945a08d52f6a37587ce83d (diff)
downloadhercules-792b211d40f10e938b1041974b04e911bd5e4ba4.tar.gz
hercules-792b211d40f10e938b1041974b04e911bd5e4ba4.tar.bz2
hercules-792b211d40f10e938b1041974b04e911bd5e4ba4.tar.xz
hercules-792b211d40f10e938b1041974b04e911bd5e4ba4.zip
- Fame list size is now defined by MAX_FAME_LIST constant (mmo.h)
- Char server can now specify the max size for blacksmith/alchemist/taekwon rankers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5435 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 44f7e420d..ea26de414 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -146,6 +146,11 @@ int start_zeny = 500;
int start_weapon = 1201;
int start_armor = 2301;
+//Custom limits for the fame lists. [Skotlex]
+int fame_list_size_chemist = MAX_FAME_LIST;
+int fame_list_size_smith = MAX_FAME_LIST;
+int fame_list_size_taekwon = MAX_FAME_LIST;
+
// check for exit signal
// 0 is saving complete
// other is char_id
@@ -2751,7 +2756,7 @@ int parse_frommap(int fd) {
struct fame_list fame_item;
WBUFW(buf,0) = 0x2b1b;
- sprintf(tmp_sql, "SELECT `char_id`,`fame`, `name` FROM `%s` WHERE `fame`>0 AND (`class`='10' OR `class`='4011'OR `class`='4033') ORDER BY `fame` DESC LIMIT 0,10", char_db);
+ sprintf(tmp_sql, "SELECT `char_id`,`fame`, `name` FROM `%s` WHERE `fame`>0 AND (`class`='10' OR `class`='4011'OR `class`='4033') ORDER BY `fame` DESC LIMIT 0,%d", char_db, fame_list_size_smith);
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);
@@ -2765,7 +2770,7 @@ int parse_frommap(int fd) {
memcpy(WBUFP(buf,len), &fame_item, sizeof(struct fame_list));
len += sizeof(struct fame_list);
- if (++num == 10)
+ if (++num == fame_list_size_smith)
break;
}
mysql_free_result(sql_res);
@@ -2773,7 +2778,7 @@ int parse_frommap(int fd) {
WBUFW(buf, 6) = len; //Blacksmith block size
num = 0;
- sprintf(tmp_sql, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND (`class`='18' OR `class`='4019' OR `class`='4041') ORDER BY `fame` DESC LIMIT 0,10", char_db);
+ sprintf(tmp_sql, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND (`class`='18' OR `class`='4019' OR `class`='4041') ORDER BY `fame` DESC LIMIT 0,%d", char_db, fame_list_size_chemist);
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);
@@ -2786,7 +2791,7 @@ int parse_frommap(int fd) {
strncpy(fame_item.name, sql_row[2], NAME_LENGTH);
memcpy(WBUFP(buf,len), &fame_item, sizeof(struct fame_list));
len += sizeof(struct fame_list);
- if (++num == 10)
+ if (++num == fame_list_size_chemist)
break;
}
mysql_free_result(sql_res);
@@ -2794,7 +2799,7 @@ int parse_frommap(int fd) {
WBUFW(buf, 4) = len; //Alchemist block size
num = 0;
- sprintf(tmp_sql, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND `class`='4046' ORDER BY `fame` DESC LIMIT 0,10", char_db);
+ sprintf(tmp_sql, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND `class`='4046' ORDER BY `fame` DESC LIMIT 0,%d", char_db, fame_list_size_taekwon);
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);
@@ -2807,7 +2812,7 @@ int parse_frommap(int fd) {
strncpy(fame_item.name, sql_row[2], NAME_LENGTH);
memcpy(WBUFP(buf,len), &fame_item, sizeof(struct fame_list));
len += sizeof(struct fame_list);
- if (++num == 10)
+ if (++num == fame_list_size_taekwon)
break;
}
mysql_free_result(sql_res);
@@ -4039,6 +4044,24 @@ int char_config_read(const char *cfgName) {
} else if (strcmpi(w1, "console") == 0) {
if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 )
console = 1;
+ } else if (strcmpi(w1, "fame_list_alchemist") == 0) {
+ fame_list_size_chemist = atoi(w2);
+ if (fame_list_size_chemist > MAX_FAME_LIST) {
+ ShowWarning("Max fame list size is %d (fame_list_alchemist)\n", MAX_FAME_LIST);
+ fame_list_size_chemist = MAX_FAME_LIST;
+ }
+ } else if (strcmpi(w1, "fame_list_blacksmith") == 0) {
+ fame_list_size_smith = atoi(w2);
+ if (fame_list_size_smith > MAX_FAME_LIST) {
+ ShowWarning("Max fame list size is %d (fame_list_blacksmith)\n", MAX_FAME_LIST);
+ fame_list_size_smith = MAX_FAME_LIST;
+ }
+ } else if (strcmpi(w1, "fame_list_taekwon") == 0) {
+ fame_list_size_taekwon = atoi(w2);
+ if (fame_list_size_taekwon > MAX_FAME_LIST) {
+ ShowWarning("Max fame list size is %d (fame_list_taekwon)\n", MAX_FAME_LIST);
+ fame_list_size_taekwon = MAX_FAME_LIST;
+ }
} else if (strcmpi(w1, "import") == 0) {
char_config_read(w2);
}