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

View File

@ -32,7 +32,6 @@ PossibleSDKs = {
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
'csgo': SDK('HL2SDKCSGO', '2.csgo', '20', 'CSGO', WinLinuxMac, 'csgo'),
'dota': SDK('HL2SDKDOTA', '2.dota', '21', 'DOTA', [], 'dota'),
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'),
'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'),
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'),
@ -409,10 +408,10 @@ class SMConfig(object):
# For everything after Swarm, this needs to be defined for entity networking
# to work properly with sendprop value changes.
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
if sdk.name in ['blade', 'insurgency', 'csgo']:
compiler.defines += ['NETWORK_VARS_ENABLED']
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'dota']:
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2']:
if builder.target_platform in ['linux', 'mac']:
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
@ -447,7 +446,7 @@ class SMConfig(object):
compiler.Dep(os.path.join(lib_folder, 'mathlib_i486.a'))
]
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
if sdk.name in ['blade', 'insurgency', 'csgo']:
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
self.AddVersioning(binary)
@ -456,7 +455,7 @@ class SMConfig(object):
if builder.target_platform == 'linux':
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency']:
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
elif sdk.name in ['l4d', 'blade', 'insurgency', 'csgo', 'dota']:
elif sdk.name in ['l4d', 'blade', 'insurgency', 'csgo']:
dynamic_libs = ['libtier0.so', 'libvstdlib.so']
else:
dynamic_libs = ['tier0_i486.so', 'vstdlib_i486.so']
@ -465,7 +464,7 @@ class SMConfig(object):
dynamic_libs = ['libtier0.dylib', 'libvstdlib.dylib']
elif builder.target_platform == 'windows':
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo']:
libs.append('interfaces')
for lib in libs:
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'

View File

@ -59,18 +59,11 @@ for sdk_name in SM.sdks:
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.6.1', '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')
]
if builder.target_platform == 'linux':
compiler.postlink += ['-lpthread', '-lrt']
if sdk.name == 'csgo' or sdk.name == 'dota':
if sdk.name == 'csgo':
if builder.target_platform == 'linux':
lib_path = os.path.join(sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a')
elif builder.target_platform == 'mac':
@ -89,7 +82,7 @@ for sdk_name in SM.sdks:
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs' + vs_year, 'libprotobuf.lib')
compiler.linkflags.insert(0, binary.Dep(lib_path))
if sdk.name in ['csgo', 'dota']:
if sdk.name == 'csgo':
binary.sources += ['smn_protobuf.cpp']
else:
binary.sources += ['smn_bitbuffer.cpp']
@ -100,17 +93,6 @@ for sdk_name in SM.sdks:
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
]
elif sdk.name == 'dota':
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'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessage_helpers.cpp'),
]
SM.binaries += builder.Add(project)

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(const 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)

View File

@ -295,11 +295,7 @@ bool ChatTriggers::OnSayCommand_Post(int client, const ICommandArgs *command)
/* Execute the cached command */
unsigned int old = SetReplyTo(SM_REPLY_CHAT);
#if SOURCE_ENGINE == SE_DOTA
engine->ClientCommand(client, "%s", m_ToExecute);
#else
serverpluginhelpers->ClientCommand(PEntityOfEntIndex(client), m_ToExecute);
#endif
SetReplyTo(old);
}

View File

@ -63,9 +63,7 @@
#endif
#if SH_IMPL_VERSION >= 5
# if SOURCE_ENGINE == SE_DOTA
SH_DECL_EXTERN2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
# elif SOURCE_ENGINE >= SE_ORANGEBOX
# if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
# else
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
@ -131,9 +129,7 @@ class GenericCommandHooker : public IConCommandLinkListener
}
}
#if SOURCE_ENGINE == SE_DOTA
void Dispatch(const CCommandContext &context, const CCommand& args)
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void Dispatch(const CCommand& args)
#else
void Dispatch()

View File

@ -67,10 +67,7 @@ ConVar *g_ServerCfgFile = NULL;
void CheckAndFinalizeConfigs();
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_EXTERN2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
void Hook_ExecDispatchPre(const CCommandContext &context, const CCommand &cmd)
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
void Hook_ExecDispatchPre(const CCommand &cmd)
#elif SOURCE_ENGINE == SE_DARKMESSIAH
@ -94,9 +91,7 @@ void Hook_ExecDispatchPre()
}
}
#if SOURCE_ENGINE == SE_DOTA
void Hook_ExecDispatchPost(const CCommandContext &context, const CCommand &cmd)
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void Hook_ExecDispatchPost(const CCommand &cmd)
#else
void Hook_ExecDispatchPost()

View File

@ -156,7 +156,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 && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_LEFT4DEAD
int EventManager::GetEventDebugID()
{
return EVENT_DEBUG_ID_INIT;

View File

@ -110,7 +110,7 @@ public: // IPluginsListener
void OnPluginUnloaded(IPlugin *plugin);
public: // IGameEventListener2
void FireGameEvent(IGameEvent *pEvent);
#if SOURCE_ENGINE >= SE_LEFT4DEAD && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_LEFT4DEAD
int GetEventDebugID();
#endif
public:

View File

@ -36,17 +36,12 @@ SH_DECL_HOOK3_void(ICvar, CallGlobalChangeCallbacks, SH_NOATTRIB, false, ConVar
SH_DECL_HOOK2_void(ICvar, CallGlobalChangeCallback, SH_NOATTRIB, false, ConVar *, const char *);
#endif
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK5_void(IServerGameDLL, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, CEntityIndex, EQueryCvarValueStatus, const char *, const char *);
SH_DECL_HOOK5_void(IServerPluginCallbacks, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, CEntityIndex, EQueryCvarValueStatus, const char *, const char *);
#elif SOURCE_ENGINE != SE_DARKMESSIAH
#if SOURCE_ENGINE != SE_DARKMESSIAH
SH_DECL_HOOK5_void(IServerGameDLL, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, edict_t *, EQueryCvarValueStatus, const char *, const char *);
SH_DECL_HOOK5_void(IServerPluginCallbacks, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, edict_t *, EQueryCvarValueStatus, const char *, const char *);
#endif
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#else
SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
@ -88,7 +83,7 @@ void GameHooks::OnVSPReceived()
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL || vsp_version < 2)
return;
#if SOURCE_ENGINE != SE_DARKMESSIAH && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE != SE_DARKMESSIAH
hooks_ += SH_ADD_HOOK(IServerPluginCallbacks, OnQueryCvarValueFinished, vsp_interface, SH_MEMBER(this, &GameHooks::OnQueryCvarValueFinished), false);
client_cvar_query_mode_ = ClientCvarQueryMode::VSP;
#endif
@ -116,19 +111,9 @@ void GameHooks::OnConVarChanged(ConVar *pConVar, const char *oldValue)
}
#if SOURCE_ENGINE != SE_DARKMESSIAH
# if SOURCE_ENGINE == SE_DOTA
void GameHooks::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, CEntityIndex player, EQueryCvarValueStatus result,
const char *cvarName, const char *cvarValue)
# else
void GameHooks::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result,
const char *cvarName, const char *cvarValue)
# endif
{
# if SOURCE_ENGINE == SE_DOTA
int client = player.Get();
# else
const char *cvarName, const char *cvarValue){
int client = IndexOfEdict(pPlayer);
# endif
# if SOURCE_ENGINE == SE_CSGO
if (g_Players.HandleConVarQuery(cookie, client, result, cvarName, cvarValue))

View File

@ -40,10 +40,7 @@ class ConVar;
class CCommand;
struct CCommandContext;
#if SOURCE_ENGINE == SE_DOTA
# define DISPATCH_ARGS const CCommandContext &context, const CCommand &command
# define DISPATCH_PROLOGUE
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
# define DISPATCH_ARGS const CCommand &command
# define DISPATCH_PROLOGUE
#else
@ -109,10 +106,7 @@ private:
#endif
// Callback for when StartQueryCvarValue() has finished.
#if SOURCE_ENGINE == SE_DOTA
void OnQueryCvarValueFinished(QueryCvarCookie_t cookie, CEntityIndex player, EQueryCvarValueStatus result,
const char *cvarName, const char *cvarValue);
#elif SOURCE_ENGINE != SE_DARKMESSIAH
#if SOURCE_ENGINE != SE_DARKMESSIAH
void OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result,
const char *cvarName, const char *cvarValue);
#endif

View File

@ -43,9 +43,7 @@
#include <tier0/mem.h>
#include <bridge/include/ILogger.h>
#if SOURCE_ENGINE == SE_DOTA
#include <game/shared/protobuf/usermessages.pb.h>
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
#include <cstrike15_usermessages.pb.h>
#endif
@ -318,11 +316,7 @@ ICommandLine *CHalfLife2::GetValveCommandLine()
#if SOURCE_ENGINE != SE_DARKMESSIAH
IChangeInfoAccessor *CBaseEdict::GetChangeAccessor()
{
#if SOURCE_ENGINE == SE_DOTA
return engine->GetChangeAccessor( IndexOfEdict((const edict_t *)this) );
#else
return engine->GetChangeAccessor( (const edict_t *)this );
#endif
}
#endif
@ -530,17 +524,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
char buffer[253];
ke::SafeSprintf(buffer, sizeof(buffer), "%s\1\n", msg);
#if SOURCE_ENGINE == SE_DOTA
CUserMsg_SayText *pMsg;
if ((pMsg = (CUserMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
pMsg->set_client(0);
pMsg->set_text(buffer);
pMsg->set_chat(false);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_SayText *pMsg;
if ((pMsg = (CCSUsrMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -567,16 +551,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
}
}
#if SOURCE_ENGINE == SE_DOTA
CUserMsg_TextMsg *pMsg;
if ((pMsg = (CUserMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
pMsg->set_dest(dest);
pMsg->add_param(msg);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_TextMsg *pMsg;
if ((pMsg = (CCSUsrMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -609,15 +584,7 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
{
cell_t players[] = {client};
#if SOURCE_ENGINE == SE_DOTA
CUserMsg_HintText *pMsg;
if ((pMsg = (CUserMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
pMsg->set_message(msg);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_HintText *pMsg;
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -647,15 +614,7 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
bool CHalfLife2::HintTextMsg(cell_t *players, int count, const char *msg)
{
#if SOURCE_ENGINE == SE_DOTA
CUserMsg_HintText *pMsg;
if ((pMsg = (CUserMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
{
return false;
}
pMsg->set_message(msg);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_HintText *pMsg;
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
{
@ -690,13 +649,7 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
int count = 0;
cell_t players[] = {client};
#if SOURCE_ENGINE == SE_DOTA
CUserMsg_VGUIMenu *pMsg;
if ((pMsg = (CUserMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_VGUIMenu *pMsg;
if ((pMsg = (CCSUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -721,18 +674,7 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
SubKey = data->GetFirstSubKey();
}
#if SOURCE_ENGINE == SE_DOTA
pMsg->set_name(name);
pMsg->set_show(show);
while (SubKey)
{
CUserMsg_VGUIMenu_Keys *key = pMsg->add_keys();
key->set_name(SubKey->GetName());
key->set_value(SubKey->GetString());
SubKey = SubKey->GetNextKey();
}
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
pMsg->set_name(name);
pMsg->set_show(show);
@ -788,11 +730,7 @@ void CHalfLife2::ProcessFakeCliCmdQueue()
if (g_Players.GetClientOfUserId(pFake->userid) == pFake->client)
{
CPlayer *pPlayer = g_Players.GetPlayerByIndex(pFake->client);
#if SOURCE_ENGINE == SE_DOTA
engine->ClientCommand(pPlayer->GetIndex(), "%s", pFake->cmd.c_str());
#else
serverpluginhelpers->ClientCommand(pPlayer->GetEdict(), pFake->cmd.c_str());
#endif
}
m_CmdQueue.pop();

View File

@ -124,7 +124,7 @@ public:
int m_SerialNumber;
CEntInfo *m_pPrev;
CEntInfo *m_pNext;
#if (SOURCE_ENGINE >= SE_PORTAL2) && (SOURCE_ENGINE != SE_DOTA)
#if SOURCE_ENGINE >= SE_PORTAL2
string_t m_iName;
string_t m_iClassName;
#endif

View File

@ -141,11 +141,7 @@ void CRadioStyle::OnSourceModShutdown()
bool CRadioStyle::IsSupported()
{
#if SOURCE_ENGINE == SE_DOTA
return false;
#else
return (g_ShowMenuId != -1);
#endif
}
bool CRadioStyle::OnClientCommand(int client, const char *cmdname, const CCommand &cmd)
@ -176,10 +172,9 @@ void CRadioStyle::OnUserMessage(int msg_id, protobuf::Message &msg, IRecipientFi
void CRadioStyle::OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter)
#endif
{
#if SOURCE_ENGINE != SE_DOTA
int count = pFilter->GetRecipientCount();
#ifdef USE_PROTOBUF_USERMESSAGES
#if SOURCE_ENGINE == SE_CSGO
int c = ((CCSUsrMsg_ShowMenu &)msg).display_time();
#else
bf_read br(bf->GetBasePointer(), 3);
@ -194,7 +189,6 @@ void CRadioStyle::OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFil
{
g_last_clients[g_last_client_count++] = pFilter->GetRecipientIndex(i);
}
#endif
}
void CRadioStyle::OnUserMessageSent(int msg_id)
@ -474,7 +468,6 @@ void CRadioMenuPlayer::Radio_Init(int keys, const char *title, const char *text)
void CRadioMenuPlayer::Radio_Refresh()
{
#if SOURCE_ENGINE != SE_DOTA
cell_t players[1] = { (cell_t)m_index };
char *ptr = display_pkt;
char save = 0;
@ -491,8 +484,7 @@ void CRadioMenuPlayer::Radio_Refresh()
time = menuHoldTime - (unsigned int)(gpGlobals->curtime - menuStartTime);
}
#ifdef USE_PROTOBUF_USERMESSAGES
// If or when we need to support multiple games per engine with this, we can switch to reflection
#if SOURCE_ENGINE == SE_CSGO
// TODO: find what happens past 240 on CS:GO
CCSUsrMsg_ShowMenu *msg = (CCSUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS);
msg->set_bits_valid_slots(display_keys);
@ -528,7 +520,6 @@ void CRadioMenuPlayer::Radio_Refresh()
#endif
display_last_refresh = gpGlobals->curtime;
#endif // !DOTA
}
int CRadioDisplay::GetAmountRemaining()

View File

@ -65,20 +65,16 @@ bool ValveMenuStyle::OnClientCommand(int client, const char *cmdname, const CCom
void ValveMenuStyle::OnSourceModAllInitialized()
{
#if SOURCE_ENGINE != SE_DOTA
g_Players.AddClientListener(this);
SH_ADD_HOOK(IServerPluginHelpers, CreateMessage, serverpluginhelpers, SH_MEMBER(this, &ValveMenuStyle::HookCreateMessage), false);
g_pSPHCC = SH_GET_CALLCLASS(serverpluginhelpers);
#endif
}
void ValveMenuStyle::OnSourceModShutdown()
{
#if SOURCE_ENGINE != SE_DOTA
SH_RELEASE_CALLCLASS(g_pSPHCC);
SH_REMOVE_HOOK(IServerPluginHelpers, CreateMessage, serverpluginhelpers, SH_MEMBER(this, &ValveMenuStyle::HookCreateMessage), false);
g_Players.RemoveClientListener(this);
#endif
}
void ValveMenuStyle::HookCreateMessage(edict_t *pEdict,

View File

@ -48,9 +48,7 @@ SH_DECL_HOOK2_void(IVEngineServer, ChangeLevel, SH_NOATTRIB, 0, const char *, co
SH_DECL_HOOK4_void(IVEngineServer, ChangeLevel, SH_NOATTRIB, 0, const char *, const char *, const char *, bool);
#endif
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_EXTERN2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
@ -210,10 +208,7 @@ NextMapManager::NextMapManager()
m_mapHistory = SourceHook::List<MapChangeData *>();
}
#if SOURCE_ENGINE == SE_DOTA
void CmdChangeLevelCallback(const CCommandContext &context, const CCommand &command)
{
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdChangeLevelCallback(const CCommand &command)
{
#else

View File

@ -59,9 +59,7 @@ struct MapChangeData
time_t startTime;
};
#if SOURCE_ENGINE == SE_DOTA
void CmdChangeLevelCallback(const CCommandContext &context, const CCommand &command);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdChangeLevelCallback(const CCommand &command);
#else
void CmdChangeLevelCallback();
@ -72,9 +70,7 @@ class NextMapManager : public SMGlobalClass
public:
NextMapManager();
#if SOURCE_ENGINE == SE_DOTA
friend void CmdChangeLevelCallback(const CCommandContext &context, const CCommand &command);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
friend void CmdChangeLevelCallback(const CCommand &command);
#else
friend void CmdChangeLevelCallback();

View File

@ -65,13 +65,6 @@ List<ICommandTargetProcessor *> target_processors;
ConVar sm_debug_connect("sm_debug_connect", "0", 0, "Log Debug information about potential connection issues.");
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, CEntityIndex, const char *, const char *, char *, int);
SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, CEntityIndex, const char *);
SH_DECL_HOOK2_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, CEntityIndex, int);
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, CEntityIndex, const CCommand &);
SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, CEntityIndex);
#else
SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, edict_t *, const char *, const char *, char *, int);
SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, edict_t *, const char *);
SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, edict_t *);
@ -81,26 +74,20 @@ SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *,
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
#endif
SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, edict_t *);
#endif // SE_DOTA
#if SOURCE_ENGINE >= SE_EYE && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_EYE
SH_DECL_HOOK2_void(IServerGameClients, ClientCommandKeyValues, SH_NOATTRIB, 0, edict_t *, KeyValues *);
#endif
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK0_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0);
#else
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t *, int, int);
#endif
#if SOURCE_ENGINE >= SE_LEFT4DEAD && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_LEFT4DEAD
SH_DECL_HOOK1_void(IServerGameDLL, ServerHibernationUpdate, SH_NOATTRIB, 0, bool);
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox. +dota
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox.
SH_DECL_HOOK1_void(IServerGameDLL, SetServerHibernation, SH_NOATTRIB, 0, bool);
#endif
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_EXTERN2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
@ -177,15 +164,15 @@ void PlayerManager::OnSourceModAllInitialized()
SH_ADD_HOOK(IServerGameClients, ClientDisconnect, serverClients, SH_MEMBER(this, &PlayerManager::OnClientDisconnect), false);
SH_ADD_HOOK(IServerGameClients, ClientDisconnect, serverClients, SH_MEMBER(this, &PlayerManager::OnClientDisconnect_Post), true);
SH_ADD_HOOK(IServerGameClients, ClientCommand, serverClients, SH_MEMBER(this, &PlayerManager::OnClientCommand), false);
#if SOURCE_ENGINE >= SE_EYE && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_EYE
SH_ADD_HOOK(IServerGameClients, ClientCommandKeyValues, serverClients, SH_MEMBER(this, &PlayerManager::OnClientCommandKeyValues), false);
SH_ADD_HOOK(IServerGameClients, ClientCommandKeyValues, serverClients, SH_MEMBER(this, &PlayerManager::OnClientCommandKeyValues_Post), true);
#endif
SH_ADD_HOOK(IServerGameClients, ClientSettingsChanged, serverClients, SH_MEMBER(this, &PlayerManager::OnClientSettingsChanged), true);
SH_ADD_HOOK(IServerGameDLL, ServerActivate, gamedll, SH_MEMBER(this, &PlayerManager::OnServerActivate), true);
#if SOURCE_ENGINE >= SE_LEFT4DEAD && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_LEFT4DEAD
SH_ADD_HOOK(IServerGameDLL, ServerHibernationUpdate, gamedll, SH_MEMBER(this, &PlayerManager::OnServerHibernationUpdate), true);
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox. +dota
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox.
SH_ADD_HOOK(IServerGameDLL, SetServerHibernation, gamedll, SH_MEMBER(this, &PlayerManager::OnServerHibernationUpdate), true);
#endif
@ -230,15 +217,15 @@ void PlayerManager::OnSourceModShutdown()
SH_REMOVE_HOOK(IServerGameClients, ClientDisconnect, serverClients, SH_MEMBER(this, &PlayerManager::OnClientDisconnect), false);
SH_REMOVE_HOOK(IServerGameClients, ClientDisconnect, serverClients, SH_MEMBER(this, &PlayerManager::OnClientDisconnect_Post), true);
SH_REMOVE_HOOK(IServerGameClients, ClientCommand, serverClients, SH_MEMBER(this, &PlayerManager::OnClientCommand), false);
#if SOURCE_ENGINE >= SE_EYE && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_EYE
SH_REMOVE_HOOK(IServerGameClients, ClientCommandKeyValues, serverClients, SH_MEMBER(this, &PlayerManager::OnClientCommandKeyValues), false);
SH_REMOVE_HOOK(IServerGameClients, ClientCommandKeyValues, serverClients, SH_MEMBER(this, &PlayerManager::OnClientCommandKeyValues_Post), true);
#endif
SH_REMOVE_HOOK(IServerGameClients, ClientSettingsChanged, serverClients, SH_MEMBER(this, &PlayerManager::OnClientSettingsChanged), true);
SH_REMOVE_HOOK(IServerGameDLL, ServerActivate, gamedll, SH_MEMBER(this, &PlayerManager::OnServerActivate), true);
#if SOURCE_ENGINE >= SE_LEFT4DEAD && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_LEFT4DEAD
SH_REMOVE_HOOK(IServerGameDLL, ServerHibernationUpdate, gamedll, SH_MEMBER(this, &PlayerManager::OnServerHibernationUpdate), true);
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox. +dota
#elif SOURCE_ENGINE > SE_EYE // 2013/orangebox, but not original orangebox.
SH_REMOVE_HOOK(IServerGameDLL, SetServerHibernation, gamedll, SH_MEMBER(this, &PlayerManager::OnServerHibernationUpdate), true);
#endif
@ -307,11 +294,7 @@ ConfigResult PlayerManager::OnSourceModConfigChanged(const char *key,
return ConfigResult_Ignore;
}
#if SOURCE_ENGINE == SE_DOTA
void PlayerManager::OnServerActivate()
#else
void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
#endif
{
static ConVar *tv_enable = icvar->FindVar("tv_enable");
#if SOURCE_ENGINE == SE_TF2
@ -329,11 +312,7 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
g_OnMapStarted = true;
m_bServerActivated = true;
#if SOURCE_ENGINE == SE_DOTA
extsys->CallOnCoreMapStart(gpGlobals->pEdicts, gpGlobals->maxEntities, gpGlobals->maxClients);
#else
extsys->CallOnCoreMapStart(pEdictList, edictCount, m_maxClients);
#endif
m_onActivate->Execute(NULL);
m_onActivate2->Execute(NULL);
@ -499,16 +478,9 @@ void PlayerManager::RunAuthChecks()
}
}
#if SOURCE_ENGINE == SE_DOTA
bool PlayerManager::OnClientConnect(CEntityIndex index, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#else
bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = IndexOfEdict(pEntity);
#endif
CPlayer *pPlayer = &m_Players[client];
++m_PlayersSinceActive;
@ -525,13 +497,8 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
logger->LogMessage("\"%s<%d><%s><>\" was already connected to the server.", pPlayer->GetName(), pPlayer->GetUserId(), pAuth);
}
#if SOURCE_ENGINE == SE_DOTA
OnClientDisconnect(pPlayer->GetIndex(), 0);
OnClientDisconnect_Post(pPlayer->GetIndex(), 0);
#else
OnClientDisconnect(pPlayer->GetEdict());
OnClientDisconnect_Post(pPlayer->GetEdict());
#endif
}
pPlayer->Initialize(pszName, pszAddress, pEntity);
@ -578,7 +545,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
m_AuthQueue[++m_AuthQueue[0]] = client;
}
m_UserIdLookUp[GetPlayerUserId(pEntity)] = client;
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
}
else
{
@ -591,17 +558,9 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
return true;
}
#if SOURCE_ENGINE == SE_DOTA
bool PlayerManager::OnClientConnect_Post(CEntityIndex index, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#else
bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = IndexOfEdict(pEntity);
#endif
bool orig_value = META_RESULT_ORIG_RET(bool);
CPlayer *pPlayer = &m_Players[client];
@ -638,18 +597,10 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
return true;
}
#if SOURCE_ENGINE == SE_DOTA
void PlayerManager::OnClientPutInServer(CEntityIndex index, const char *playername)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#else
void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername)
{
int client = IndexOfEdict(pEntity);
#endif
cell_t res;
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
/* If they're not connected, they're a bot */
@ -682,7 +633,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
// This doesn't actually get incremented until OnClientConnect. Fake it to check.
int newCount = m_PlayersSinceActive + 1;
int userId = GetPlayerUserId(pEntity);
int userId = engine->GetPlayerUserId(pEntity);
#if (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013 \
|| SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2)
static ConVar *tv_name = icvar->FindVar("tv_name");
@ -722,11 +673,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
m_SourceTVUserId = userId;
}
#if SOURCE_ENGINE == SE_DOTA
if (!OnClientConnect(client, playername, "127.0.0.1", error, sizeof(error)))
#else
if (!OnClientConnect(pEntity, playername, "127.0.0.1", error, sizeof(error)))
#endif
{
/* :TODO: kick the bot if it's rejected */
return;
@ -808,13 +755,8 @@ void PlayerManager::OnSourceModLevelEnd()
{
if (m_Players[i].IsConnected())
{
#if SOURCE_ENGINE == SE_DOTA
OnClientDisconnect(m_Players[i].GetIndex(), 0);
OnClientDisconnect_Post(m_Players[i].GetIndex(), 0);
#else
OnClientDisconnect(m_Players[i].GetEdict());
OnClientDisconnect_Post(m_Players[i].GetEdict());
#endif
}
}
m_PlayerCount = 0;
@ -838,30 +780,17 @@ void PlayerManager::OnServerHibernationUpdate(bool bHibernating)
if (pPlayer->IsSourceTV() || pPlayer->IsReplay())
continue;
#endif
#if SOURCE_ENGINE == SE_DOTA
OnClientDisconnect(m_Players[i].GetIndex(), 0);
OnClientDisconnect_Post(m_Players[i].GetIndex(), 0);
#else
OnClientDisconnect(m_Players[i].GetEdict());
OnClientDisconnect_Post(m_Players[i].GetEdict());
#endif
}
}
}
}
#if SOURCE_ENGINE == SE_DOTA
void PlayerManager::OnClientDisconnect(CEntityIndex index, int reason)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#else
void PlayerManager::OnClientDisconnect(edict_t *pEntity)
{
int client = IndexOfEdict(pEntity);
#endif
cell_t res;
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (pPlayer->IsConnected())
@ -889,16 +818,9 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
}
}
#if SOURCE_ENGINE == SE_DOTA
void PlayerManager::OnClientDisconnect_Post(CEntityIndex index, int reason)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#else
void PlayerManager::OnClientDisconnect_Post(edict_t *pEntity)
{
int client = IndexOfEdict(pEntity);
#endif
CPlayer *pPlayer = &m_Players[client];
if (!pPlayer->IsConnected())
{
@ -1114,24 +1036,17 @@ void ListPluginsToClient(CPlayer *player, const CCommand &args)
}
}
#if SOURCE_ENGINE == SE_DOTA
void PlayerManager::OnClientCommand(CEntityIndex index, const CCommand &args)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void PlayerManager::OnClientCommand(edict_t *pEntity, const CCommand &args)
{
int client = IndexOfEdict(pEntity);
#else
void PlayerManager::OnClientCommand(edict_t *pEntity)
{
CCommand args;
int client = IndexOfEdict(pEntity);
#endif
cell_t res = Pl_Continue;
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (!pPlayer->IsConnected())
@ -1236,7 +1151,7 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
}
}
#if SOURCE_ENGINE >= SE_EYE && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_EYE
static bool s_LastCCKVAllowed = true;
void PlayerManager::OnClientCommandKeyValues(edict_t *pEntity, KeyValues *pCommand)
@ -1316,18 +1231,10 @@ void PlayerManager::OnClientCommandKeyValues_Post(edict_t *pEntity, KeyValues *p
}
#endif
#if SOURCE_ENGINE == SE_DOTA
void PlayerManager::OnClientSettingsChanged(CEntityIndex index)
{
int client = index.Get();
edict_t *pEntity = PEntityOfEntIndex(client);
#else
void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
{
int client = IndexOfEdict(pEntity);
#endif
cell_t res;
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (!pPlayer->IsConnected())
@ -1447,7 +1354,7 @@ int PlayerManager::GetClientOfUserId(int userid)
CPlayer *player = GetPlayerByIndex(client);
if (player && player->IsConnected())
{
int realUserId = GetPlayerUserId(player->GetEdict());
int realUserId = engine->GetPlayerUserId(player->GetEdict());
if (realUserId == userid)
{
return client;
@ -1464,7 +1371,7 @@ int PlayerManager::GetClientOfUserId(int userid)
{
continue;
}
if (GetPlayerUserId(player->GetEdict()) == userid)
if (engine->GetPlayerUserId(player->GetEdict()) == userid)
{
m_UserIdLookUp[userid] = i;
return i;
@ -1570,7 +1477,7 @@ void PlayerManager::InvalidatePlayer(CPlayer *pPlayer)
}
}
m_UserIdLookUp[GetPlayerUserId(pPlayer->m_pEdict)] = 0;
m_UserIdLookUp[engine->GetPlayerUserId(pPlayer->m_pEdict)] = 0;
pPlayer->Disconnect();
}
@ -1995,10 +1902,7 @@ int PlayerManager::GetClientFromSerial(unsigned int serial)
return 0;
}
#if SOURCE_ENGINE == SE_DOTA
void CmdMaxplayersCallback(const CCommandContext &context, const CCommand &command)
{
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdMaxplayersCallback(const CCommand &command)
{
#else
@ -2108,13 +2012,7 @@ void CPlayer::UpdateAuthIds()
}
// First cache engine networkid
const char *authstr;
#if SOURCE_ENGINE == SE_DOTA
authstr = engine->GetPlayerNetworkIDString(m_iIndex - 1);
#else
authstr = engine->GetPlayerNetworkIDString(m_pEdict);
#endif
const char *authstr = engine->GetPlayerNetworkIDString(m_pEdict);
if (!authstr)
{
// engine doesn't have the client's auth string just yet, we can't do anything
@ -2144,13 +2042,7 @@ void CPlayer::UpdateAuthIds()
k_unSteamUserDesktopInstance, k_EUniversePublic, k_EAccountTypeIndividual);
}
#else
const CSteamID *steamId;
#if SOURCE_ENGINE == SE_DOTA
steamId = engine->GetClientSteamID(m_iIndex);
#else
steamId = engine->GetClientSteamID(m_pEdict);
#endif
const CSteamID *steamId = engine->GetClientSteamID(m_pEdict);
if (steamId)
{
m_SteamId = (*steamId);
@ -2348,11 +2240,7 @@ bool CPlayer::IsAuthStringValidated()
#if SOURCE_ENGINE >= SE_ORANGEBOX
if (!IsFakeClient() && g_Players.m_bAuthstringValidation && !g_HL2.IsLANServer())
{
#if SOURCE_ENGINE == SE_DOTA
return engine->IsClientFullyAuthenticated(m_iIndex);
#else
return engine->IsClientFullyAuthenticated(m_pEdict);
#endif
}
#endif
@ -2438,12 +2326,7 @@ void CPlayer::Kick(const char *str)
else
{
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
#if SOURCE_ENGINE == SE_DOTA
// Including network_connection.pb.h (and .cpp) is overkill for just this. -p
// Copied from ENetworkDisconnectionReason enum
const int NETWORK_DISCONNECT_KICKED = 39;
pClient->Disconnect(NETWORK_DISCONNECT_KICKED);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
pClient->Disconnect(str);
#else
pClient->Disconnect("%s", str);
@ -2560,7 +2443,7 @@ void CPlayer::DoBasicAdminChecks()
{
if (!g_Players.CheckSetAdminName(client, this, id))
{
int userid = GetPlayerUserId(m_pEdict);
int userid = engine->GetPlayerUserId(m_pEdict);
g_Timers.CreateTimer(&s_KickPlayerTimer, 0.1f, (void *)userid, 0);
}
return;
@ -2599,7 +2482,7 @@ int CPlayer::GetUserId()
{
if (m_UserId == -1)
{
m_UserId = GetPlayerUserId(GetEdict());
m_UserId = engine->GetPlayerUserId(GetEdict());
}
return m_UserId;
@ -2675,9 +2558,5 @@ void CPlayer::PrintToConsole(const char *pMsg)
return;
}
#if SOURCE_ENGINE == SE_DOTA
engine->ClientPrintf(m_iIndex, pMsg);
#else
engine->ClientPrintf(m_pEdict, pMsg);
#endif
}

View File

@ -164,16 +164,6 @@ public:
CPlayer *GetPlayerByIndex(int client) const;
void RunAuthChecks();
public:
#if SOURCE_ENGINE == SE_DOTA
bool OnClientConnect(CEntityIndex index, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
bool OnClientConnect_Post(CEntityIndex index, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
void OnClientPutInServer(CEntityIndex index, char const *playername);
void OnClientDisconnect(CEntityIndex index, int reason);
void OnClientDisconnect_Post(CEntityIndex index, int reason);
void OnClientCommand(CEntityIndex index, const CCommand &args);
void OnClientSettingsChanged(CEntityIndex index);
//void OnClientSettingsChanged_Pre(CEntityIndex client);
#else
bool OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
bool OnClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
void OnClientPutInServer(edict_t *pEntity, char const *playername);
@ -181,7 +171,7 @@ public:
void OnClientDisconnect_Post(edict_t *pEntity);
#if SOURCE_ENGINE >= SE_ORANGEBOX
void OnClientCommand(edict_t *pEntity, const CCommand &args);
#if SOURCE_ENGINE >= SE_EYE && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_EYE
void OnClientCommandKeyValues(edict_t *pEntity, KeyValues *pCommand);
void OnClientCommandKeyValues_Post(edict_t *pEntity, KeyValues *pCommand);
#endif
@ -190,7 +180,6 @@ public:
#endif
void OnClientSettingsChanged(edict_t *pEntity);
//void OnClientSettingsChanged_Pre(edict_t *pEntity);
#endif
void OnServerHibernationUpdate(bool bHibernating);
public: //IPlayerManager
void AddClientListener(IClientListener *listener);
@ -236,11 +225,7 @@ public:
bool HandleConVarQuery(QueryCvarCookie_t cookie, int client, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue);
#endif
private:
#if SOURCE_ENGINE == SE_DOTA
void OnServerActivate();
#else
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
#endif
void InvalidatePlayer(CPlayer *pPlayer);
private:
List<IClientListener *> m_hooks;
@ -275,9 +260,7 @@ private:
bool m_bInCCKVHook;
};
#if SOURCE_ENGINE == SE_DOTA
void CmdMaxplayersCallback(const CCommandContext &context, const CCommand &command);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdMaxplayersCallback(const CCommand &command);
#else
void CmdMaxplayersCallback();

View File

@ -33,16 +33,14 @@
#include "sm_stringutil.h"
#include "logic_bridge.h"
#if SOURCE_ENGINE == SE_DOTA
#include <dota_usermessage_helpers.h>
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
#include <cstrike15_usermessage_helpers.h>
#endif
#include <amtl/am-string.h>
UserMessages g_UserMsgs;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
SH_DECL_HOOK3_void(IVEngineServer, SendUserMessage, SH_NOATTRIB, 0, IRecipientFilter &, int, const protobuf::Message &);
#else
#if SOURCE_ENGINE >= SE_LEFT4DEAD
@ -95,7 +93,7 @@ void UserMessages::OnSourceModAllShutdown()
{
if (m_HookCount)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Pre), false);
SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Post), true);
#else
@ -110,10 +108,7 @@ void UserMessages::OnSourceModAllShutdown()
int UserMessages::GetMessageIndex(const char *msg)
{
#if SOURCE_ENGINE == SE_DOTA
// Can split this per engine and/or game later
return g_DotaUsermessageHelpers.GetIndex(msg);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
// Can split this per engine and/or game later
return g_Cstrike15UsermessageHelpers.GetIndex(msg);
#else
@ -151,9 +146,7 @@ int UserMessages::GetMessageIndex(const char *msg)
bool UserMessages::GetMessageName(int msgid, char *buffer, size_t maxlength) const
{
#ifdef USE_PROTOBUF_USERMESSAGES
#if SOURCE_ENGINE == SE_DOTA
const char *pszName = g_DotaUsermessageHelpers.GetName(msgid);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
const char *pszName = g_Cstrike15UsermessageHelpers.GetName(msgid);
#endif
if (!pszName)
@ -304,7 +297,7 @@ bool UserMessages::EndMessage()
return false;
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
if (m_CurFlags & USERMSG_BLOCKHOOKS)
{
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(m_CellRecFilter), m_CurId, *m_FakeEngineBuffer);
@ -334,7 +327,7 @@ bool UserMessages::EndMessage()
} else {
engine->MessageEnd();
}
#endif // SE_CSGO || SE_DOTA
#endif // SE_CSGO
m_InExec = false;
m_CurFlags = 0;
@ -419,7 +412,7 @@ bool UserMessages::InternalHook(int msg_id, IBitBufUserMessageListener *pListene
if (!m_HookCount++)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
SH_ADD_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Pre), false);
SH_ADD_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Post), true);
#else
@ -443,9 +436,7 @@ bool UserMessages::InternalHook(int msg_id, IBitBufUserMessageListener *pListene
#ifdef USE_PROTOBUF_USERMESSAGES
const protobuf::Message *UserMessages::GetMessagePrototype(int msg_type)
{
#if SOURCE_ENGINE == SE_DOTA
return g_DotaUsermessageHelpers.GetPrototype(msg_type);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
return g_Cstrike15UsermessageHelpers.GetPrototype(msg_type);
#endif
}
@ -496,7 +487,7 @@ void UserMessages::_DecRefCounter()
{
if (--m_HookCount == 0)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Pre), false);
SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Post), true);
#else
@ -508,12 +499,10 @@ void UserMessages::_DecRefCounter()
}
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg)
{
#if SOURCE_ENGINE == SE_DOTA
OnStartMessage_Pre(&filter, msg_type, g_DotaUsermessageHelpers.GetName(msg_type));
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
OnStartMessage_Pre(&filter, msg_type, g_Cstrike15UsermessageHelpers.GetName(msg_type));
#endif
if (m_FakeMetaRes == MRES_SUPERCEDE)
@ -528,9 +517,7 @@ void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type,
m_FakeEngineBuffer = &const_cast<protobuf::Message &>(msg);
}
#if SOURCE_ENGINE == SE_DOTA
OnStartMessage_Post(&filter, msg_type, g_DotaUsermessageHelpers.GetName(msg_type));
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
OnStartMessage_Post(&filter, msg_type, g_Cstrike15UsermessageHelpers.GetName(msg_type));
#endif
@ -564,7 +551,7 @@ void UserMessages::OnSendUserMessage_Post(IRecipientFilter &filter, int msg_type
RETURN_META(res)
#endif
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
protobuf::Message *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
@ -604,7 +591,7 @@ bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_typ
UM_RETURN_META_VALUE(MRES_IGNORED, NULL);
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
protobuf::Message *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)
@ -769,7 +756,7 @@ void UserMessages::OnMessageEnd_Pre()
if (!handled && intercepted)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer);
#else
bf_write *engine_bfw;
@ -781,11 +768,11 @@ void UserMessages::OnMessageEnd_Pre()
m_ReadBuffer.StartReading(m_InterceptBuffer.GetBasePointer(), m_InterceptBuffer.GetNumBytesWritten());
engine_bfw->WriteBitsFromBuffer(&m_ReadBuffer, m_InterceptBuffer.GetNumBitsWritten());
ENGINE_CALL(MessageEnd)();
#endif // SE_CSGO || SE_DOTA
#endif // SE_CSGO
}
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
int size = m_OrigBuffer->ByteSize();
uint8 *data = (uint8 *)stackalloc(size);
m_OrigBuffer->SerializePartialToArray(data, size);
@ -815,7 +802,7 @@ void UserMessages::OnMessageEnd_Pre()
iter++;
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
delete pTempMsg;
#endif
}

View File

@ -44,7 +44,7 @@
using namespace SourceHook;
using namespace SourceMod;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
#define USE_PROTOBUF_USERMESSAGES
#endif
@ -102,12 +102,12 @@ public: //IUserMessages
bool intercept=false);
UserMessageType GetUserMessageType() const;
public:
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
void OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg);
void OnSendUserMessage_Post(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg);
#endif
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
protobuf::Message *OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name);
protobuf::Message *OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name);
#elif SOURCE_ENGINE >= SE_LEFT4DEAD

File diff suppressed because it is too large Load Diff

View File

@ -45,9 +45,7 @@
#include "ConCmdManager.h"
#include "IDBDriver.h"
#include "provider.h"
#if SOURCE_ENGINE == SE_DOTA
# include "convar_sm_dota.h"
#elif SOURCE_ENGINE >= SE_ALIENSWARM
#if SOURCE_ENGINE >= SE_ALIENSWARM
# include "convar_sm_swarm.h"
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
# include "convar_sm_l4d.h"
@ -116,19 +114,11 @@ public:
}
virtual void ClientCommand(edict_t *pEdict, const char *szCommand)
{
#if SOURCE_ENGINE == SE_DOTA
engine->ClientCommand(IndexOfEdict(pEdict), "%s", szCommand);
#else
engine->ClientCommand(pEdict, "%s", szCommand);
#endif
}
virtual void FakeClientCommand(edict_t *pEdict, const char *szCommand)
{
#if SOURCE_ENGINE == SE_DOTA
engine->ClientCommand(IndexOfEdict(pEdict), "%s", szCommand);
#else
serverpluginhelpers->ClientCommand(pEdict, szCommand);
#endif
}
} engine_wrapper;
@ -401,8 +391,6 @@ void UTIL_ConsolePrint(const char *fmt, ...)
#define GAMEFIX "2.insurgency"
#elif SOURCE_ENGINE == SE_CSGO
#define GAMEFIX "2.csgo"
#elif SOURCE_ENGINE == SE_DOTA
#define GAMEFIX "2.dota"
#elif SOURCE_ENGINE == SE_CONTAGION
#define GAMEFIX "2.contagion"
#else
@ -528,8 +516,6 @@ const char *CoreProviderImpl::GetSourceEngineName()
return "insurgency";
#elif SOURCE_ENGINE == SE_CSGO
return "csgo";
#elif SOURCE_ENGINE == SE_DOTA
return "dota";
#endif
}
@ -546,8 +532,7 @@ bool CoreProviderImpl::SymbolsAreHidden()
|| (SOURCE_ENGINE == SE_LEFT4DEAD2) \
|| (SOURCE_ENGINE == SE_INSURGENCY) \
|| (SOURCE_ENGINE == SE_BLADE) \
|| (SOURCE_ENGINE == SE_CSGO) \
|| (SOURCE_ENGINE == SE_DOTA)
|| (SOURCE_ENGINE == SE_CSGO)
return true;
#else
return false;
@ -605,7 +590,7 @@ bool CoreProviderImpl::DescribePlayer(int index, const char **namep, const char
*authp = (auth && *auth) ? auth : "STEAM_ID_PENDING";
}
if (useridp)
*useridp = GetPlayerUserId(player->GetEdict());
*useridp = ::engine->GetPlayerUserId(player->GetEdict());
return true;
}
@ -655,15 +640,9 @@ int CoreProviderImpl::QueryClientConVar(int client, const char *cvar)
#if SOURCE_ENGINE != SE_DARKMESSIAH
switch (hooks_.GetClientCvarQueryMode()) {
case ClientCvarQueryMode::DLL:
# if SOURCE_ENGINE == SE_DOTA
return ::engine->StartQueryCvarValue(CEntityIndex(client), cvar);
# else
return ::engine->StartQueryCvarValue(PEntityOfEntIndex(client), cvar);
# endif
case ClientCvarQueryMode::VSP:
# if SOURCE_ENGINE != SE_DOTA
return serverpluginhelpers->StartQueryCvarValue(PEntityOfEntIndex(client), cvar);
# endif
default:
return InvalidQueryCvarCookie;
}

View File

@ -51,7 +51,7 @@
#include <bridge/include/ILogger.h>
#include <ITranslator.h>
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
#include <netmessages.pb.h>
#endif
@ -977,7 +977,7 @@ static cell_t FakeClientCommandEx(IPluginContext *pContext, const cell_t *params
return 0;
}
g_HL2.AddToFakeCliCmdQueue(params[1], GetPlayerUserId(pPlayer->GetEdict()), buffer);
g_HL2.AddToFakeCliCmdQueue(params[1], engine->GetPlayerUserId(pPlayer->GetEdict()), buffer);
return 1;
}
@ -1164,7 +1164,7 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
char data[256];
bf_write buffer(data, sizeof(data));
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
#if SOURCE_ENGINE == SE_CSGO
CNETMsg_SetConVar msg;
CMsg_CVars_CVar *cvar = msg.mutable_convars()->add_cvars();
@ -1259,7 +1259,7 @@ static cell_t ConVar_ReplicateToClient(IPluginContext *pContext, const cell_t *p
static cell_t FakeClientCommandKeyValues(IPluginContext *pContext, const cell_t *params)
{
#if SOURCE_ENGINE >= SE_EYE && SOURCE_ENGINE != SE_DOTA
#if SOURCE_ENGINE >= SE_EYE
int client = params[1];
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);

View File

@ -1583,11 +1583,9 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
case FIELD_CLASSPTR:
type = PropEnt_Entity;
break;
#if SOURCE_ENGINE != SE_DOTA
case FIELD_EDICT:
type = PropEnt_Edict;
break;
#endif
default:
return pContext->ThrowNativeError("Data field %s is not an entity nor edict (%d)",
prop,
@ -1678,13 +1676,11 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
case FIELD_CLASSPTR:
type = PropEnt_Entity;
break;
#if SOURCE_ENGINE != SE_DOTA
case FIELD_EDICT:
type = PropEnt_Edict;
if (!pEdict)
return pContext->ThrowNativeError("Edict %d is invalid", params[1]);
break;
#endif
default:
return pContext->ThrowNativeError("Data field %s is not an entity nor edict (%d)",
prop,

View File

@ -127,16 +127,6 @@ static cell_t CreateFakeClient(IPluginContext *pContext, const cell_t *params)
pContext->LocalToString(params[1], &netname);
#if SOURCE_ENGINE == SE_DOTA
int index = engine->CreateFakeClient(netname).Get();
if (index == -1)
{
return 0;
}
return index;
#else
edict_t *pEdict = engine->CreateFakeClient(netname);
/* :TODO: does the engine fire forwards for us and whatnot? no idea... */
@ -147,7 +137,6 @@ static cell_t CreateFakeClient(IPluginContext *pContext, const cell_t *params)
}
return IndexOfEdict(pEdict);
#endif
}
static cell_t SetFakeClientConVar(IPluginContext *pContext, const cell_t *params)
@ -174,11 +163,7 @@ static cell_t SetFakeClientConVar(IPluginContext *pContext, const cell_t *params
pContext->LocalToString(params[2], &cvar);
pContext->LocalToString(params[3], &value);
#if SOURCE_ENGINE == SE_DOTA
engine->SetFakeClientConVarValue(pPlayer->GetIndex(), cvar, value);
#else
engine->SetFakeClientConVarValue(pPlayer->GetEdict(), cvar, value);
#endif
return 1;
}
@ -293,9 +278,6 @@ static cell_t IsSoundPrecached(IPluginContext *pContext, const cell_t *params)
static cell_t smn_CreateDialog(IPluginContext *pContext, const cell_t *params)
{
#if SOURCE_ENGINE == SE_DOTA
return pContext->ThrowNativeError("CreateDialog is not supported on this game");
#else
KeyValues *pKV;
HandleError herr;
Handle_t hndl = static_cast<Handle_t>(params[2]);
@ -323,7 +305,6 @@ static cell_t smn_CreateDialog(IPluginContext *pContext, const cell_t *params)
vsp_interface);
return 1;
#endif // DOTA
}
static cell_t PrintToChat(IPluginContext *pContext, const cell_t *params)
@ -535,8 +516,6 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
return 70;
case SOURCE_ENGINE_CSGO:
return 80;
case SOURCE_ENGINE_DOTA:
return 90;
#endif
}

View File

@ -37,9 +37,7 @@
#include "logic_bridge.h"
#include "sourcemod.h"
#if SOURCE_ENGINE == SE_DOTA
#include <game/shared/protobuf/usermessages.pb.h>
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
#include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h>
#endif
@ -318,26 +316,7 @@ void UTIL_SendHudText(int client, const hud_text_parms &textparms, const char *p
players[0] = client;
#if SOURCE_ENGINE == SE_DOTA
CUserMsg_HudMsg *msg = (CUserMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
msg->set_channel(textparms.channel & 0xFF);
msg->set_x(textparms.x);
msg->set_y(textparms.y);
Color c1(textparms.r1, textparms.g1, textparms.b1, textparms.a1);
msg->set_color1(c1.GetRawColor());
Color c2(textparms.r2, textparms.g2, textparms.b2, textparms.a2);
msg->set_color2(c2.GetRawColor());
msg->set_effect(textparms.effect);
msg->set_fade_in_time(textparms.fadeinTime);
msg->set_fade_out_time(textparms.fadeoutTime);
msg->set_hold_time(textparms.holdTime);
msg->set_fx_time(textparms.fxTime);
msg->set_message(pMessage);
#elif SOURCE_ENGINE == SE_CSGO
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
msg->set_channel(textparms.channel & 0xFF);

View File

@ -269,13 +269,7 @@ size_t MsgListenerWrapper::_FillInPlayers(int *pl_array, IRecipientFilter *pFilt
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;

View File

@ -108,9 +108,7 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen
#if SOURCE_ENGINE >= SE_ORANGEBOX
GET_V_IFACE_CURRENT(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION);
#endif
#if SOURCE_ENGINE != SE_DOTA
GET_V_IFACE_CURRENT(GetEngineFactory, serverpluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
#endif
/* :TODO: Make this optional and... make it find earlier versions [?] */
GET_V_IFACE_CURRENT(GetServerFactory, playerinfo, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);

View File

@ -32,9 +32,7 @@
#ifndef _INCLUDE_SOURCEMOD_MM_API_H_
#define _INCLUDE_SOURCEMOD_MM_API_H_
#if SOURCE_ENGINE == SE_DOTA
#include "convar_sm_dota.h"
#elif SOURCE_ENGINE >= SE_ALIENSWARM
#if SOURCE_ENGINE >= SE_ALIENSWARM
#include "convar_sm_swarm.h"
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
#include "convar_sm_l4d.h"

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);
}

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();

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)

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);

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);

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;

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))
{

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;
}

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);

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]),

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,

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)
{

View File

@ -97,7 +97,6 @@
"engine" "blade"
"engine" "insurgency"
"engine" "csgo"
"engine" "dota"
"engine" "sdk2013"
"engine" "contagion"
"engine" "bms"

View File

@ -1,69 +0,0 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* CGlobalEntityList */
"#default"
{
"#supported"
{
"game" "dota"
}
"Addresses"
{
"EntInfosPtr"
{
"windows"
{
"signature" "EntInfosFinder"
"read" "21"
}
}
}
"Offsets"
{
"gEntList"
{
"linux" "18"
}
"EntInfo"
{
"linux" "4"
"mac" "4"
}
}
"Signatures"
{
"EntInfosFinder"
{
"library" "server"
"windows" "\x83\x2A\xFF\x74\x03\x0F\x2A\x2A\xC1\x2A\x04\x8B\x2A\x2A\x2A\x2A\x2A\xEB\x06\x8B"
}
"LevelShutdown"
{
"library" "server"
"linux" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8"
}
"gEntList"
{
"library" "server"
"mac" "@gEntList"
}
}
}
}

View File

@ -85,11 +85,6 @@
"engine" "csgo"
}
"engine.dota.txt"
{
"engine" "dota"
}
"engine.blade.txt"
{
"engine" "blade"

View File

@ -1,163 +0,0 @@
"Games"
{
"#default"
{
"Offsets"
{
"EndTouch"
{
"windows" "107"
"linux" "108"
"mac" "108"
}
"FireBullets"
{
"windows" "120"
"linux" "121"
"mac" "121"
}
"GetMaxHealth"
{
"windows" "124"
"linux" "125"
"mac" "125"
}
"OnTakeDamage"
{
"windows" "73"
"linux" "74"
"mac" "74"
}
"PreThink"
{
"windows" "363"
"linux" "364"
"mac" "364"
}
"PostThink"
{
"windows" "364"
"linux" "365"
"mac" "365"
}
"SetTransmit"
{
"windows" "22"
"linux" "23"
"mac" "23"
}
"ShouldCollide"
{
"windows" "17"
"linux" "18"
"mac" "18"
}
"Spawn"
{
"windows" "27"
"linux" "28"
"mac" "28"
}
"StartTouch"
{
"windows" "105"
"linux" "106"
"mac" "106"
}
"Think"
{
"windows" "54"
"linux" "55"
"mac" "55"
}
"Touch"
{
"windows" "106"
"linux" "107"
"mac" "107"
}
"TraceAttack"
{
"windows" "71"
"linux" "72"
"mac" "72"
}
"Use"
{
"windows" "104"
"linux" "105"
"mac" "105"
}
"VPhysicsUpdate"
{
"windows" "165"
"linux" "166"
"mac" "166"
}
"Weapon_CanSwitchTo"
{
"windows" "296"
"linux" "297"
"mac" "297"
}
"Weapon_CanUse"
{
"windows" "290"
"linux" "291"
"mac" "291"
}
"Weapon_Drop"
{
"windows" "293"
"linux" "294"
"mac" "294"
}
"Weapon_Equip"
{
"windows" "291"
"linux" "292"
"mac" "292"
}
"Weapon_Switch"
{
"windows" "294"
"linux" "295"
"mac" "295"
}
}
}
"#default"
{
"Addresses"
{
"EntityListenersPtr"
{
"windows"
{
"signature" "EntityListenersFinder"
"read" "18"
}
}
}
"Signatures"
{
// Find AddListenerEntity inlined in CPhysSaveRestoreBlockHandler::PreRestore (virtual)
"EntityListenersFinder"
{
"library" "server"
"windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x33\xC0\x56\x85\xC9\x7E\x32\x8B\x15"
}
}
"Offsets"
{
"EntityListeners"
{
"linux" "131108"
"mac" "131108"
}
}
}
}

View File

@ -41,11 +41,6 @@
"engine" "csgo"
}
"engine.dota.txt"
{
"engine" "dota"
}
"engine.ep2v.txt"
{
"engine" "orangebox_valve"

View File

@ -1,342 +0,0 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* Sounds */
"#default"
{
"Keys"
{
"SlapSoundCount" "7"
"SlapSound1" "vo/axe/axe_pain_01.mp3"
"SlapSound1" "vo/axe/axe_pain_02.mp3"
"SlapSound1" "vo/axe/axe_pain_03.mp3"
"SlapSound1" "vo/axe/axe_pain_04.mp3"
"SlapSound1" "vo/axe/axe_pain_05.mp3"
"SlapSound1" "vo/axe/axe_pain_06.mp3"
"SlapSound1" "vo/axe/axe_pain_07.mp3"
}
}
/* General Temp Entities */
"#default"
{
"Offsets"
{
//Offset into CBaseTempEntity constructor
"s_pTempEntities"
{
"windows" "7"
"linux" "9"
}
"GetTEName"
{
"windows" "4"
"linux" "4"
"mac" "4"
}
"GetTENext"
{
"windows" "8"
"linux" "8"
"mac" "8"
}
"TE_GetServerClass"
{
"windows" "0"
"linux" "0"
"mac" "0"
}
}
"Signatures"
{
"CBaseTempEntity"
{
"library" "server"
"windows" "\xFF\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8D"
"linux" "\x55\x89\xE5\x53\x83\xEC\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x85\xDB\x74\x2A\x8D\xB4\x26\x00\x00\x00\x00\x8B"
}
"s_pTempEntities"
{
"library" "server"
"mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
}
}
}
/* CGlobalEntityList */
"#default"
{
"Signatures"
{
/* Functions in CGlobalEntityList */
"FindEntityByClassname"
{
"library" "server"
// Fallback to IServerTools method instead on Windows, lest we add custom logic since it's not a thiscall on Windows in Dota
"linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x1C\x8B\x45\x0C\x8B\x5D\x08\x8B\x7D\x10\x85\xC0\x74\x7A\x8B\x10\x89"
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
}
}
/* General GameRules */
"#default"
{
"Keys"
{
"GameRulesProxy" "CDOTAGamerulesProxy"
"GameRulesDataTable" "dota_gamerules_data"
}
}
/* IServer interface pointer */
"#default"
{
"Keys"
{
/* Signature for the beginning of IVEngineServer::CreateFakeClient.
*
* The engine binary is not actually scanned in order to look for
* this. SourceHook is used to used to determine the address of the
* function and this signature is used to verify that it contains
* the expected code. A pointer to sv (IServer interface) is used
* here.
*/
"CreateFakeClient_Windows" "\x55\x8B\xEC\x56\xFF\x75\x0C\xB9\x2A\x2A\x2A\x2A\xE8"
"CreateFakeClient_Linux" "\x55\x89\xE5\x83\xEC\x2A\x8B\x45\x10\x89\x5D\xF8\x89\x75\xFC\x8B\x5D\x08\xC7\x04\x24\x2A\x2A\x2A\x2A\x89"
}
"Offsets"
{
/* Offset into IVEngineServer::CreateFakeClient */
"sv"
{
"windows" "8"
"linux" "21"
}
}
"Signatures"
{
/* CBaseServer object for IServer interface */
"sv"
{
"library" "engine"
"mac" "@sv"
}
}
}
/* Resource Entity override */
"#default"
{
// Dota's player manager does not have DT_PlayerResource embedded, unlike most other games
"Keys"
{
"ResourceEntityClassname" "dota_player_manager"
}
}
/* EntityFactoryDictionary function */
"#default"
{
"Signatures"
{
"EntityFactory"
{
"library" "server"
"mac" "@_Z23EntityFactoryDictionaryv"
}
"EntityFactoryFinder"
{
// EntityFactoryDictionary gets inlined on Windows in Dota 2. The pointer to the static factory becomes a global.
"library" "server"
"windows" "\xFF\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x8B\xC8\xC7"
}
// EntityFactoryDictionary is difficult to find on Linux due to multiple matches. This finds a caller of it instead.
"EntityFactoryCaller"
{
"library" "server"
"linux" "\xA1\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x00\x00\x00\x00\xC7\x2A\x2A\x00\x00\x00\x00\x85\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x89\x2A\x2A\x89\x2A\x2A\xE8"
}
}
"Offsets"
{
"EntityFactoryOffset"
{
"windows" "4"
}
// This is the offset into the address found by the EntityFactoryCaller signature.
"EntityFactoryCallOffset"
{
"linux" "41"
}
}
}
/* CBaseEntityOutput::FireOutput */
"#default"
{
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x55\x8B\xEC\x83\xE4\xC0\x81\xEC\x2A\x2A\x2A\x2A\x8B\xC1\x53"
"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"
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
}
/* SetUserInfo data */
"#default"
{
"Offsets"
{
/**
* CBaseClient::SetUserCVar(char const*,char const*);
* Linux offset straight from VTable dump.
* Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA)
* Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
*/
"SetUserCvar"
{
"windows" "26"
"linux" "63"
"mac" "63"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "25"
"linux" "62"
"mac" "62"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
* Linux: mov byte ptr [esi+0B0h], 0
* Win: mov byte ptr [esi+0B0h], 0
*
* L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
*/
"InfoChanged"
{
"windows" "212"
"linux" "212"
"mac" "212"
}
}
}
"dota"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "438"
"linux" "439"
"mac" "439"
}
"RemovePlayerItem"
{
"windows" "300"
"linux" "301"
"mac" "301"
}
"Weapon_GetSlot"
{
"windows" "288"
"linux" "289"
"mac" "289"
}
"Ignite"
{
"windows" "226"
"linux" "227"
"mac" "227"
}
"Extinguish"
{
"windows" "229"
"linux" "230"
"mac" "230"
}
"Teleport"
{
"windows" "116"
"linux" "117"
"mac" "117"
}
"CommitSuicide"
{
"windows" "482"
"linux" "482"
"mac" "482"
}
"GetVelocity"
{
"windows" "149"
"linux" "150"
"mac" "150"
}
"EyeAngles"
{
"windows" "140"
"linux" "141"
"mac" "141"
}
"AcceptInput"
{
"windows" "43"
"linux" "44"
"mac" "44"
}
"SetEntityModel"
{
"windows" "28"
"linux" "29"
"mac" "29"
}
"WeaponEquip"
{
"windows" "291"
"linux" "292"
"mac" "292"
}
"Activate"
{
"windows" "39"
"linux" "40"
"mac" "40"
}
"PlayerRunCmd"
{
"windows" "458"
"linux" "459"
"mac" "459"
}
}
}
}

View File

@ -80,11 +80,6 @@
"engine" "csgo"
}
"engine.dota.txt"
{
"engine" "dota"
}
"engine.blade.txt"
{
"engine" "blade"

View File

@ -83,7 +83,6 @@
#define FILENAME_1_6_SDK2013 "sourcemod.2.sdk2013" PLATFORM_EXT
#define FILENAME_1_6_TF2 "sourcemod.2.tf2" PLATFORM_EXT
#define FILENAME_1_6_ND "sourcemod.2.nd" PLATFORM_EXT
#define FILENAME_1_6_DOTA "sourcemod.2.dota" PLATFORM_EXT
#define FILENAME_1_6_BLADE "sourcemod.2.blade" PLATFORM_EXT
#define FILENAME_1_6_INSURGENCY "sourcemod.2.insurgency" PLATFORM_EXT
#define FILENAME_1_6_CONTAGION "sourcemod.2.contagion" PLATFORM_EXT
@ -343,11 +342,6 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
}
break;
}
case SOURCE_ENGINE_DOTA:
{
filename = FILENAME_1_6_DOTA;
break;
}
case SOURCE_ENGINE_BLADE:
{
filename = FILENAME_1_6_BLADE;

View File

@ -63,7 +63,6 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|| StrEqual(game, "left4dead2", false)
|| StrEqual(game, "garrysmod", false)
|| StrEqual(game, "swarm", false)
|| StrEqual(game, "dota", false)
|| StrEqual(game, "bms", false)
|| GetEngineVersion() == Engine_Insurgency)
{

View File

@ -153,26 +153,4 @@ typedef int QueryCvarCookie_t;
}
#endif //SOURCE_ENGINE >= SE_LEFT4DEAD
#if SOURCE_ENGINE == SE_DOTA
inline int GetPlayerUserId(edict_t *pEdict)
{
return engine->GetPlayerUserId(IndexOfEdict(pEdict) - 1);
}
inline int GetPlayerUserId(int client)
{
return engine->GetPlayerUserId(client - 1);
}
#else
inline int GetPlayerUserId(edict_t *pEdict)
{
return engine->GetPlayerUserId(pEdict);
}
inline int GetPlayerUserId(int client)
{
return engine->GetPlayerUserId(PEntityOfEntIndex(client));
}
#endif //SOURCE_ENGINE >= SE_DOTA
#endif //_INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_

View File

@ -143,7 +143,6 @@ CopyFiles('gamedata/sdkhooks.games', 'addons/sourcemod/gamedata/sdkhooks.games',
'engine.contagion.txt',
'engine.csgo.txt',
'engine.darkm.txt',
'engine.dota.txt',
'engine.ep2v.txt',
'engine.insurgency.txt',
'engine.l4d.txt',
@ -184,7 +183,6 @@ CopyFiles('gamedata/sdktools.games', 'addons/sourcemod/gamedata/sdktools.games',
'engine.csgo.txt',
'engine.css.txt',
'engine.darkm.txt',
'engine.dota.txt',
'engine.ep1.txt',
'engine.ep2.txt',
'engine.ep2valve.txt',
@ -243,7 +241,6 @@ CopyFiles('gamedata/core.games', 'addons/sourcemod/gamedata/core.games',
'engine.csgo.txt',
'engine.css.txt',
'engine.darkm.txt',
'engine.dota.txt',
'engine.ep1.txt',
'engine.ep2.txt',
'engine.ep2valve.txt',