2
0
mirror of https://github.com/rehlds/reapi.git synced 2025-05-13 23:27:21 +03:00

Fix crash initialization reunion api for oldest reunion version

This commit is contained in:
s1lentq 2025-04-01 00:07:14 +07:00
parent 94264bd89a
commit 906c09c492
2 changed files with 11 additions and 7 deletions

@ -34,6 +34,10 @@ enum reu_authkey_kind
class IReunionApi
{
public:
// NOTE: GetMajorVersion, GetMinorVersion have been since version 0.1.0.92c
int version_major;
int version_minor;
enum
{
LONG_AUTHID_LEN = 16

@ -12,28 +12,28 @@ bool ReunionApi_Init()
if (!g_ReunionApi)
return false;
if (g_ReunionApi->GetMajorVersion() != REUNION_API_VERSION_MAJOR)
if (g_ReunionApi->version_major != REUNION_API_VERSION_MAJOR)
{
UTIL_ServerPrint("[%s]: Reunion API major version mismatch; expected %d, real %d\n", Plugin_info.logtag, REUNION_API_VERSION_MAJOR, g_ReunionApi->GetMajorVersion());
UTIL_ServerPrint("[%s]: Reunion API major version mismatch; expected %d, real %d\n", Plugin_info.logtag, REUNION_API_VERSION_MAJOR, g_ReunionApi->version_major);
// need to notify that it is necessary to update the Reunion.
if (g_ReunionApi->GetMajorVersion() < REUNION_API_VERSION_MAJOR)
if (g_ReunionApi->version_major < REUNION_API_VERSION_MAJOR)
{
UTIL_ServerPrint("[%s]: Please update the Reunion up to a major version API >= %d\n", Plugin_info.logtag, REUNION_API_VERSION_MAJOR);
}
// need to notify that it is necessary to update the module.
else if (g_ReunionApi->GetMajorVersion() > REUNION_API_VERSION_MAJOR)
else if (g_ReunionApi->version_major > REUNION_API_VERSION_MAJOR)
{
UTIL_ServerPrint("[%s]: Please update the %s up to a major version API >= %d\n", Plugin_info.logtag, Plugin_info.logtag, g_ReunionApi->GetMajorVersion());
UTIL_ServerPrint("[%s]: Please update the %s up to a major version API >= %d\n", Plugin_info.logtag, Plugin_info.logtag, g_ReunionApi->version_major);
}
return false;
}
if (g_ReunionApi->GetMinorVersion() < REUNION_API_VERSION_MINOR)
if (g_ReunionApi->version_minor < REUNION_API_VERSION_MINOR)
{
UTIL_ServerPrint("[%s]: Reunion API minor version mismatch; expected at least %d, real %d\n", Plugin_info.logtag, REUNION_API_VERSION_MINOR, g_ReunionApi->GetMinorVersion());
UTIL_ServerPrint("[%s]: Reunion API minor version mismatch; expected at least %d, real %d\n", Plugin_info.logtag, REUNION_API_VERSION_MINOR, g_ReunionApi->version_minor);
UTIL_ServerPrint("[%s]: Please update the Reunion up to a minor version API >= %d\n", Plugin_info.logtag, REUNION_API_VERSION_MINOR);
return false;
}