summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-01 23:15:49 -0200
committershennetsind <ind@henn.et>2013-02-01 23:15:49 -0200
commit125b75890b29073b0264009e9638e68911a1aa07 (patch)
tree5225a2ad5f0d38a0a64a9cf3e05a020ed636d6a3
parent17f2e6a581ef9e37f01cfd1b98c335a6d5b5ac75 (diff)
downloadhercules-125b75890b29073b0264009e9638e68911a1aa07.tar.gz
hercules-125b75890b29073b0264009e9638e68911a1aa07.tar.bz2
hercules-125b75890b29073b0264009e9638e68911a1aa07.tar.xz
hercules-125b75890b29073b0264009e9638e68911a1aa07.zip
Added New Char-Server Rename Packet
Special Thanks to Ancyker http://hercules.ws/board/tracker/issue-7040-missing-char-server-rename-packet/ Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/char/char.c29
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