summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-24 23:09:12 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-24 23:09:12 +0000
commit487ab0cc92f387857df51d0f137a1c2b671d8977 (patch)
tree2f49c1c482e90f903d53b5e14936c060715d9d87 /src/map/script.c
parentd5bf16b258b6f1131dd11dd3fc8dbe3b069cc777 (diff)
downloadhercules-487ab0cc92f387857df51d0f137a1c2b671d8977.tar.gz
hercules-487ab0cc92f387857df51d0f137a1c2b671d8977.tar.bz2
hercules-487ab0cc92f387857df51d0f137a1c2b671d8977.tar.xz
hercules-487ab0cc92f387857df51d0f137a1c2b671d8977.zip
- Added script command escape_sql. It will return an escaped string for use in the sql_query script command (in case you want to use input of players in your queries).
- Removed the skill packet from TK_RUN as the client ignores the walkok packet sent right after it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6262 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index f5230dc3e..876f17477 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -135,6 +135,7 @@ char tmp_sql[65535];
unsigned char* parse_subexpr(unsigned char *,int);
#ifndef TXT_ONLY
int buildin_query_sql(struct script_state *st);
+int buildin_escape_sql(struct script_state *st);
#endif
int buildin_atoi(struct script_state *st);
int buildin_axtoi(struct script_state *st);
@@ -455,6 +456,7 @@ struct {
{buildin_axtoi,"axtoi","s"},
#ifndef TXT_ONLY
{buildin_query_sql, "query_sql", "s*"},
+ {buildin_escape_sql, "escape_sql", "s"},
#endif
{buildin_atoi,"atoi","s"},
{buildin_mes,"mes","s"},
@@ -9728,6 +9730,17 @@ int buildin_query_sql(struct script_state *st) {
return 0;
}
+
+//Allows escaping of a given string.
+int buildin_escape_sql(struct script_state *st) {
+ char *t_query, *query;
+ query = conv_str(st,& (st->stack->stack_data[st->start+2]));
+
+ t_query = aCallocA(strlen(query)*2+1,sizeof(char));
+ jstrescapecpy(t_query,query);
+ push_str(st->stack,C_STR,(unsigned char *)t_query);
+ return 0;
+}
#endif
int buildin_getd (struct script_state *st)