diff --git a/loader/loader.cpp b/loader/loader.cpp index 1f90a58d..4ab3699a 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -68,6 +68,7 @@ #define FILENAME_1_6_EP1 "sourcemod.2.ep1" PLATFORM_EXT HINSTANCE g_hCore = NULL; +bool load_attempted = false; size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) { @@ -140,6 +141,8 @@ bool GetFileOfAddress(void *pAddr, char *buffer, size_t maxlength) DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, const MetamodLoaderInfo *mli) { char *filename; + + load_attempted = true; if (mvi->api_major > METAMOD_API_MAJOR) { @@ -182,7 +185,15 @@ DLL_EXPORT void UnloadInterface_MMS() DLL_EXPORT void *CreateInterface(const char *iface, int *ret) { - if (strcmp(iface, METAMOD_PLAPI_NAME)) + /** + * If a load has already been attempted, bail out immediately. + */ + if (load_attempted) + { + return NULL; + } + + if (strcmp(iface, METAMOD_PLAPI_NAME) == 0) { char thisfile[256]; char targetfile[256]; diff --git a/loader/msvc8/loader.vcproj b/loader/msvc8/loader.vcproj index a9a524e1..0d48a624 100644 --- a/loader/msvc8/loader.vcproj +++ b/loader/msvc8/loader.vcproj @@ -1,7 +1,7 @@ + + diff --git a/loader/svn_version.h b/loader/svn_version.h new file mode 100644 index 00000000..fc40f58b --- /dev/null +++ b/loader/svn_version.h @@ -0,0 +1,46 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod + * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +/** + * Autogenerated by build scripts + */ + +#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ +#define _INCLUDE_SOURCEMOD_VERSION_H_ + +/** + * @file Contains SourceMod version information. + */ + +#define SVN_FULL_VERSION "1.0.0.1336" +#define SVN_FILE_VERSION 1,0,0,1336 + +#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/loader/svn_version.tpl b/loader/svn_version.tpl new file mode 100644 index 00000000..611663dc --- /dev/null +++ b/loader/svn_version.tpl @@ -0,0 +1,46 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod + * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +/** + * Autogenerated by build scripts + */ + +#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ +#define _INCLUDE_SOURCEMOD_VERSION_H_ + +/** + * @file Contains SourceMod version information. + */ + +#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$" +#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ + +#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/loader/version.rc b/loader/version.rc new file mode 100644 index 00000000..946552e0 --- /dev/null +++ b/loader/version.rc @@ -0,0 +1,104 @@ +// Microsoft Visual C++ generated resource script. +// +//#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +#include "svn_version.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION SVN_FILE_VERSION + PRODUCTVERSION SVN_FILE_VERSION + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "Comments", "SourceMod Loader" + VALUE "FileDescription", "SourceMod Loader" + VALUE "FileVersion", SVN_FULL_VERSION + VALUE "InternalName", "sourcemod" + VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC" + VALUE "OriginalFilename", "sourcemod_mm.dll" + VALUE "ProductName", "SourceMod Loader" + VALUE "ProductVersion", SVN_FULL_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED +