mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-05-02 09:07:12 +02:00
Minor changes I that should've been done in previous commits.
This commit is contained in:
parent
fab15840cb
commit
1c08f33604
@ -74,14 +74,14 @@ void OnSquirrelLoad()
|
|||||||
// Make sure that we have a valid plugin API
|
// Make sure that we have a valid plugin API
|
||||||
if (!_SqMod)
|
if (!_SqMod)
|
||||||
{
|
{
|
||||||
return; // Unable to proceed.
|
return; // Unable to proceed!
|
||||||
}
|
}
|
||||||
// Obtain the Squirrel API and VM
|
// Obtain the Squirrel API and VM
|
||||||
_SqVM = _SqMod->GetSquirrelVM();
|
_SqVM = _SqMod->GetSquirrelVM();
|
||||||
// Make sure that a valid virtual machine exists
|
// Make sure that a valid virtual machine exists
|
||||||
if (!_SqVM)
|
if (!_SqVM)
|
||||||
{
|
{
|
||||||
return; // Unable to proceed.
|
return; // Unable to proceed!
|
||||||
}
|
}
|
||||||
// Set this as the default database
|
// Set this as the default database
|
||||||
DefaultVM::Set(_SqVM);
|
DefaultVM::Set(_SqVM);
|
||||||
@ -107,7 +107,7 @@ void OnSquirrelTerminate()
|
|||||||
bool CheckAPIVer(CCStr ver)
|
bool CheckAPIVer(CCStr ver)
|
||||||
{
|
{
|
||||||
// Obtain the numeric representation of the API version
|
// Obtain the numeric representation of the API version
|
||||||
long vernum = strtol(ver, nullptr, 10);
|
long vernum = std::strtol(ver, nullptr, 10);
|
||||||
// Check against version mismatch
|
// Check against version mismatch
|
||||||
if (vernum == SQMOD_API_VER)
|
if (vernum == SQMOD_API_VER)
|
||||||
{
|
{
|
||||||
|
@ -22,14 +22,14 @@
|
|||||||
namespace SqMod {
|
namespace SqMod {
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
PluginFuncs* _Func = NULL;
|
PluginFuncs* _Func = nullptr;
|
||||||
PluginCallbacks* _Clbk = NULL;
|
PluginCallbacks* _Clbk = nullptr;
|
||||||
PluginInfo* _Info = NULL;
|
PluginInfo* _Info = nullptr;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
HSQAPI _SqAPI = NULL;
|
HSQAPI _SqAPI = nullptr;
|
||||||
HSQEXPORTS _SqMod = NULL;
|
HSQEXPORTS _SqMod = nullptr;
|
||||||
HSQUIRRELVM _SqVM = NULL;
|
HSQUIRRELVM _SqVM = nullptr;
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Bind speciffic functions to certain server events.
|
* Bind speciffic functions to certain server events.
|
||||||
@ -75,14 +75,14 @@ void OnSquirrelLoad()
|
|||||||
// Make sure that we have a valid plugin API
|
// Make sure that we have a valid plugin API
|
||||||
if (!_SqMod)
|
if (!_SqMod)
|
||||||
{
|
{
|
||||||
return; // Unable to proceed.
|
return; // Unable to proceed!
|
||||||
}
|
}
|
||||||
// Obtain the Squirrel API and VM
|
// Obtain the Squirrel API and VM
|
||||||
_SqVM = _SqMod->GetSquirrelVM();
|
_SqVM = _SqMod->GetSquirrelVM();
|
||||||
// Make sure that a valid virtual machine exists
|
// Make sure that a valid virtual machine exists
|
||||||
if (!_SqVM)
|
if (!_SqVM)
|
||||||
{
|
{
|
||||||
return; // Unable to proceed.
|
return; // Unable to proceed!
|
||||||
}
|
}
|
||||||
// Set this as the default database
|
// Set this as the default database
|
||||||
DefaultVM::Set(_SqVM);
|
DefaultVM::Set(_SqVM);
|
||||||
@ -99,7 +99,7 @@ void OnSquirrelTerminate()
|
|||||||
{
|
{
|
||||||
OutputMessage("Terminating: %s", SQXML_NAME);
|
OutputMessage("Terminating: %s", SQXML_NAME);
|
||||||
// Release the current database (if any)
|
// Release the current database (if any)
|
||||||
DefaultVM::Set(NULL);
|
DefaultVM::Set(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
@ -108,7 +108,7 @@ void OnSquirrelTerminate()
|
|||||||
bool CheckAPIVer(CCStr ver)
|
bool CheckAPIVer(CCStr ver)
|
||||||
{
|
{
|
||||||
// Obtain the numeric representation of the API version
|
// Obtain the numeric representation of the API version
|
||||||
long vernum = strtol(ver, NULL, 10);
|
long vernum = std::strtol(ver, nullptr, 10);
|
||||||
// Check against version mismatch
|
// Check against version mismatch
|
||||||
if (vernum == SQMOD_API_VER)
|
if (vernum == SQMOD_API_VER)
|
||||||
{
|
{
|
||||||
@ -170,9 +170,9 @@ void BindCallbacks()
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void UnbindCallbacks()
|
void UnbindCallbacks()
|
||||||
{
|
{
|
||||||
_Clbk->OnInitServer = NULL;
|
_Clbk->OnInitServer = nullptr;
|
||||||
_Clbk->OnInternalCommand = NULL;
|
_Clbk->OnInternalCommand = nullptr;
|
||||||
_Clbk->OnShutdownServer = NULL;
|
_Clbk->OnShutdownServer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user