CLIENT PREFS ARE GO!!1!shiftone!!1!

Fully implemented amb734 - Including console interface and menu for clients to use.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402140
This commit is contained in:
Matt Woodrow
2008-05-12 08:06:47 +00:00
parent 6e91780e73
commit d88ba02fde
22 changed files with 1177 additions and 112 deletions
+28 -5
View File
@@ -35,11 +35,16 @@
#define MAXCLIENTS 64
#include "smsdk_ext.h"
#include "sh_list.h"
#include "cookie.h"
#include "menus.h"
#define DRIVER_MYSQL 1
#define DRIVER_SQLITE 0
#define MAX_TRANSLATE_PARAMS 32
/**
* @brief Sample implementation of the SDK Extension.
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
@@ -117,10 +122,7 @@ public:
public:
IDBDriver *Driver;
IDatabase *Database;
IPreparedQuery *Query_InsertCookie;
IPreparedQuery *Query_SelectData;
IPreparedQuery *Query_InsertData;
IPhraseCollection *phrases;
};
class CookieTypeHandler : public IHandleTypeDispatch
@@ -128,16 +130,37 @@ class CookieTypeHandler : public IHandleTypeDispatch
public:
void OnHandleDestroy(HandleType_t type, void *object)
{
/* No delete needed since this Cookies are persistant */
/* No delete needed since Cookies are persistant */
}
};
class CookieIteratorHandler : public IHandleTypeDispatch
{
public:
void OnHandleDestroy(HandleType_t type, void *object)
{
delete (SourceHook::List<Cookie *>::iterator *)object;
}
};
size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...);
extern sp_nativeinfo_t g_ClientPrefNatives[];
extern ClientPrefs g_ClientPrefs;
extern HandleType_t g_CookieType;
extern CookieTypeHandler g_CookieTypeHandler;
extern HandleType_t g_CookieIterator;
extern CookieIteratorHandler g_CookieIteratorHandler;
bool Translate(char *buffer,
size_t maxlength,
const char *format,
unsigned int numparams,
size_t *pOutLength,
...);
extern int driver;
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_