ソースを参照

Added a nasty hack to prevent multilanguage clients from breaking guild notices

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9737 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 18 年 前
コミット
025f66c3c3
2 ファイル変更14 行追加0 行削除
  1. 2 0
      Changelog-Trunk.txt
  2. 12 0
      src/map/clif.c

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/01/29
+	* Added a nasty hack to prevent multilanguage clients from breaking guild notices
 2007/01/27
 	* Made @reloadscript wipe ALL previous mobs that the script engine spawned
 	- this way it is manageable via global vars; the other way doesn't allow that

+ 12 - 0
src/map/clif.c

@@ -10545,6 +10545,18 @@ void clif_parse_GuildChangeNotice(int fd,struct map_session_data *sd) {
 	if(!sd->state.gmaster_flag)
 		return;
 
+	// compensate for the client's double marker bug (in both strings)
+	if ((RFIFOB(fd, 6) == '|') && (RFIFOB(fd, 6+3) == '|')) {
+		memmove(RFIFOP(fd, 6+3), RFIFOP(fd, 6+6), 60-6); memset(RFIFOP(fd, 60-3), 0x00, 3); // drop the duplicate marker
+	}
+	if ((RFIFOB(fd, 66) == '|') && (RFIFOB(fd, 66+3) == '|')) {
+		memmove(RFIFOP(fd, 66+3), RFIFOP(fd, 66+6), 180-6); memset(RFIFOP(fd, 180-3), 0x00, 3); // drop the duplicate marker
+	}
+	// compensate for the client's adding of an extra space at the end of the message
+	if (RFIFOB(fd, 66) == '|') {
+		memset(RFIFOP(fd, 66 + strnlen(RFIFOP(fd, 66), 120)-1), 0x00, 1); // delete extra space at the end
+	}
+
 	guild_change_notice(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6),(char*)RFIFOP(fd,66));
 }