summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-20 03:38:47 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-20 03:38:47 +0000
commit0a4feb1f7d662faeefd1072d39530c2f610a3a1a (patch)
treeb2a82245d6672ca1261efc076caf052bc62f726c /src/char_sql
parent0f4b1a36a2552e62227ee1350e8034a8f122c028 (diff)
downloadhercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.tar.gz
hercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.tar.bz2
hercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.tar.xz
hercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.zip
* Corrected packet_db.txt. See topic:158382 for details. As a side-effect, the latest packet version is now 22 instead of 21.
* Added a charserver config option for the character renaming flag, along with a detailed comment on what it's supposed to be. This eliminates all that "change PACKETVER to 8 and recompile" mess. * Moved PACKETVER back to clif.h, cleaned the related code a bit. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10888 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index b9abe1038..34883ca83 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -103,6 +103,7 @@ char unknown_char_name[NAME_LENGTH] = "Unknown"; // Name to use when the request
char char_name_letters[1024] = ""; // list of letters/symbols used to authorise or not a name of a character. by [Yor]
//The following are characters that are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
#define TRIM_CHARS "\032\t\x0A\x0D "
+bool char_rename = true;
int char_per_account = 0; //Maximum charas per account (default unlimited) [Sirius]
int char_del_level = 0; //From which level u can delete character [Lupus]
@@ -1605,15 +1606,13 @@ int mmo_char_tobuf(uint8* buf, struct mmo_charstatus* p)
WBUFB(buf,101) = min(p->int_, UCHAR_MAX);
WBUFB(buf,102) = min(p->dex, UCHAR_MAX);
WBUFB(buf,103) = min(p->luk, UCHAR_MAX);
- //Updated packet structure with rename-button included. Credits to Sara-chan
-#if PACKETVER > 7
WBUFW(buf,104) = p->char_num;
- WBUFW(buf,106) = 1;// Rename bit (0=rename,1=no rename)
- return 108;
-#else
- WBUFB(buf,104) = p->char_num;
- return 106;
-#endif
+ if (char_rename) {
+ WBUFW(buf,106) = 1;// Rename bit (0=rename,1=no rename)
+ return 108;
+ } else {
+ return 106;
+ }
}
int mmo_char_send006b(int fd, struct char_session_data* sd)
@@ -3083,7 +3082,7 @@ int parse_char(int fd)
for(i = 0; i < AUTH_FIFO_SIZE && !(
auth_fifo[i].account_id == sd->account_id &&
auth_fifo[i].login_id1 == sd->login_id1 &&
- auth_fifo[i].login_id2 == sd->login_id2 && // relate to the versions higher than 18
+ auth_fifo[i].login_id2 == sd->login_id2 &&
auth_fifo[i].ip == session[fd]->client_addr &&
auth_fifo[i].delflag == 2)
; i++);
@@ -3908,6 +3907,8 @@ int char_config_read(const char* cfgName)
char_name_option = atoi(w2);
} else if (strcmpi(w1, "char_name_letters") == 0) {
strcpy(char_name_letters, w2);
+ } else if (strcmpi(w1, "char_rename") == 0) {
+ char_rename = config_switch(w2);
} else if (strcmpi(w1, "chars_per_account") == 0) { //maxchars per account [Sirius]
char_per_account = atoi(w2);
} else if (strcmpi(w1, "char_del_level") == 0) { //disable/enable char deletion by its level condition [Lupus]