diff options
author | Mysterious <mysteriousragnarok@hotmail.com> | 2013-02-03 17:59:43 -0800 |
---|---|---|
committer | Mysterious <mysteriousragnarok@hotmail.com> | 2013-02-03 17:59:43 -0800 |
commit | 9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9 (patch) | |
tree | a9b1a6855824986b8bfa47a98236d30a1f2e1d33 /src/char/char.c | |
parent | ac7c180e10c5c84eae1ef8769942853ac8abc6f9 (diff) | |
parent | fe8d3fc42729f2afc37426e26080b2d04f65d9f3 (diff) | |
download | hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.tar.gz hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.tar.bz2 hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.tar.xz hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.zip |
Merge pull request #1 from HerculesWS/master
Merging
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index 83b58a0a7..d454e8bd0 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3991,6 +3991,35 @@ int parse_char(int fd) return 0; RFIFOSKIP(fd,6); break; + // char rename request + // R 08fc <char ID>.l <new name>.24B + case 0x8fc: + FIFOSD_CHECK(30); + { + int i, cid =RFIFOL(fd,2); + char name[NAME_LENGTH]; + char esc_name[NAME_LENGTH*2+1]; + safestrncpy(name, (char *)RFIFOP(fd,6), NAME_LENGTH); + RFIFOSKIP(fd,30); + + ARR_FIND( 0, MAX_CHARS, i, sd->found_char[i] == cid ); + if( i == MAX_CHARS ) + break; + + normalize_name(name,TRIM_CHARS); + Sql_EscapeStringLen(sql_handle, esc_name, name, strnlen(name, NAME_LENGTH)); + if( !check_char_name(name,esc_name) ) { + i = 1; + safestrncpy(sd->new_name, name, NAME_LENGTH); + } else + i = 0; + + WFIFOHEAD(fd, 4); + WFIFOW(fd,0) = 0x28e; + WFIFOW(fd,2) = i; + WFIFOSET(fd,4); + } + break; // char rename request // R 028d <account ID>.l <char ID>.l <new name>.24B |