diff options
author | malufett <malufett.eat.my.binaries@gmail.com> | 2013-02-03 23:23:44 +0800 |
---|---|---|
committer | malufett <malufett.eat.my.binaries@gmail.com> | 2013-02-03 23:23:44 +0800 |
commit | 7a20f13a210f395b8276cb19583e0b302f4f6a1f (patch) | |
tree | 4a0dd554aa88f68f97f5d9f9676d23d1cfc9da15 /src/char/char.c | |
parent | 7626b141f8e56b1739abce76f5a99cbbb2b4b159 (diff) | |
parent | 24d6aba263ff25724b8e6c9d6a228bba9fd6e756 (diff) | |
download | hercules-7a20f13a210f395b8276cb19583e0b302f4f6a1f.tar.gz hercules-7a20f13a210f395b8276cb19583e0b302f4f6a1f.tar.bz2 hercules-7a20f13a210f395b8276cb19583e0b302f4f6a1f.tar.xz hercules-7a20f13a210f395b8276cb19583e0b302f4f6a1f.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
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 |