- Updated to Sqlite 3.2.3. See sqlite.org for details about new stuff.
- Base dir for db files is now changed to the game mod dir. Update your config files!
This commit is contained in:
parent
bad4c02647
commit
96c4d33da4
|
@ -1,7 +1,7 @@
|
|||
MODNAME = sqlite_amxx
|
||||
SRCFILES = sqlite_amx.cpp sqlite.cpp amxxmodule.cpp
|
||||
|
||||
EXTRA_INCLUDEDIRS = -I../../amxmodx -Isqlite-source-3_2_2
|
||||
EXTRA_INCLUDEDIRS = -I../../amxmodx -Isqlite-source-3_2_3
|
||||
|
||||
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# where x is debug or opt and proc is ix86 or amd64
|
||||
# You must use this script from the project src dir
|
||||
|
||||
#options =
|
||||
#options =
|
||||
# debug - enable gdb debugging
|
||||
# amd64 - compile for AMD64
|
||||
# proc=ix86 - assumed not amd64
|
||||
|
@ -15,7 +15,7 @@
|
|||
$PROJECT = "sqlite_amxx";
|
||||
$sdk = "../../hlsdk/SourceCode";
|
||||
$mm = "../../metamod/metamod";
|
||||
$sql = "sqlite-source-3_2_2";
|
||||
$sql = "sqlite-source-3_2_3";
|
||||
$gccf = "gcc";
|
||||
|
||||
@CPP_SOURCE_FILES = ("sqlite.cpp", "sqlite_amx.cpp", "amxxmodule.cpp");
|
||||
|
@ -44,7 +44,7 @@ while ($cmd = shift)
|
|||
$OPTIONS{"proc"} = "i".$proc."86";
|
||||
}
|
||||
} elsif ($cmd =~ /clean/) {
|
||||
$OPTIONS{"clean"} = 1;
|
||||
$OPTIONS{"clean"} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
//#define USE_METAMOD
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
|
@ -28,8 +28,8 @@
|
|||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX dettach
|
||||
//#define FN_AMXX_DETTACH OnAmxxDettach
|
||||
// AMXX detach
|
||||
#define FN_AMXX_DETACH OnAmxxDetach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
@ -48,8 +48,8 @@
|
|||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta dettach
|
||||
//#define FN_META_DETTACH OnMetaDettach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
|
@ -75,7 +75,7 @@
|
|||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
//#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
|
|
|
@ -57,7 +57,7 @@ static cell AMX_NATIVE_CALL sql_connect(AMX *amx, cell *params) // 6 param
|
|||
i = 0;
|
||||
|
||||
if (!strlen(dbname)) {
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Recieved invalid parameter.");
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Received invalid parameter.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,14 @@ static cell AMX_NATIVE_CALL sql_connect(AMX *amx, cell *params) // 6 param
|
|||
DBList.push_back(c);
|
||||
id = (unsigned int)(DBList.size() - 1);
|
||||
}
|
||||
|
||||
char pathbuffer[1024];
|
||||
MF_BuildPathnameR(pathbuffer, 1023, "%s", dbname);
|
||||
#if defined _DEBUG
|
||||
MF_PrintSrvConsole("Sqlite connect uses path: \"%s\"\n", pathbuffer);
|
||||
#endif
|
||||
|
||||
if (!c->Connect(dbname))
|
||||
if (!c->Connect(pathbuffer))
|
||||
{
|
||||
if (c->ErrorStr.size() < 1)
|
||||
{
|
||||
|
@ -376,7 +382,7 @@ void OnAmxxAttach()
|
|||
MF_AddNatives(mysql_Natives);
|
||||
}
|
||||
|
||||
void ServerDeactivate()
|
||||
void OnAmxxDetach()
|
||||
{
|
||||
unsigned int i = 0;
|
||||
for (i=0; i<Results.size(); i++)
|
||||
|
@ -393,5 +399,5 @@ void ServerDeactivate()
|
|||
Results.clear();
|
||||
DBList.clear();
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
//RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user