Compare commits
81
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34b5caf464 | ||
|
|
ecae5b0479 | ||
|
|
1ab9dc141f | ||
|
|
6a8529460f | ||
|
|
c63e2b318f | ||
|
|
c4a3c421ff | ||
|
|
cb3d03d699 | ||
|
|
faad5ff3ea | ||
|
|
cc02c00fd4 | ||
|
|
2bedba3f2c | ||
|
|
369f96ddfb | ||
|
|
ab1fb8309e | ||
|
|
5e9f27fe6d | ||
|
|
b8e4510f7e | ||
|
|
0d69ce8b9a | ||
|
|
a66f93b64b | ||
|
|
702ac32bc0 | ||
|
|
97c9cc9b23 | ||
|
|
f38f097396 | ||
|
|
b10edfa86f | ||
|
|
cf92376962 | ||
|
|
92d8d96cd9 | ||
|
|
ce7a98dffa | ||
|
|
f3af8539d2 | ||
|
|
35e12b16ba | ||
|
|
6e9c95034e | ||
|
|
34968def58 | ||
|
|
4800732c00 | ||
|
|
7d7bf38941 | ||
|
|
5c13a0bc69 | ||
|
|
3e63e611c2 | ||
|
|
c3598d8e71 | ||
|
|
f57097651b | ||
|
|
a5450aad18 | ||
|
|
0a4a06d9e1 | ||
|
|
dd51da519d | ||
|
|
c79f52e2c9 | ||
|
|
c4279da3b2 | ||
|
|
3923177037 | ||
|
|
80a0e24b66 | ||
|
|
75d770ba0f | ||
|
|
d9e6daa006 | ||
|
|
f08b60bc98 | ||
|
|
4d98fc2a3d | ||
|
|
0b4ec459d3 | ||
|
|
65269551f9 | ||
|
|
47b0022331 | ||
|
|
7df2b28fe0 | ||
|
|
7df1069613 | ||
|
|
7585acaeef | ||
|
|
dfcf953131 | ||
|
|
cb31a65807 | ||
|
|
6123c5e013 | ||
|
|
cb73b935ec | ||
|
|
76e8e7e50c | ||
|
|
40d049e1f6 | ||
|
|
48012ccf08 | ||
|
|
80ceb149b0 | ||
|
|
1ef60a13d0 | ||
|
|
e8e40d126e | ||
|
|
c7033827f5 | ||
|
|
ff27214615 | ||
|
|
7b45e963d5 | ||
|
|
96965ef7cd | ||
|
|
8f7ce184fb | ||
|
|
4bed0a2893 | ||
|
|
6ab2e23d9d | ||
|
|
dd27de8d85 | ||
|
|
8c79a6df33 | ||
|
|
e8111f3c0a | ||
|
|
a038181193 | ||
|
|
52fe916311 | ||
|
|
d01d7b1879 | ||
|
|
d8406a3efc | ||
|
|
d74204aded | ||
|
|
77be859667 | ||
|
|
71193c67b2 | ||
|
|
cc1493aa66 | ||
|
|
43946e6b6f | ||
|
|
5776909b13 | ||
|
|
048c227fcc |
@@ -381,6 +381,9 @@ class SMConfig(object):
|
||||
if builder.target_platform in ['linux', 'mac']:
|
||||
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
|
||||
|
||||
if sdk.name == 'csgo' and builder.target_platform == 'linux':
|
||||
compiler.linkflags += ['-lstdc++']
|
||||
|
||||
for path in paths:
|
||||
compiler.cxxincludes += [os.path.join(sdk.path, *path)]
|
||||
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
SourceMod Changelog
|
||||
|
||||
SourceMod 1.6.3 [2014-11-25]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.6.3_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated game support for TF2, CS:GO, No More Room in Hell, Insurgency, PVK2 and Fistful of Frags.
|
||||
- Made changes to make TF2, CSS, DoDS, HL2DM, and SDK 2013 mods less likely to break on game update (PR 174, PR 192).
|
||||
- Added support for longer key names in languages.cfg (to fix Portuguese) (bug 6282, PR 208).
|
||||
|
||||
Developer Changes:
|
||||
- Updated TF2 player condition and holiday enums (Ross "Powerlord" Bemrose) (PR 183, PR 181).
|
||||
- Add support for TF2 player conditions >= 96 for condition functions/forwards (PR 205).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.6.2 [2014-09-20]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.6.2_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated game support for TF2, CS:GO, No More Room in Hell and Fistful of Frags.
|
||||
- Added compatibility shim to force Steam player auth strings to be in "Steam2" rendered format (PR 136).
|
||||
- Fixed possible performance regression in DBI handling.
|
||||
|
||||
Developer Changes:
|
||||
- Added new GetClientAuthId native to retrieve player auth strings in desired format (PR 159).
|
||||
- Updated TF2 weapon and player condition enums (FlaminSarge).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.6.1 [2014-08-17]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.6.1_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated game support for CS:GO and Fistful of Frags.
|
||||
- Added support for Romanian language.
|
||||
- Re-added languages.cfg, missing from 1.6.0, causing all clients to use server language.
|
||||
- Fixed a regression in version 1.6.0 that caused certain SDKHooks usage patterns to cause a server crash (PR 107).
|
||||
- Improved error reporting in basebans plugin when banreasons.txt is missing (PR 115).
|
||||
- Fixed incorrect logged gravity value for sm_gravity command (Ryan "VoiDeD" Stecker) (PR 116).
|
||||
- Fixed a regression in version 1.6.0 causing SDKHook_ReloadPost hooks to not fire in plugins (Peace-Maker) (PR 96).
|
||||
- Added workaround for game bug in TF2_RemoveWeaponSlot to avoid wearable entities left on map (Ryan "VoiDeD" Stecker) (bug 6206, PR 121).
|
||||
- Removed DisableJIT option from core.cfg. (It was never meant for normal use.)
|
||||
|
||||
Developer Changes:
|
||||
- Added new TF2_RemoveWearable native (Ryan "VoiDeD" Stecker, WildCard65) (PR 114).
|
||||
- Added new functions for interacting with and playing scripted game sounds (Ross "Powerlord" Bemrose) (bug 5942, PR 65).
|
||||
- Added new StringToKeyValues natives (Ryan "VoiDeD" Stecker) (PR 74).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.6.0 [2014-07-03]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.6.0_Release_Notes
|
||||
|
||||
@@ -132,13 +132,5 @@
|
||||
* passed. You can disable this feature by setting the value to "0".
|
||||
*/
|
||||
"SlowScriptTimeout" "8"
|
||||
|
||||
/**
|
||||
* Disable the SourcePawn just-in-time compiler. This is intended for C++ developers using
|
||||
* debugging tools and finding it difficult to inspect JIT stack frames. The interpreter
|
||||
* is not as well-tested as the JIT and will make script execution roughly 10X slower, so
|
||||
* it is not intended for general purpose use.
|
||||
*/
|
||||
"DisableJIT" "no"
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -52,17 +52,14 @@ for sdk_name in SM.sdks:
|
||||
compiler = binary.compiler
|
||||
|
||||
if sdk.name == 'csgo':
|
||||
# Protobuf 2.3 headers have some signed/unsigned compares. I believe that it's fixed in later versions, but Valve.
|
||||
if compiler.cxx.behavior == 'gcc':
|
||||
compiler.cflags += ['-Wno-sign-compare']
|
||||
compiler.cxxincludes += [
|
||||
os.path.join(sdk.path, 'common', 'protobuf-2.3.0', 'src'),
|
||||
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf')
|
||||
]
|
||||
elif sdk.name == 'dota':
|
||||
compiler.cxxincludes += [
|
||||
os.path.join(sdk.path, 'common', 'protobuf-2.4.1', 'src'),
|
||||
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf')
|
||||
@@ -109,6 +106,7 @@ for sdk_name in SM.sdks:
|
||||
binary.sources += [
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'networkbasetypes.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'network_connection.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf', 'ai_activity.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf', 'usermessages.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_commonmessages.pb.cc'),
|
||||
|
||||
+12
-2
@@ -648,8 +648,11 @@ QueryCvarCookie_t ConVarManager::QueryClientConVar(edict_t *pPlayer, const char
|
||||
return InvalidQueryCvarCookie;
|
||||
}
|
||||
|
||||
ConVarQuery query = {cookie, pCallback, (cell_t)hndl, IndexOfEdict(pPlayer)};
|
||||
m_ConVarQueries.push_back(query);
|
||||
if (pCallback != NULL)
|
||||
{
|
||||
ConVarQuery query = { cookie, pCallback, (cell_t) hndl, IndexOfEdict(pPlayer) };
|
||||
m_ConVarQueries.push_back(query);
|
||||
}
|
||||
#endif
|
||||
|
||||
return cookie;
|
||||
@@ -753,6 +756,13 @@ void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, CEntityIn
|
||||
void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
|
||||
#endif // SE_DOTA
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
if (g_Players.HandleConVarQuery(cookie, pPlayer, result, cvarName, cvarValue))
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
IPluginFunction *pCallback = NULL;
|
||||
cell_t value = 0;
|
||||
List<ConVarQuery>::iterator iter;
|
||||
|
||||
@@ -155,7 +155,7 @@ void EventManager::FireGameEvent(IGameEvent *pEvent)
|
||||
Just need to add ourselves as a listener to make our hook on IGameEventManager2::FireEvent work */
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD && SOURCE_ENGINE != SE_DOTA
|
||||
int EventManager::GetEventDebugID()
|
||||
{
|
||||
return EVENT_DEBUG_ID_INIT;
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public: // IPluginsListener
|
||||
void OnPluginUnloaded(IPlugin *plugin);
|
||||
public: // IGameEventListener2
|
||||
void FireGameEvent(IGameEvent *pEvent);
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD && SOURCE_ENGINE != SE_DOTA
|
||||
int GetEventDebugID();
|
||||
#endif
|
||||
public:
|
||||
|
||||
+26
-11
@@ -153,6 +153,18 @@ void CHalfLife2::OnSourceModAllInitialized_Post()
|
||||
|
||||
void CHalfLife2::InitLogicalEntData()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_DODS \
|
||||
|| SOURCE_ENGINE == SE_HL2DM \
|
||||
|| SOURCE_ENGINE == SE_CSS \
|
||||
|| SOURCE_ENGINE == SE_SDK2013
|
||||
|
||||
if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", NULL))
|
||||
{
|
||||
g_EntList = servertools->GetEntityList();
|
||||
}
|
||||
#endif
|
||||
|
||||
char *addr = NULL;
|
||||
|
||||
/*
|
||||
@@ -162,21 +174,24 @@ void CHalfLife2::InitLogicalEntData()
|
||||
* If symbols aren't present (Windows or stripped Linux/Mac),
|
||||
* attempt find via LevelShutdown + offset
|
||||
*/
|
||||
if (g_pGameConf->GetMemSig("gEntList", (void **)&addr))
|
||||
if (!g_EntList)
|
||||
{
|
||||
#if !defined PLATFORM_WINDOWS
|
||||
if (!addr)
|
||||
if (g_pGameConf->GetMemSig("gEntList", (void **) &addr))
|
||||
{
|
||||
// Key exists so notify if lookup fails, but try other method.
|
||||
g_Logger.LogError("Failed lookup of gEntList directly - Reverting to lookup via LevelShutdown");
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
g_EntList = reinterpret_cast<void *>(addr);
|
||||
#if !defined PLATFORM_WINDOWS
|
||||
}
|
||||
if (!addr)
|
||||
{
|
||||
// Key exists so notify if lookup fails, but try other method.
|
||||
g_Logger.LogError("Failed lookup of gEntList directly - Reverting to lookup via LevelShutdown");
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
g_EntList = reinterpret_cast<void *>(addr);
|
||||
#if !defined PLATFORM_WINDOWS
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_EntList)
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
#include "logic_bridge.h"
|
||||
#include <sourcemod_version.h>
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#include <steam/steamclientpublic.h>
|
||||
#endif
|
||||
|
||||
class CSteamID;
|
||||
|
||||
PlayerManager g_Players;
|
||||
bool g_OnMapStarted = false;
|
||||
IForward *PreAdminCheck = NULL;
|
||||
@@ -399,15 +405,28 @@ void PlayerManager::RunAuthChecks()
|
||||
{
|
||||
CPlayer *pPlayer;
|
||||
const char *authstr;
|
||||
const CSteamID *steamid = NULL;
|
||||
unsigned int removed = 0;
|
||||
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
|
||||
{
|
||||
pPlayer = &m_Players[m_AuthQueue[i]];
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
steamid = engine->GetClientSteamID(pPlayer->m_iIndex);
|
||||
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_iIndex - 1);
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
steamid = engine->GetClientSteamID(pPlayer->m_pEdict);
|
||||
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_pEdict);
|
||||
#else
|
||||
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_pEdict);
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
if (authstr && authstr[0] == '[' && steamid)
|
||||
{
|
||||
authstr = steamid->Render();
|
||||
}
|
||||
#endif
|
||||
|
||||
pPlayer->SetAuthString(authstr);
|
||||
|
||||
if (!pPlayer->IsAuthStringValidated())
|
||||
@@ -502,6 +521,9 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
|
||||
/* Get the client's language */
|
||||
if (m_QueryLang)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
pPlayer->m_LangId = translator->GetServerLanguage();
|
||||
#else
|
||||
const char *name;
|
||||
if (!pPlayer->IsFakeClient() && (name=engine->GetClientConVarValue(client, "cl_language")))
|
||||
{
|
||||
@@ -510,6 +532,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
|
||||
} else {
|
||||
pPlayer->m_LangId = translator->GetServerLanguage();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
List<IClientListener *>::iterator iter;
|
||||
@@ -727,6 +750,13 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
}
|
||||
pPlayer->Authorize_Post();
|
||||
}
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
else
|
||||
{
|
||||
// Not a bot
|
||||
pPlayer->m_LanguageCookie = g_ConVarManager.QueryClientConVar(pEntity, "cl_language", NULL, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (playerinfo)
|
||||
{
|
||||
@@ -1862,6 +1892,24 @@ void CmdMaxplayersCallback()
|
||||
g_Players.MaxPlayersChanged();
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
bool PlayerManager::HandleConVarQuery(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
|
||||
{
|
||||
for (int i = 1; i <= m_maxClients; i++)
|
||||
{
|
||||
if (m_Players[i].m_LanguageCookie == cookie)
|
||||
{
|
||||
unsigned int langid;
|
||||
m_Players[i].m_LangId = (translator->GetLanguageByName(cvarValue, &langid)) ? langid : translator->GetServerLanguage();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************
|
||||
*** PLAYER CODE ***
|
||||
@@ -1886,6 +1934,9 @@ CPlayer::CPlayer()
|
||||
m_bIsReplay = false;
|
||||
m_Serial.value = -1;
|
||||
m_SteamAccountID = 0;
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|
||||
@@ -1966,6 +2017,9 @@ void CPlayer::Disconnect()
|
||||
m_bIsReplay = false;
|
||||
m_Serial.value = -1;
|
||||
m_SteamAccountID = 0;
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CPlayer::SetName(const char *name)
|
||||
@@ -2401,3 +2455,28 @@ void CPlayer::PrintToConsole(const char *pMsg)
|
||||
engine->ClientPrintf(m_pEdict, pMsg);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||
const EUniverse kCurrentSteamUniverse = k_EUniversePublic;
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
const EUniverse kCurrentSteamUniverse = k_EUniverseInvalid;
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
const char *CSteamID::Render() const
|
||||
{
|
||||
static char szSteamID[64];
|
||||
|
||||
switch (GetEAccountType())
|
||||
{
|
||||
case k_EAccountTypeInvalid:
|
||||
case k_EAccountTypeIndividual:
|
||||
snprintf(szSteamID, sizeof(szSteamID), "STEAM_%u:%u:%u", kCurrentSteamUniverse, GetAccountID() % 2, GetAccountID() >> 1);
|
||||
break;
|
||||
default:
|
||||
szSteamID[0] = '\0';
|
||||
}
|
||||
|
||||
return szSteamID;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -131,6 +131,9 @@ private:
|
||||
bool m_bIsReplay;
|
||||
serial_t m_Serial;
|
||||
unsigned int m_SteamAccountID;
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
QueryCvarCookie_t m_LanguageCookie;
|
||||
#endif
|
||||
};
|
||||
|
||||
class PlayerManager :
|
||||
@@ -211,6 +214,9 @@ public:
|
||||
unsigned int GetReplyTo();
|
||||
unsigned int SetReplyTo(unsigned int reply);
|
||||
void MaxPlayersChanged(int newvalue = -1);
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
bool HandleConVarQuery(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue);
|
||||
#endif
|
||||
private:
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void OnServerActivate();
|
||||
|
||||
@@ -19,6 +19,12 @@ if builder.target_platform == 'linux':
|
||||
elif builder.target_platform == 'mac':
|
||||
binary.compiler.cflags += ['-Wno-deprecated-declarations']
|
||||
binary.compiler.postlink += ['-framework', 'CoreServices']
|
||||
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
binary.sources += [
|
||||
'common_logic.cpp',
|
||||
'smn_adt_array.cpp',
|
||||
|
||||
@@ -615,6 +615,17 @@ void DBManager::ThreadMain()
|
||||
ke::AutoLock lock(&m_ThinkLock);
|
||||
m_ThinkQueue.push(op);
|
||||
}
|
||||
|
||||
|
||||
if (!m_Terminate)
|
||||
{
|
||||
ke::AutoUnlock unlock(&m_QueueEvent);
|
||||
#ifdef _WIN32
|
||||
Sleep(20);
|
||||
#else
|
||||
usleep(20000);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Terminate)
|
||||
|
||||
@@ -887,6 +887,14 @@ SMCResult Translator::ReadSMC_LeavingSection(const SMCStates *states)
|
||||
|
||||
SMCResult Translator::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
|
||||
{
|
||||
size_t len = strlen(key);
|
||||
|
||||
if (len >= sizeof(((Language *)0)->m_code2))
|
||||
{
|
||||
smcore.LogError("[SM] Warning encountered parsing languages.cfg file.");
|
||||
smcore.LogError("[SM] Invalid language code \"%s\" is too long.", key);
|
||||
}
|
||||
|
||||
AddLanguage(key, value);
|
||||
|
||||
return SMCResult_Continue;
|
||||
|
||||
@@ -54,7 +54,7 @@ enum PhraseParseState
|
||||
|
||||
struct Language
|
||||
{
|
||||
char m_code2[4];
|
||||
char m_code2[32];
|
||||
int m_CanonicalName;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,9 +35,11 @@
|
||||
#include "PlayerManager.h"
|
||||
#include "HalfLife2.h"
|
||||
|
||||
#include <vstdlib/random.h>
|
||||
|
||||
static cell_t SetRandomSeed(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
engrandom->SetSeed(params[1]);
|
||||
::RandomSeed(params[1]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -47,14 +49,14 @@ static cell_t GetRandomFloat(IPluginContext *pContext, const cell_t *params)
|
||||
float fMin = sp_ctof(params[1]);
|
||||
float fMax = sp_ctof(params[2]);
|
||||
|
||||
float fRandom = engrandom->RandomFloat(fMin, fMax);
|
||||
float fRandom = ::RandomFloat(fMin, fMax);
|
||||
|
||||
return sp_ftoc(fRandom);
|
||||
}
|
||||
|
||||
static cell_t GetRandomInt(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
return engrandom->RandomInt(params[1], params[2]);
|
||||
return ::RandomInt(params[1], params[2]);
|
||||
}
|
||||
|
||||
static cell_t IsMapValid(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
+28
-1
@@ -797,6 +797,32 @@ static cell_t smn_FileToKeyValues(IPluginContext *pCtx, const cell_t *params)
|
||||
return g_HL2.KVLoadFromFile(kv, basefilesystem, path);
|
||||
}
|
||||
|
||||
static cell_t smn_StringToKeyValues(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||
HandleError herr;
|
||||
HandleSecurity sec;
|
||||
KeyValueStack *pStk;
|
||||
KeyValues *kv;
|
||||
|
||||
sec.pOwner = NULL;
|
||||
sec.pIdentity = g_pCoreIdent;
|
||||
|
||||
if ((herr=handlesys->ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr);
|
||||
}
|
||||
|
||||
char *buffer;
|
||||
char *resourceName;
|
||||
pCtx->LocalToString(params[2], &buffer);
|
||||
pCtx->LocalToString(params[3], &resourceName);
|
||||
|
||||
kv = pStk->pCurRoot.front();
|
||||
return kv->LoadFromBuffer(resourceName, buffer);
|
||||
}
|
||||
|
||||
static cell_t smn_KvSetEscapeSequences(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||
@@ -1101,6 +1127,7 @@ REGISTER_NATIVES(keyvaluenatives)
|
||||
{"KvGetDataType", smn_KvGetDataType},
|
||||
{"KeyValuesToFile", smn_KeyValuesToFile},
|
||||
{"FileToKeyValues", smn_FileToKeyValues},
|
||||
{"StringToKeyValues", smn_StringToKeyValues},
|
||||
{"KvSetEscapeSequences", smn_KvSetEscapeSequences},
|
||||
{"KvDeleteThis", smn_KvDeleteThis},
|
||||
{"KvDeleteKey", smn_KvDeleteKey},
|
||||
@@ -1113,4 +1140,4 @@ REGISTER_NATIVES(keyvaluenatives)
|
||||
{"KvGetVector", smn_KvGetVector},
|
||||
{"KvSetVector", smn_KvSetVector},
|
||||
{NULL, NULL}
|
||||
};
|
||||
};
|
||||
@@ -37,6 +37,15 @@
|
||||
#include <inetchannel.h>
|
||||
#include <iclient.h>
|
||||
|
||||
#ifndef PRIu64
|
||||
#ifdef _WIN32
|
||||
#define PRIu64 "I64u"
|
||||
#else
|
||||
#define PRIu64 "llu"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static cell_t sm_GetMaxHumanPlayers(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
int maxHumans = -1;
|
||||
@@ -380,6 +389,124 @@ static cell_t RunAdminCacheChecks(IPluginContext *pContext, const cell_t *params
|
||||
return (id != pPlayer->GetAdminId()) ? 1 : 0;
|
||||
}
|
||||
|
||||
// Must match clients.inc
|
||||
enum AuthIdType
|
||||
{
|
||||
AuthType_Engine = 0,
|
||||
AuthType_Steam2,
|
||||
AuthType_Steam3,
|
||||
AuthType_SteamId64,
|
||||
};
|
||||
|
||||
static cell_t GetClientAuthId(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
|
||||
if (!pPlayer)
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
|
||||
}
|
||||
else if (!pPlayer->IsConnected())
|
||||
{
|
||||
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
|
||||
}
|
||||
|
||||
bool validate = !!params[5];
|
||||
|
||||
switch (params[2])
|
||||
{
|
||||
case AuthType_Engine:
|
||||
{
|
||||
const char *authstr;
|
||||
if (validate)
|
||||
{
|
||||
// Keep this as a validation check
|
||||
authstr = pPlayer->GetAuthString(params[5]);
|
||||
if (!authstr || authstr[0] == '\0')
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
authstr = engine->GetPlayerNetworkIDString(pPlayer->GetIndex());
|
||||
#else
|
||||
authstr = engine->GetPlayerNetworkIDString(pPlayer->GetEdict());
|
||||
#endif
|
||||
pContext->StringToLocal(params[3], params[4], authstr);
|
||||
}
|
||||
break;
|
||||
case AuthType_Steam2:
|
||||
case AuthType_Steam3:
|
||||
{
|
||||
if (pPlayer->IsFakeClient())
|
||||
{
|
||||
pContext->StringToLocal(params[3], params[4], "BOT");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static char authstr[64];
|
||||
unsigned int acctId = pPlayer->GetSteamAccountID(validate);
|
||||
if (acctId == 0)
|
||||
{
|
||||
if (g_HL2.IsLANServer())
|
||||
{
|
||||
pContext->StringToLocal(params[3], params[4], "STEAM_ID_LAN");
|
||||
return 1;
|
||||
}
|
||||
else if (!params[5])
|
||||
{
|
||||
pContext->StringToLocal(params[3], params[4], "STEAM_ID_PENDING");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (params[2] == AuthType_Steam2)
|
||||
{
|
||||
#if SOURCE_ENGINE <= SE_LEFT4DEAD
|
||||
unsigned int universe = 0;
|
||||
#else
|
||||
unsigned int universe = 1;
|
||||
#endif
|
||||
_snprintf(authstr, sizeof(authstr), "STEAM_%u:%u:%u", universe, acctId & 1, acctId >> 1);
|
||||
pContext->StringToLocal(params[3], params[4], authstr);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_snprintf(authstr, sizeof(authstr), "[U:1:%u]", acctId);
|
||||
pContext->StringToLocal(params[3], params[4], authstr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AuthType_SteamId64:
|
||||
{
|
||||
if (pPlayer->IsFakeClient() || g_HL2.IsLANServer())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned int acctId = pPlayer->GetSteamAccountID(validate);
|
||||
if (acctId == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t steamId = acctId;
|
||||
steamId |= ((uint64_t)1<<32); // Instance (1/Desktop)
|
||||
steamId |= ((uint64_t)1<<52); // Type (1/Individual)
|
||||
steamId |= ((uint64_t)1<<56); // Universe (1/Public)
|
||||
|
||||
static char authstr[64];
|
||||
snprintf(authstr, sizeof(authstr), "%" PRIu64, steamId);
|
||||
pContext->StringToLocal(params[3], params[4], authstr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
REGISTER_NATIVES(playernatives)
|
||||
{
|
||||
{"GetMaxHumanPlayers", sm_GetMaxHumanPlayers},
|
||||
@@ -393,6 +520,7 @@ REGISTER_NATIVES(playernatives)
|
||||
{"GetClientAvgData", GetAvgData},
|
||||
{"GetClientAvgPackets", GetAvgPackets},
|
||||
{"RunAdminCacheChecks", RunAdminCacheChecks},
|
||||
{"GetClientAuthId", GetClientAuthId},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -45,13 +45,13 @@ ISmmPluginManager *g_pMMPlugins = NULL;
|
||||
CGlobalVars *gpGlobals = NULL;
|
||||
ICvar *icvar = NULL;
|
||||
IGameEventManager2 *gameevents = NULL;
|
||||
IUniformRandomStream *engrandom = NULL;
|
||||
CallClass<IVEngineServer> *enginePatch = NULL;
|
||||
CallClass<IServerGameDLL> *gamedllPatch = NULL;
|
||||
IPlayerInfoManager *playerinfo = NULL;
|
||||
IBaseFileSystem *basefilesystem = NULL;
|
||||
IFileSystem *filesystem = NULL;
|
||||
IEngineSound *enginesound = NULL;
|
||||
IServerTools *servertools = NULL;
|
||||
IServerPluginHelpers *serverpluginhelpers = NULL;
|
||||
IServerPluginCallbacks *vsp_interface = NULL;
|
||||
int vsp_version = 0;
|
||||
@@ -67,10 +67,10 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen
|
||||
GET_V_IFACE_CURRENT(GetServerFactory, serverClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, icvar, ICvar, CVAR_INTERFACE_VERSION);
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, engrandom, IUniformRandomStream, VENGINE_SERVER_RANDOM_INTERFACE_VERSION);
|
||||
GET_V_IFACE_CURRENT(GetFileSystemFactory, basefilesystem, IBaseFileSystem, BASEFILESYSTEM_INTERFACE_VERSION);
|
||||
GET_V_IFACE_CURRENT(GetFileSystemFactory, filesystem, IFileSystem, FILESYSTEM_INTERFACE_VERSION);
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, enginesound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION);
|
||||
GET_V_IFACE_CURRENT(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION);
|
||||
#if SOURCE_ENGINE != SE_DOTA
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, serverpluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -47,9 +47,9 @@
|
||||
#include <eiface.h>
|
||||
#include <igameevents.h>
|
||||
#include <iplayerinfo.h>
|
||||
#include <random.h>
|
||||
#include <filesystem.h>
|
||||
#include <IEngineSound.h>
|
||||
#include <toolframework/itoolentity.h>
|
||||
|
||||
#ifndef METAMOD_PLAPI_VERSION
|
||||
#include <metamod_wrappers.h>
|
||||
@@ -98,11 +98,11 @@ extern CGlobalVars *gpGlobals;
|
||||
extern IGameEventManager2 *gameevents;
|
||||
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
|
||||
extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
|
||||
extern IUniformRandomStream *engrandom;
|
||||
extern IPlayerInfoManager *playerinfo;
|
||||
extern IBaseFileSystem *basefilesystem;
|
||||
extern IFileSystem *filesystem;
|
||||
extern IEngineSound *enginesound;
|
||||
extern IServerTools *servertools;
|
||||
extern IServerPluginHelpers *serverpluginhelpers;
|
||||
extern IServerPluginCallbacks *vsp_interface;
|
||||
extern int vsp_version;
|
||||
|
||||
@@ -8,6 +8,10 @@ binary.compiler.cxxincludes += [
|
||||
os.path.join(builder.sourcePath, 'public', 'jit'),
|
||||
os.path.join(builder.sourcePath, 'public', 'jit', 'x86'),
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
binary.sources += [
|
||||
'extension.cpp',
|
||||
|
||||
@@ -5,6 +5,10 @@ binary = SM.ExtLibrary(builder, 'clientprefs.ext')
|
||||
binary.compiler.cxxincludes += [
|
||||
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
binary.sources += [
|
||||
'extension.cpp',
|
||||
|
||||
@@ -372,12 +372,10 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
float delay = sp_ctof(params[1]);
|
||||
int reason = params[2];
|
||||
signed int unknown = 1;//We might want to find what this is?
|
||||
__asm
|
||||
{
|
||||
push reason
|
||||
movss xmm1, delay
|
||||
mov edi, unknown
|
||||
mov ecx, gamerules
|
||||
call addr
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ binary.compiler.includes += [
|
||||
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
|
||||
]
|
||||
binary.compiler.defines += ['CURL_STATICLIB']
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
binary.compiler.postlink += [libcurl.binary]
|
||||
if builder.target_platform == 'linux':
|
||||
binary.compiler.postlink += ['-lrt']
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
import os
|
||||
|
||||
binary = SM.ExtLibrary(builder, 'geoip.ext')
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
if builder.target_platform == 'windows':
|
||||
binary.compiler.postlink += ['wsock32.lib']
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ if SM.mysql_root:
|
||||
os.path.join(SM.mysql_root, 'include'),
|
||||
os.path.join(SM.mms_root, 'core', 'sourcehook')
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
if builder.target_platform == 'linux' or builder.target_platform == 'mac':
|
||||
binary.compiler.postlink += [
|
||||
|
||||
@@ -5,6 +5,10 @@ binary = SM.ExtLibrary(builder, 'regex.ext')
|
||||
binary.compiler.cxxincludes += [
|
||||
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
if builder.target_platform == 'linux':
|
||||
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_linux', 'libpcre.a')
|
||||
|
||||
@@ -106,7 +106,7 @@ static cell_t MatchRegex(IPluginContext *pCtx, const cell_t *params)
|
||||
|
||||
if ((err=g_pHandleSys->ReadHandle(hndl, g_RegexHandle, &sec, (void **)&x)) != HandleError_None)
|
||||
{
|
||||
return pCtx->ThrowNativeError("Invalid file handle %x (error %d)", hndl, err);
|
||||
return pCtx->ThrowNativeError("Invalid regex handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
if (!x)
|
||||
@@ -159,7 +159,7 @@ static cell_t GetRegexSubString(IPluginContext *pCtx, const cell_t *params)
|
||||
|
||||
if ((err=g_pHandleSys->ReadHandle(hndl, g_RegexHandle, &sec, (void **)&x)) != HandleError_None)
|
||||
{
|
||||
return pCtx->ThrowNativeError("Invalid file handle %x (error %d)", hndl, err);
|
||||
return pCtx->ThrowNativeError("Invalid regex handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
if (!x)
|
||||
|
||||
@@ -438,6 +438,21 @@ FeatureStatus SDKHooks::GetFeatureStatus(FeatureType type, const char *name)
|
||||
/**
|
||||
* Functions
|
||||
*/
|
||||
|
||||
static void PopulateCallbackList(const ke::Vector<HookList> &source, ke::Vector<IPluginFunction *> &destination, int entity)
|
||||
{
|
||||
destination.ensure(8); /* Skip trivial allocations as AMTL uses length<<1. */
|
||||
for (size_t iter = 0; iter < source.length(); ++iter)
|
||||
{
|
||||
if (source[iter].entity != entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
destination.append(source[iter].callback);
|
||||
}
|
||||
}
|
||||
|
||||
cell_t SDKHooks::Call(int entity, SDKHookType type, int other)
|
||||
{
|
||||
return Call(gamehelpers->ReferenceToEntity(entity), type, gamehelpers->ReferenceToEntity(other));
|
||||
@@ -461,17 +476,14 @@ cell_t SDKHooks::Call(CBaseEntity *pEnt, SDKHookType type, CBaseEntity *pOther)
|
||||
continue;
|
||||
}
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEnt);
|
||||
int other = gamehelpers->EntityToBCompatRef(pOther);
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(other);
|
||||
|
||||
@@ -914,15 +926,11 @@ void SDKHooks::Hook_FireBulletsPost(const FireBulletsInfo_t &info)
|
||||
|
||||
const char *weapon = pInfo->GetWeaponName();
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(info.m_iShots);
|
||||
callback->PushString(weapon?weapon:"");
|
||||
@@ -956,15 +964,11 @@ int SDKHooks::Hook_GetMaxHealth()
|
||||
|
||||
cell_t res = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCellByRef(&new_max);
|
||||
callback->Execute(&res);
|
||||
@@ -1013,15 +1017,11 @@ int SDKHooks::Hook_OnTakeDamage(CTakeDamageInfoHack &info)
|
||||
|
||||
cell_t res, ret = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCellByRef(&attacker);
|
||||
callback->PushCellByRef(&inflictor);
|
||||
@@ -1095,15 +1095,11 @@ int SDKHooks::Hook_OnTakeDamagePost(CTakeDamageInfoHack &info)
|
||||
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(info.GetAttacker());
|
||||
callback->PushCell(info.GetInflictor());
|
||||
@@ -1168,15 +1164,11 @@ bool SDKHooks::Hook_Reload()
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
cell_t res = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->Execute(&res);
|
||||
}
|
||||
@@ -1195,7 +1187,7 @@ bool SDKHooks::Hook_ReloadPost()
|
||||
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
|
||||
|
||||
CVTableHook vhook(pEntity);
|
||||
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Reload];
|
||||
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_ReloadPost];
|
||||
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
|
||||
{
|
||||
if (vhook != vtablehooklist[entry]->vtablehook)
|
||||
@@ -1206,15 +1198,11 @@ bool SDKHooks::Hook_ReloadPost()
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
cell_t origreturn = META_RESULT_ORIG_RET(bool) ? 1 : 0;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(origreturn);
|
||||
callback->Execute(NULL);
|
||||
@@ -1253,15 +1241,11 @@ bool SDKHooks::Hook_ShouldCollide(int collisionGroup, int contentsMask)
|
||||
cell_t origRet = ((META_RESULT_STATUS >= MRES_OVERRIDE)?(META_RESULT_OVERRIDE_RET(bool)):(META_RESULT_ORIG_RET(bool))) ? 1 : 0;
|
||||
cell_t res = 0;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(collisionGroup);
|
||||
callback->PushCell(contentsMask);
|
||||
@@ -1301,15 +1285,11 @@ void SDKHooks::Hook_Spawn()
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
cell_t res = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->Execute(&res);
|
||||
}
|
||||
@@ -1399,15 +1379,11 @@ void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir,
|
||||
int ammotype = info.GetAmmoType();
|
||||
cell_t res, ret = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCellByRef(&attacker);
|
||||
callback->PushCellByRef(&inflictor);
|
||||
@@ -1477,15 +1453,11 @@ void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vec
|
||||
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(info.GetAttacker());
|
||||
callback->PushCell(info.GetInflictor());
|
||||
@@ -1521,15 +1493,11 @@ void SDKHooks::Hook_Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
|
||||
int caller = gamehelpers->EntityToBCompatRef(pCaller);
|
||||
cell_t ret = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(activator);
|
||||
callback->PushCell(caller);
|
||||
@@ -1564,15 +1532,11 @@ void SDKHooks::Hook_UsePost(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
|
||||
int activator = gamehelpers->EntityToBCompatRef(pActivator);
|
||||
int caller = gamehelpers->EntityToBCompatRef(pCaller);
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(activator);
|
||||
callback->PushCell(caller);
|
||||
|
||||
@@ -66,6 +66,7 @@ IPlayerInfoManager *playerinfomngr = NULL;
|
||||
ICvar *icvar = NULL;
|
||||
IServer *iserver = NULL;
|
||||
CGlobalVars *gpGlobals;
|
||||
ISoundEmitterSystemBase *soundemitterbase = NULL;
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
IServerTools *servertools = NULL;
|
||||
@@ -258,6 +259,7 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
GET_V_IFACE_ANY(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION);
|
||||
#endif
|
||||
GET_V_IFACE_ANY(GetEngineFactory, soundemitterbase, ISoundEmitterSystemBase, SOUNDEMITTERSYSTEM_INTERFACE_VERSION);
|
||||
|
||||
gpGlobals = ismm->GetCGlobals();
|
||||
enginePatch = SH_GET_CALLCLASS(engine);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <convar.h>
|
||||
#include <iserver.h>
|
||||
#include <cdll_int.h>
|
||||
#include "SoundEmitterSystem/isoundemittersystembase.h"
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#include <itoolentity.h>
|
||||
@@ -124,6 +125,7 @@ extern CGlobalVars *gpGlobals;
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
extern IServerTools *servertools;
|
||||
#endif
|
||||
extern ISoundEmitterSystemBase *soundemitterbase;
|
||||
/* Interfaces from SourceMod */
|
||||
extern IBinTools *g_pBinTools;
|
||||
extern IGameConfig *g_pGameConf;
|
||||
|
||||
@@ -285,36 +285,46 @@ void TempEntityManager::Initialize()
|
||||
int offset;
|
||||
m_Loaded = false;
|
||||
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
m_ListHead = servertools->GetTempEntList();
|
||||
#else
|
||||
/*
|
||||
* First try to lookup s_pTempEntities directly for platforms with symbols.
|
||||
* If symbols aren't present (Windows or stripped Linux/Mac),
|
||||
* attempt find via CBaseTempEntity ctor + offset
|
||||
*/
|
||||
#if SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_DODS \
|
||||
|| SOURCE_ENGINE == SE_HL2DM \
|
||||
|| SOURCE_ENGINE == SE_CSS \
|
||||
|| SOURCE_ENGINE == SE_SDK2013
|
||||
|
||||
/* Read our sigs and offsets from the config file */
|
||||
if (g_pGameConf->GetMemSig("s_pTempEntities", &addr) && addr)
|
||||
if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", NULL))
|
||||
{
|
||||
|
||||
/* Store the head of the TE linked list */
|
||||
m_ListHead = *(void **)addr;
|
||||
m_ListHead = servertools->GetTempEntList();
|
||||
}
|
||||
else if (g_pGameConf->GetMemSig("CBaseTempEntity", &addr) && addr)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (!g_pGameConf->GetOffset("s_pTempEntities", &offset))
|
||||
/*
|
||||
* First try to lookup s_pTempEntities directly for platforms with symbols.
|
||||
* If symbols aren't present (Windows or stripped Linux/Mac),
|
||||
* attempt find via CBaseTempEntity ctor + offset
|
||||
*/
|
||||
|
||||
/* Read our sigs and offsets from the config file */
|
||||
if (g_pGameConf->GetMemSig("s_pTempEntities", &addr) && addr)
|
||||
{
|
||||
|
||||
/* Store the head of the TE linked list */
|
||||
m_ListHead = *(void **) addr;
|
||||
}
|
||||
else if (g_pGameConf->GetMemSig("CBaseTempEntity", &addr) && addr)
|
||||
{
|
||||
if (!g_pGameConf->GetOffset("s_pTempEntities", &offset))
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Store the head of the TE linked list */
|
||||
m_ListHead = **(void ***) ((unsigned char *) addr + offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Store the head of the TE linked list */
|
||||
m_ListHead = **(void ***)((unsigned char *)addr + offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif // == TF2
|
||||
|
||||
if (!g_pGameConf->GetOffset("GetTEName", &m_NameOffs))
|
||||
{
|
||||
|
||||
@@ -130,9 +130,19 @@ bool UTIL_VerifySignature(const void *addr, const char *sig, size_t len)
|
||||
|
||||
void GetIServer()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
iserver = engine->GetIServer();
|
||||
#else
|
||||
#if SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_DODS \
|
||||
|| SOURCE_ENGINE == SE_HL2DM \
|
||||
|| SOURCE_ENGINE == SE_CSS \
|
||||
|| SOURCE_ENGINE == SE_SDK2013
|
||||
|
||||
if (g_SMAPI->GetEngineFactory(false)("VEngineServer022", NULL))
|
||||
{
|
||||
iserver = engine->GetIServer();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
void *addr;
|
||||
const char *sigstr;
|
||||
char sig[32];
|
||||
@@ -191,7 +201,6 @@ void GetIServer()
|
||||
|
||||
/* Finally we have the interface we were looking for */
|
||||
iserver = *reinterpret_cast<IServer **>(reinterpret_cast<unsigned char *>(vfunc) + offset);
|
||||
#endif // !TF2
|
||||
}
|
||||
|
||||
void GetResourceEntity()
|
||||
|
||||
@@ -714,7 +714,7 @@ static cell_t GetClientEyeAngles(IPluginContext *pContext, const cell_t *params)
|
||||
return got_angles ? 1 : 0;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX && SOURCE_ENGINE != SE_TF2
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
static cell_t NativeFindEntityByClassname(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *searchname;
|
||||
@@ -793,25 +793,35 @@ static cell_t NativeFindEntityByClassname(IPluginContext *pContext, const cell_t
|
||||
|
||||
static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
CBaseEntity *pStartEnt = NULL;
|
||||
if (params[1] != -1)
|
||||
#if SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_DODS \
|
||||
|| SOURCE_ENGINE == SE_HL2DM \
|
||||
|| SOURCE_ENGINE == SE_CSS \
|
||||
|| SOURCE_ENGINE == SE_SDK2013
|
||||
|
||||
static bool bHasServerTools3 = !!g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", NULL);
|
||||
if (bHasServerTools3)
|
||||
{
|
||||
pStartEnt = gamehelpers->ReferenceToEntity(params[1]);
|
||||
if (!pStartEnt)
|
||||
CBaseEntity *pStartEnt = NULL;
|
||||
if (params[1] != -1)
|
||||
{
|
||||
return pContext->ThrowNativeError("Entity %d (%d) is invalid",
|
||||
gamehelpers->ReferenceToIndex(params[1]),
|
||||
params[1]);
|
||||
pStartEnt = gamehelpers->ReferenceToEntity(params[1]);
|
||||
if (!pStartEnt)
|
||||
{
|
||||
return pContext->ThrowNativeError("Entity %d (%d) is invalid",
|
||||
gamehelpers->ReferenceToIndex(params[1]),
|
||||
params[1]);
|
||||
}
|
||||
}
|
||||
|
||||
char *searchname;
|
||||
pContext->LocalToString(params[2], &searchname);
|
||||
|
||||
CBaseEntity *pEntity = servertools->FindEntityByClassname(pStartEnt, searchname);
|
||||
return gamehelpers->EntityToBCompatRef(pEntity);
|
||||
}
|
||||
#endif
|
||||
|
||||
char *searchname;
|
||||
pContext->LocalToString(params[2], &searchname);
|
||||
|
||||
CBaseEntity *pEntity = servertools->FindEntityByClassname(pStartEnt, searchname);
|
||||
return gamehelpers->EntityToBCompatRef(pEntity);
|
||||
#else
|
||||
static ValveCall *pCall = NULL;
|
||||
static bool bProbablyNoFEBC = false;
|
||||
|
||||
@@ -869,7 +879,6 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para
|
||||
FINISH_CALL_SIMPLE(&pEntity);
|
||||
|
||||
return gamehelpers->EntityToBCompatRef(pEntity);
|
||||
#endif // == TF2
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
|
||||
@@ -512,6 +512,74 @@ RETURN_META_NEWPARAMS(
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t entindex)
|
||||
{
|
||||
if ( !soundname[0] )
|
||||
return false;
|
||||
|
||||
#if SOURCE_ENGINE >= SE_PORTAL2
|
||||
HSOUNDSCRIPTHASH index = (HSOUNDSCRIPTHASH)soundemitterbase->GetSoundIndex(soundname);
|
||||
#else
|
||||
HSOUNDSCRIPTHANDLE index = (HSOUNDSCRIPTHANDLE)soundemitterbase->GetSoundIndex(soundname);
|
||||
#endif
|
||||
if (!soundemitterbase->IsValidIndex(index))
|
||||
return false;
|
||||
|
||||
gender_t gender = GENDER_NONE;
|
||||
|
||||
// I don't know if gender applies to any mutliplayer games, but just in case...
|
||||
// Of course, if it's SOUND_FROM_PLAYER, we have no idea which gender it is
|
||||
int ent = SoundReferenceToIndex(entindex);
|
||||
if (ent > 0)
|
||||
{
|
||||
edict_t *edict = gamehelpers->EdictOfIndex(ent);
|
||||
if (edict != NULL && !edict->IsFree())
|
||||
{
|
||||
IServerEntity *serverEnt = edict->GetIServerEntity();
|
||||
if (serverEnt != NULL)
|
||||
{
|
||||
const char *actormodel = STRING(serverEnt->GetModelName());
|
||||
gender = soundemitterbase->GetActorGender(actormodel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return soundemitterbase->GetParametersForSoundEx(soundname, index, *soundParams, gender);
|
||||
}
|
||||
|
||||
bool InternalPrecacheScriptSound(const char *soundname)
|
||||
{
|
||||
int soundIndex = soundemitterbase->GetSoundIndex(soundname);
|
||||
if (!soundemitterbase->IsValidIndex(soundIndex))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CSoundParametersInternal *internal = soundemitterbase->InternalGetParametersForSound(soundIndex);
|
||||
|
||||
if (!internal)
|
||||
return false;
|
||||
|
||||
int waveCount = internal->NumSoundNames();
|
||||
|
||||
if (!waveCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int wave = 0; wave < waveCount; wave++)
|
||||
{
|
||||
const char* waveName = soundemitterbase->GetWaveName(internal->GetSoundNames()[wave].symbol);
|
||||
// return true even if we precache no new wavs
|
||||
if (!engsound->IsSoundPrecached(waveName))
|
||||
{
|
||||
engsound->PrecacheSound(waveName);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/************************
|
||||
* *
|
||||
* Sound Related Natives *
|
||||
@@ -1135,6 +1203,51 @@ static cell_t smn_GetDistGainFromSoundLevel(IPluginContext *pContext, const cell
|
||||
return sp_ftoc(engsound->GetDistGainFromSoundLevel((soundlevel_t)decibel, distance));
|
||||
}
|
||||
|
||||
// native bool:GetGameSoundParams(const String:gameSound[], &channel, &soundLevel, &Float:volume, &pitch, String:sample[], maxlength, entity=SOUND_FROM_WORLD)
|
||||
static cell_t smn_GetGameSoundParams(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *soundname;
|
||||
pContext->LocalToString(params[1], &soundname);
|
||||
|
||||
CSoundParameters soundParams;
|
||||
|
||||
if (!GetSoundParams(&soundParams, soundname, params[8]))
|
||||
return false;
|
||||
|
||||
cell_t *channel;
|
||||
cell_t *fakeVolume;
|
||||
cell_t *pitch;
|
||||
cell_t *soundLevel;
|
||||
|
||||
pContext->LocalToPhysAddr(params[2], &channel);
|
||||
pContext->LocalToPhysAddr(params[3], &soundLevel);
|
||||
pContext->LocalToPhysAddr(params[4], &fakeVolume);
|
||||
pContext->LocalToPhysAddr(params[5], &pitch);
|
||||
|
||||
*channel = soundParams.channel;
|
||||
*pitch = soundParams.pitch;
|
||||
*soundLevel = (cell_t)soundParams.soundlevel;
|
||||
*fakeVolume = sp_ftoc(soundParams.volume);
|
||||
|
||||
pContext->StringToLocal(params[6], params[7], soundParams.soundname);
|
||||
|
||||
// Precache the sound we're returning
|
||||
if (!engsound->IsSoundPrecached(soundParams.soundname))
|
||||
{
|
||||
InternalPrecacheScriptSound(soundname);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// native bool:PrecacheScriptSound(const String:soundname[])
|
||||
static cell_t smn_PrecacheScriptSound(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *soundname;
|
||||
pContext->LocalToString(params[1], &soundname);
|
||||
return InternalPrecacheScriptSound(soundname);
|
||||
}
|
||||
|
||||
sp_nativeinfo_t g_SoundNatives[] =
|
||||
{
|
||||
{"EmitAmbientSound", EmitAmbientSound},
|
||||
@@ -1149,5 +1262,7 @@ sp_nativeinfo_t g_SoundNatives[] =
|
||||
{"RemoveAmbientSoundHook", smn_RemoveAmbientSoundHook},
|
||||
{"RemoveNormalSoundHook", smn_RemoveNormalSoundHook},
|
||||
{"GetDistGainFromSoundLevel", smn_GetDistGainFromSoundLevel},
|
||||
{"GetGameSoundParams", smn_GetGameSoundParams},
|
||||
{"PrecacheScriptSound", smn_PrecacheScriptSound},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
@@ -5,6 +5,10 @@ binary = SM.ExtLibrary(builder, 'dbi.sqlite.ext')
|
||||
binary.compiler.cxxincludes += [
|
||||
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
binary.compiler.defines += [
|
||||
'SQLITE_OMIT_LOAD_EXTENSION',
|
||||
|
||||
@@ -599,6 +599,55 @@ cell_t TF2_IsHolidayActive(IPluginContext *pContext, const cell_t *params)
|
||||
return (retValue) ? 1 : 0;
|
||||
}
|
||||
|
||||
cell_t TF2_RemoveWearable(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
//CBasePlayer::RemoveWearable(CEconWearable *)
|
||||
|
||||
if (!pWrapper)
|
||||
{
|
||||
int offset;
|
||||
|
||||
if (!g_pGameConf->GetOffset("RemoveWearable", &offset))
|
||||
{
|
||||
return pContext->ThrowNativeError("Failed to locate function");
|
||||
}
|
||||
|
||||
PassInfo pass[1];
|
||||
pass[0].flags = PASSFLAG_BYVAL;
|
||||
pass[0].size = sizeof(CBaseEntity *);
|
||||
pass[0].type = PassType_Basic;
|
||||
|
||||
pWrapper = g_pBinTools->CreateVCall(offset, 0, 0, NULL, pass, 1);
|
||||
|
||||
g_RegNatives.Register(pWrapper);
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
CBaseEntity *pWearable;
|
||||
if (!(pWearable = UTIL_GetCBaseEntity(params[2], false)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Wearable index %d is not valid", params[2]);
|
||||
}
|
||||
|
||||
unsigned char vstk[sizeof(void *) + sizeof(CBaseEntity *)];
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
*(void **)vptr = (void *)pEntity;
|
||||
vptr += sizeof(void *);
|
||||
*(CBaseEntity **)vptr = pWearable;
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sp_nativeinfo_t g_TFNatives[] =
|
||||
{
|
||||
{"TF2_IgnitePlayer", TF2_Burn},
|
||||
@@ -616,5 +665,6 @@ sp_nativeinfo_t g_TFNatives[] =
|
||||
{"TF2_MakeBleed", TF2_MakeBleed},
|
||||
{"TF2_IsPlayerInDuel", TF2_IsPlayerInDuel},
|
||||
{"TF2_IsHolidayActive", TF2_IsHolidayActive},
|
||||
{"TF2_RemoveWearable", TF2_RemoveWearable},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -5,6 +5,10 @@ binary = SM.ExtLibrary(builder, 'topmenus.ext')
|
||||
binary.compiler.cxxincludes += [
|
||||
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
binary.sources += [
|
||||
'extension.cpp',
|
||||
|
||||
@@ -5,6 +5,10 @@ binary = SM.ExtLibrary(builder, 'updater.ext')
|
||||
binary.compiler.cxxincludes += [
|
||||
os.path.join(SM.mms_root, 'core', 'sourcehook'),
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
binary.sources += [
|
||||
'extension.cpp',
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
"plugin_f99d77668e7aa0adb6a960322ab05568" "" /* UCP Server (Endi) - Version 7.8 */
|
||||
"plugin_7b3ce69f15e61cc896228cb8424be589" "" /* UCP Server (Endi) - Version 7.8.2 */
|
||||
"plugin_24602c74f183cfcd157b3d50dee96c52" "" /* UCP Server (Endi) - Version 7.8.3 */
|
||||
"plugin_43bd225c5fdcd3af35729ca9d481b20d" "" /* UCP Server (Endi) - Version 8.3 */
|
||||
"plugin_78140f1a0f26cd3297767d0598eac4b1" "" /* [Any] PReplay (DarthNinja) - Version 1.0.0 */
|
||||
"plugin_55923ba6bfe41569a3e4fbd7ca4606e5" "" /* VIP Plugin (World-Source.Ru) - Version 2.0 */
|
||||
"plugin_4bf983e1d5b61ba0b1ab9a7e53bfda27" "" /* WarMod CS:GO (Twelve-60) */
|
||||
"plugin_4bf983e1d5b61ba0b1ab9a7e53bfda27" "" /* WarMod CS:GO (Twelve-60) */
|
||||
"plugin_08574c4295afdaa5f613b8ceef96ecc3" "" /* AlliedBans (TommY) - Version 3.140902A */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
"game" "nucleardawn"
|
||||
"game" "csgo"
|
||||
"game" "berimbau"
|
||||
"game" "nmrih"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@@ -192,6 +193,7 @@
|
||||
"game" "csgo"
|
||||
"game" "berimbau"
|
||||
"game" "$INSURGENCY" // retail game
|
||||
"game" "nmrih"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
|
||||
@@ -35,17 +35,17 @@
|
||||
"mac" "68"
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows" "364"
|
||||
"linux" "365"
|
||||
"mac" "365"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "365"
|
||||
"linux" "366"
|
||||
"mac" "366"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "366"
|
||||
"linux" "367"
|
||||
"mac" "367"
|
||||
}
|
||||
"Reload"
|
||||
{
|
||||
"windows" "308"
|
||||
@@ -172,4 +172,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,22 +36,22 @@
|
||||
"mac" "63"
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows" "331"
|
||||
"linux" "332"
|
||||
"mac" "332"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "332"
|
||||
"linux" "333"
|
||||
"mac" "333"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "333"
|
||||
"linux" "334"
|
||||
"mac" "334"
|
||||
}
|
||||
"Reload"
|
||||
{
|
||||
"windows" "272"
|
||||
"linux" "278"
|
||||
"mac" "278"
|
||||
"windows" "273"
|
||||
"linux" "279"
|
||||
"mac" "279"
|
||||
}
|
||||
"SetTransmit"
|
||||
{
|
||||
@@ -109,34 +109,34 @@
|
||||
}
|
||||
"Weapon_CanSwitchTo"
|
||||
{
|
||||
"windows" "265"
|
||||
"linux" "266"
|
||||
"mac" "266"
|
||||
"windows" "266"
|
||||
"linux" "267"
|
||||
"mac" "267"
|
||||
}
|
||||
"Weapon_CanUse"
|
||||
{
|
||||
"windows" "259"
|
||||
"linux" "260"
|
||||
"mac" "260"
|
||||
}
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "262"
|
||||
"linux" "263"
|
||||
"mac" "263"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "260"
|
||||
"linux" "261"
|
||||
"mac" "261"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "263"
|
||||
"linux" "264"
|
||||
"mac" "264"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "261"
|
||||
"linux" "262"
|
||||
"mac" "262"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
{
|
||||
"windows" "264"
|
||||
"linux" "265"
|
||||
"mac" "265"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,136 +6,136 @@
|
||||
{
|
||||
"EndTouch"
|
||||
{
|
||||
"windows" "104"
|
||||
"linux" "105"
|
||||
"mac" "105"
|
||||
"windows" "106"
|
||||
"linux" "107"
|
||||
"mac" "107"
|
||||
}
|
||||
"FireBullets"
|
||||
{
|
||||
"windows" "117"
|
||||
"linux" "118"
|
||||
"mac" "118"
|
||||
"windows" "119"
|
||||
"linux" "120"
|
||||
"mac" "120"
|
||||
}
|
||||
"GetMaxHealth"
|
||||
{
|
||||
"windows" "121"
|
||||
"linux" "122"
|
||||
"mac" "122"
|
||||
"windows" "123"
|
||||
"linux" "124"
|
||||
"mac" "124"
|
||||
}
|
||||
"GroundEntChanged"
|
||||
{
|
||||
"windows" "175"
|
||||
"linux" "177"
|
||||
"mac" "177"
|
||||
"windows" "177"
|
||||
"linux" "179"
|
||||
"mac" "179"
|
||||
}
|
||||
"OnTakeDamage"
|
||||
{
|
||||
"windows" "65"
|
||||
"linux" "66"
|
||||
"mac" "66"
|
||||
"windows" "67"
|
||||
"linux" "68"
|
||||
"mac" "68"
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows" "357"
|
||||
"linux" "358"
|
||||
"mac" "358"
|
||||
"windows" "360"
|
||||
"linux" "361"
|
||||
"mac" "361"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "358"
|
||||
"linux" "359"
|
||||
"mac" "359"
|
||||
"windows" "361"
|
||||
"linux" "362"
|
||||
"mac" "362"
|
||||
}
|
||||
"Reload"
|
||||
{
|
||||
"windows" "281"
|
||||
"linux" "282"
|
||||
"mac" "282"
|
||||
"windows" "284"
|
||||
"linux" "285"
|
||||
"mac" "285"
|
||||
}
|
||||
"SetTransmit"
|
||||
{
|
||||
"windows" "20"
|
||||
"linux" "21"
|
||||
"mac" "21"
|
||||
}
|
||||
"ShouldCollide"
|
||||
{
|
||||
"windows" "16"
|
||||
"linux" "17"
|
||||
"mac" "17"
|
||||
}
|
||||
"Spawn"
|
||||
{
|
||||
"windows" "22"
|
||||
"linux" "23"
|
||||
"mac" "23"
|
||||
}
|
||||
"ShouldCollide"
|
||||
{
|
||||
"windows" "17"
|
||||
"linux" "18"
|
||||
"mac" "18"
|
||||
}
|
||||
"Spawn"
|
||||
{
|
||||
"windows" "24"
|
||||
"linux" "25"
|
||||
"mac" "25"
|
||||
}
|
||||
"StartTouch"
|
||||
{
|
||||
"windows" "102"
|
||||
"linux" "103"
|
||||
"mac" "103"
|
||||
"windows" "104"
|
||||
"linux" "105"
|
||||
"mac" "105"
|
||||
}
|
||||
"Think"
|
||||
{
|
||||
"windows" "49"
|
||||
"linux" "50"
|
||||
"mac" "50"
|
||||
"windows" "51"
|
||||
"linux" "52"
|
||||
"mac" "52"
|
||||
}
|
||||
"Touch"
|
||||
{
|
||||
"windows" "105"
|
||||
"linux" "106"
|
||||
"mac" "106"
|
||||
}
|
||||
"TraceAttack"
|
||||
{
|
||||
"windows" "65"
|
||||
"linux" "66"
|
||||
"mac" "66"
|
||||
}
|
||||
"Use"
|
||||
{
|
||||
"windows" "103"
|
||||
"linux" "104"
|
||||
"mac" "104"
|
||||
}
|
||||
"TraceAttack"
|
||||
{
|
||||
"windows" "63"
|
||||
"linux" "64"
|
||||
"mac" "64"
|
||||
}
|
||||
"Use"
|
||||
{
|
||||
"windows" "101"
|
||||
"linux" "102"
|
||||
"mac" "102"
|
||||
}
|
||||
"VPhysicsUpdate"
|
||||
{
|
||||
"windows" "154"
|
||||
"linux" "155"
|
||||
"mac" "155"
|
||||
"windows" "156"
|
||||
"linux" "157"
|
||||
"mac" "157"
|
||||
}
|
||||
"Weapon_CanSwitchTo"
|
||||
{
|
||||
"windows" "282"
|
||||
"linux" "283"
|
||||
"mac" "283"
|
||||
"windows" "285"
|
||||
"linux" "286"
|
||||
"mac" "286"
|
||||
}
|
||||
"Weapon_CanUse"
|
||||
{
|
||||
"windows" "276"
|
||||
"linux" "277"
|
||||
"mac" "277"
|
||||
}
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "279"
|
||||
"linux" "280"
|
||||
"mac" "280"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "277"
|
||||
"linux" "278"
|
||||
"mac" "278"
|
||||
"windows" "282"
|
||||
"linux" "283"
|
||||
"mac" "283"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "280"
|
||||
"linux" "281"
|
||||
"mac" "281"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
{
|
||||
"windows" "283"
|
||||
"linux" "284"
|
||||
"mac" "284"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,17 +23,17 @@
|
||||
"mac" "63"
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows" "331"
|
||||
"linux" "332"
|
||||
"mac" "332"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "332"
|
||||
"linux" "333"
|
||||
"mac" "333"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "333"
|
||||
"linux" "334"
|
||||
"mac" "334"
|
||||
}
|
||||
"SetTransmit"
|
||||
{
|
||||
"windows" "20"
|
||||
@@ -78,40 +78,40 @@
|
||||
}
|
||||
"VPhysicsUpdate"
|
||||
{
|
||||
"windows" "157"
|
||||
"linux" "158"
|
||||
"mac" "158"
|
||||
"windows" "158"
|
||||
"linux" "159"
|
||||
"mac" "159"
|
||||
}
|
||||
"Weapon_CanSwitchTo"
|
||||
{
|
||||
"windows" "265"
|
||||
"linux" "266"
|
||||
"mac" "266"
|
||||
"windows" "266"
|
||||
"linux" "267"
|
||||
"mac" "267"
|
||||
}
|
||||
"Weapon_CanUse"
|
||||
{
|
||||
"windows" "259"
|
||||
"linux" "260"
|
||||
"mac" "260"
|
||||
}
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "262"
|
||||
"linux" "263"
|
||||
"mac" "263"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "260"
|
||||
"linux" "261"
|
||||
"mac" "261"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "263"
|
||||
"linux" "264"
|
||||
"mac" "264"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "261"
|
||||
"linux" "262"
|
||||
"mac" "262"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
{
|
||||
"windows" "264"
|
||||
"linux" "265"
|
||||
"mac" "265"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,21 +6,21 @@
|
||||
{
|
||||
"EndTouch"
|
||||
{
|
||||
"windows" "101"
|
||||
"linux" "102"
|
||||
"mac" "102"
|
||||
"windows" "102"
|
||||
"linux" "103"
|
||||
"mac" "103"
|
||||
}
|
||||
"FireBullets"
|
||||
{
|
||||
"windows" "113"
|
||||
"linux" "114"
|
||||
"mac" "114"
|
||||
"windows" "114"
|
||||
"linux" "115"
|
||||
"mac" "115"
|
||||
}
|
||||
"GroundEntChanged"
|
||||
{
|
||||
"windows" "178"
|
||||
"linux" "180"
|
||||
"mac" "180"
|
||||
"windows" "179"
|
||||
"linux" "181"
|
||||
"mac" "181"
|
||||
}
|
||||
"OnTakeDamage"
|
||||
{
|
||||
@@ -30,21 +30,21 @@
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows" "344"
|
||||
"linux" "345"
|
||||
"mac" "345"
|
||||
"windows" "346"
|
||||
"linux" "347"
|
||||
"mac" "347"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "325"
|
||||
"linux" "326"
|
||||
"mac" "325"
|
||||
"windows" "326"
|
||||
"linux" "327"
|
||||
"mac" "327"
|
||||
}
|
||||
"Reload"
|
||||
{
|
||||
"windows" "269"
|
||||
"linux" "270"
|
||||
"mac" "270"
|
||||
"windows" "271"
|
||||
"linux" "272"
|
||||
"mac" "272"
|
||||
}
|
||||
"SetTransmit"
|
||||
{
|
||||
@@ -66,9 +66,9 @@
|
||||
}
|
||||
"StartTouch"
|
||||
{
|
||||
"windows" "99"
|
||||
"linux" "100"
|
||||
"mac" "100"
|
||||
"windows" "100"
|
||||
"linux" "101"
|
||||
"mac" "101"
|
||||
}
|
||||
"Think"
|
||||
{
|
||||
@@ -78,9 +78,9 @@
|
||||
}
|
||||
"Touch"
|
||||
{
|
||||
"windows" "100"
|
||||
"linux" "101"
|
||||
"mac" "101"
|
||||
"windows" "101"
|
||||
"linux" "102"
|
||||
"mac" "102"
|
||||
}
|
||||
"TraceAttack"
|
||||
{
|
||||
@@ -90,46 +90,46 @@
|
||||
}
|
||||
"Use"
|
||||
{
|
||||
"windows" "97"
|
||||
"linux" "98"
|
||||
"mac" "98"
|
||||
"windows" "98"
|
||||
"linux" "99"
|
||||
"mac" "99"
|
||||
}
|
||||
"VPhysicsUpdate"
|
||||
{
|
||||
"windows" "158"
|
||||
"linux" "159"
|
||||
"mac" "159"
|
||||
"windows" "159"
|
||||
"linux" "160"
|
||||
"mac" "160"
|
||||
}
|
||||
"Weapon_CanSwitchTo"
|
||||
{
|
||||
"windows" "267"
|
||||
"linux" "268"
|
||||
"mac" "268"
|
||||
"windows" "268"
|
||||
"linux" "269"
|
||||
"mac" "269"
|
||||
}
|
||||
"Weapon_CanUse"
|
||||
{
|
||||
"windows" "261"
|
||||
"linux" "262"
|
||||
"mac" "262"
|
||||
}
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "264"
|
||||
"linux" "265"
|
||||
"mac" "265"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "262"
|
||||
"linux" "263"
|
||||
"mac" "263"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "265"
|
||||
"linux" "266"
|
||||
"mac" "266"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "263"
|
||||
"linux" "264"
|
||||
"mac" "264"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
{
|
||||
"windows" "266"
|
||||
"linux" "267"
|
||||
"mac" "267"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,119 +1,153 @@
|
||||
"Games"
|
||||
{
|
||||
/* Pirates, Vikings and Knights II 2.3 */
|
||||
/* Pirates, Vikings and Knights II */
|
||||
"pvkii"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
"Blocked"
|
||||
{
|
||||
"windows" "103"
|
||||
"linux" "104"
|
||||
"mac" "104"
|
||||
}
|
||||
"EndTouch"
|
||||
{
|
||||
"windows" "93"
|
||||
"linux" "94"
|
||||
"windows" "101"
|
||||
"linux" "102"
|
||||
"mac" "102"
|
||||
}
|
||||
"FireBullets"
|
||||
{
|
||||
"windows" "105"
|
||||
"linux" "106"
|
||||
"windows" "113"
|
||||
"linux" "114"
|
||||
"mac" "114"
|
||||
}
|
||||
"GetMaxHealth"
|
||||
{
|
||||
"windows" "118"
|
||||
"linux" "119"
|
||||
"mac" "119"
|
||||
}
|
||||
"GroundEntChanged"
|
||||
{
|
||||
"windows" "178"
|
||||
"linux" "180"
|
||||
"mac" "180"
|
||||
}
|
||||
"OnTakeDamage"
|
||||
{
|
||||
"windows" "61"
|
||||
"linux" "62"
|
||||
"windows" "63"
|
||||
"linux" "64"
|
||||
"mac" "64"
|
||||
}
|
||||
"OnTakeDamage_Alive"
|
||||
{
|
||||
"windows" "274"
|
||||
"linux" "275"
|
||||
"mac" "275"
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows" "292"
|
||||
"linux" "293"
|
||||
"windows" "335"
|
||||
"linux" "336"
|
||||
"mac" "336"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows" "293"
|
||||
"linux" "294"
|
||||
"windows" "336"
|
||||
"linux" "337"
|
||||
"mac" "337"
|
||||
}
|
||||
"Reload"
|
||||
{
|
||||
"windows" "272"
|
||||
"linux" "273"
|
||||
"mac" "273"
|
||||
}
|
||||
"SetTransmit"
|
||||
{
|
||||
"windows" "20"
|
||||
"linux" "21"
|
||||
"windows" "21"
|
||||
"linux" "22"
|
||||
"mac" "22"
|
||||
}
|
||||
"ShouldCollide"
|
||||
{
|
||||
"windows" "15"
|
||||
"linux" "16"
|
||||
"windows" "16"
|
||||
"linux" "17"
|
||||
"mac" "17"
|
||||
}
|
||||
"Spawn"
|
||||
{
|
||||
"windows" "22"
|
||||
"linux" "23"
|
||||
"windows" "23"
|
||||
"linux" "24"
|
||||
"mac" "24"
|
||||
}
|
||||
"StartTouch"
|
||||
{
|
||||
"windows" "91"
|
||||
"linux" "92"
|
||||
"windows" "99"
|
||||
"linux" "100"
|
||||
"mac" "100"
|
||||
}
|
||||
"Think"
|
||||
{
|
||||
"windows" "46"
|
||||
"linux" "47"
|
||||
"windows" "48"
|
||||
"linux" "49"
|
||||
"mac" "49"
|
||||
}
|
||||
"Touch"
|
||||
{
|
||||
"windows" "92"
|
||||
"linux" "93"
|
||||
"windows" "100"
|
||||
"linux" "101"
|
||||
"mac" "101"
|
||||
}
|
||||
"TraceAttack"
|
||||
{
|
||||
"windows" "59"
|
||||
"linux" "60"
|
||||
}
|
||||
"UpdateOnRemove"
|
||||
{
|
||||
"windows" "98"
|
||||
"linux" "99"
|
||||
"windows" "61"
|
||||
"linux" "62"
|
||||
"mac" "62"
|
||||
}
|
||||
"Use"
|
||||
{
|
||||
"windows" "90"
|
||||
"linux" "91"
|
||||
"windows" "98"
|
||||
"linux" "99"
|
||||
"mac" "99"
|
||||
}
|
||||
"VPhysicsUpdate"
|
||||
{
|
||||
"windows" "145"
|
||||
"linux" "146"
|
||||
"windows" "158"
|
||||
"linux" "159"
|
||||
"mac" "159"
|
||||
}
|
||||
"Weapon_CanSwitchTo"
|
||||
{
|
||||
"windows" "237"
|
||||
"linux" "238"
|
||||
"windows" "268"
|
||||
"linux" "269"
|
||||
"mac" "269"
|
||||
}
|
||||
"Weapon_CanUse"
|
||||
{
|
||||
"windows" "231"
|
||||
"linux" "232"
|
||||
"windows" "262"
|
||||
"linux" "263"
|
||||
"mac" "263"
|
||||
}
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows" "234"
|
||||
"linux" "235"
|
||||
"windows" "265"
|
||||
"linux" "266"
|
||||
"mac" "266"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows" "232"
|
||||
"linux" "233"
|
||||
"windows" "263"
|
||||
"linux" "264"
|
||||
"mac" "264"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
{
|
||||
"windows" "235"
|
||||
"linux" "236"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
"IEntityFactoryDictionary"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
|
||||
"linux" "@_Z23EntityFactoryDictionaryv"
|
||||
"windows" "266"
|
||||
"linux" "267"
|
||||
"mac" "267"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,15 +252,15 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "444"
|
||||
"linux" "445"
|
||||
"mac" "445"
|
||||
"windows" "445"
|
||||
"linux" "446"
|
||||
"mac" "446"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "290"
|
||||
"linux" "291"
|
||||
"mac" "291"
|
||||
"windows" "291"
|
||||
"linux" "292"
|
||||
"mac" "292"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
@@ -288,9 +288,9 @@
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "494"
|
||||
"linux" "494"
|
||||
"mac" "494"
|
||||
"windows" "495"
|
||||
"linux" "495"
|
||||
"mac" "495"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
@@ -330,9 +330,9 @@
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "464"
|
||||
"linux" "465"
|
||||
"mac" "465"
|
||||
"windows" "465"
|
||||
"linux" "466"
|
||||
"mac" "466"
|
||||
}
|
||||
"GiveAmmo"
|
||||
{
|
||||
|
||||
@@ -18,10 +18,8 @@
|
||||
{
|
||||
"game" "ageofchivalry"
|
||||
"game" "bg2"
|
||||
"game" "pvkii"
|
||||
"game" "gesource"
|
||||
"game" "fas"
|
||||
"game" "fistful_of_frags"
|
||||
"game" "cspromod"
|
||||
"game" "ag2"
|
||||
}
|
||||
@@ -71,8 +69,6 @@
|
||||
"#supported"
|
||||
{
|
||||
"game" "ageofchivalry"
|
||||
"game" "pvkii"
|
||||
"game" "fistful_of_frags"
|
||||
"game" "cspromod"
|
||||
"game" "ag2"
|
||||
}
|
||||
@@ -97,12 +93,10 @@
|
||||
"game" "ageofchivalry"
|
||||
"game" "zps"
|
||||
"game" "bg2"
|
||||
"game" "pvkii"
|
||||
"game" "gesource"
|
||||
"game" "RnLBeta"
|
||||
"game" "obsidian"
|
||||
"game" "fas"
|
||||
"game" "fistful_of_frags"
|
||||
"game" "cspromod"
|
||||
"game" "ag2"
|
||||
}
|
||||
|
||||
@@ -237,87 +237,87 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "436"
|
||||
"linux" "437"
|
||||
"mac" "437"
|
||||
"windows" "439"
|
||||
"linux" "440"
|
||||
"mac" "440"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "286"
|
||||
"linux" "287"
|
||||
"mac" "287"
|
||||
"windows" "289"
|
||||
"linux" "290"
|
||||
"mac" "290"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "284"
|
||||
"linux" "285"
|
||||
"mac" "285"
|
||||
"windows" "287"
|
||||
"linux" "288"
|
||||
"mac" "288"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "220"
|
||||
"linux" "221"
|
||||
"mac" "221"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "223"
|
||||
"linux" "224"
|
||||
"mac" "224"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "226"
|
||||
"linux" "227"
|
||||
"mac" "227"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows" "113"
|
||||
"linux" "114"
|
||||
"mac" "114"
|
||||
"windows" "115"
|
||||
"linux" "116"
|
||||
"mac" "116"
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "484"
|
||||
"linux" "484"
|
||||
"mac" "484"
|
||||
"windows" "487"
|
||||
"linux" "487"
|
||||
"mac" "487"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows" "138"
|
||||
"linux" "139"
|
||||
"mac" "139"
|
||||
"windows" "140"
|
||||
"linux" "141"
|
||||
"mac" "141"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows" "129"
|
||||
"linux" "130"
|
||||
"mac" "130"
|
||||
"windows" "131"
|
||||
"linux" "132"
|
||||
"mac" "132"
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
"windows" "38"
|
||||
"linux" "39"
|
||||
"mac" "39"
|
||||
"windows" "40"
|
||||
"linux" "41"
|
||||
"mac" "41"
|
||||
}
|
||||
"SetEntityModel"
|
||||
{
|
||||
"windows" "24"
|
||||
"linux" "25"
|
||||
"mac" "25"
|
||||
"windows" "26"
|
||||
"linux" "27"
|
||||
"mac" "27"
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "277"
|
||||
"linux" "278"
|
||||
"mac" "278"
|
||||
"windows" "280"
|
||||
"linux" "281"
|
||||
"mac" "281"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
"windows" "34"
|
||||
"linux" "35"
|
||||
"mac" "35"
|
||||
"windows" "36"
|
||||
"linux" "37"
|
||||
"mac" "37"
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "455"
|
||||
"linux" "456"
|
||||
"mac" "456"
|
||||
"windows" "458"
|
||||
"linux" "459"
|
||||
"mac" "459"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,32 @@
|
||||
|
||||
"Games"
|
||||
{
|
||||
/* General Temp Entities */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
"GetTEName"
|
||||
{
|
||||
"windows" "4"
|
||||
"linux" "4"
|
||||
"mac" "4"
|
||||
}
|
||||
"GetTENext"
|
||||
{
|
||||
"windows" "8"
|
||||
"linux" "8"
|
||||
"mac" "8"
|
||||
}
|
||||
"TE_GetServerClass"
|
||||
{
|
||||
"windows" "0"
|
||||
"linux" "0"
|
||||
"mac" "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* IServer interface pointer */
|
||||
"#default"
|
||||
{
|
||||
@@ -48,21 +74,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* No longer necessary. Remove later. */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"EntityFactory"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
|
||||
"linux" "@_Z23EntityFactoryDictionaryv"
|
||||
"mac" "@_Z23EntityFactoryDictionaryv"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* SetUserInfo data */
|
||||
"#default"
|
||||
{
|
||||
|
||||
@@ -131,33 +131,33 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "400"
|
||||
"linux" "401"
|
||||
"mac" "401"
|
||||
"windows" "401"
|
||||
"linux" "402"
|
||||
"mac" "402"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "269"
|
||||
"linux" "270"
|
||||
"mac" "270"
|
||||
"windows" "270"
|
||||
"linux" "271"
|
||||
"mac" "271"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "267"
|
||||
"linux" "268"
|
||||
"mac" "268"
|
||||
"windows" "268"
|
||||
"linux" "279"
|
||||
"mac" "279"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "208"
|
||||
"linux" "209"
|
||||
"mac" "209"
|
||||
"windows" "209"
|
||||
"linux" "210"
|
||||
"mac" "210"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "212"
|
||||
"linux" "213"
|
||||
"mac" "213"
|
||||
"windows" "213"
|
||||
"linux" "214"
|
||||
"mac" "214"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
@@ -167,9 +167,9 @@
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "441"
|
||||
"linux" "441"
|
||||
"mac" "441"
|
||||
"windows" "443"
|
||||
"linux" "443"
|
||||
"mac" "443"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
@@ -197,9 +197,9 @@
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "260"
|
||||
"linux" "261"
|
||||
"mac" "261"
|
||||
"windows" "261"
|
||||
"linux" "262"
|
||||
"mac" "262"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
@@ -209,15 +209,15 @@
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "418"
|
||||
"linux" "419"
|
||||
"mac" "419"
|
||||
"windows" "419"
|
||||
"linux" "420"
|
||||
"mac" "420"
|
||||
}
|
||||
"GiveAmmo"
|
||||
{
|
||||
"windows" "251"
|
||||
"linux" "252"
|
||||
"mac" "252"
|
||||
"windows" "252"
|
||||
"linux" "253"
|
||||
"mac" "253"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/* Offset into CBaseTempEntity constructor */
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"windows" "19"
|
||||
"windows" "16"
|
||||
}
|
||||
"GetTEName"
|
||||
{
|
||||
@@ -46,7 +46,7 @@
|
||||
"CBaseTempEntity"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x00\x2A\x2A\x2A\x2A\x89\x48"
|
||||
"windows" "\x55\x8B\xEC\x8B\x45\x08\x89\x41\x04\xC7\x01\x2A\x2A\x2A\x2A\xA1"
|
||||
}
|
||||
"s_pTempEntities"
|
||||
{
|
||||
@@ -66,7 +66,7 @@
|
||||
"FindEntityByClassname"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\x03\xC0\x8B\x3C\xC6\xEB\x2A\x8B"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x57\x8B\xF9\x8B\x4D\x08\x85\xC9\x74\x15"
|
||||
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
}
|
||||
@@ -81,7 +81,7 @@
|
||||
/* Offset into CreateGameRulesObject */
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "2"
|
||||
"windows" "5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
"CreateGameRulesObject"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
|
||||
"windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x07"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
@@ -117,7 +117,7 @@
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57\x89"
|
||||
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x53\x8B\x5D\x20\x8B\xC1\x8B\x4D\x1C\x56\x57\x8B"
|
||||
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
@@ -131,57 +131,57 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "412"
|
||||
"linux" "413"
|
||||
"mac" "413"
|
||||
"windows" "414"
|
||||
"linux" "415"
|
||||
"mac" "415"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "271"
|
||||
"linux" "272"
|
||||
"mac" "272"
|
||||
"windows" "272"
|
||||
"linux" "273"
|
||||
"mac" "273"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "269"
|
||||
"linux" "270"
|
||||
"mac" "270"
|
||||
"windows" "270"
|
||||
"linux" "271"
|
||||
"mac" "271"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "209"
|
||||
"linux" "210"
|
||||
"mac" "210"
|
||||
"windows" "210"
|
||||
"linux" "211"
|
||||
"mac" "211"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "213"
|
||||
"linux" "214"
|
||||
"mac" "214"
|
||||
"windows" "214"
|
||||
"linux" "215"
|
||||
"mac" "215"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows" "109"
|
||||
"linux" "110"
|
||||
"mac" "110"
|
||||
"windows" "110"
|
||||
"linux" "111"
|
||||
"mac" "111"
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "451"
|
||||
"linux" "451"
|
||||
"mac" "451"
|
||||
"windows" "453"
|
||||
"linux" "453"
|
||||
"mac" "453"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows" "141"
|
||||
"linux" "142"
|
||||
"mac" "142"
|
||||
"windows" "142"
|
||||
"linux" "143"
|
||||
"mac" "143"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows" "132"
|
||||
"linux" "133"
|
||||
"mac" "133"
|
||||
"windows" "133"
|
||||
"linux" "134"
|
||||
"mac" "134"
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
@@ -197,9 +197,9 @@
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "262"
|
||||
"linux" "263"
|
||||
"mac" "263"
|
||||
"windows" "263"
|
||||
"linux" "264"
|
||||
"mac" "264"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
@@ -209,15 +209,15 @@
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "430"
|
||||
"linux" "431"
|
||||
"mac" "431"
|
||||
"windows" "432"
|
||||
"linux" "433"
|
||||
"mac" "433"
|
||||
}
|
||||
"GiveAmmo"
|
||||
{
|
||||
"windows" "253"
|
||||
"linux" "253"
|
||||
"mac" "253"
|
||||
"windows" "254"
|
||||
"linux" "255"
|
||||
"mac" "255"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,59 @@
|
||||
"Games"
|
||||
{
|
||||
/* Pirates, Vikings and Knights II */
|
||||
|
||||
/* GameRules */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CreateGameRulesObject */
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "5"
|
||||
"linux" "9"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
/* This signature sometimes has multiple matches, but this
|
||||
* does not matter as g_pGameRules is involved in all of them.
|
||||
* The same g_pGameRules offset applies to each match.
|
||||
*
|
||||
* Sometimes this block of bytes is at the beginning of the static
|
||||
* CreateGameRulesObject function and sometimes it is in the middle
|
||||
* of an entirely different function. This depends on the game.
|
||||
*/
|
||||
"CreateGameRulesObject"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x07"
|
||||
"linux" "\x55\x89\xE5\x56\x53\x83\xEC\x2A\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x85\xC0\x74\x08\x8B\x10\x89"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@g_pGameRules"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CBaseEntityOutput::FireOutput */
|
||||
"pvkii"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x8B\xC1\xC7\x2A\x2A\x2A\x2A\x2A\x00\x56\x57\x89"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\x8B\x55\x08\x8B\x75\x14\x8B\x5A\x14\x85\xDB\x0F\x84"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"pvkii"
|
||||
{
|
||||
"Offsets"
|
||||
@@ -19,80 +72,101 @@
|
||||
/* CBasePlayer */
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "354"
|
||||
"linux" "355"
|
||||
"windows" "403"
|
||||
"linux" "404"
|
||||
"mac" "404"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "241"
|
||||
"linux" "242"
|
||||
"windows" "272"
|
||||
"linux" "273"
|
||||
"mac" "273"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "239"
|
||||
"linux" "240"
|
||||
"windows" "270"
|
||||
"linux" "271"
|
||||
"mac" "271"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "196"
|
||||
"linux" "197"
|
||||
"windows" "211"
|
||||
"linux" "212"
|
||||
"mac" "212"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "200"
|
||||
"linux" "201"
|
||||
"windows" "215"
|
||||
"linux" "216"
|
||||
"mac" "216"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows" "101"
|
||||
"linux" "102"
|
||||
"windows" "109"
|
||||
"linux" "110"
|
||||
"mac" "110"
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "395"
|
||||
"linux" "395"
|
||||
"windows" "442"
|
||||
"linux" "442"
|
||||
"mac" "442"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows" "131"
|
||||
"linux" "132"
|
||||
"windows" "141"
|
||||
"linux" "142"
|
||||
"mac" "142"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows" "123"
|
||||
"linux" "124"
|
||||
"windows" "132"
|
||||
"linux" "133"
|
||||
"mac" "133"
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
"windows" "35"
|
||||
"linux" "36"
|
||||
"windows" "37"
|
||||
"linux" "38"
|
||||
"mac" "38"
|
||||
}
|
||||
"SetEntityModel"
|
||||
{
|
||||
"windows" "24"
|
||||
"linux" "25"
|
||||
"windows" "25"
|
||||
"linux" "26"
|
||||
"mac" "26"
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "232"
|
||||
"linux" "233"
|
||||
"windows" "263"
|
||||
"linux" "264"
|
||||
"mac" "264"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
"windows" "32"
|
||||
"linux" "33"
|
||||
"windows" "34"
|
||||
"linux" "35"
|
||||
"mac" "35"
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "374"
|
||||
"linux" "375"
|
||||
"windows" "421"
|
||||
"linux" "422"
|
||||
"mac" "422"
|
||||
}
|
||||
"FireOutputBackup"
|
||||
"GiveAmmo"
|
||||
{
|
||||
"windows" "6"
|
||||
"linux" "10"
|
||||
"windows" "254"
|
||||
"linux" "255"
|
||||
"mac" "255"
|
||||
}
|
||||
}
|
||||
|
||||
"Keys"
|
||||
{
|
||||
"GameRulesProxy" "CPVK2GameRulesProxy"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
|
||||
@@ -18,33 +18,33 @@
|
||||
{
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows" "396"
|
||||
"linux" "400"
|
||||
"mac" "400"
|
||||
"windows" "397"
|
||||
"linux" "401"
|
||||
"mac" "401"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows" "269"
|
||||
"linux" "270"
|
||||
"mac" "270"
|
||||
"windows" "270"
|
||||
"linux" "271"
|
||||
"mac" "271"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows" "267"
|
||||
"linux" "268"
|
||||
"mac" "268"
|
||||
"windows" "268"
|
||||
"linux" "269"
|
||||
"mac" "269"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "208"
|
||||
"linux" "209"
|
||||
"mac" "209"
|
||||
"windows" "209"
|
||||
"linux" "210"
|
||||
"mac" "210"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "212"
|
||||
"linux" "213"
|
||||
"mac" "213"
|
||||
"windows" "213"
|
||||
"linux" "214"
|
||||
"mac" "214"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
@@ -54,9 +54,9 @@
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "440"
|
||||
"linux" "440"
|
||||
"mac" "440"
|
||||
"windows" "441"
|
||||
"linux" "441"
|
||||
"mac" "441"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
@@ -84,9 +84,9 @@
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows" "260"
|
||||
"linux" "261"
|
||||
"mac" "261"
|
||||
"windows" "261"
|
||||
"linux" "262"
|
||||
"mac" "262"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
@@ -96,15 +96,15 @@
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows" "417"
|
||||
"linux" "418"
|
||||
"mac" "418"
|
||||
"windows" "418"
|
||||
"linux" "419"
|
||||
"mac" "419"
|
||||
}
|
||||
"GiveAmmo"
|
||||
{
|
||||
"windows" "251"
|
||||
"linux" "252"
|
||||
"mac" "252"
|
||||
"windows" "252"
|
||||
"linux" "253"
|
||||
"mac" "253"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,27 +33,27 @@
|
||||
"CTTeamScoreOffset"
|
||||
{
|
||||
"windows" "98"
|
||||
"linux" "124"
|
||||
"linux" "109"
|
||||
"mac" "150"
|
||||
}
|
||||
//Offset into CheckRestartRound
|
||||
"TTeamScoreOffset"
|
||||
{
|
||||
"windows" "122"
|
||||
"linux" "159"
|
||||
"linux" "142"
|
||||
"mac" "185"
|
||||
}
|
||||
"ClanTagOffset"
|
||||
{
|
||||
"windows" "12"
|
||||
"linux" "41"
|
||||
"linux" "29"
|
||||
"mac" "22"
|
||||
}
|
||||
//Offset into HandleCommand_Buy_Internal
|
||||
"CCSPlayerInventoryOffset"
|
||||
{
|
||||
"windows" "285"
|
||||
"linux" "87"
|
||||
"linux" "32"
|
||||
"mac" "109"
|
||||
}
|
||||
"GetItemInLoadout"
|
||||
@@ -96,7 +96,7 @@
|
||||
"TerminateRound"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x83\x2A\x2A\x53\x56\x8B\xF1\xF3\x0F\x2A\x2A\x2A\x2A\x57\x33\xFF\x89\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x00\x00\x00\x00"
|
||||
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x83\x2A\x2A\x53\x56\x57\x8B\xF9\xF3\x0F\x2A\x2A\x2A\x2A\x33\xDB\xC7\x2A\x2A\x2A\x00\x00\x00\x00\x89"
|
||||
"linux" "@_ZN12CCSGameRules14TerminateRoundEfi"
|
||||
"mac" "@_ZN12CCSGameRules14TerminateRoundEfi"
|
||||
}
|
||||
@@ -118,7 +118,7 @@
|
||||
"CheckWinLimit"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x64\x53\x56\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\x81\xF9"
|
||||
"windows" "\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x2A\x53\x56\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\x81\xF9"
|
||||
"linux" "@_ZN12CCSGameRules17CheckRestartRoundEv"
|
||||
"mac" "@_ZN12CCSGameRules17CheckRestartRoundEv"
|
||||
}
|
||||
|
||||
+19
-12
@@ -46,14 +46,14 @@
|
||||
"AddCondition"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x8B\x8E\x2A\x2A\x2A\x2A\x85\xC9\x0F\x84"
|
||||
"windows" "\x55\x8B\xEC\x83\xEC\x08\x56\x8B\xF1\x8B\x8E\x2A\x2A\x2A\x2A\x85\xC9\x0F\x84\x2A\x2A\x2A\x2A\x8B\x01\x8B"
|
||||
"linux" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity"
|
||||
"mac" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity"
|
||||
}
|
||||
"RemoveCondition"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x8B\x75\x08\x57\x8B\xF9\x83\xFE\x40"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x8B\x75\x08\x57\x8B\xF9\x83\xFE\x2A\x7C\x2A\x8D"
|
||||
"linux" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb"
|
||||
"mac" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb"
|
||||
}
|
||||
@@ -81,7 +81,7 @@
|
||||
"MakeBleed"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\xEC\x20\x56\x8B\xF1\x89\x75\xF8"
|
||||
"windows" "\x55\x8B\xEC\x83\xEC\x20\x56\x8B\xF1\x89\x75\xF8\x8B\x8E"
|
||||
"linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefi"
|
||||
"mac" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefi"
|
||||
}
|
||||
@@ -113,22 +113,22 @@
|
||||
{
|
||||
"ForceRespawn"
|
||||
{
|
||||
"windows" "324"
|
||||
"linux" "325"
|
||||
"mac" "325"
|
||||
"windows" "325"
|
||||
"linux" "326"
|
||||
"mac" "326"
|
||||
}
|
||||
"CalcIsAttackCriticalHelper"
|
||||
{
|
||||
"windows" "383"
|
||||
"linux" "390"
|
||||
"mac" "390"
|
||||
}
|
||||
"CalcIsAttackCriticalHelperNoCrits"
|
||||
{
|
||||
"windows" "384"
|
||||
"linux" "391"
|
||||
"mac" "391"
|
||||
}
|
||||
"CalcIsAttackCriticalHelperNoCrits"
|
||||
{
|
||||
"windows" "385"
|
||||
"linux" "392"
|
||||
"mac" "392"
|
||||
}
|
||||
|
||||
// CTFGameRules::IsHolidayActive
|
||||
"IsHolidayActive"
|
||||
@@ -137,6 +137,13 @@
|
||||
"linux" "139"
|
||||
"mac" "139"
|
||||
}
|
||||
|
||||
"RemoveWearable"
|
||||
{
|
||||
"windows" "427"
|
||||
"linux" "428"
|
||||
"mac" "428"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ binary.compiler.cxxincludes += [
|
||||
os.path.join(SM.mms_root, 'core'),
|
||||
os.path.join(SM.mms_root, 'sourcehook')
|
||||
]
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
binary.compiler.linkflags += extra_ldflags
|
||||
binary.sources = [
|
||||
'loader.cpp'
|
||||
|
||||
+17
-34
@@ -58,22 +58,12 @@ new String:g_BanReasonsPath[PLATFORM_MAX_PATH];
|
||||
|
||||
#include "basebans/ban.sp"
|
||||
|
||||
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
|
||||
{
|
||||
BuildPath(Path_SM, g_BanReasonsPath, sizeof(g_BanReasonsPath), "configs/banreasons.txt");
|
||||
if(LoadBanReasons())
|
||||
{
|
||||
return APLRes_Success;
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(error, err_max, "Couldn't load file %s: See log for details.", g_BanReasonsPath);
|
||||
return APLRes_Failure;
|
||||
}
|
||||
}
|
||||
|
||||
public OnPluginStart()
|
||||
{
|
||||
BuildPath(Path_SM, g_BanReasonsPath, sizeof(g_BanReasonsPath), "configs/banreasons.txt");
|
||||
|
||||
LoadBanReasons();
|
||||
|
||||
LoadTranslations("common.phrases");
|
||||
LoadTranslations("basebans.phrases");
|
||||
LoadTranslations("core.phrases");
|
||||
@@ -106,14 +96,7 @@ public OnPluginEnd()
|
||||
public OnMapStart()
|
||||
{
|
||||
//(Re-)Load BanReasons
|
||||
if(g_hKvBanReasons != INVALID_HANDLE)
|
||||
{
|
||||
CloseHandle(g_hKvBanReasons);
|
||||
}
|
||||
if(!LoadBanReasons())
|
||||
{
|
||||
SetFailState("Error trying to load or parse %s: See logfile for details", g_BanReasonsPath);
|
||||
}
|
||||
LoadBanReasons();
|
||||
}
|
||||
|
||||
public OnClientDisconnect(client)
|
||||
@@ -121,32 +104,32 @@ public OnClientDisconnect(client)
|
||||
g_IsWaitingForChatReason[client] = false;
|
||||
}
|
||||
|
||||
public bool:LoadBanReasons()
|
||||
LoadBanReasons()
|
||||
{
|
||||
if (g_hKvBanReasons != INVALID_HANDLE)
|
||||
{
|
||||
CloseHandle(g_hKvBanReasons);
|
||||
}
|
||||
|
||||
g_hKvBanReasons = CreateKeyValues("banreasons");
|
||||
|
||||
if(FileToKeyValues(g_hKvBanReasons, g_BanReasonsPath))
|
||||
{
|
||||
decl String:sectionName[255];
|
||||
if(!KvGetSectionName(g_hKvBanReasons, sectionName, sizeof(sectionName)))
|
||||
{
|
||||
LogMessage("Error in %s: File corrupt or in the wrong format", g_BanReasonsPath);
|
||||
return false;
|
||||
return SetFailState("Error in %s: File corrupt or in the wrong format", g_BanReasonsPath);
|
||||
}
|
||||
|
||||
if(strcmp(sectionName, "banreasons") != 0)
|
||||
{
|
||||
LogMessage("Error in %s: Couldn't find 'banreasons'", g_BanReasonsPath);
|
||||
return false;
|
||||
return SetFailState("Error in %s: Couldn't find 'banreasons'", g_BanReasonsPath);
|
||||
}
|
||||
|
||||
//Reset kvHandle
|
||||
KvRewind(g_hKvBanReasons);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage("Error in %s: File not found, corrupt or in the wrong format", g_BanReasonsPath);
|
||||
return false;
|
||||
} else {
|
||||
return SetFailState("Error in %s: File not found, corrupt or in the wrong format", g_BanReasonsPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ new g_GravityTarget[MAXPLAYERS+1];
|
||||
PerformGravity(client, target, Float:amount)
|
||||
{
|
||||
SetEntityGravity(target, amount);
|
||||
LogAction(client, target, "\"%L\" set gravity on \"%L\" to %d.", client, target, amount);
|
||||
LogAction(client, target, "\"%L\" set gravity on \"%L\" to %f.", client, target, amount);
|
||||
}
|
||||
|
||||
public AdminMenu_Gravity(Handle:topmenu,
|
||||
|
||||
@@ -45,6 +45,25 @@ enum NetFlow
|
||||
NetFlow_Both, /**< Both values added together */
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth string types.
|
||||
*
|
||||
* Note that for the Steam2 and Steam3 types, the following ids are
|
||||
* also valid values:
|
||||
* "STEAM_ID_PENDING" - Authentication is pending.
|
||||
* "STEAM_ID_LAN" - Authentication is disabled because of being on a LAN server.
|
||||
* "BOT" - The client is a bot.
|
||||
*/
|
||||
enum AuthIdType
|
||||
{
|
||||
AuthId_Engine = 0, /**< The game-specific auth string as returned from the engine */
|
||||
|
||||
// The following are only available on games that support Steam authentication.
|
||||
AuthId_Steam2, /**< Steam2 rendered format, ex "STEAM_1:1:4153990" */
|
||||
AuthId_Steam3, /**< Steam3 rendered format, ex "[U:1:8307981]" */
|
||||
AuthId_SteamID64, /**< A SteamID64 (uint64) as a String, ex "76561197968573709" */
|
||||
};
|
||||
|
||||
/**
|
||||
* MAXPLAYERS is not the same as MaxClients.
|
||||
* MAXPLAYERS is a hardcoded value as an upper limit. MaxClients changes based on the server.
|
||||
@@ -261,14 +280,29 @@ native bool:GetClientIP(client, String:ip[], maxlen, bool:remport=true);
|
||||
* @param client Player index.
|
||||
* @param auth Buffer to store the client's auth string.
|
||||
* @param maxlen Maximum length of string buffer (includes NULL terminator).
|
||||
* @param validate Check backend validation status.
|
||||
* DO NOT PASS FALSE UNLESS YOU UNDERSTAND THE CONSEQUENCES,
|
||||
* @param validate Check backend validation status.
|
||||
* DO NOT PASS FALSE UNLESS YOU UNDERSTAND THE CONSEQUENCES,
|
||||
* You WILL KNOW if you need to use this, MOST WILL NOT.
|
||||
* @return True on success, false otherwise.
|
||||
* @error If the client is not connected or the index is invalid.
|
||||
*/
|
||||
native bool:GetClientAuthString(client, String:auth[], maxlen, bool:validate=true);
|
||||
|
||||
/**
|
||||
* Retrieves a client's authentication string (SteamID).
|
||||
*
|
||||
* @param client Player index.
|
||||
* @param authType Auth id type and format to use.
|
||||
* @param auth Buffer to store the client's auth id.
|
||||
* @param maxlen Maximum length of string buffer (includes NULL terminator).
|
||||
* @param validate Check backend validation status.
|
||||
* DO NOT PASS FALSE UNLESS YOU UNDERSTAND THE CONSEQUENCES,
|
||||
* You WILL KNOW if you need to use this, MOST WILL NOT.
|
||||
* @return True on success, false otherwise.
|
||||
* @error If the client is not connected or the index is invalid.
|
||||
*/
|
||||
native bool:GetClientAuthId(client, AuthIdType:authType, String:auth[], maxlen, bool:validate=true);
|
||||
|
||||
/**
|
||||
* Returns the client's Steam account ID.
|
||||
*
|
||||
|
||||
@@ -360,6 +360,18 @@ native bool:KeyValuesToFile(Handle:kv, const String:file[]);
|
||||
*/
|
||||
native bool:FileToKeyValues(Handle:kv, const String:file[]);
|
||||
|
||||
/**
|
||||
* Converts a given string to a KeyValues tree. The string is read into
|
||||
* the current postion of the tree.
|
||||
*
|
||||
* @param kv KeyValues Handle.
|
||||
* @param buffer String buffer to load into the KeyValues.
|
||||
* @param resourceName The resource name of the KeyValues, used for error tracking purposes.
|
||||
* @return True on success, false otherwise.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool:StringToKeyValues(Handle:kv, const String:buffer[], const String:resourceName[]="StringToKeyValues");
|
||||
|
||||
/**
|
||||
* Sets whether or not the KeyValues parser will read escape sequences.
|
||||
* For example, \n would be read as a literal newline. This defaults
|
||||
|
||||
@@ -448,3 +448,229 @@ stock ATTN_TO_SNDLEVEL(Float:attn)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the parameters for a game sound.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param gameSound Name of game sound.
|
||||
* @param channel Channel to emit with.
|
||||
* @param level Sound level.
|
||||
* @param volume Sound volume.
|
||||
* @param pitch Sound pitch.
|
||||
* @param sample Sound file name relative to the "sounds" folder.
|
||||
* @param maxlength Maximum length of sample string buffer.
|
||||
* @param entity Entity the sound is being emitted from.
|
||||
* @return True if the sound was successfully retrieved, false if it
|
||||
* was not found
|
||||
*/
|
||||
native bool:GetGameSoundParams(const String:gameSound[],
|
||||
&channel,
|
||||
&soundLevel,
|
||||
&Float:volume,
|
||||
&pitch,
|
||||
String:sample[],
|
||||
maxlength,
|
||||
entity=SOUND_FROM_PLAYER);
|
||||
|
||||
/**
|
||||
* Emits a game sound to a list of clients.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param clients Array of client indexes.
|
||||
* @param numClients Number of clients in the array.
|
||||
* @param gameSound Name of game sound.
|
||||
* @param entity Entity to emit from.
|
||||
* @param flags Sound flags.
|
||||
* @param speakerentity Unknown.
|
||||
* @param origin Sound origin.
|
||||
* @param dir Sound direction.
|
||||
* @param updatePos Unknown (updates positions?)
|
||||
* @param soundtime Alternate time to play sound for.
|
||||
* @return True if the sound was played successfully, false if it failed
|
||||
* @error Invalid client index.
|
||||
*/
|
||||
stock bool:EmitGameSound(const clients[],
|
||||
numClients,
|
||||
const String:gameSound[],
|
||||
entity = SOUND_FROM_PLAYER,
|
||||
flags = SND_NOFLAGS,
|
||||
speakerentity = -1,
|
||||
const Float:origin[3] = NULL_VECTOR,
|
||||
const Float:dir[3] = NULL_VECTOR,
|
||||
bool:updatePos = true,
|
||||
Float:soundtime = 0.0)
|
||||
{
|
||||
new channel;
|
||||
new level;
|
||||
new Float:volume;
|
||||
new pitch;
|
||||
new String:sample[PLATFORM_MAX_PATH];
|
||||
|
||||
if (GetGameSoundParams(gameSound, channel, level, volume, pitch, sample, sizeof(sample), entity))
|
||||
{
|
||||
EmitSound(clients, numClients, sample, entity, channel, level, flags, volume, pitch, speakerentity, origin, dir, updatePos, soundtime);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emits an ambient game sound.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param gameSound Name of game sound.
|
||||
* @param pos Origin of sound.
|
||||
* @param entity Entity index to associate sound with.
|
||||
* @param flags Sound flags.
|
||||
* @param delay Play delay.
|
||||
* @noreturn
|
||||
*/
|
||||
stock bool:EmitAmbientGameSound(const String:gameSound[],
|
||||
const Float:pos[3],
|
||||
entity = SOUND_FROM_WORLD,
|
||||
flags = SND_NOFLAGS,
|
||||
Float:delay = 0.0)
|
||||
{
|
||||
new channel; // This is never actually used for Ambients, but it's a mandatory field to GetGameSoundParams
|
||||
new level;
|
||||
new Float:volume;
|
||||
new pitch;
|
||||
new String:sample[PLATFORM_MAX_PATH];
|
||||
|
||||
if (GetGameSoundParams(gameSound, channel, level, volume, pitch, sample, sizeof(sample), entity))
|
||||
{
|
||||
EmitAmbientSound(sample, pos, entity, level, flags, volume, pitch, delay);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper to emit a game sound to one client.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @param gameSound Name of game sound.
|
||||
* @param entity Entity to emit from.
|
||||
* @param flags Sound flags.
|
||||
* @param speakerentity Unknown.
|
||||
* @param origin Sound origin.
|
||||
* @param dir Sound direction.
|
||||
* @param updatePos Unknown (updates positions?)
|
||||
* @param soundtime Alternate time to play sound for.
|
||||
* @noreturn
|
||||
* @error Invalid client index.
|
||||
*/
|
||||
stock bool:EmitGameSoundToClient(client,
|
||||
const String:gameSound[],
|
||||
entity = SOUND_FROM_PLAYER,
|
||||
flags = SND_NOFLAGS,
|
||||
speakerentity = -1,
|
||||
const Float:origin[3] = NULL_VECTOR,
|
||||
const Float:dir[3] = NULL_VECTOR,
|
||||
bool:updatePos = true,
|
||||
Float:soundtime = 0.0)
|
||||
{
|
||||
new clients[1];
|
||||
clients[0] = client;
|
||||
/* Save some work for SDKTools and remove SOUND_FROM_PLAYER references */
|
||||
entity = (entity == SOUND_FROM_PLAYER) ? client : entity;
|
||||
return EmitGameSound(clients, 1, gameSound, entity, flags,
|
||||
speakerentity, origin, dir, updatePos, soundtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper to emit game sound to all clients.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param gameSound Name of game sound.
|
||||
* @param entity Entity to emit from.
|
||||
* @param flags Sound flags.
|
||||
* @param speakerentity Unknown.
|
||||
* @param origin Sound origin.
|
||||
* @param dir Sound direction.
|
||||
* @param updatePos Unknown (updates positions?)
|
||||
* @param soundtime Alternate time to play sound for.
|
||||
* @noreturn
|
||||
* @error Invalid client index.
|
||||
*/
|
||||
stock bool:EmitGameSoundToAll(const String:gameSound[],
|
||||
entity = SOUND_FROM_PLAYER,
|
||||
flags = SND_NOFLAGS,
|
||||
speakerentity = -1,
|
||||
const Float:origin[3] = NULL_VECTOR,
|
||||
const Float:dir[3] = NULL_VECTOR,
|
||||
bool:updatePos = true,
|
||||
Float:soundtime = 0.0)
|
||||
{
|
||||
new clients[MaxClients];
|
||||
new total = 0;
|
||||
|
||||
for (new i=1; i<=MaxClients; i++)
|
||||
{
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
clients[total++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (!total)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return EmitGameSound(clients, total, gameSound, entity, flags,
|
||||
speakerentity, origin, dir, updatePos, soundtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Precache a game sound.
|
||||
*
|
||||
* Most games will precache all game sounds on map start, but this is not guaranteed...
|
||||
* Team Fortress 2 is known to not pre-cache MvM game mode sounds on non-MvM maps.
|
||||
*
|
||||
* Due to the above, this native should be called before any calls to GetGameSoundParams,
|
||||
* EmitGameSound*, or EmitAmbientGameSound.
|
||||
*
|
||||
* It should be safe to pass already precached game sounds to this function.
|
||||
*
|
||||
* Note: It precaches all files for a game sound.
|
||||
*
|
||||
* @param soundname Game sound to precache
|
||||
*
|
||||
* @return True if the game sound was found, false if sound did not exist
|
||||
* or had no files
|
||||
*/
|
||||
native bool:PrecacheScriptSound(const String:soundname[]);
|
||||
|
||||
@@ -153,6 +153,17 @@ enum TFCond
|
||||
TFCond_HalloweenTiny,
|
||||
TFCond_HalloweenInHell,
|
||||
TFCond_HalloweenGhostMode,
|
||||
|
||||
TFCond_DodgeChance = 79,
|
||||
TFCond_Parachute,
|
||||
TFCond_BlastJumping,
|
||||
TFCond_HalloweenKart,
|
||||
TFCond_HalloweenKartDash,
|
||||
TFCond_BalloonHead,
|
||||
TFCond_MeleeOnly,
|
||||
TFCond_SwimmingCurse,
|
||||
TFCond_HalloweenKartNoTurn,
|
||||
TFCond_HalloweenKartCage,
|
||||
};
|
||||
|
||||
const Float:TFCondDuration_Infinite = -1.0;
|
||||
@@ -164,6 +175,7 @@ enum TFHoliday
|
||||
TFHoliday_Christmas,
|
||||
TFHoliday_ValentinesDay,
|
||||
TFHoliday_MeetThePyro,
|
||||
TFHoliday_SpyVsEngyWar,
|
||||
TFHoliday_FullMoon,
|
||||
TFHoliday_HalloweenOrFullMoon,
|
||||
TFHoliday_HalloweenOrFullMoonOrValentines,
|
||||
@@ -359,6 +371,17 @@ native bool:TF2_IsHolidayActive(TFHoliday:holiday);
|
||||
*/
|
||||
native bool:TF2_IsPlayerInDuel(client);
|
||||
|
||||
/**
|
||||
* Removes an econ wearable (hat, misc, etc) from a player.
|
||||
* This also deletes the wearable entity.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @param wearable Index of the wearable entity.
|
||||
* @noreturn
|
||||
* @error Invalid client index, client not in game, invalid wearable entity, or no mod support.
|
||||
*/
|
||||
native TF2_RemoveWearable(client, wearable);
|
||||
|
||||
/**
|
||||
* Called after a condition is added to a player
|
||||
*
|
||||
@@ -436,5 +459,6 @@ public __ext_tf2_SetNTVOptional()
|
||||
MarkNativeAsOptional("TF2_GetClass");
|
||||
MarkNativeAsOptional("TF2_IsPlayerInDuel");
|
||||
MarkNativeAsOptional("TF2_IsHolidayActive");
|
||||
MarkNativeAsOptional("TF2_RemoveWearable");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -249,6 +249,7 @@ enum {
|
||||
TF_WEAPON_SPELLBOOK,
|
||||
TF_WEAPON_SPELLBOOK_PROJECTILE,
|
||||
TF_WEAPON_SNIPERRIFLE_CLASSIC,
|
||||
TF_WEAPON_PARACHUTE,
|
||||
};
|
||||
|
||||
// TF2 Weapon Loadout Slots
|
||||
@@ -435,6 +436,20 @@ stock TF2_RemoveWeaponSlot(client, slot)
|
||||
new weaponIndex;
|
||||
while ((weaponIndex = GetPlayerWeaponSlot(client, slot)) != -1)
|
||||
{
|
||||
// bug #6206
|
||||
// papering over a valve bug where a weapon's extra wearables aren't properly removed from the weapon's owner
|
||||
new extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearable");
|
||||
if (extraWearable != -1)
|
||||
{
|
||||
TF2_RemoveWearable(client, extraWearable);
|
||||
}
|
||||
|
||||
extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearableViewModel");
|
||||
if (extraWearable != -1)
|
||||
{
|
||||
TF2_RemoveWearable(client, extraWearable);
|
||||
}
|
||||
|
||||
RemovePlayerItem(client, weaponIndex);
|
||||
AcceptEntityInput(weaponIndex, "Kill");
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.6.0
|
||||
1.6.3
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ i
|
||||
D
|
||||
S
|
||||
!
|
||||
it's so cute, she calls it a mayonegg
|
||||
joys of buildbot, part 5: a watermelon's diatribes need not be cause for spilling the queen's tea
|
||||
crab
|
||||
joys of buildbot, part 6: a merry metal matchturtle mocks mostly and mainly in Madrid.
|
||||
@@ -42,7 +43,7 @@ horrible is horrible is rukia
|
||||
i'm gonna get u good
|
||||
The Patty Winters show this morning was about how terrible sawce is, same as yesterday's show; however, things are looking up for tomorrow.
|
||||
IT'S CLOBBERIN' TIME ERRDAY
|
||||
vc2005 supremecy
|
||||
vc2005 supremecy :|
|
||||
clobstermonkey
|
||||
that thing
|
||||
clobber build because amx.h changed (sigh)
|
||||
|
||||
@@ -14,6 +14,11 @@ binary.compiler.includes += [
|
||||
os.path.join(builder.sourcePath, 'knight', 'shared'),
|
||||
]
|
||||
|
||||
if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang':
|
||||
binary.compiler.cxxflags += ['-fno-rtti']
|
||||
elif binary.compiler.vendor == 'msvc':
|
||||
binary.compiler.cxxflags += ['/GR-']
|
||||
|
||||
if builder.target_platform == 'linux':
|
||||
binary.compiler.postlink += ['-lpthread', '-lrt']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user