Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01989d3851 |
@@ -36,11 +36,7 @@
|
|||||||
|
|
||||||
#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
|
||||||
@@ -82,11 +78,7 @@ 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)
|
||||||
|
|||||||
@@ -356,6 +356,27 @@ static cell_t GetAvgPackets(IPluginContext *pContext, const cell_t *params)
|
|||||||
return sp_ftoc(value);
|
return sp_ftoc(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t sm_GetClientIClient(IPluginContext *pContext, const cell_t *params)
|
||||||
|
{
|
||||||
|
int client = params[1];
|
||||||
|
|
||||||
|
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
|
||||||
|
if (!pPlayer)
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Client index %d is invalid", client);
|
||||||
|
}
|
||||||
|
else if (!pPlayer->IsConnected())
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Client %d is not connected", client);
|
||||||
|
}
|
||||||
|
else if (pPlayer->IsFakeClient())
|
||||||
|
{
|
||||||
|
return pContext->ThrowNativeError("Client %d is a bot", client);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (cell_t)pPlayer->GetIClient();
|
||||||
|
}
|
||||||
|
|
||||||
static cell_t RunAdminCacheChecks(IPluginContext *pContext, const cell_t *params)
|
static cell_t RunAdminCacheChecks(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
int client = params[1];
|
int client = params[1];
|
||||||
@@ -392,6 +413,7 @@ REGISTER_NATIVES(playernatives)
|
|||||||
{"GetClientAvgChoke", GetAvgChoke},
|
{"GetClientAvgChoke", GetAvgChoke},
|
||||||
{"GetClientAvgData", GetAvgData},
|
{"GetClientAvgData", GetAvgData},
|
||||||
{"GetClientAvgPackets", GetAvgPackets},
|
{"GetClientAvgPackets", GetAvgPackets},
|
||||||
|
{"GetClientIClient", sm_GetClientIClient },
|
||||||
{"RunAdminCacheChecks", RunAdminCacheChecks},
|
{"RunAdminCacheChecks", RunAdminCacheChecks},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ 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);
|
||||||
|
|
||||||
@@ -108,7 +107,6 @@ 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,7 +166,6 @@ 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,19 +58,7 @@ 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;
|
||||||
|
|||||||
@@ -53,10 +53,6 @@ static CBaseEntity *FindEntityByNetClass(int start, const char *classname)
|
|||||||
if (network == NULL)
|
if (network == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
IHandleEntity *pHandleEnt = network->GetEntityHandle();
|
|
||||||
if (pHandleEnt == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
ServerClass *sClass = network->GetServerClass();
|
ServerClass *sClass = network->GetServerClass();
|
||||||
const char *name = sClass->GetName();
|
const char *name = sClass->GetName();
|
||||||
|
|
||||||
|
|||||||
@@ -741,6 +741,15 @@ native float GetClientAvgData(int client, NetFlow flow);
|
|||||||
*/
|
*/
|
||||||
native float GetClientAvgPackets(int client, NetFlow flow);
|
native float GetClientAvgPackets(int client, NetFlow flow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the client's baseserver IClient pointer.
|
||||||
|
*
|
||||||
|
* @param client Player's index.
|
||||||
|
* @return IClient address.
|
||||||
|
* @error Invalid client index, client not connected, or fake client.
|
||||||
|
*/
|
||||||
|
native Address GetClientIClient(int client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates an userid index to the real player index.
|
* Translates an userid index to the real player index.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -615,10 +615,7 @@ native int FormatNativeString(int out_param,
|
|||||||
*
|
*
|
||||||
* @param data Data passed to the RequestFrame native.
|
* @param data Data passed to the RequestFrame native.
|
||||||
*/
|
*/
|
||||||
typeset RequestFrameCallback {
|
typedef RequestFrameCallback = function void (any data);
|
||||||
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