Remove support for Source 1 Dota 2. (#496)

This commit is contained in:
Nicholas Hastings
2016-04-26 23:18:47 -04:00
parent 6dc602ad7c
commit 40f2512317
52 changed files with 101 additions and 2264 deletions
-12
View File
@@ -179,11 +179,7 @@ SH_DECL_MANUALHOOK0_void(PostThink, 0, 0, 0);
SH_DECL_MANUALHOOK0(Reload, 0, 0, 0, bool);
SH_DECL_MANUALHOOK2_void(SetTransmit, 0, 0, 0, CCheckTransmitInfo *, bool);
SH_DECL_MANUALHOOK2(ShouldCollide, 0, 0, 0, bool, int, int);
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_MANUALHOOK1_void(Spawn, 0, 0, 0, CEntityKeyValues *);
#else
SH_DECL_MANUALHOOK0_void(Spawn, 0, 0, 0);
#endif
SH_DECL_MANUALHOOK1_void(StartTouch, 0, 0, 0, CBaseEntity *);
SH_DECL_MANUALHOOK0_void(Think, 0, 0, 0);
SH_DECL_MANUALHOOK1_void(Touch, 0, 0, 0, CBaseEntity *);
@@ -1355,11 +1351,7 @@ bool SDKHooks::Hook_ShouldCollide(int collisionGroup, int contentsMask)
RETURN_META_VALUE(MRES_IGNORED, true);
}
#if SOURCE_ENGINE == SE_DOTA
void SDKHooks::Hook_Spawn(CEntityKeyValues *kv)
#else
void SDKHooks::Hook_Spawn()
#endif
{
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
@@ -1393,11 +1385,7 @@ void SDKHooks::Hook_Spawn()
RETURN_META(MRES_IGNORED);
}
#if SOURCE_ENGINE == SE_DOTA
void SDKHooks::Hook_SpawnPost(CEntityKeyValues *kv)
#else
void SDKHooks::Hook_SpawnPost()
#endif
{
Call(META_IFACEPTR(CBaseEntity), SDKHook_SpawnPost);
}
-9
View File
@@ -31,10 +31,6 @@
#define GAMEDESC_CAN_CHANGE
#endif
#if SOURCE_ENGINE == SE_DOTA
class CEntityKeyValues;
#endif
/**
* Globals
@@ -305,13 +301,8 @@ public:
bool Hook_ReloadPost();
void Hook_SetTransmit(CCheckTransmitInfo *pInfo, bool bAlways);
bool Hook_ShouldCollide(int collisonGroup, int contentsMask);
#if SOURCE_ENGINE == SE_DOTA
void Hook_Spawn(CEntityKeyValues *kv);
void Hook_SpawnPost(CEntityKeyValues *kv);
#else
void Hook_Spawn();
void Hook_SpawnPost();
#endif
void Hook_StartTouch(CBaseEntity *pOther);
void Hook_StartTouchPost(CBaseEntity *pOther);
void Hook_Think();
-12
View File
@@ -44,11 +44,7 @@ public: //IRecipientFilter
bool IsReliable() const;
bool IsInitMessage() const;
int GetRecipientCount() const;
#if SOURCE_ENGINE == SE_DOTA
CEntityIndex GetRecipientIndex(int slot) const;
#else
int GetRecipientIndex(int slot) const;
#endif
public:
void Initialize(cell_t *ptr, size_t count);
void SetToReliable(bool isreliable);
@@ -83,11 +79,7 @@ inline int CellRecipientFilter::GetRecipientCount() const
return m_Size;
}
#if SOURCE_ENGINE == SE_DOTA
inline CEntityIndex CellRecipientFilter::GetRecipientIndex(int slot) const
#else
inline int CellRecipientFilter::GetRecipientIndex(int slot) const
#endif
{
int ret;
if ((slot < 0) || (slot >= GetRecipientCount()))
@@ -99,11 +91,7 @@ inline int CellRecipientFilter::GetRecipientIndex(int slot) const
ret = static_cast<int>(m_Players[slot]);
}
#if SOURCE_ENGINE == SE_DOTA
return CEntityIndex(ret);
#else
return ret;
#endif
}
inline void CellRecipientFilter::SetToInit(bool isinitmsg)
-2
View File
@@ -262,9 +262,7 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
GET_V_IFACE_ANY(GetEngineFactory, engsound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION);
GET_V_IFACE_ANY(GetEngineFactory, enginetrace, IEngineTrace, INTERFACEVERSION_ENGINETRACE_SERVER);
GET_V_IFACE_ANY(GetEngineFactory, netstringtables, INetworkStringTableContainer, INTERFACENAME_NETWORKSTRINGTABLESERVER);
#if SOURCE_ENGINE != SE_DOTA
GET_V_IFACE_ANY(GetEngineFactory, pluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
#endif
GET_V_IFACE_ANY(GetServerFactory, serverClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
GET_V_IFACE_ANY(GetEngineFactory, voiceserver, IVoiceServer, INTERFACEVERSION_VOICESERVER);
GET_V_IFACE_ANY(GetServerFactory, playerinfomngr, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);
+1 -3
View File
@@ -95,9 +95,7 @@ public: //IClientListner
public: // IVoiceServer
bool OnSetClientListening(int iReceiver, int iSender, bool bListen);
void VoiceInit();
#if SOURCE_ENGINE == SE_DOTA
void OnClientCommand(CEntityIndex index, const CCommand &args);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void OnClientCommand(edict_t *pEntity, const CCommand &args);
#else
void OnClientCommand(edict_t *pEntity);
+1 -7
View File
@@ -138,13 +138,7 @@ size_t TempEntHooks::_FillInPlayers(int *pl_array, IRecipientFilter *pFilter)
for (size_t i=0; i<size; i++)
{
int index;
#if SOURCE_ENGINE == SE_DOTA
index = pFilter->GetRecipientIndex(i).Get();
#else
index = pFilter->GetRecipientIndex(i);
#endif
pl_array[i] = index;
pl_array[i] = pFilter->GetRecipientIndex(i);
}
return size;
-4
View File
@@ -217,11 +217,7 @@ int GetClientAimTarget(edict_t *pEdict, bool only_players)
QAngle eye_angles;
/* Get the private information we need */
#if SOURCE_ENGINE == SE_DOTA
serverClients->ClientEarPosition(IndexOfEdict(pEdict), &eye_position);
#else
serverClients->ClientEarPosition(pEdict, &eye_position);
#endif
if (!GetEyeAngles(pEntity, &eye_angles))
{
-16
View File
@@ -486,11 +486,7 @@ static cell_t SetClientViewEntity(IPluginContext *pContext, const cell_t *params
return pContext->ThrowNativeError("Entity %d is not valid", params[2]);
}
#if SOURCE_ENGINE == SE_DOTA
engine->SetView(params[1], params[2]);
#else
engine->SetView(player->GetEdict(), pEdict);
#endif
return 1;
}
@@ -683,11 +679,7 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params)
/* Force suicide */
if (should_slay)
{
#if SOURCE_ENGINE == SE_DOTA
engine->ClientCommand(params[1], "kill\n");
#else
pluginhelpers->ClientCommand(pEdict, "kill\n");
#endif
}
if (s_frag_offs > 0)
@@ -711,11 +703,7 @@ static cell_t GetClientEyePosition(IPluginContext *pContext, const cell_t *param
}
Vector pos;
#if SOURCE_ENGINE == SE_DOTA
serverClients->ClientEarPosition(params[1], &pos);
#else
serverClients->ClientEarPosition(player->GetEdict(), &pos);
#endif
cell_t *addr;
pContext->LocalToPhysAddr(params[2], &addr);
@@ -1362,11 +1350,7 @@ static cell_t SetClientName(IPluginContext *pContext, const cell_t *params)
FINISH_CALL_SIMPLE(NULL);
// Notify the server of the change.
#if SOURCE_ENGINE == SE_DOTA
serverClients->ClientSettingsChanged(player->GetIndex());
#else
serverClients->ClientSettingsChanged(player->GetEdict());
#endif
return 1;
}
+2 -8
View File
@@ -58,9 +58,7 @@ bool g_ClientMutes[SM_MAXPLAYERS+1][SM_MAXPLAYERS+1];
SH_DECL_HOOK3(IVoiceServer, SetClientListening, SH_NOATTRIB, 0, bool, int, int, bool);
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, CEntityIndex, const CCommand &);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
#else
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
@@ -93,11 +91,7 @@ void SDKTools::VoiceInit()
SH_ADD_HOOK(IServerGameClients, ClientCommand, serverClients, SH_MEMBER(this, &SDKTools::OnClientCommand), true);
}
#if SOURCE_ENGINE == SE_DOTA
void SDKTools::OnClientCommand(CEntityIndex index, const CCommand &args)
{
int client = index.Get();
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void SDKTools::OnClientCommand(edict_t *pEntity, const CCommand &args)
{
int client = IndexOfEdict(pEntity);
+1 -27
View File
@@ -32,11 +32,7 @@
#include "vsound.h"
#include <IForwardSys.h>
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, CEntityIndex, const Vector &, const char *, float, soundlevel_t, int, int, float);
#else
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float);
#endif
#if SOURCE_ENGINE >= SE_PORTAL2
SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 0, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
@@ -74,13 +70,7 @@ size_t SoundHooks::_FillInPlayers(int *pl_array, IRecipientFilter *pFilter)
for (size_t i=0; i<size; i++)
{
int index;
#if SOURCE_ENGINE == SE_DOTA
index = pFilter->GetRecipientIndex(i).Get();
#else
index = pFilter->GetRecipientIndex(i);
#endif
pl_array[i] = index;
pl_array[i] = pFilter->GetRecipientIndex(i);
}
return size;
@@ -227,16 +217,9 @@ bool SoundHooks::RemoveHook(int type, IPluginFunction *pFunc)
return false;
}
#if SOURCE_ENGINE == SE_DOTA
void SoundHooks::OnEmitAmbientSound(CEntityIndex index, const Vector &pos, const char *samp, float vol,
soundlevel_t soundlevel, int fFlags, int pitch, float delay)
{
int entindex = index.Get();
#else
void SoundHooks::OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol,
soundlevel_t soundlevel, int fFlags, int pitch, float delay)
{
#endif
SoundHookIter iter;
IPluginFunction *pFunc;
cell_t vec[3] = {sp_ftoc(pos.x), sp_ftoc(pos.y), sp_ftoc(pos.z)};
@@ -272,13 +255,8 @@ void SoundHooks::OnEmitAmbientSound(int entindex, const Vector &pos, const char
vec2.x = sp_ctof(vec[0]);
vec2.y = sp_ctof(vec[1]);
vec2.z = sp_ctof(vec[2]);
#if SOURCE_ENGINE == SE_DOTA
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::EmitAmbientSound,
(CEntityIndex(entindex), vec2, buffer, vol, soundlevel, fFlags, pitch, delay));
#else
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::EmitAmbientSound,
(entindex, vec2, buffer, vol, soundlevel, fFlags, pitch, delay));
#endif
}
}
}
@@ -755,11 +733,7 @@ static cell_t FadeClientVolume(IPluginContext *pContext, const cell_t *params)
}
engine->FadeClientVolume(
#if SOURCE_ENGINE == SE_DOTA
player->GetIndex(),
#else
player->GetEdict(),
#endif
sp_ctof(params[2]),
sp_ctof(params[3]),
sp_ctof(params[4]),
-4
View File
@@ -51,11 +51,7 @@ public:
void AddHook(int type, IPluginFunction *pFunc);
bool RemoveHook(int type, IPluginFunction *pFunc);
#if SOURCE_ENGINE == SE_DOTA
void OnEmitAmbientSound(CEntityIndex index, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
#else
void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
#endif
#if SOURCE_ENGINE >= SE_PORTAL2
int OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *, unsigned int, const char *pSample, float flVolume,
-4
View File
@@ -138,11 +138,7 @@ static cell_t ReadStringTable(IPluginContext *pContext, const cell_t *params)
}
stringidx = params[2];
#if SOURCE_ENGINE == SE_DOTA
value = pTable->GetString(stringidx, false);
#else
value = pTable->GetString(stringidx);
#endif
if (!value)
{