Parcourir la source

* Script command 'query_logsql' now throws a warning when SQL logs are disabled (related r11892).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14811 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei il y a 14 ans
Parent
commit
1eb3c83394
2 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 1 0
      Changelog-Trunk.txt
  2. 7 0
      src/map/script.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2011/05/08
+	* Script command 'query_logsql' now throws a warning when SQL logs are disabled (related r11892). [Ai4rei]
 	* Updated/revised description of instance-related script commands (bugreport:4880). [Ai4rei]
 	- Fixed 'instance_create' would return -4 (party already instancing) when the requested party was not found.
 	- 'instance_create' return value -2 now means 'party not found' rather than 'missing parameter'.

+ 7 - 0
src/map/script.c

@@ -12737,6 +12737,13 @@ BUILDIN_FUNC(query_sql)
 BUILDIN_FUNC(query_logsql)
 {
 #ifndef TXT_ONLY
+	if( !log_config.sql_logs )
+	{// logmysql_handle == NULL
+		ShowWarning("buildin_query_logsql: SQL logs are disabled, query '%s' will not be executed.\n", script_getstr(st,2));
+		script_pushint(st,-1);
+		return 1;
+	}
+
 	return buildin_query_sql_sub(st, logmysql_handle);
 #else
 	//for TXT version, we always return -1