Merge
This commit is contained in:
commit
46095d797c
@ -40,7 +40,9 @@
|
||||
* @file Contains SourceMod version information.
|
||||
*/
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
|
||||
|
@ -487,6 +487,21 @@ static cell_t sm_FileSize(IPluginContext *pContext, const cell_t *params)
|
||||
#endif
|
||||
}
|
||||
|
||||
static cell_t sm_CreateDirectory(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *name;
|
||||
char realpath[PLATFORM_MAX_PATH];
|
||||
|
||||
pContext->LocalToString(params[1], &name);
|
||||
g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name);
|
||||
|
||||
#if defined PLATFORM_WINDOWS
|
||||
return mkdir(realpath) == 0;
|
||||
#else
|
||||
return mkdir(realpath, params[2]) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static cell_t sm_RemoveDir(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *name;
|
||||
@ -959,5 +974,6 @@ REGISTER_NATIVES(filesystem)
|
||||
{"WriteFileString", sm_WriteFileString},
|
||||
{"AddGameLogHook", sm_AddGameLogHook},
|
||||
{"RemoveGameLogHook", sm_RemoveGameLogHook},
|
||||
{"CreateDirectory", sm_CreateDirectory},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
@ -910,6 +910,15 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident)
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove it from the type cache. */
|
||||
if (pType->nameIdx != -1)
|
||||
{
|
||||
const char *typeName;
|
||||
|
||||
typeName = m_strtab->GetString(pType->nameIdx);
|
||||
sm_trie_delete(m_TypeLookup, typeName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
|
||||
#define _INCLUDE_BINTOOLS_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_BINTOOLS_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_GEOIP_VERSION_H_
|
||||
#define _INCLUDE_GEOIP_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_GEOIP_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
|
||||
#define _INCLUDE_MYSQLEXT_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_REGEXEXT_VERSION_H_
|
||||
#define _INCLUDE_REGEXEXT_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_REGEXEXT_VERSION_H_
|
||||
|
@ -82,6 +82,8 @@ extern sp_nativeinfo_t g_TeamNatives[];
|
||||
|
||||
bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
{
|
||||
HandleError err;
|
||||
|
||||
if (!gameconfs->LoadGameConfigFile(SDKTOOLS_GAME_FILE, &g_pGameConf, error, maxlength))
|
||||
{
|
||||
return false;
|
||||
@ -102,14 +104,26 @@ bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
SM_GET_IFACE(GAMEHELPERS, g_pGameHelpers);
|
||||
|
||||
playerhelpers->AddClientListener(&g_SdkTools);
|
||||
g_CallHandle = handlesys->CreateType("ValveCall", this, 0, NULL, NULL, myself->GetIdentity(), NULL);
|
||||
g_CallHandle = handlesys->CreateType("ValveCall", this, 0, NULL, NULL, myself->GetIdentity(), &err);
|
||||
if (g_CallHandle == 0)
|
||||
{
|
||||
snprintf(error, maxlength, "Could not create call handle type (err: %d)", err);
|
||||
return false;
|
||||
}
|
||||
|
||||
TypeAccess TraceAccess;
|
||||
handlesys->InitAccessDefaults(&TraceAccess, NULL);
|
||||
TraceAccess.ident = myself->GetIdentity();
|
||||
TraceAccess.access[HTypeAccess_Create] = true;
|
||||
TraceAccess.access[HTypeAccess_Inherit] = true;
|
||||
g_TraceHandle = handlesys->CreateType("TraceRay", this, 0, &TraceAccess, NULL, myself->GetIdentity(), NULL);
|
||||
g_TraceHandle = handlesys->CreateType("TraceRay", this, 0, &TraceAccess, NULL, myself->GetIdentity(), &err);
|
||||
if (g_TraceHandle == 0)
|
||||
{
|
||||
handlesys->RemoveType(g_CallHandle, myself->GetIdentity());
|
||||
g_CallHandle = 0;
|
||||
snprintf(error, maxlength, "Could not create traceray handle type (err: %d)", err);
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined ORANGEBOX_BUILD
|
||||
g_pCVar = icvar;
|
||||
@ -186,6 +200,23 @@ void SDKTools::SDK_OnUnload()
|
||||
SH_RELEASE_CALLCLASS(enginesoundPatch);
|
||||
enginesoundPatch = NULL;
|
||||
}
|
||||
|
||||
bool err;
|
||||
if (g_CallHandle != 0)
|
||||
{
|
||||
if ((err = handlesys->RemoveType(g_CallHandle, myself->GetIdentity())) != true)
|
||||
{
|
||||
g_pSM->LogError(myself, "Could not remove call handle (type=%x, err=%d)", g_CallHandle, err);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_TraceHandle != 0)
|
||||
{
|
||||
if ((err = handlesys->RemoveType(g_TraceHandle, myself->GetIdentity())) != true)
|
||||
{
|
||||
g_pSM->LogError(myself, "Could not remove trace handle (type=%x, err=%d)", g_TraceHandle, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late)
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_SQLITEEXT_VERSION_H_
|
||||
#define _INCLUDE_SQLITEEXT_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SQLITEEXT_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||
|
@ -36,7 +36,9 @@
|
||||
#ifndef _INCLUDE_SQLITEEXT_VERSION_H_
|
||||
#define _INCLUDE_SQLITEEXT_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SQLITEEXT_VERSION_H_
|
||||
|
@ -40,7 +40,9 @@
|
||||
* @file Contains SourceMod version information.
|
||||
*/
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2230
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
|
||||
|
@ -353,6 +353,25 @@ native FlushFile(Handle:file);
|
||||
*/
|
||||
native bool:RemoveDir(const String:path[]);
|
||||
|
||||
#define FPERM_U_READ 0x0100 /* User can read. */
|
||||
#define FPERM_U_WRITE 0x0080 /* User can write. */
|
||||
#define FPERM_U_EXEC 0x0040 /* User can exec. */
|
||||
#define FPERM_G_READ 0x0020 /* Group can read. */
|
||||
#define FPERM_G_WRITE 0x0010 /* Group can write. */
|
||||
#define FPERM_G_EXEC 0x0008 /* Group can exec. */
|
||||
#define FPERM_O_READ 0x0004 /* Anyone can read. */
|
||||
#define FPERM_O_WRITE 0x0002 /* Anyone can write. */
|
||||
#define FPERM_O_EXEC 0x0001 /* Anyone can exec. */
|
||||
|
||||
/**
|
||||
* Creates a directory.
|
||||
*
|
||||
* @param path Path to create.
|
||||
* @param mode Permissions (default is o=rx,g=rx,u=rwx). Note that folders must have
|
||||
* the execute bit set on Linux. On Windows, the mode is ignored.
|
||||
*/
|
||||
native bool:CreateDirectory(const String:path[], mode);
|
||||
|
||||
/**
|
||||
* Returns a file timestamp as a unix timestamp.
|
||||
*
|
||||
|
@ -39,4 +39,4 @@
|
||||
#define SOURCEMOD_V_MINOR 1 /**< SourceMod Minor version */
|
||||
#define SOURCEMOD_V_RELEASE 0 /**< SourceMod Release version */
|
||||
|
||||
#define SOURCEMOD_VERSION "1.1.0-svn" /**< SourceMod version string (major.minor.release.build) */
|
||||
#define SOURCEMOD_VERSION "1.1.0" /**< SourceMod version string (major.minor.release.build) */
|
||||
|
@ -19,7 +19,9 @@
|
||||
* @file Contains SourceMod version information.
|
||||
*/
|
||||
|
||||
#define SVN_FULL_VERSION "1.1.0-svn"
|
||||
#define SVN_FILE_VERSION 1,1,0,2139
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
|
||||
|
@ -32,7 +32,9 @@
|
||||
#ifndef _INCLUDE_JIT_VERSION_H_
|
||||
#define _INCLUDE_JIT_VERSION_H_
|
||||
|
||||
#define SVN_FULL_VERSION "1.2.0-svn"
|
||||
#define SVN_FILE_VERSION 1,2,0,2218
|
||||
#define SM_BUILD_STRING ""
|
||||
#define SM_BUILD_UNIQUEID "2302:54350d76a097" SM_BUILD_STRING
|
||||
#define SVN_FULL_VERSION "1.1.0" SM_BUILD_STRING
|
||||
#define SVN_FILE_VERSION 1,1,0,0
|
||||
|
||||
#endif //_INCLUDE_JIT_VERSION_H_
|
||||
|
@ -2647,6 +2647,10 @@ jit_rewind:
|
||||
/* Write these last because error jumps should be predicted forwardly (not taken) */
|
||||
WriteErrorRoutines(data, jit);
|
||||
|
||||
AlignMe(jit);
|
||||
data->jit_sysreq_c = jit->get_outputpos();
|
||||
WriteOp_Sysreq_C_Function(jit);
|
||||
|
||||
/* Build thunk tables */
|
||||
if (data->num_thunks > data->max_thunks)
|
||||
{
|
||||
@ -2709,6 +2713,10 @@ jit_rewind:
|
||||
/* Write these last because error jumps should be predicted as not taken (forward) */
|
||||
WriteErrorRoutines(data, jit);
|
||||
|
||||
AlignMe(jit);
|
||||
data->jit_sysreq_c = jit->get_outputpos();
|
||||
WriteOp_Sysreq_C_Function(jit);
|
||||
|
||||
/* Write the thunk offsets. */
|
||||
for (unsigned int i = 0; i < data->num_thunks; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user