Pārlūkot izejas kodu

Fixed char-server not making use of name_ignoring_case setting, bugreport:4700

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15374 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 gadi atpakaļ
vecāks
revīzija
cce944588a
1 mainītis faili ar 10 papildinājumiem un 6 dzēšanām
  1. 10 6
      src/char_sql/char.c

+ 10 - 6
src/char_sql/char.c

@@ -1325,12 +1325,16 @@ int check_char_name(char * name, char * esc_name)
 			if( strchr(char_name_letters, name[i]) != NULL )
 				return -2;
 	}
-
-	// check name (already in use?)
-	if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `name` = '%s' LIMIT 1", char_db, esc_name) )
-	{
-		Sql_ShowDebug(sql_handle);
-		return -2;
+	if( name_ignoring_case ) {
+		if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE BINARY `name` = '%s' LIMIT 1", char_db, esc_name) ) {
+			Sql_ShowDebug(sql_handle);
+			return -2;
+		}
+	} else {
+		if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `name` = '%s' LIMIT 1", char_db, esc_name) ) {
+			Sql_ShowDebug(sql_handle);
+			return -2;
+		}
 	}
 	if( Sql_NumRows(sql_handle) > 0 )
 		return -1; // name already exists