[server] Implement a few CPlugins member functions

This commit is contained in:
RD42
2024-04-18 22:41:01 +08:00
parent 9dfb9f748e
commit 32f2bc4e94
4 changed files with 388 additions and 3 deletions
+48
View File
@@ -4,6 +4,49 @@
//----------------------------------------------------------
#define SAMP_PLUGIN_VERSION 0x0220
//----------------------------------------------------------
#ifdef __cplusplus
#define PLUGIN_EXTERN_C extern "C"
#else
#define PLUGIN_EXTERN_C
#endif
#if defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef __GNUC__
#pragma message "Warning: Not using a GNU compiler."
#endif
#define PLUGIN_CALL
#ifndef SAMPSVR
// Compile code with -fvisibility=hidden to hide non-exported functions.
#define PLUGIN_EXPORT PLUGIN_EXTERN_C __attribute__((visibility("default")))
#else
#define PLUGIN_EXPORT PLUGIN_EXTERN_C
#endif
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#ifndef _MSC_VER
#pragma message "Warning: Not using a VC++ compiler."
#endif
#define PLUGIN_CALL __stdcall
#define PLUGIN_EXPORT PLUGIN_EXTERN_C
#else
#error "You must define one of WIN32, LINUX or FREEBSD"
#endif
//----------------------------------------------------------
enum SUPPORTS_FLAGS
{
SUPPORTS_VERSION = SAMP_PLUGIN_VERSION,
SUPPORTS_VERSION_MASK = 0xffff,
SUPPORTS_AMX_NATIVES = 0x10000,
SUPPORTS_PROCESS_TICK = 0x20000,
};
//----------------------------------------------------------
enum PLUGIN_DATA_TYPE
{
// For some debugging
@@ -65,4 +108,9 @@ enum PLUGIN_AMX_EXPORT
PLUGIN_AMX_EXPORT_UTF8Put = 43,
};
//----------------------------------------------------------
#endif // _PLUGINCOMMON_H_INCLUDED
//----------------------------------------------------------
// EOF