Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed598e9b28 | ||
|
|
d93f6984cc | ||
|
|
207584818f | ||
|
|
7a42d6b564 |
@@ -36,7 +36,11 @@
|
|||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
SH_DECL_HOOK1_void(ICvar, UnregisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
SH_DECL_HOOK1_void(ICvar, UnregisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
||||||
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
SH_DECL_HOOK2_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *, bool);
|
||||||
|
#else
|
||||||
SH_DECL_HOOK1_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
SH_DECL_HOOK1_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
SH_DECL_HOOK1_void(ICvar, RegisterConCommandBase, SH_NOATTRIB, 0, ConCommandBase *);
|
SH_DECL_HOOK1_void(ICvar, RegisterConCommandBase, SH_NOATTRIB, 0, ConCommandBase *);
|
||||||
#endif
|
#endif
|
||||||
@@ -78,7 +82,11 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SOURCE_ENGINE == SE_CSGO
|
||||||
|
void LinkConCommandBase(ConCommandBase *pBase, bool unknown)
|
||||||
|
#else
|
||||||
void LinkConCommandBase(ConCommandBase *pBase)
|
void LinkConCommandBase(ConCommandBase *pBase)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
IConCommandLinkListener *listener = IConCommandLinkListener::head;
|
IConCommandLinkListener *listener = IConCommandLinkListener::head;
|
||||||
while (listener)
|
while (listener)
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ IGameConfig *g_pGameConf = NULL;
|
|||||||
IGameEventManager2 *gameevents = NULL;
|
IGameEventManager2 *gameevents = NULL;
|
||||||
bool hooked_everything = false;
|
bool hooked_everything = false;
|
||||||
int g_msgHintText = -1;
|
int g_msgHintText = -1;
|
||||||
|
CGlobalVars *gpGlobals;
|
||||||
|
|
||||||
SMEXT_LINK(&g_CStrike);
|
SMEXT_LINK(&g_CStrike);
|
||||||
|
|
||||||
@@ -107,6 +108,7 @@ bool CStrike::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
|
|||||||
{
|
{
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
||||||
|
gpGlobals = ismm->GetCGlobals();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ private:
|
|||||||
extern IBinTools *g_pBinTools;
|
extern IBinTools *g_pBinTools;
|
||||||
extern IGameConfig *g_pGameConf;
|
extern IGameConfig *g_pGameConf;
|
||||||
extern ISDKTools *g_pSDKTools;
|
extern ISDKTools *g_pSDKTools;
|
||||||
|
extern CGlobalVars *gpGlobals;
|
||||||
extern int g_msgHintText;
|
extern int g_msgHintText;
|
||||||
extern bool g_pIgnoreTerminateDetour;
|
extern bool g_pIgnoreTerminateDetour;
|
||||||
extern bool g_pIgnoreCSWeaponDropDetour;
|
extern bool g_pIgnoreCSWeaponDropDetour;
|
||||||
|
|||||||
@@ -58,7 +58,19 @@ void TimeLeftEvents::FireGameEvent(IGameEvent *event)
|
|||||||
if (get_new_timeleft_offset || !round_end_found)
|
if (get_new_timeleft_offset || !round_end_found)
|
||||||
{
|
{
|
||||||
get_new_timeleft_offset = false;
|
get_new_timeleft_offset = false;
|
||||||
timersys->NotifyOfGameStart();
|
|
||||||
|
float flGameStartTime = gpGlobals->curtime;
|
||||||
|
uintptr_t gamerules = (uintptr_t)g_pSDKTools->GetGameRules();
|
||||||
|
if (gamerules)
|
||||||
|
{
|
||||||
|
sm_sendprop_info_t info;
|
||||||
|
if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info))
|
||||||
|
{
|
||||||
|
flGameStartTime = *(float *)(gamerules + info.actual_offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timersys->NotifyOfGameStart(flGameStartTime - gpGlobals->curtime);
|
||||||
timersys->MapTimeLeftChanged();
|
timersys->MapTimeLeftChanged();
|
||||||
}
|
}
|
||||||
round_end_found = false;
|
round_end_found = false;
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ void EntityOutputManager::Shutdown()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityOutputs->Destroy();
|
|
||||||
ClassNames->Destroy();
|
ClassNames->Destroy();
|
||||||
fireOutputDetour->Destroy();
|
fireOutputDetour->Destroy();
|
||||||
}
|
}
|
||||||
@@ -66,7 +65,6 @@ void EntityOutputManager::Init()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityOutputs = adtfactory->CreateBasicTrie();
|
|
||||||
ClassNames = adtfactory->CreateBasicTrie();
|
ClassNames = adtfactory->CreateBasicTrie();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,45 +118,30 @@ bool EntityOutputManager::FireEventDetour(void *pOutput, CBaseEntity *pActivator
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char sOutput[20];
|
|
||||||
ke::SafeSprintf(sOutput, sizeof(sOutput), "%p", pOutput);
|
|
||||||
|
|
||||||
// attempt to directly lookup a hook using the pOutput pointer
|
// attempt to directly lookup a hook using the pOutput pointer
|
||||||
OutputNameStruct *pOutputName = NULL;
|
OutputNameStruct *pOutputName = NULL;
|
||||||
|
|
||||||
bool fastLookup = false;
|
const char *classname = gamehelpers->GetEntityClassname(pCaller);
|
||||||
|
if (!classname)
|
||||||
// Fast lookup failed - check the slow way for hooks that haven't fired yet
|
|
||||||
if ((fastLookup = EntityOutputs->Retrieve(sOutput, (void **)&pOutputName)) == false)
|
|
||||||
{
|
{
|
||||||
const char *classname = gamehelpers->GetEntityClassname(pCaller);
|
return true;
|
||||||
if (!classname)
|
}
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *outputname = FindOutputName(pOutput, pCaller);
|
const char *outputname = FindOutputName(pOutput, pCaller);
|
||||||
if (!outputname)
|
if (!outputname)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pOutputName = FindOutputPointer(classname, outputname, false);
|
pOutputName = FindOutputPointer(classname, outputname, false);
|
||||||
|
|
||||||
if (!pOutputName)
|
if (!pOutputName)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pOutputName->hooks.empty())
|
if (!pOutputName->hooks.empty())
|
||||||
{
|
{
|
||||||
if (!fastLookup)
|
|
||||||
{
|
|
||||||
// hook exists on this classname and output - map it into our quick find trie
|
|
||||||
EntityOutputs->Insert(sOutput, pOutputName);
|
|
||||||
}
|
|
||||||
|
|
||||||
SourceHook::List<omg_hooks *>::iterator _iter;
|
SourceHook::List<omg_hooks *>::iterator _iter;
|
||||||
|
|
||||||
omg_hooks *hook;
|
omg_hooks *hook;
|
||||||
|
|||||||
@@ -121,8 +121,6 @@ private:
|
|||||||
|
|
||||||
const char *FindOutputName(void *pOutput, CBaseEntity *pCaller);
|
const char *FindOutputName(void *pOutput, CBaseEntity *pCaller);
|
||||||
|
|
||||||
//Maps CEntityOutput * to a OutputNameStruct
|
|
||||||
IBasicTrie *EntityOutputs;
|
|
||||||
// Maps classname to a ClassNameStruct
|
// Maps classname to a ClassNameStruct
|
||||||
IBasicTrie *ClassNames;
|
IBasicTrie *ClassNames;
|
||||||
|
|
||||||
|
|||||||
@@ -615,7 +615,10 @@ native int FormatNativeString(int out_param,
|
|||||||
*
|
*
|
||||||
* @param data Data passed to the RequestFrame native.
|
* @param data Data passed to the RequestFrame native.
|
||||||
*/
|
*/
|
||||||
typedef RequestFrameCallback = function void (any data);
|
typeset RequestFrameCallback {
|
||||||
|
function void ();
|
||||||
|
function void (any data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a single use Next Frame hook.
|
* Creates a single use Next Frame hook.
|
||||||
|
|||||||
Reference in New Issue
Block a user