Selaa lähdekoodia

blank email for char deletion works when email is a@a.com (SQL)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1053 54d463be-8e91-2dee-dedb-b68131a5f0ec
(no author) 20 vuotta sitten
vanhempi
commit
417b04426f
2 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  1. 4 0
      Changelog.txt
  2. 4 1
      src/char_sql/char.c

+ 4 - 0
Changelog.txt

@@ -1,6 +1,10 @@
 Date	Added
 
 02/05
+	* Changed the way char deletion works for SQL [1051: Ajarn]
+	  - If the email the client fails check then check if the
+	    email is blank and the DB email is a@a.com (default)
+	    If so, assume it was created with _M/_F, and delete it
 	* SQL Login accepts _M/_F now [Credit to Sirius] [1049: Ajarn]
 	* Map server now actually reads bind_ip [1048: Ajarn]
 	  Side note: login reads bind_ip, but doesn't use login_ip now.

+ 4 - 1
src/char_sql/char.c

@@ -2601,7 +2601,10 @@ int parse_char(int fd) {
 			sql_res = mysql_store_result(&lmysql_handle);
 			if (sql_res) {
 				sql_row = mysql_fetch_row(sql_res);
-				if (strcmp(email,sql_row[0]) == 0) {
+
+				if ( (strcmp(email,sql_row[0]) == 0) || // client_value == db_value?
+					 ((strcmp(email,"") == 0) &&
+					  (strcmp(sql_row[0],"a@a.com") == 0)) ) { // client_value == "" && db_value == "a@a.com" ?
 					mysql_free_result(sql_res);
 				} else {
 					WFIFOW(fd, 0) = 0x70;