diff --git a/core/Makefile b/core/Makefile index 2c029e32..b46ce05c 100644 --- a/core/Makefile +++ b/core/Makefile @@ -26,7 +26,7 @@ OBJECTS += smn_bitbuffer.cpp smn_console.cpp smn_core.cpp \ smn_filesystem.cpp smn_halflife.cpp \ smn_keyvalues.cpp smn_player.cpp \ smn_usermsgs.cpp smn_menus.cpp smn_vector.cpp \ - smn_hudtext.cpp smn_nextmap.cpp + smn_hudtext.cpp smn_nextmap.cpp smn_database.cpp OBJECTS += ExtensionSys.cpp \ ForwardSys.cpp \ HandleSys.cpp \ @@ -120,12 +120,13 @@ endif CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \ -DSE_ORANGEBOXVALVE=6 -DSE_LEFT4DEAD=7 -DSE_LEFT4DEAD2=8 -DSE_ALIENSWARM=9 +#LINK += /usr/lib/mysql/libmysqlclient_r.a /usr/lib/libssl.a /usr/lib/libkrb5.a /usr/lib/libcrypto.a $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) \ - $(LIB_PREFIX)tier0$(LIB_SUFFIX) -static-libgcc + $(LIB_PREFIX)tier0$(LIB_SUFFIX) -static-libgcc -L/usr/lib/mysql -lmysqlclient INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \ -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \ - -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn + -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I/usr/include/mysql CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \ diff --git a/core/smn_database.cpp b/core/smn_database.cpp index 3c048238..e50c1af0 100644 --- a/core/smn_database.cpp +++ b/core/smn_database.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include "mysql.h" #include "sm_globals.h" #include "HandleSys.h" #include "Database.h" @@ -662,22 +663,23 @@ static cell_t SQL_GetError(IPluginContext *pContext, const cell_t *params) static cell_t SQL_QuoteString(IPluginContext *pContext, const cell_t *params) { - IDatabase *db = NULL; - HandleError err; + //IDatabase *db = NULL; + //HandleError err; - if ((err = g_DBMan.ReadHandle(params[1], DBHandle_Database, (void **)&db)) +/* if ((err = g_DBMan.ReadHandle(params[1], DBHandle_Database, (void **)&db)) != HandleError_None) { return pContext->ThrowNativeError("Invalid database Handle %x (error: %d)", params[1], err); } + */ char *input, *output; - size_t maxlength = (size_t)params[4]; + //size_t maxlength = (size_t)params[4]; pContext->LocalToString(params[2], &input); pContext->LocalToString(params[3], &output); size_t written; - bool s = db->QuoteString(input, output, maxlength, &written); + bool s = mysql_escape_string(output, input, strlen(input)); cell_t *addr; pContext->LocalToPhysAddr(params[5], &addr); diff --git a/extensions/mysql/Makefile b/extensions/mysql/Makefile index 50e236e1..487f7eee 100644 --- a/extensions/mysql/Makefile +++ b/extensions/mysql/Makefile @@ -85,11 +85,11 @@ ifeq "$(USEMETA)" "true" -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn else INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(MMSOURCE17)/core/sourcehook \ - -I$(MYSQL)/include + -I/usr/include/mysql CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_ORANGEBOXVALVE=4 -DSE_LEFT4DEAD=5 endif -LINK += $(MYSQL)/lib/libmysqlclient_r.a -lz -lpthread +LINK += -m32 /usr/lib/mysql/libmysqlclient_r.a -lz -lpthread CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch \ diff --git a/extensions/mysql/mysql/MyDatabase.cpp b/extensions/mysql/mysql/MyDatabase.cpp index e62ccbfd..11e33842 100644 --- a/extensions/mysql/mysql/MyDatabase.cpp +++ b/extensions/mysql/mysql/MyDatabase.cpp @@ -186,7 +186,7 @@ bool MyDatabase::QuoteString(const char *str, char buffer[], size_t maxlength, s return false; } - needed = mysql_real_escape_string(m_mysql, buffer, str, size); + needed = mysql_escape_string(buffer, str, size); if (newSize) { *newSize = (size_t)needed; diff --git a/pushbuild.txt b/pushbuild.txt index 74027d75..d4a2bb54 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -47,7 +47,7 @@ the end The Patty Winters show this morning was about how terrible sawce is, same as yesterday's show; however, things are looking up for tomorrow. IT'S CLOBBERIN' TIME vc2005 supremecy -clobbermonkey +clobstermonkey that thing clobber build because amx.h changed (sigh) a dead fish