Get SourceMod version from SourcePawn library
This commit is contained in:
parent
5aaca22760
commit
a3a9655d07
@ -9,8 +9,8 @@ compiler:
|
|||||||
- clang
|
- clang
|
||||||
before_script:
|
before_script:
|
||||||
- cd ..
|
- cd ..
|
||||||
- git clone --depth=1 --branch=1.7-dev https://github.com/alliedmodders/sourcemod sourcemod-1.7
|
- git clone --depth=1 --branch=1.8-dev --recursive https://github.com/alliedmodders/sourcemod sourcemod-1.8
|
||||||
- git clone --depth=1 --branch=master https://github.com/alliedmodders/ambuild
|
- git clone --depth=1 --branch=master --recursive https://github.com/alliedmodders/ambuild
|
||||||
- cd ambuild && python setup.py install --user
|
- cd ambuild && python setup.py install --user
|
||||||
- cd $TRAVIS_BUILD_DIR
|
- cd $TRAVIS_BUILD_DIR
|
||||||
- git fetch --unshallow || true
|
- git fetch --unshallow || true
|
||||||
|
@ -32,7 +32,7 @@ class SM:
|
|||||||
self.compiler.DetectAll(AMBuild)
|
self.compiler.DetectAll(AMBuild)
|
||||||
|
|
||||||
#Detect variables
|
#Detect variables
|
||||||
envvars = { 'SOURCEMOD': 'sourcemod-1.7' }
|
envvars = { 'SOURCEMOD': 'sourcemod-1.8' }
|
||||||
|
|
||||||
# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
|
# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
|
||||||
def findDictByKey(dictionary, key, value):
|
def findDictByKey(dictionary, key, value):
|
||||||
|
@ -4,7 +4,7 @@ environment:
|
|||||||
GYP_MSVS_VERSION: '2015'
|
GYP_MSVS_VERSION: '2015'
|
||||||
install:
|
install:
|
||||||
- cd ..
|
- cd ..
|
||||||
- git clone --depth=1 --branch=1.7-dev https://github.com/alliedmodders/sourcemod sourcemod-1.7
|
- git clone --depth=1 --branch=1.8-dev --recursive https://github.com/alliedmodders/sourcemod sourcemod-1.8
|
||||||
- git clone --depth=1 --branch=master https://github.com/alliedmodders/ambuild
|
- git clone --depth=1 --branch=master https://github.com/alliedmodders/ambuild
|
||||||
- cd ambuild
|
- cd ambuild
|
||||||
- C:\python27\python.exe setup.py install
|
- C:\python27\python.exe setup.py install
|
||||||
|
@ -15,7 +15,7 @@ def BuildEverything():
|
|||||||
|
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD'], 'public'))
|
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD'], 'public'))
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD'], 'public', 'extensions'))
|
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD'], 'public', 'extensions'))
|
||||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD'], 'public', 'sourcepawn'))
|
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD'], 'sourcepawn', 'include'))
|
||||||
|
|
||||||
if AMBuild.target['platform'] in ['linux']:
|
if AMBuild.target['platform'] in ['linux']:
|
||||||
compiler['POSTLINKFLAGS'].append('-lm')
|
compiler['POSTLINKFLAGS'].append('-lm')
|
||||||
|
@ -19,6 +19,12 @@
|
|||||||
|
|
||||||
#include "extension.h"
|
#include "extension.h"
|
||||||
|
|
||||||
|
#ifndef PLATFORM_ARCH_FOLDER
|
||||||
|
#define PLATFORM_ARCH_FOLDER ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sp_vm_api.h>
|
||||||
|
|
||||||
#include <IWebternet.h>
|
#include <IWebternet.h>
|
||||||
#include "MemoryDownloader.h"
|
#include "MemoryDownloader.h"
|
||||||
|
|
||||||
@ -122,6 +128,7 @@ char crashGamePath[512];
|
|||||||
char crashCommandLine[1024];
|
char crashCommandLine[1024];
|
||||||
char crashSourceModPath[512];
|
char crashSourceModPath[512];
|
||||||
char crashGameDirectory[256];
|
char crashGameDirectory[256];
|
||||||
|
char crashSourceModVersion[32];
|
||||||
char steamInf[1024];
|
char steamInf[1024];
|
||||||
|
|
||||||
char dumpStoragePath[512];
|
char dumpStoragePath[512];
|
||||||
@ -129,22 +136,6 @@ char logPath[512];
|
|||||||
|
|
||||||
google_breakpad::ExceptionHandler *handler = NULL;
|
google_breakpad::ExceptionHandler *handler = NULL;
|
||||||
|
|
||||||
# if 0
|
|
||||||
struct PluginInfo {
|
|
||||||
unsigned int serial;
|
|
||||||
PluginStatus status;
|
|
||||||
char filename[256];
|
|
||||||
char name[256];
|
|
||||||
char author[256];
|
|
||||||
char description[256];
|
|
||||||
char version[256];
|
|
||||||
char url[256];
|
|
||||||
};
|
|
||||||
|
|
||||||
unsigned int plugin_count;
|
|
||||||
PluginInfo plugins[256];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined _LINUX
|
#if defined _LINUX
|
||||||
void terminateHandler()
|
void terminateHandler()
|
||||||
{
|
{
|
||||||
@ -212,6 +203,10 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
|
|||||||
sys_write(extra, crashSourceModPath, my_strlen(crashSourceModPath));
|
sys_write(extra, crashSourceModPath, my_strlen(crashSourceModPath));
|
||||||
sys_write(extra, "\nGameDirectory=", 15);
|
sys_write(extra, "\nGameDirectory=", 15);
|
||||||
sys_write(extra, crashGameDirectory, my_strlen(crashGameDirectory));
|
sys_write(extra, crashGameDirectory, my_strlen(crashGameDirectory));
|
||||||
|
if (crashSourceModVersion[0]) {
|
||||||
|
sys_write(extra, "\nSourceModVersion=", 18);
|
||||||
|
sys_write(extra, crashSourceModVersion, my_strlen(crashSourceModVersion));
|
||||||
|
}
|
||||||
sys_write(extra, "\nExtensionVersion=", 18);
|
sys_write(extra, "\nExtensionVersion=", 18);
|
||||||
sys_write(extra, SM_VERSION, my_strlen(SM_VERSION));
|
sys_write(extra, SM_VERSION, my_strlen(SM_VERSION));
|
||||||
sys_write(extra, "\nExtensionBuild=", 16);
|
sys_write(extra, "\nExtensionBuild=", 16);
|
||||||
@ -1188,6 +1183,38 @@ bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
#error Bad platform.
|
#error Bad platform.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
do {
|
||||||
|
char spJitPath[512];
|
||||||
|
g_pSM->BuildPath(Path_SM, spJitPath, sizeof(spJitPath), "bin/" PLATFORM_ARCH_FOLDER "sourcepawn.jit.x86." PLATFORM_LIB_EXT);
|
||||||
|
|
||||||
|
char spJitError[255];
|
||||||
|
std::unique_ptr<ILibrary> spJit(libsys->OpenLibrary(spJitPath, spJitError, sizeof(spJitError)));
|
||||||
|
if (!spJit) {
|
||||||
|
smutils->LogMessage(myself, "WARNING: Failed to load SourcePawn library %s: %s", spJitPath, spJitError);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetSourcePawnFactoryFn factoryFn = (GetSourcePawnFactoryFn)spJit->GetSymbolAddress("GetSourcePawnFactory");
|
||||||
|
if (!factoryFn) {
|
||||||
|
smutils->LogMessage(myself, "WARNING: SourcePawn library is out of date: No factory function.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ISourcePawnFactory *spFactory = factoryFn(0x0207);
|
||||||
|
if (!spFactory) {
|
||||||
|
smutils->LogMessage(myself, "WARNING: SourcePawn library is out of date: Failed to get version 2.7", 0x0207);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ISourcePawnEnvironment *spEnvironment = spFactory->CurrentEnvironment();
|
||||||
|
if (!spEnvironment) {
|
||||||
|
smutils->LogMessage(myself, "WARNING: Could not get SourcePawn environment.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy(crashSourceModVersion, spEnvironment->APIv2()->GetVersionString(), sizeof(crashSourceModVersion));
|
||||||
|
} while(false);
|
||||||
|
|
||||||
plsys->AddPluginsListener(this);
|
plsys->AddPluginsListener(this);
|
||||||
|
|
||||||
IPluginIterator *iterator = plsys->GetPluginIterator();
|
IPluginIterator *iterator = plsys->GetPluginIterator();
|
||||||
|
Loading…
Reference in New Issue
Block a user