Kaynağa Gözat

- Fixed the login-sql server replying to the change-sex packet with the wrong gender, causing the char-server to screw-up job-change updates.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8180 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 yıl önce
ebeveyn
işleme
29fdbcae3b
4 değiştirilmiş dosya ile 8 ekleme ve 3 silme
  1. 3 0
      Changelog-Trunk.txt
  2. 1 0
      src/char/char.c
  3. 1 0
      src/char_sql/char.c
  4. 3 3
      src/login_sql/login.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/08/07
 2006/08/07
+	* Fixed the login-sql server replying to the change-sex packet with the
+	  wrong gender, causing the char-server to screw-up job-change updates.
+	  [Skotlex]
 	* Cleaned up the apparent mess that is pc_skill. Hopefully it SHOULD work as
 	* Cleaned up the apparent mess that is pc_skill. Hopefully it SHOULD work as
 	  described on the docs now, this should also fix adopting not correctly
 	  described on the docs now, this should also fix adopting not correctly
 	  giving the family-related skills. The flag value of skill should be: 0 to
 	  giving the family-related skills. The flag value of skill should be: 0 to

+ 1 - 0
src/char/char.c

@@ -2735,6 +2735,7 @@ int parse_frommap(int fd) {
 		case 0x2aff:
 		case 0x2aff:
 			if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,2))
 			if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,2))
 				return 0;
 				return 0;
+			//TODO: When data mismatches memory, update guild/party online/offline states.
 			server[id].users = RFIFOW(fd,4);
 			server[id].users = RFIFOW(fd,4);
 			// add online players in the list by [Yor], adapted to use dbs by [Skotlex]
 			// add online players in the list by [Yor], adapted to use dbs by [Skotlex]
 			j = 0;
 			j = 0;

+ 1 - 0
src/char_sql/char.c

@@ -2582,6 +2582,7 @@ int parse_frommap(int fd) {
 			if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,2))
 			if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,2))
 				return 0;
 				return 0;
 		{
 		{
+			//TODO: When data mismatches memory, update guild/party online/offline states.
 			int i, aid, cid;
 			int i, aid, cid;
 			struct online_char_data* character;
 			struct online_char_data* character;
 
 

+ 3 - 3
src/login_sql/login.c

@@ -1242,10 +1242,10 @@ int parse_fromchar(int fd){
 			}
 			}
 
 
 			if (strcmpi(sql_row[0], "M") == 0)
 			if (strcmpi(sql_row[0], "M") == 0)
-				sex = 1;
+				sex = 0; //Change to female
 			else
 			else
-				sex = 0;
-			sprintf(tmpsql,"UPDATE `%s` SET `sex` = '%c' WHERE `%s` = '%d'", login_db, (sex==0?'M':'F'), login_db_account_id, acc);
+				sex = 1; //Change to make
+			sprintf(tmpsql,"UPDATE `%s` SET `sex` = '%c' WHERE `%s` = '%d'", login_db, (sex?'M':'F'), login_db_account_id, acc);
 			//query
 			//query
 			if(mysql_query(&mysql_handle, tmpsql)) {
 			if(mysql_query(&mysql_handle, tmpsql)) {
 				ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
 				ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));