Update for latest Blade Symphony SDK

This commit is contained in:
Asher Baker 2020-03-11 22:36:25 +00:00
parent e941c1acea
commit 6465bd83a4
16 changed files with 176 additions and 143 deletions

View File

@ -52,7 +52,7 @@ PossibleSDKs = {
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'), 'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
'csgo': SDK('HL2SDKCSGO', '2.csgo', '21', 'CSGO', CSGO, 'csgo'), 'csgo': SDK('HL2SDKCSGO', '2.csgo', '21', 'CSGO', CSGO, 'csgo'),
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'), 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'),
'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'), 'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinOnly, 'blade'),
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'), 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'),
'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'), 'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'),
'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'), 'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'),
@ -538,7 +538,7 @@ class SMConfig(object):
if builder.target.platform in ['linux', 'mac']: if builder.target.platform in ['linux', 'mac']:
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE'] compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
if sdk.name == 'csgo' and builder.target.platform == 'linux': if sdk.name in ['csgo', 'blade'] and builder.target.platform == 'linux':
compiler.linkflags += ['-lstdc++'] compiler.linkflags += ['-lstdc++']
compiler.defines += ['_GLIBCXX_USE_CXX11_ABI=0'] compiler.defines += ['_GLIBCXX_USE_CXX11_ABI=0']
@ -584,7 +584,7 @@ class SMConfig(object):
if builder.target.platform == 'linux': if builder.target.platform == 'linux':
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency', 'doi']: if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency', 'doi']:
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so'] dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
elif arch == 'x64' and sdk.name == 'csgo': elif arch == 'x64' and sdk.name in ['csgo', 'blade']:
dynamic_libs = ['libtier0_client.so', 'libvstdlib_client.so'] dynamic_libs = ['libtier0_client.so', 'libvstdlib_client.so']
elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo']: elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo']:
dynamic_libs = ['libtier0.so', 'libvstdlib.so'] dynamic_libs = ['libtier0.so', 'libvstdlib.so']

View File

@ -2,6 +2,7 @@
import os import os
project = SM.HL2Project(builder, 'sourcemod') project = SM.HL2Project(builder, 'sourcemod')
project.sources += [ project.sources += [
'MenuStyle_Valve.cpp', 'MenuStyle_Valve.cpp',
'logic_bridge.cpp', 'logic_bridge.cpp',
@ -37,7 +38,6 @@ project.sources += [
'MenuStyle_Radio.cpp', 'MenuStyle_Radio.cpp',
'sm_autonatives.cpp', 'sm_autonatives.cpp',
'ConsoleDetours.cpp', 'ConsoleDetours.cpp',
'vprof_tool.cpp',
'smn_commandline.cpp', 'smn_commandline.cpp',
'GameHooks.cpp', 'GameHooks.cpp',
] ]
@ -63,13 +63,19 @@ for sdk_name in SM.sdks:
os.path.join(sdk.path, 'public', 'engine', 'protobuf'), os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf') os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf')
] ]
elif sdk.name == 'blade':
compiler.cxxincludes += [
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf')
]
if compiler.like('msvc'): if compiler.like('msvc'):
compiler.defines += ['_ALLOW_KEYWORD_MACROS'] compiler.defines += ['_ALLOW_KEYWORD_MACROS']
if builder.target.platform == 'linux': if builder.target.platform == 'linux':
compiler.postlink += ['-lpthread', '-lrt'] compiler.postlink += ['-lpthread', '-lrt']
if sdk.name == 'csgo': if sdk.name in ['csgo', 'blade']:
if builder.target.platform == 'linux': if builder.target.platform == 'linux':
if arch == 'x86': if arch == 'x86':
lib_path = os.path.join(sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a') lib_path = os.path.join(sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a')
@ -95,17 +101,28 @@ for sdk_name in SM.sdks:
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs' + vs_year, 'libprotobuf.lib') lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs' + vs_year, 'libprotobuf.lib')
compiler.linkflags.insert(0, binary.Dep(lib_path)) compiler.linkflags.insert(0, binary.Dep(lib_path))
if sdk.name == 'csgo': if sdk.name in ['csgo', 'blade']:
binary.sources += ['smn_protobuf.cpp'] binary.sources += ['smn_protobuf.cpp']
else: else:
binary.sources += ['smn_bitbuffer.cpp'] binary.sources += ['smn_bitbuffer.cpp']
if sdk.name != 'blade':
binary.sources += [
'vprof_tool.cpp',
]
if sdk.name == 'csgo': if sdk.name == 'csgo':
binary.sources += [ binary.sources += [
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'), os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
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_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'), os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
] ]
elif sdk.name == 'blade':
binary.sources += [
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf', 'berimbau_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf', 'berimbau_usermessage_helpers.cpp'),
]
SM.binaries += builder.Add(project) SM.binaries += builder.Add(project)

View File

@ -45,9 +45,10 @@
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
#include <cstrike15_usermessages.pb.h> #include <cstrike15_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <berimbau_usermessages.pb.h>
#endif #endif
typedef ICommandLine *(*FakeGetCommandLine)(); typedef ICommandLine *(*FakeGetCommandLine)();
#define TIER0_NAME FORMAT_SOURCE_BIN_NAME("tier0") #define TIER0_NAME FORMAT_SOURCE_BIN_NAME("tier0")
@ -516,7 +517,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
char buffer[253]; char buffer[253];
ke::SafeSprintf(buffer, sizeof(buffer), "%s\1\n", msg); ke::SafeSprintf(buffer, sizeof(buffer), "%s\1\n", msg);
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CCSUsrMsg_SayText *pMsg; CCSUsrMsg_SayText *pMsg;
if ((pMsg = (CCSUsrMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL) if ((pMsg = (CCSUsrMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{ {
@ -543,7 +544,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
} }
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CCSUsrMsg_TextMsg *pMsg; CCSUsrMsg_TextMsg *pMsg;
if ((pMsg = (CCSUsrMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL) if ((pMsg = (CCSUsrMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{ {
@ -580,7 +581,7 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
{ {
cell_t players[] = {client}; cell_t players[] = {client};
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CCSUsrMsg_HintText *pMsg; CCSUsrMsg_HintText *pMsg;
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL) if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{ {
@ -610,7 +611,7 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
bool CHalfLife2::HintTextMsg(cell_t *players, int count, const char *msg) bool CHalfLife2::HintTextMsg(cell_t *players, int count, const char *msg)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CCSUsrMsg_HintText *pMsg; CCSUsrMsg_HintText *pMsg;
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL) if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
{ {
@ -645,7 +646,7 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
int count = 0; int count = 0;
cell_t players[] = {client}; cell_t players[] = {client};
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CCSUsrMsg_VGUIMenu *pMsg; CCSUsrMsg_VGUIMenu *pMsg;
if ((pMsg = (CCSUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL) if ((pMsg = (CCSUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
{ {
@ -670,7 +671,7 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
SubKey = data->GetFirstSubKey(); SubKey = data->GetFirstSubKey();
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
pMsg->set_name(name); pMsg->set_name(name);
pMsg->set_show(show); pMsg->set_show(show);

View File

@ -45,6 +45,8 @@
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
#include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h> #include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <game/shared/berimbau/protobuf/berimbau_usermessages.pb.h>
#endif #endif
extern const char *g_RadioNumTable[]; extern const char *g_RadioNumTable[];
@ -174,7 +176,7 @@ void CRadioStyle::OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFil
{ {
int count = pFilter->GetRecipientCount(); int count = pFilter->GetRecipientCount();
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
int c = ((CCSUsrMsg_ShowMenu &)msg).display_time(); int c = ((CCSUsrMsg_ShowMenu &)msg).display_time();
#else #else
bf_read br(bf->GetBasePointer(), 3); bf_read br(bf->GetBasePointer(), 3);
@ -483,7 +485,7 @@ void CRadioMenuPlayer::Radio_Refresh()
time = menuHoldTime - (unsigned int)(gpGlobals->curtime - menuStartTime); time = menuHoldTime - (unsigned int)(gpGlobals->curtime - menuStartTime);
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
// TODO: find what happens past 240 on CS:GO // TODO: find what happens past 240 on CS:GO
CCSUsrMsg_ShowMenu *msg = (CCSUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS); CCSUsrMsg_ShowMenu *msg = (CCSUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS);
msg->set_bits_valid_slots(display_keys); msg->set_bits_valid_slots(display_keys);

View File

@ -2463,7 +2463,7 @@ void CPlayer::Kick(const char *str)
} }
else else
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
pClient->Disconnect(str); pClient->Disconnect(str);
#else #else
pClient->Disconnect("%s", str); pClient->Disconnect("%s", str);

View File

@ -816,7 +816,7 @@ public:
inline bool GetColor(const char *pszFieldName, Color *out) inline bool GetColor(const char *pszFieldName, Color *out)
{ {
#if SOURCE_ENGINE != SE_CSGO #if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false; return false;
#else #else
GETCHECK_FIELD(); GETCHECK_FIELD();
@ -837,7 +837,7 @@ public:
inline bool SetColor(const char *pszFieldName, const Color &value) inline bool SetColor(const char *pszFieldName, const Color &value)
{ {
#if SOURCE_ENGINE != SE_CSGO #if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false; return false;
#else #else
GETCHECK_FIELD(); GETCHECK_FIELD();
@ -856,7 +856,7 @@ public:
inline bool GetRepeatedColor(const char *pszFieldName, int index, Color *out) inline bool GetRepeatedColor(const char *pszFieldName, int index, Color *out)
{ {
#if SOURCE_ENGINE != SE_CSGO #if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false; return false;
#else #else
GETCHECK_FIELD(); GETCHECK_FIELD();
@ -878,7 +878,7 @@ public:
inline bool SetRepeatedColor(const char *pszFieldName, int index, const Color &value) inline bool SetRepeatedColor(const char *pszFieldName, int index, const Color &value)
{ {
#if SOURCE_ENGINE != SE_CSGO #if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false; return false;
#else #else
GETCHECK_FIELD(); GETCHECK_FIELD();
@ -898,7 +898,7 @@ public:
inline bool AddColor(const char *pszFieldName, const Color &value) inline bool AddColor(const char *pszFieldName, const Color &value)
{ {
#if SOURCE_ENGINE != SE_CSGO #if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false; return false;
#else #else
GETCHECK_FIELD(); GETCHECK_FIELD();

View File

@ -35,12 +35,14 @@
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
#include <cstrike15_usermessage_helpers.h> #include <cstrike15_usermessage_helpers.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <berimbau_usermessage_helpers.h>
#endif #endif
#include <amtl/am-string.h> #include <amtl/am-string.h>
UserMessages g_UserMsgs; UserMessages g_UserMsgs;
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_DECL_HOOK3_void(IVEngineServer, SendUserMessage, SH_NOATTRIB, 0, IRecipientFilter &, int, const protobuf::Message &); SH_DECL_HOOK3_void(IVEngineServer, SendUserMessage, SH_NOATTRIB, 0, IRecipientFilter &, int, const protobuf::Message &);
#else #else
#if SOURCE_ENGINE >= SE_LEFT4DEAD #if SOURCE_ENGINE >= SE_LEFT4DEAD
@ -49,7 +51,7 @@ SH_DECL_HOOK3(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRec
SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int); SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int);
#endif #endif
SH_DECL_HOOK0_void(IVEngineServer, MessageEnd, SH_NOATTRIB, 0); SH_DECL_HOOK0_void(IVEngineServer, MessageEnd, SH_NOATTRIB, 0);
#endif // ==SE_CSGO #endif // ==SE_CSGO || ==SE_BLADE
UserMessages::UserMessages() UserMessages::UserMessages()
#ifndef USE_PROTOBUF_USERMESSAGES #ifndef USE_PROTOBUF_USERMESSAGES
@ -93,7 +95,7 @@ void UserMessages::OnSourceModAllShutdown()
{ {
if (m_HookCount) if (m_HookCount)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Pre), false); 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); SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Post), true);
#else #else
@ -111,6 +113,8 @@ int UserMessages::GetMessageIndex(const char *msg)
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
// Can split this per engine and/or game later // Can split this per engine and/or game later
return g_Cstrike15UsermessageHelpers.GetIndex(msg); return g_Cstrike15UsermessageHelpers.GetIndex(msg);
#elif SOURCE_ENGINE == SE_BLADE
return g_BerimbauUsermessageHelpers.GetIndex(msg);
#else #else
int msgid; int msgid;
@ -148,6 +152,8 @@ bool UserMessages::GetMessageName(int msgid, char *buffer, size_t maxlength) con
#ifdef USE_PROTOBUF_USERMESSAGES #ifdef USE_PROTOBUF_USERMESSAGES
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
const char *pszName = g_Cstrike15UsermessageHelpers.GetName(msgid); const char *pszName = g_Cstrike15UsermessageHelpers.GetName(msgid);
#elif SOURCE_ENGINE == SE_BLADE
const char *pszName = g_BerimbauUsermessageHelpers.GetName(msgid);
#endif #endif
if (!pszName) if (!pszName)
return false; return false;
@ -297,7 +303,7 @@ bool UserMessages::EndMessage()
return false; return false;
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (m_CurFlags & USERMSG_BLOCKHOOKS) if (m_CurFlags & USERMSG_BLOCKHOOKS)
{ {
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(m_CellRecFilter), m_CurId, *m_FakeEngineBuffer); ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(m_CellRecFilter), m_CurId, *m_FakeEngineBuffer);
@ -327,7 +333,7 @@ bool UserMessages::EndMessage()
} else { } else {
engine->MessageEnd(); engine->MessageEnd();
} }
#endif // SE_CSGO #endif // SE_CSGO || SE_BLADE
m_InExec = false; m_InExec = false;
m_CurFlags = 0; m_CurFlags = 0;
@ -412,7 +418,7 @@ bool UserMessages::InternalHook(int msg_id, IBitBufUserMessageListener *pListene
if (!m_HookCount++) if (!m_HookCount++)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_ADD_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Pre), false); 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); SH_ADD_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Post), true);
#else #else
@ -438,6 +444,8 @@ const protobuf::Message *UserMessages::GetMessagePrototype(int msg_type)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
return g_Cstrike15UsermessageHelpers.GetPrototype(msg_type); return g_Cstrike15UsermessageHelpers.GetPrototype(msg_type);
#elif SOURCE_ENGINE == SE_BLADE
return g_BerimbauUsermessageHelpers.GetPrototype(msg_type);
#endif #endif
} }
#endif #endif
@ -487,7 +495,7 @@ void UserMessages::_DecRefCounter()
{ {
if (--m_HookCount == 0) if (--m_HookCount == 0)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Pre), false); 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); SH_REMOVE_HOOK(IVEngineServer, SendUserMessage, engine, SH_MEMBER(this, &UserMessages::OnSendUserMessage_Post), true);
#else #else
@ -499,12 +507,17 @@ void UserMessages::_DecRefCounter()
} }
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg) void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
OnStartMessage_Pre(&filter, msg_type, g_Cstrike15UsermessageHelpers.GetName(msg_type)); const char *pszName = g_Cstrike15UsermessageHelpers.GetName(msg_type);
#elif SOURCE_ENGINE == SE_BLADE
const char *pszName = g_BerimbauUsermessageHelpers.GetName(msg_type);
#endif #endif
OnStartMessage_Pre(&filter, msg_type, pszName);
if (m_FakeMetaRes == MRES_SUPERCEDE) if (m_FakeMetaRes == MRES_SUPERCEDE)
{ {
int size = msg.ByteSize(); int size = msg.ByteSize();
@ -517,9 +530,7 @@ void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type,
m_FakeEngineBuffer = &const_cast<protobuf::Message &>(msg); m_FakeEngineBuffer = &const_cast<protobuf::Message &>(msg);
} }
#if SOURCE_ENGINE == SE_CSGO OnStartMessage_Post(&filter, msg_type, pszName);
OnStartMessage_Post(&filter, msg_type, g_Cstrike15UsermessageHelpers.GetName(msg_type));
#endif
OnMessageEnd_Pre(); OnMessageEnd_Pre();
if (m_FakeMetaRes == MRES_SUPERCEDE) if (m_FakeMetaRes == MRES_SUPERCEDE)
@ -551,7 +562,7 @@ void UserMessages::OnSendUserMessage_Post(IRecipientFilter &filter, int msg_type
RETURN_META(res) RETURN_META(res)
#endif #endif
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
protobuf::Message *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name) protobuf::Message *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
#elif SOURCE_ENGINE >= SE_LEFT4DEAD #elif SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name) bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
@ -591,7 +602,7 @@ bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_typ
UM_RETURN_META_VALUE(MRES_IGNORED, NULL); UM_RETURN_META_VALUE(MRES_IGNORED, NULL);
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
protobuf::Message *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name) protobuf::Message *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)
#elif SOURCE_ENGINE >= SE_LEFT4DEAD #elif SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name) bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)
@ -756,7 +767,7 @@ void UserMessages::OnMessageEnd_Pre()
if (!handled && intercepted) if (!handled && intercepted)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer); ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer);
#else #else
bf_write *engine_bfw; bf_write *engine_bfw;
@ -768,11 +779,11 @@ void UserMessages::OnMessageEnd_Pre()
m_ReadBuffer.StartReading(m_InterceptBuffer.GetBasePointer(), m_InterceptBuffer.GetNumBytesWritten()); m_ReadBuffer.StartReading(m_InterceptBuffer.GetBasePointer(), m_InterceptBuffer.GetNumBytesWritten());
engine_bfw->WriteBitsFromBuffer(&m_ReadBuffer, m_InterceptBuffer.GetNumBitsWritten()); engine_bfw->WriteBitsFromBuffer(&m_ReadBuffer, m_InterceptBuffer.GetNumBitsWritten());
ENGINE_CALL(MessageEnd)(); ENGINE_CALL(MessageEnd)();
#endif // SE_CSGO #endif // SE_CSGO || SE_BLADE
} }
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
int size = m_OrigBuffer->ByteSize(); int size = m_OrigBuffer->ByteSize();
uint8 *data = (uint8 *)stackalloc(size); uint8 *data = (uint8 *)stackalloc(size);
m_OrigBuffer->SerializePartialToArray(data, size); m_OrigBuffer->SerializePartialToArray(data, size);
@ -802,7 +813,7 @@ void UserMessages::OnMessageEnd_Pre()
iter++; iter++;
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
delete pTempMsg; delete pTempMsg;
#endif #endif
} }

View File

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

View File

@ -51,7 +51,7 @@
#include <bridge/include/ILogger.h> #include <bridge/include/ILogger.h>
#include <ITranslator.h> #include <ITranslator.h>
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#include <netmessages.pb.h> #include <netmessages.pb.h>
#endif #endif
@ -1171,7 +1171,7 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
char data[256]; char data[256];
bf_write buffer(data, sizeof(data)); bf_write buffer(data, sizeof(data));
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CNETMsg_SetConVar msg; CNETMsg_SetConVar msg;
CMsg_CVars_CVar *cvar = msg.mutable_convars()->add_cvars(); CMsg_CVars_CVar *cvar = msg.mutable_convars()->add_cvars();

View File

@ -301,31 +301,31 @@ static cell_t RemoveEntity(IPluginContext *pContext, const cell_t *params)
// Some games have UTIL_Remove exposed on IServerTools, but for consistence, we'll // Some games have UTIL_Remove exposed on IServerTools, but for consistence, we'll
// use this method for all. Results in DeathNotice( this ) being called on parent, // use this method for all. Results in DeathNotice( this ) being called on parent,
// and parent being cleared (both if any parent) before UTIL_Remove is called. // and parent being cleared (both if any parent) before UTIL_Remove is called.
static inputfunc_t fnKillEntity = nullptr; static inputfunc_t fnKillEntity = nullptr;
if (!fnKillEntity) if (!fnKillEntity)
{ {
// Get world, as other ents aren't guaranteed to inherit full datadesc (but kill func is same for all) // Get world, as other ents aren't guaranteed to inherit full datadesc (but kill func is same for all)
CBaseEntity *pGetterEnt = g_HL2.ReferenceToEntity(0); CBaseEntity *pGetterEnt = g_HL2.ReferenceToEntity(0);
if (pGetterEnt == nullptr) if (pGetterEnt == nullptr)
{ {
// If we don't have a world entity yet, we'll have to rely on the given entity. Does this even make sense??? // If we don't have a world entity yet, we'll have to rely on the given entity. Does this even make sense???
pGetterEnt = pEntity; pGetterEnt = pEntity;
} }
datamap_t *pMap = g_HL2.GetDataMap(pGetterEnt); datamap_t *pMap = g_HL2.GetDataMap(pGetterEnt);
sm_datatable_info_t info; sm_datatable_info_t info;
if (!g_HL2.FindDataMapInfo(pMap, "InputKill", &info)) if (!g_HL2.FindDataMapInfo(pMap, "InputKill", &info))
{ {
return pContext->ThrowNativeError("Failed to find Kill input!"); return pContext->ThrowNativeError("Failed to find Kill input!");
} }
fnKillEntity = info.prop->inputFunc; fnKillEntity = info.prop->inputFunc;
} }
// Input data is ignored for this. No need to initialize // Input data is ignored for this. No need to initialize
static inputdata_t data; static inputdata_t data;
(pEntity->*fnKillEntity)(data); (pEntity->*fnKillEntity)(data);
return 1; return 1;
@ -1379,7 +1379,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \ #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \
|| SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \ || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \
|| SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (pProp->GetFlags() & SPROP_VARINT) if (pProp->GetFlags() & SPROP_VARINT)
{ {
bit_count = sizeof(int) * 8; bit_count = sizeof(int) * 8;
@ -1498,7 +1498,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \ #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \
|| SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \ || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \
|| SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (pProp->GetFlags() & SPROP_VARINT) if (pProp->GetFlags() & SPROP_VARINT)
{ {
bit_count = sizeof(int) * 8; bit_count = sizeof(int) * 8;
@ -1829,22 +1829,22 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
switch (td->fieldType) switch (td->fieldType)
{ {
case FIELD_EHANDLE: case FIELD_EHANDLE:
type = PropEnt_Handle; type = PropEnt_Handle;
break; break;
case FIELD_CLASSPTR: case FIELD_CLASSPTR:
type = PropEnt_Entity; type = PropEnt_Entity;
break; break;
case FIELD_EDICT: case FIELD_EDICT:
type = PropEnt_Edict; type = PropEnt_Edict;
if (!pEdict) if (!pEdict)
return pContext->ThrowNativeError("Edict %d is invalid", params[1]); return pContext->ThrowNativeError("Edict %d is invalid", params[1]);
break; break;
case FIELD_CUSTOM: case FIELD_CUSTOM:
if ((td->flags & FTYPEDESC_OUTPUT) == FTYPEDESC_OUTPUT) if ((td->flags & FTYPEDESC_OUTPUT) == FTYPEDESC_OUTPUT)
{ {
type = PropEnt_Variant; type = PropEnt_Variant;
} }
break; break;
} }
@ -1881,9 +1881,9 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
switch (type) switch (type)
{ {
case PropEnt_Handle: case PropEnt_Handle:
case PropEnt_Variant: case PropEnt_Variant:
{ {
CBaseHandle *hndl; CBaseHandle *hndl;
if (type == PropEnt_Handle) if (type == PropEnt_Handle)
{ {
@ -1893,44 +1893,44 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
{ {
auto *pVariant = (variant_t *)((intptr_t)pEntity + offset); auto *pVariant = (variant_t *)((intptr_t)pEntity + offset);
hndl = &pVariant->eVal; hndl = &pVariant->eVal;
} }
hndl->Set((IHandleEntity *) pOther); hndl->Set((IHandleEntity *) pOther);
if (params[2] == Prop_Send && (pEdict != NULL)) if (params[2] == Prop_Send && (pEdict != NULL))
{ {
g_HL2.SetEdictStateChanged(pEdict, offset); g_HL2.SetEdictStateChanged(pEdict, offset);
} }
} }
break; break;
case PropEnt_Entity: case PropEnt_Entity:
{ {
*(CBaseEntity **) ((uint8_t *) pEntity + offset) = pOther; *(CBaseEntity **) ((uint8_t *) pEntity + offset) = pOther;
break; break;
} }
case PropEnt_Edict: case PropEnt_Edict:
{ {
edict_t *pOtherEdict = NULL; edict_t *pOtherEdict = NULL;
if (pOther) if (pOther)
{ {
IServerNetworkable *pNetworkable = ((IServerUnknown *) pOther)->GetNetworkable(); IServerNetworkable *pNetworkable = ((IServerUnknown *) pOther)->GetNetworkable();
if (!pNetworkable) if (!pNetworkable)
{ {
return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]); return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]);
} }
pOtherEdict = pNetworkable->GetEdict(); pOtherEdict = pNetworkable->GetEdict();
if (!pOtherEdict || pOtherEdict->IsFree()) if (!pOtherEdict || pOtherEdict->IsFree())
{ {
return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]); return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]);
} }
} }
*(edict_t **) ((uint8_t *) pEntity + offset) = pOtherEdict; *(edict_t **) ((uint8_t *) pEntity + offset) = pOtherEdict;
break; break;
} }
} }

View File

@ -39,6 +39,8 @@
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
#include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h> #include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <game/shared/berimbau/protobuf/berimbau_usermessages.pb.h>
#endif #endif
#define MAX_HUD_CHANNELS 6 #define MAX_HUD_CHANNELS 6
@ -316,7 +318,7 @@ void UTIL_SendHudText(int client, const hud_text_parms &textparms, const char *p
players[0] = client; players[0] = client;
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0); CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
msg->set_channel(textparms.channel & 0xFF); msg->set_channel(textparms.channel & 0xFF);

View File

@ -21,7 +21,7 @@
#if SOURCE_ENGINE >= SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD #if SOURCE_ENGINE >= SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD
#define GETMAXHEALTH_IS_VIRTUAL #define GETMAXHEALTH_IS_VIRTUAL
#endif #endif
#if SOURCE_ENGINE != SE_HL2DM && SOURCE_ENGINE != SE_DODS && SOURCE_ENGINE != SE_CSS && SOURCE_ENGINE != SE_TF2 && SOURCE_ENGINE != SE_LEFT4DEAD2 && SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_NUCLEARDAWN #if SOURCE_ENGINE != SE_HL2DM && SOURCE_ENGINE != SE_DODS && SOURCE_ENGINE != SE_CSS && SOURCE_ENGINE != SE_TF2 && SOURCE_ENGINE != SE_LEFT4DEAD2 && SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_NUCLEARDAWN && SOURCE_ENGINE != SE_BLADE
#define GAMEDESC_CAN_CHANGE #define GAMEDESC_CAN_CHANGE
#endif #endif
@ -78,11 +78,11 @@ enum SDKHookType
SDKHook_Reload, SDKHook_Reload,
SDKHook_ReloadPost, SDKHook_ReloadPost,
SDKHook_GetMaxHealth, SDKHook_GetMaxHealth,
SDKHook_Blocked, SDKHook_Blocked,
SDKHook_BlockedPost, SDKHook_BlockedPost,
SDKHook_OnTakeDamage_Alive, SDKHook_OnTakeDamage_Alive,
SDKHook_OnTakeDamage_AlivePost, SDKHook_OnTakeDamage_AlivePost,
SDKHook_CanBeAutobalanced, SDKHook_CanBeAutobalanced,
SDKHook_MAXHOOKS SDKHook_MAXHOOKS
}; };

View File

@ -88,10 +88,10 @@ CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *
m_flRadius = 0.0f; m_flRadius = 0.0f;
#endif #endif
#if SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI || SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
m_iDamagedOtherPlayers = 0; m_iDamagedOtherPlayers = 0;
m_iObjectsPenetrated = 0; m_iObjectsPenetrated = 0;
m_uiBulletID = 0; m_uiBulletID = 0;
m_uiRecoilIndex = 0; m_uiRecoilIndex = 0;
#endif #endif
} }

View File

@ -182,7 +182,7 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params)
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 \ #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_CSGO || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (pProp->GetFlags() & SPROP_VARINT) if (pProp->GetFlags() & SPROP_VARINT)
{ {
bit_count = sizeof(int) * 8; bit_count = sizeof(int) * 8;
@ -256,7 +256,7 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
FIND_PROP_SEND(DPT_Int, "integer"); FIND_PROP_SEND(DPT_Int, "integer");
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 \ #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_CSGO || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (pProp->GetFlags() & SPROP_VARINT) if (pProp->GetFlags() & SPROP_VARINT)
{ {
bit_count = sizeof(int) * 8; bit_count = sizeof(int) * 8;

View File

@ -34,7 +34,7 @@
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float); SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float);
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_DECL_HOOK18(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, void *); SH_DECL_HOOK18(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, void *);
SH_DECL_HOOK18(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *); SH_DECL_HOOK18(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *);
#elif SOURCE_ENGINE >= SE_PORTAL2 #elif SOURCE_ENGINE >= SE_PORTAL2
@ -316,7 +316,7 @@ uint32 GenerateSoundEntryHash(char const *pSoundEntry)
} }
#endif #endif
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample, int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample,
float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
@ -422,7 +422,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
CellRecipientFilter crf; CellRecipientFilter crf;
crf.Initialize(players, size); crf.Initialize(players, size);
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
RETURN_META_VALUE_NEWPARAMS( RETURN_META_VALUE_NEWPARAMS(
MRES_IGNORED, MRES_IGNORED,
-1, -1,
@ -467,7 +467,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
#endif #endif
} }
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
int SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample, int SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample,
float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
@ -574,7 +574,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
CellRecipientFilter crf; CellRecipientFilter crf;
crf.Initialize(players, size); crf.Initialize(players, size);
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
RETURN_META_VALUE_NEWPARAMS( RETURN_META_VALUE_NEWPARAMS(
MRES_IGNORED, MRES_IGNORED,
-1, -1,
@ -876,7 +876,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
player[0] = cl_array[i]; player[0] = cl_array[i];
crf.Reset(); crf.Reset();
crf.Initialize(player, 1); crf.Initialize(player, 1);
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (g_InSoundHook) if (g_InSoundHook)
{ {
SH_CALL(enginesoundPatch, SH_CALL(enginesoundPatch,
@ -1054,7 +1054,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
#endif #endif
} }
} else { } else {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
if (g_InSoundHook) if (g_InSoundHook)
{ {
SH_CALL(enginesoundPatch, SH_CALL(enginesoundPatch,
@ -1341,7 +1341,7 @@ static cell_t EmitSoundEntry(IPluginContext *pContext, const cell_t *params)
if (g_InSoundHook) if (g_InSoundHook)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_CALL(enginesoundPatch, SH_CALL(enginesoundPatch,
static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float, static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float,
soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *)> soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *)>
@ -1365,7 +1365,7 @@ SH_CALL(enginesoundPatch,
else { else {
if (g_InSoundHook) if (g_InSoundHook)
{ {
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
SH_CALL(enginesoundPatch, SH_CALL(enginesoundPatch,
static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float, static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float,
soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *)> soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *)>

View File

@ -53,7 +53,7 @@ public:
void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay); void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
int OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *, unsigned int, const char *pSample, float flVolume, int OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *, unsigned int, const char *pSample, float flVolume,
soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,