mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-15 22:57:12 +02:00
Prevent server callbacks not being bound when compiling on linux.
This commit is contained in:
@ -14,16 +14,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -163,7 +153,10 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnServerFrame = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
@ -175,24 +168,6 @@ static void OnServerFrame(float /*delta*/)
|
||||
Session::Process();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnServerFrame = OnServerFrame;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnServerFrame = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void RegisterAPI(HSQUIRRELVM vm)
|
||||
{
|
||||
@ -532,8 +507,11 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQIRC_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnServerFrame = OnServerFrame;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQIRC_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -8,16 +8,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -155,20 +145,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -243,8 +219,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQJSON_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQJSON_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -10,16 +10,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -157,20 +147,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -326,8 +302,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQMG_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQMG_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -8,16 +8,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -155,20 +145,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -220,8 +196,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQMMDB_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQMMDB_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -8,16 +8,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -155,20 +145,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -233,8 +209,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQMYSQL_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQMYSQL_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -8,16 +8,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -156,20 +146,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -229,8 +205,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQSAMPLE_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQSAMPLE_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -8,16 +8,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -155,20 +145,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -239,8 +215,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQSQLITE_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQSQLITE_NAME);
|
||||
// Dummy spacing
|
||||
|
@ -13,16 +13,6 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Bind specific functions to certain server events.
|
||||
*/
|
||||
void BindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Undo changes made with BindCallbacks().
|
||||
*/
|
||||
void UnbindCallbacks();
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Register the module API under the specified virtual machine.
|
||||
*/
|
||||
@ -160,20 +150,6 @@ static uint8_t OnServerInitialise()
|
||||
static void OnServerShutdown(void)
|
||||
{
|
||||
// The server may still send callbacks
|
||||
UnbindCallbacks();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void BindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void UnbindCallbacks()
|
||||
{
|
||||
_Clbk->OnServerInitialise = nullptr;
|
||||
_Clbk->OnServerShutdown = nullptr;
|
||||
_Clbk->OnPluginCommand = nullptr;
|
||||
@ -517,8 +493,10 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * functions, PluginCall
|
||||
_Info->apiMinorVersion = PLUGIN_API_MINOR;
|
||||
// Assign the plug-in name
|
||||
std::snprintf(_Info->name, sizeof(_Info->name), "%s", SQXML_HOST_NAME);
|
||||
// Bind callbacks
|
||||
BindCallbacks();
|
||||
// Bind to the server callbacks
|
||||
_Clbk->OnServerInitialise = OnServerInitialise;
|
||||
_Clbk->OnServerShutdown = OnServerShutdown;
|
||||
_Clbk->OnPluginCommand = OnPluginCommand;
|
||||
// Notify that the plug-in was successfully loaded
|
||||
OutputMessage("Successfully loaded %s", SQXML_NAME);
|
||||
// Dummy spacing
|
||||
|
Reference in New Issue
Block a user