Add outbreak build
This commit is contained in:
+17
-2
@@ -42,11 +42,12 @@ project.sources += [
|
||||
'GameHooks.cpp',
|
||||
]
|
||||
|
||||
# SDK name to shipping gamedir
|
||||
# SDK name to shipping gamedir, mostly
|
||||
pb_gamedir_map = {
|
||||
'csgo': 'csgo',
|
||||
'blade': 'berimbau',
|
||||
'mcv': 'vietnam',
|
||||
'outbreak': 'terror'
|
||||
}
|
||||
|
||||
# SDK name to source code gamedir
|
||||
@@ -54,6 +55,7 @@ pb_gamesrcdir_map = {
|
||||
'csgo': 'cstrike15',
|
||||
'blade': 'berimbau',
|
||||
'mcv': 'vietnam',
|
||||
'outbreak': 'terror',
|
||||
}
|
||||
|
||||
for sdk_target in SM.sdk_targets:
|
||||
@@ -61,7 +63,7 @@ for sdk_target in SM.sdk_targets:
|
||||
cxx = sdk_target.cxx
|
||||
|
||||
binary_name = 'sourcemod.' + sdk['extension']
|
||||
needs_protobuf = sdk['name'] in ['csgo', 'blade', 'mcv']
|
||||
needs_protobuf = sdk['name'] in ['csgo', 'blade', 'mcv', 'outbreak']
|
||||
|
||||
binary = SM.HL2Config(project, builder, cxx, binary_name, sdk)
|
||||
SM.ConfigureForExtension(builder, binary.compiler)
|
||||
@@ -76,9 +78,16 @@ for sdk_target in SM.sdk_targets:
|
||||
os.path.join(sdk['path'], 'public', 'engine', 'protobuf'),
|
||||
os.path.join(sdk['path'], 'public', 'game', 'shared', pb_gamedir_map[sdk['name']], 'protobuf')
|
||||
]
|
||||
if sdk['name'] == 'outbreak':
|
||||
compiler.cxxincludes += [
|
||||
# Outbreak has "base" usermessages split from the game-specific ones
|
||||
os.path.join(sdk['path'], 'public', 'game', 'shared', 'protobuf')
|
||||
]
|
||||
protobuf_version = "2.5.0"
|
||||
if sdk['name'] == 'mcv':
|
||||
protobuf_version = "3.2.0"
|
||||
elif sdk['name'] == 'outbreak':
|
||||
protobuf_version = "3.17.3"
|
||||
compiler.cxxincludes += [
|
||||
os.path.join(sdk['path'], 'common', 'protobuf-' + protobuf_version, 'src')
|
||||
]
|
||||
@@ -141,6 +150,12 @@ for sdk_target in SM.sdk_targets:
|
||||
os.path.join(sdk['path'], 'public', 'game', 'shared', pb_gamedir_map[sdk['name']], 'protobuf', pb_gamesrcdir_map[sdk['name']] + '_gcmessages.pb.cc'),
|
||||
os.path.join(sdk['path'], 'public', 'engine', 'protobuf', 'engine_gcmessages.pb.cc'),
|
||||
]
|
||||
if sdk['name'] == 'outbreak':
|
||||
binary.sources += [
|
||||
os.path.join(sdk['path'], 'public', 'engine', 'protobuf', 'network_connection.pb.cc'),
|
||||
os.path.join(sdk['path'], 'public', 'game', 'shared', 'protobuf', 'base_usermessages.pb.cc'),
|
||||
os.path.join(sdk['path'], 'public', 'game', 'shared', 'protobuf', 'base_usermessage_helpers.cpp'),
|
||||
]
|
||||
|
||||
SM.binaries += builder.Add(project)
|
||||
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ void GameHooks::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPla
|
||||
const char *cvarName, const char *cvarValue){
|
||||
int client = IndexOfEdict(pPlayer);
|
||||
|
||||
# if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
# if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (g_Players.HandleConVarQuery(cookie, client, result, cvarName, cvarValue))
|
||||
return;
|
||||
# endif
|
||||
|
||||
+48
-11
@@ -49,6 +49,8 @@
|
||||
#include <berimbau_usermessages.pb.h>
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
#include <vietnam_usermessages.pb.h>
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
#include <terror_usermessages.pb.h>
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_CSS
|
||||
@@ -190,7 +192,8 @@ void CHalfLife2::InitLogicalEntData()
|
||||
|| SOURCE_ENGINE == SE_BMS \
|
||||
|| SOURCE_ENGINE == SE_BLADE \
|
||||
|| SOURCE_ENGINE == SE_NUCLEARDAWN \
|
||||
|| SOURCE_ENGINE == SE_PVKII
|
||||
|| SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_OUTBREAK
|
||||
|
||||
if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr))
|
||||
{
|
||||
@@ -487,7 +490,11 @@ ServerClass *CHalfLife2::FindEntityServerClass(CBaseEntity *pEntity)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
return pNetwork->GetServerClassForModify();
|
||||
#else
|
||||
return pNetwork->GetServerClass();
|
||||
#endif
|
||||
}
|
||||
|
||||
DataTableInfo *CHalfLife2::_FindServerClass(const char *classname)
|
||||
@@ -641,9 +648,14 @@ 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_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_SayText *pMsg;
|
||||
if ((pMsg = (CUsrMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#else
|
||||
CCSUsrMsg_SayText *pMsg;
|
||||
if ((pMsg = (CCSUsrMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#endif
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -668,9 +680,14 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
|
||||
}
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_TextMsg *pMsg;
|
||||
if ((pMsg = (CUsrMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#else
|
||||
CCSUsrMsg_TextMsg *pMsg;
|
||||
if ((pMsg = (CCSUsrMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#endif
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -705,9 +722,14 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
|
||||
{
|
||||
cell_t players[] = {client};
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_HintText *pMsg;
|
||||
if ((pMsg = (CUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#else
|
||||
CCSUsrMsg_HintText *pMsg;
|
||||
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#endif
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -735,9 +757,14 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
|
||||
|
||||
bool CHalfLife2::HintTextMsg(cell_t *players, int count, const char *msg)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_HintText *pMsg;
|
||||
if ((pMsg = (CUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
|
||||
#else
|
||||
CCSUsrMsg_HintText *pMsg;
|
||||
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
|
||||
#endif
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -770,9 +797,14 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
|
||||
int count = 0;
|
||||
cell_t players[] = {client};
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_VGUIMenu *pMsg;
|
||||
if ((pMsg = (CUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#else
|
||||
CCSUsrMsg_VGUIMenu *pMsg;
|
||||
if ((pMsg = (CCSUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
|
||||
#endif
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -795,13 +827,17 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
|
||||
SubKey = data->GetFirstSubKey();
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
pMsg->set_name(name);
|
||||
pMsg->set_show(show);
|
||||
|
||||
while (SubKey)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_VGUIMenu_Subkey *key = pMsg->add_subkeys();
|
||||
#else
|
||||
CCSUsrMsg_VGUIMenu_Subkey *key = pMsg->add_subkeys();
|
||||
#endif
|
||||
key->set_name(SubKey->GetName());
|
||||
key->set_str(SubKey->GetString());
|
||||
SubKey = SubKey->GetNextKey();
|
||||
@@ -1656,12 +1692,13 @@ uint64_t CHalfLife2::GetServerSteamId64() const
|
||||
|| SOURCE_ENGINE == SE_EYE \
|
||||
|| SOURCE_ENGINE == SE_HL2DM \
|
||||
|| SOURCE_ENGINE == SE_INSURGENCY \
|
||||
|| SOURCE_ENGINE == SE_DOI \
|
||||
|| SOURCE_ENGINE == SE_DOI \
|
||||
|| SOURCE_ENGINE == SE_SDK2013 \
|
||||
|| SOURCE_ENGINE == SE_ALIENSWARM \
|
||||
|| SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_MCV \
|
||||
|| SOURCE_ENGINE == SE_OUTBREAK
|
||||
const CSteamID *sid = engine->GetGameServerSteamID();
|
||||
if (sid)
|
||||
{
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
#include <game/shared/berimbau/protobuf/berimbau_usermessages.pb.h>
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
#include <game/shared/vietnam/protobuf/vietnam_usermessages.pb.h>
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
#include <game/shared/protobuf/base_usermessages.pb.h>
|
||||
#endif
|
||||
|
||||
extern const char *g_RadioNumTable[];
|
||||
@@ -186,6 +188,8 @@ void CRadioStyle::OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFil
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
int c = ((CCSUsrMsg_ShowMenu &)msg).display_time();
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
int c = ((CUsrMsg_ShowMenu &)msg).display_time();
|
||||
#else
|
||||
bf_read br(bf->GetBasePointer(), 3);
|
||||
|
||||
@@ -502,9 +506,13 @@ void CRadioMenuPlayer::Radio_Refresh()
|
||||
time = menuHoldTime - (unsigned int)(gpGlobals->curtime - menuStartTime);
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
// TODO: find what happens past 240 on CS:GO
|
||||
CCSUsrMsg_ShowMenu *msg = (CCSUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS);
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_ShowMenu *msg = (CUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS);
|
||||
#else
|
||||
CCSUsrMsg_ShowMenu *msg = (CCSUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS);
|
||||
#endif
|
||||
if (!msg)
|
||||
{
|
||||
return;
|
||||
|
||||
+11
-8
@@ -81,7 +81,7 @@ SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, ed
|
||||
|
||||
// mock lacks NetworkIDValidated; episode1/darkm (< SE_ORANGEBOX) predate it.
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX && SOURCE_ENGINE != SE_MOCK
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK3_void(IServerGameClients, NetworkIDValidated, SH_NOATTRIB, 0, const char *, const char *, CSteamID);
|
||||
#else
|
||||
SH_DECL_HOOK2_void(IServerGameClients, NetworkIDValidated, SH_NOATTRIB, 0, const char *, const char *);
|
||||
@@ -508,7 +508,7 @@ void PlayerManager::RunAuthChecks()
|
||||
}
|
||||
|
||||
#if defined SM_HAS_NETWORKID_VALIDATED
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
void PlayerManager::OnNetworkIDValidated(const char *pszUserName, const char *pszNetworkID, CSteamID steamID)
|
||||
#else
|
||||
void PlayerManager::OnNetworkIDValidated(const char *pszUserName, const char *pszNetworkID)
|
||||
@@ -546,7 +546,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
|
||||
/* Get the client's language */
|
||||
if (m_QueryLang)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
pPlayer->m_LangId = translator->GetServerLanguage();
|
||||
#else
|
||||
const char *name;
|
||||
@@ -703,7 +703,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
&& ((!m_bIsReplayActive && newCount == 1)
|
||||
|| (m_bIsReplayActive && newCount == 2))
|
||||
&& (m_SourceTVUserId == userId
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
// It seems likely that MCV will change this at some point, but it's GOTV at the moment.
|
||||
|| strcmp(playername, "GOTV") == 0
|
||||
#elif SOURCE_ENGINE == SE_BLADE
|
||||
@@ -762,7 +762,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
}
|
||||
pPlayer->Authorize_Post();
|
||||
}
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
else if(m_QueryLang)
|
||||
{
|
||||
// Not a bot
|
||||
@@ -826,7 +826,8 @@ void PlayerManager::OnServerHibernationUpdate(bool bHibernating)
|
||||
CPlayer *pPlayer = &m_Players[i];
|
||||
if (pPlayer->IsConnected() && pPlayer->IsFakeClient())
|
||||
{
|
||||
#if SOURCE_ENGINE < SE_LEFT4DEAD || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE < SE_LEFT4DEAD || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_NUCLEARDAWN || \
|
||||
SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
// These games have the bug fixed where hltv/replay was getting kicked on hibernation
|
||||
if (pPlayer->IsSourceTV() || pPlayer->IsReplay())
|
||||
continue;
|
||||
@@ -2016,7 +2017,7 @@ void CmdMaxplayersCallback()
|
||||
g_Players.MaxPlayersChanged();
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool PlayerManager::HandleConVarQuery(QueryCvarCookie_t cookie, int client, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
|
||||
{
|
||||
for (int i = 1; i <= m_maxClients; i++)
|
||||
@@ -2254,7 +2255,7 @@ void CPlayer::Disconnect()
|
||||
m_bIsSourceTV = false;
|
||||
m_bIsReplay = false;
|
||||
m_Serial.value = -1;
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
ClearNetchannelQueue();
|
||||
@@ -2478,6 +2479,8 @@ void CPlayer::Kick(const char *str)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
pClient->Disconnect(str);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
pClient->Disconnect(NETWORK_DISCONNECT_KICKED);
|
||||
#else
|
||||
pClient->Disconnect("%s", str);
|
||||
#endif
|
||||
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
bool m_bIsReplay = false;
|
||||
serial_t m_Serial;
|
||||
CSteamID m_SteamId;
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
std::deque<std::string> m_PrintfBuffer;
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
void OnClientSettingsChanged(edict_t *pEntity);
|
||||
//void OnClientSettingsChanged_Pre(edict_t *pEntity);
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX && SOURCE_ENGINE != SE_MOCK
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
void OnNetworkIDValidated(const char *pszUserName, const char *pszNetworkID, CSteamID steamID);
|
||||
#else
|
||||
void OnNetworkIDValidated(const char *pszUserName, const char *pszNetworkID);
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
{
|
||||
return m_bInCCKVHook;
|
||||
}
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool HandleConVarQuery(QueryCvarCookie_t cookie, int client, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue);
|
||||
#endif
|
||||
private:
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
#ifndef _INCLUDE_SOURCEMOD_SMPBMESSAGE_H_
|
||||
#define _INCLUDE_SOURCEMOD_SMPBMESSAGE_H_
|
||||
|
||||
#ifdef GetMessage
|
||||
#undef GetMessage
|
||||
#endif
|
||||
|
||||
#include <sh_list.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include <amtl/am-string.h>
|
||||
|
||||
+33
-14
@@ -39,12 +39,15 @@
|
||||
#include <berimbau_usermessage_helpers.h>
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
#include <vietnam_usermessage_helpers.h>
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
#include <base_usermessage_helpers.h>
|
||||
#include <terror_usermessage_helpers.h>
|
||||
#endif
|
||||
#include <amtl/am-string.h>
|
||||
|
||||
UserMessages g_UserMsgs;
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK3_void(IVEngineServer, SendUserMessage, SH_NOATTRIB, 0, IRecipientFilter &, int, const protobuf::Message &);
|
||||
#else
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||
@@ -53,7 +56,7 @@ SH_DECL_HOOK3(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRec
|
||||
SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int);
|
||||
#endif
|
||||
SH_DECL_HOOK0_void(IVEngineServer, MessageEnd, SH_NOATTRIB, 0);
|
||||
#endif // ==SE_CSGO || ==SE_BLADE || ==SE_MCV
|
||||
#endif // ==SE_CSGO || ==SE_BLADE || ==SE_MCV || ==SE_OUTBREAK
|
||||
|
||||
UserMessages::UserMessages()
|
||||
#ifndef USE_PROTOBUF_USERMESSAGES
|
||||
@@ -96,7 +99,7 @@ void UserMessages::OnSourceModAllShutdown()
|
||||
{
|
||||
if (m_HookCount)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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
|
||||
@@ -118,6 +121,9 @@ int UserMessages::GetMessageIndex(const char *msg)
|
||||
return g_BerimbauUsermessageHelpers.GetIndex(msg);
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
return g_VietnamUsermessageHelpers.GetIndex(msg);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
int idx = g_TerrorUsermessageHelpers.GetIndex(msg);
|
||||
return idx == -1 ? g_BaseUsermessageHelpers.GetIndex(msg) : idx;
|
||||
#else
|
||||
|
||||
int msgid;
|
||||
@@ -159,6 +165,10 @@ bool UserMessages::GetMessageName(int msgid, char *buffer, size_t maxlength) con
|
||||
const char *pszName = g_BerimbauUsermessageHelpers.GetName(msgid);
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
const char *pszName = g_VietnamUsermessageHelpers.GetName(msgid);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
const char *pszName = g_TerrorUsermessageHelpers.GetName(msgid);
|
||||
if (pszName == nullptr)
|
||||
pszName = g_BaseUsermessageHelpers.GetName(msgid);
|
||||
#endif
|
||||
if (!pszName)
|
||||
return false;
|
||||
@@ -308,7 +318,7 @@ bool UserMessages::EndMessage()
|
||||
return false;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (m_CurFlags & USERMSG_BLOCKHOOKS)
|
||||
{
|
||||
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(m_CellRecFilter), m_CurId, *m_FakeEngineBuffer);
|
||||
@@ -338,7 +348,7 @@ bool UserMessages::EndMessage()
|
||||
} else {
|
||||
engine->MessageEnd();
|
||||
}
|
||||
#endif // SE_CSGO || SE_BLADE || SE_MCV
|
||||
#endif // SE_CSGO || SE_BLADE || SE_MCV || SE_OUTBREAK
|
||||
|
||||
m_InExec = false;
|
||||
m_CurFlags = 0;
|
||||
@@ -423,7 +433,7 @@ bool UserMessages::InternalHook(int msg_id, IBitBufUserMessageListener *pListene
|
||||
|
||||
if (!m_HookCount++)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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
|
||||
@@ -453,6 +463,11 @@ const protobuf::Message *UserMessages::GetMessagePrototype(int msg_type)
|
||||
return g_BerimbauUsermessageHelpers.GetPrototype(msg_type);
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
return g_VietnamUsermessageHelpers.GetPrototype(msg_type);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
auto *msg = g_TerrorUsermessageHelpers.GetPrototype(msg_type);
|
||||
if (msg == nullptr)
|
||||
msg = g_BaseUsermessageHelpers.GetPrototype(msg_type);
|
||||
return msg;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -501,7 +516,7 @@ void UserMessages::_DecRefCounter()
|
||||
{
|
||||
if (--m_HookCount == 0)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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
|
||||
@@ -513,7 +528,7 @@ void UserMessages::_DecRefCounter()
|
||||
}
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
@@ -522,6 +537,10 @@ void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type,
|
||||
const char *pszName = g_BerimbauUsermessageHelpers.GetName(msg_type);
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
const char *pszName = g_VietnamUsermessageHelpers.GetName(msg_type);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
const char *pszName = g_TerrorUsermessageHelpers.GetName(msg_type);
|
||||
if (pszName == nullptr)
|
||||
pszName = g_BaseUsermessageHelpers.GetName(msg_type);
|
||||
#endif
|
||||
|
||||
OnStartMessage_Pre(&filter, msg_type, pszName);
|
||||
@@ -570,7 +589,7 @@ void UserMessages::OnSendUserMessage_Post(IRecipientFilter &filter, int msg_type
|
||||
RETURN_META(res)
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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)
|
||||
@@ -610,7 +629,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_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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)
|
||||
@@ -773,7 +792,7 @@ void UserMessages::OnMessageEnd_Pre()
|
||||
|
||||
if (!handled && intercepted)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer);
|
||||
#else
|
||||
bf_write *engine_bfw;
|
||||
@@ -785,11 +804,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_BLADE || SE_MCV
|
||||
#endif // SE_CSGO || SE_BLADE || SE_MCV || SE_OUTBREAK
|
||||
}
|
||||
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
int size = m_OrigBuffer->ByteSize();
|
||||
uint8 *data = (uint8 *)stackalloc(size);
|
||||
m_OrigBuffer->SerializePartialToArray(data, size);
|
||||
@@ -819,7 +838,7 @@ void UserMessages::OnMessageEnd_Pre()
|
||||
iter++;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
delete pTempMsg;
|
||||
#endif
|
||||
}
|
||||
|
||||
+6
-3
@@ -43,11 +43,14 @@
|
||||
|
||||
using namespace SourceMod;
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#define USE_PROTOBUF_USERMESSAGES
|
||||
#endif
|
||||
|
||||
#ifdef USE_PROTOBUF_USERMESSAGES
|
||||
#ifdef GetMessage
|
||||
#undef GetMessage
|
||||
#endif
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include <netmessages.pb.h>
|
||||
@@ -100,12 +103,12 @@ public: //IUserMessages
|
||||
bool intercept=false);
|
||||
UserMessageType GetUserMessageType() const;
|
||||
public:
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
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
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
SH_DECL_HOOK1_void(ICvar, UnregisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK2_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *, bool);
|
||||
#else
|
||||
SH_DECL_HOOK1_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
void LinkConCommandBase(ConCommandBase *pBase, bool unknown)
|
||||
#else
|
||||
void LinkConCommandBase(ConCommandBase *pBase)
|
||||
|
||||
+125
-117
@@ -46,11 +46,11 @@
|
||||
#include "IDBDriver.h"
|
||||
#include "provider.h"
|
||||
#include "sm_convar.h"
|
||||
#include <amtl/os/am-shared-library.h>
|
||||
#include <amtl/os/am-path.h>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <amtl/os/am-shared-library.h>
|
||||
#include <amtl/os/am-path.h>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <bridge/include/IVEngineServerBridge.h>
|
||||
#include <bridge/include/IPlayerInfoBridge.h>
|
||||
#include <bridge/include/IFileSystemBridge.h>
|
||||
@@ -197,9 +197,9 @@ public:
|
||||
{
|
||||
return filesystem->GetSearchPath(pathID, bGetPackFiles, pPath, nMaxLen);
|
||||
}
|
||||
const char* GetGameBinArchSubdirectory() override
|
||||
const char* GetGameBinArchSubdirectory() override
|
||||
{
|
||||
#if defined( KE_ARCH_X64 ) && SOURCE_ENGINE >= SE_BLADE
|
||||
#if defined( KE_ARCH_X64 ) && SOURCE_ENGINE >= SE_BLADE && SOURCE_ENGINE != SE_OUTBREAK
|
||||
#if defined( PLATFORM_WINDOWS )
|
||||
#if SOURCE_ENGINE == SE_MCV
|
||||
return "win64" PLATFORM_SEP;
|
||||
@@ -214,112 +214,115 @@ public:
|
||||
#else
|
||||
// Already included in the GameBin path(s), if required
|
||||
return "";
|
||||
#endif // defined( KE_ARCH_X64 ) && SOURCE_ENGINE >= SE_BLADE
|
||||
}
|
||||
bool SupportsAsync() override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
int AsyncRead(const char *filename, const char *pathID, SourceMod::AsyncControl_t *control) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
auto request = std::make_unique<AsyncReadRequest>();
|
||||
request->request.pszFilename = filename;
|
||||
request->request.pszPathID = pathID;
|
||||
request->request.pfnCallback = AsyncReadCallback;
|
||||
request->request.pContext = request.get();
|
||||
FSAsyncControl_t native_control = nullptr;
|
||||
int status = filesystem->AsyncReadMultiple(&request->request, 1, &native_control);
|
||||
if (status >= SourceMod::AsyncStatus_Ok && native_control)
|
||||
async_requests_.emplace(native_control, std::move(request));
|
||||
*control = native_control;
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
int AsyncWrite(const char *filename, const void *data, int size, bool append,
|
||||
SourceMod::AsyncControl_t *control) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK || SOURCE_ENGINE == SE_DARKMESSIAH
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
return filesystem->AsyncWrite(filename, data, size, false, append,
|
||||
reinterpret_cast<FSAsyncControl_t *>(control));
|
||||
#endif
|
||||
}
|
||||
int AsyncStatus(SourceMod::AsyncControl_t control) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
return filesystem->AsyncStatus(reinterpret_cast<FSAsyncControl_t>(control));
|
||||
#endif
|
||||
}
|
||||
int AsyncGetResult(SourceMod::AsyncControl_t control, void **data, int *size) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
FSAsyncControl_t native_control = reinterpret_cast<FSAsyncControl_t>(control);
|
||||
void *engine_data;
|
||||
int engine_size;
|
||||
int status = filesystem->AsyncGetResult(native_control, &engine_data, &engine_size);
|
||||
if (status != SourceMod::AsyncStatus_Ok)
|
||||
return status;
|
||||
|
||||
auto iter = async_requests_.find(native_control);
|
||||
if (iter == async_requests_.end())
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
|
||||
if (data)
|
||||
*data = iter->second->contents.empty() ? nullptr : iter->second->contents.data();
|
||||
if (size)
|
||||
*size = static_cast<int>(iter->second->contents.size());
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
void AsyncAbort(SourceMod::AsyncControl_t control) override
|
||||
{
|
||||
#if SOURCE_ENGINE != SE_MOCK
|
||||
filesystem->AsyncAbort(reinterpret_cast<FSAsyncControl_t>(control));
|
||||
#endif
|
||||
}
|
||||
void AsyncRelease(SourceMod::AsyncControl_t control) override
|
||||
{
|
||||
#if SOURCE_ENGINE != SE_MOCK
|
||||
FSAsyncControl_t native_control = reinterpret_cast<FSAsyncControl_t>(control);
|
||||
filesystem->AsyncRelease(native_control);
|
||||
async_requests_.erase(native_control);
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
#if SOURCE_ENGINE != SE_MOCK
|
||||
struct AsyncReadRequest
|
||||
{
|
||||
FileAsyncRequest_t request;
|
||||
std::vector<uint8_t> contents;
|
||||
};
|
||||
|
||||
static void AsyncReadCallback(const FileAsyncRequest_t &request, int bytes, FSAsyncStatus_t status)
|
||||
{
|
||||
auto *async_request = static_cast<AsyncReadRequest *>(request.pContext);
|
||||
if (status != FSASYNC_OK || bytes < 0 || (bytes && !request.pData))
|
||||
return;
|
||||
|
||||
async_request->contents.resize(bytes);
|
||||
if (bytes)
|
||||
memcpy(async_request->contents.data(), request.pData, bytes);
|
||||
}
|
||||
|
||||
std::unordered_map<FSAsyncControl_t, std::unique_ptr<AsyncReadRequest>> async_requests_;
|
||||
#endif
|
||||
} fs_wrapper;
|
||||
#endif // defined( KE_ARCH_X64 ) && SOURCE_ENGINE >= SE_BLADE && SOURCE_ENGINE != SE_OUTBREAK
|
||||
}
|
||||
bool SupportsAsync() override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
int AsyncRead(const char *filename, const char *pathID, SourceMod::AsyncControl_t *control) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
auto request = std::make_unique<AsyncReadRequest>();
|
||||
request->request.pszFilename = filename;
|
||||
request->request.pszPathID = pathID;
|
||||
request->request.pfnCallback = AsyncReadCallback;
|
||||
request->request.pContext = request.get();
|
||||
FSAsyncControl_t native_control = nullptr;
|
||||
int status = filesystem->AsyncReadMultiple(&request->request, 1, &native_control);
|
||||
if (status >= SourceMod::AsyncStatus_Ok && native_control)
|
||||
async_requests_.emplace(native_control, std::move(request));
|
||||
*control = native_control;
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
int AsyncWrite(const char *filename, const void *data, int size, bool append,
|
||||
SourceMod::AsyncControl_t *control) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK || SOURCE_ENGINE == SE_DARKMESSIAH
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
return filesystem->AsyncWrite(filename, "GAME", data, size, false, append,
|
||||
reinterpret_cast<FSAsyncControl_t *>(control));
|
||||
#else
|
||||
return filesystem->AsyncWrite(filename, data, size, false, append,
|
||||
reinterpret_cast<FSAsyncControl_t *>(control));
|
||||
#endif
|
||||
}
|
||||
int AsyncStatus(SourceMod::AsyncControl_t control) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
return filesystem->AsyncStatus(reinterpret_cast<FSAsyncControl_t>(control));
|
||||
#endif
|
||||
}
|
||||
int AsyncGetResult(SourceMod::AsyncControl_t control, void **data, int *size) override
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_MOCK
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
#else
|
||||
FSAsyncControl_t native_control = reinterpret_cast<FSAsyncControl_t>(control);
|
||||
void *engine_data;
|
||||
int engine_size;
|
||||
int status = filesystem->AsyncGetResult(native_control, &engine_data, &engine_size);
|
||||
if (status != SourceMod::AsyncStatus_Ok)
|
||||
return status;
|
||||
|
||||
auto iter = async_requests_.find(native_control);
|
||||
if (iter == async_requests_.end())
|
||||
return SourceMod::AsyncStatus_FileOpenError;
|
||||
|
||||
if (data)
|
||||
*data = iter->second->contents.empty() ? nullptr : iter->second->contents.data();
|
||||
if (size)
|
||||
*size = static_cast<int>(iter->second->contents.size());
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
void AsyncAbort(SourceMod::AsyncControl_t control) override
|
||||
{
|
||||
#if SOURCE_ENGINE != SE_MOCK
|
||||
filesystem->AsyncAbort(reinterpret_cast<FSAsyncControl_t>(control));
|
||||
#endif
|
||||
}
|
||||
void AsyncRelease(SourceMod::AsyncControl_t control) override
|
||||
{
|
||||
#if SOURCE_ENGINE != SE_MOCK
|
||||
FSAsyncControl_t native_control = reinterpret_cast<FSAsyncControl_t>(control);
|
||||
filesystem->AsyncRelease(native_control);
|
||||
async_requests_.erase(native_control);
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
#if SOURCE_ENGINE != SE_MOCK
|
||||
struct AsyncReadRequest
|
||||
{
|
||||
FileAsyncRequest_t request;
|
||||
std::vector<uint8_t> contents;
|
||||
};
|
||||
|
||||
static void AsyncReadCallback(const FileAsyncRequest_t &request, int bytes, FSAsyncStatus_t status)
|
||||
{
|
||||
auto *async_request = static_cast<AsyncReadRequest *>(request.pContext);
|
||||
if (status != FSASYNC_OK || bytes < 0 || (bytes && !request.pData))
|
||||
return;
|
||||
|
||||
async_request->contents.resize(bytes);
|
||||
if (bytes)
|
||||
memcpy(async_request->contents.data(), request.pData, bytes);
|
||||
}
|
||||
|
||||
std::unordered_map<FSAsyncControl_t, std::unique_ptr<AsyncReadRequest>> async_requests_;
|
||||
#endif
|
||||
} fs_wrapper;
|
||||
|
||||
class VPlayerInfo_Logic : public IPlayerInfoBridge
|
||||
{
|
||||
@@ -508,6 +511,8 @@ void UTIL_ConsolePrint(const char *fmt, ...)
|
||||
#define GAMEFIX "2.pvkii"
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
#define GAMEFIX "2.mcv"
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
#define GAMEFIX "2.outbreak"
|
||||
#elif SOURCE_ENGINE == SE_MOCK
|
||||
#define GAMEFIX "2.mock"
|
||||
#else
|
||||
@@ -636,6 +641,8 @@ const char *CoreProviderImpl::GetSourceEngineName()
|
||||
return "pvkii";
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
return "mcv";
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
return "outbreak";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -651,11 +658,12 @@ bool CoreProviderImpl::SymbolsAreHidden()
|
||||
|| (SOURCE_ENGINE == SE_NUCLEARDAWN) \
|
||||
|| (SOURCE_ENGINE == SE_LEFT4DEAD2) \
|
||||
|| (SOURCE_ENGINE == SE_INSURGENCY) \
|
||||
|| (SOURCE_ENGINE == SE_DOI) \
|
||||
|| (SOURCE_ENGINE == SE_DOI) \
|
||||
|| (SOURCE_ENGINE == SE_BLADE) \
|
||||
|| (SOURCE_ENGINE == SE_CSGO) \
|
||||
|| (SOURCE_ENGINE == SE_PVKII) \
|
||||
|| (SOURCE_ENGINE == SE_MCV)
|
||||
|| (SOURCE_ENGINE == SE_CSGO) \
|
||||
|| (SOURCE_ENGINE == SE_PVKII) \
|
||||
|| (SOURCE_ENGINE == SE_MCV) \
|
||||
|| (SOURCE_ENGINE == SE_OUTBREAK)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
||||
+37
-11
@@ -51,7 +51,10 @@
|
||||
#include <bridge/include/ILogger.h>
|
||||
#include <ITranslator.h>
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#ifdef GetMessage
|
||||
#undef GetMessage
|
||||
#endif
|
||||
#include <netmessages.pb.h>
|
||||
#endif
|
||||
|
||||
@@ -67,6 +70,29 @@
|
||||
#define NET_SETCONVAR 5
|
||||
#endif
|
||||
|
||||
// SourcePawn exposes command and convar flags as a 32-bit int. Outbreak's
|
||||
// engine stores the native mask as uint64, so keep the conversion at this API
|
||||
// boundary and preserve the low 32-bit bit pattern.
|
||||
static int GetConCommandBaseFlags(const ConCommandBase *cmd)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
return static_cast<int>(static_cast<uint32>(cmd->GetFlags()));
|
||||
#else
|
||||
return cmd->m_nFlags;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void SetConCommandBaseFlags(ConCommandBase *cmd, int flags)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
uint64 newFlags = static_cast<uint32>(flags);
|
||||
cmd->RemoveFlags(~newFlags);
|
||||
cmd->AddFlags(newFlags);
|
||||
#else
|
||||
cmd->m_nFlags = flags;
|
||||
#endif
|
||||
}
|
||||
|
||||
enum ConVarBounds
|
||||
{
|
||||
ConVarBound_Upper = 0,
|
||||
@@ -141,14 +167,14 @@ public:
|
||||
if (m_CmdFlags.retrieve(name, &pCmd))
|
||||
{
|
||||
TrackConCommandBase(pCmd, this);
|
||||
*flags = pCmd->m_nFlags;
|
||||
*flags = GetConCommandBaseFlags(pCmd);
|
||||
return true;
|
||||
}
|
||||
else if ((pCmd=FindCommandBase(name)))
|
||||
{
|
||||
m_CmdFlags.insert(name, pCmd);
|
||||
TrackConCommandBase(pCmd, this);
|
||||
*flags = pCmd->m_nFlags;
|
||||
*flags = GetConCommandBaseFlags(pCmd);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -161,14 +187,14 @@ public:
|
||||
ConCommandBase *pCmd;
|
||||
if (m_CmdFlags.retrieve(name, &pCmd))
|
||||
{
|
||||
pCmd->m_nFlags = flags;
|
||||
SetConCommandBaseFlags(pCmd, flags);
|
||||
TrackConCommandBase(pCmd, this);
|
||||
return true;
|
||||
}
|
||||
else if ((pCmd=FindCommandBase(name)))
|
||||
{
|
||||
m_CmdFlags.insert(name, pCmd);
|
||||
pCmd->m_nFlags = flags;
|
||||
SetConCommandBaseFlags(pCmd, flags);
|
||||
TrackConCommandBase(pCmd, this);
|
||||
return true;
|
||||
}
|
||||
@@ -550,7 +576,7 @@ static cell_t sm_GetConVarFlags(IPluginContext *pContext, const cell_t *params)
|
||||
return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
return pConVar->m_nFlags;
|
||||
return GetConCommandBaseFlags(pConVar);
|
||||
}
|
||||
|
||||
static cell_t sm_GetConVarPlugin(IPluginContext *pContext, const cell_t *params)
|
||||
@@ -580,7 +606,7 @@ static cell_t sm_SetConVarFlags(IPluginContext *pContext, const cell_t *params)
|
||||
return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
pConVar->m_nFlags = params[2];
|
||||
SetConCommandBaseFlags(pConVar, params[2]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1154,7 +1180,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
|
||||
|
||||
pContext->StringToLocalUTF8(params[1], params[2], pConCmd->GetName(), NULL);
|
||||
*pIsCmd = pConCmd->IsCommand() ? 1 : 0;
|
||||
*pFlags = pConCmd->m_nFlags;
|
||||
*pFlags = GetConCommandBaseFlags(pConCmd);
|
||||
|
||||
if (params[6])
|
||||
{
|
||||
@@ -1203,7 +1229,7 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pContext->StringToLocalUTF8(params[2], params[3], pConCmd->GetName(), NULL);
|
||||
*pIsCmd = pConCmd->IsCommand() ? 1 : 0;
|
||||
*pFlags = pConCmd->m_nFlags;
|
||||
*pFlags = GetConCommandBaseFlags(pConCmd);
|
||||
|
||||
if (params[7])
|
||||
{
|
||||
@@ -1232,7 +1258,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_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
CNETMsg_SetConVar msg;
|
||||
CMsg_CVars_CVar *cvar = msg.mutable_convars()->add_cvars();
|
||||
|
||||
@@ -1455,7 +1481,7 @@ static cell_t sm_CommandIteratorConVarFlags(IPluginContext *pContext, const cell
|
||||
}
|
||||
|
||||
ConCmdInfo *pInfo = (*(iter->iter));
|
||||
return pInfo->pCmd->m_nFlags;
|
||||
return GetConCommandBaseFlags(pInfo->pCmd);
|
||||
}
|
||||
|
||||
static cell_t sm_CommandIteratorGetDesc(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
@@ -1574,7 +1574,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
|
||||
#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_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (pProp->GetFlags() & SPROP_VARINT)
|
||||
{
|
||||
bit_count = sizeof(int) * 8;
|
||||
@@ -1694,7 +1694,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
|
||||
#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_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (pProp->GetFlags() & SPROP_VARINT)
|
||||
{
|
||||
bit_count = sizeof(int) * 8;
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
#include <game/shared/berimbau/protobuf/berimbau_usermessages.pb.h>
|
||||
#elif SOURCE_ENGINE == SE_MCV
|
||||
#include <game/shared/vietnam/protobuf/vietnam_usermessages.pb.h>
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
#include <game/shared/protobuf/base_usermessages.pb.h>
|
||||
#endif
|
||||
|
||||
#define MAX_HUD_CHANNELS 6
|
||||
@@ -323,8 +325,12 @@ void UTIL_SendHudText(int client, const hud_text_parms &textparms, const char *p
|
||||
|
||||
players[0] = client;
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
CUsrMsg_HudMsg *msg = (CUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
|
||||
#else
|
||||
CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
|
||||
#endif
|
||||
if (!msg)
|
||||
{
|
||||
return;
|
||||
@@ -382,7 +388,7 @@ static cell_t ShowSyncHudText(IPluginContext *pContext, const cell_t *params)
|
||||
Handle_t err;
|
||||
CPlayer *pPlayer;
|
||||
hud_syncobj_t *obj;
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
char message_buffer[512];
|
||||
#else
|
||||
char message_buffer[255-36];
|
||||
@@ -471,7 +477,7 @@ static cell_t ShowHudText(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
int client;
|
||||
CPlayer *pPlayer;
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
char message_buffer[512];
|
||||
#else
|
||||
char message_buffer[255-36];
|
||||
|
||||
@@ -49,7 +49,11 @@
|
||||
#include <bridge/include/IProviderCallbacks.h>
|
||||
#include <bridge/include/ILogger.h>
|
||||
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, void *, const char *, const char *, bool, bool);
|
||||
#else
|
||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool);
|
||||
#endif
|
||||
SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, false);
|
||||
SH_DECL_HOOK1_void(IServerGameDLL, GameFrame, SH_NOATTRIB, false, bool);
|
||||
SH_DECL_HOOK1_void(IServerGameDLL, Think, SH_NOATTRIB, false, bool);
|
||||
@@ -198,7 +202,9 @@ bool SourceModBase::InitializeSourceMod(char *error, size_t maxlength, bool late
|
||||
|
||||
/* Hook this now so we can detect startup without calling StartSourceMod() */
|
||||
SH_ADD_HOOK(IServerGameDLL, LevelInit, gamedll, SH_MEMBER(this, &SourceModBase::LevelInit), false);
|
||||
#if SOURCE_ENGINE != SE_OUTBREAK
|
||||
SH_ADD_HOOK(IVEngineServer, GetMapEntitiesString, engine, SH_MEMBER(this, &SourceModBase::GetMapEntitiesString), false);
|
||||
#endif
|
||||
|
||||
/* Only load if we're not late */
|
||||
if (!late)
|
||||
@@ -276,7 +282,11 @@ void SourceModBase::StartSourceMod(bool late)
|
||||
}
|
||||
|
||||
static bool g_LevelEndBarrier = false;
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool SourceModBase::LevelInit(char const *pMapName, void *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
|
||||
#else
|
||||
bool SourceModBase::LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
|
||||
#endif
|
||||
{
|
||||
/* Seed rand() globally per map */
|
||||
srand(time(NULL));
|
||||
@@ -325,13 +335,16 @@ bool SourceModBase::LevelInit(char const *pMapName, char const *pMapEntities, ch
|
||||
|
||||
g_LevelEndBarrier = true;
|
||||
|
||||
#if SOURCE_ENGINE != SE_OUTBREAK
|
||||
int parseError;
|
||||
size_t position;
|
||||
bool success = logicore.ParseEntityLumpString(pMapEntities, parseError, position);
|
||||
|
||||
logicore.SetEntityLumpWritable(true);
|
||||
#endif
|
||||
g_pOnMapInit->PushString(pMapName);
|
||||
g_pOnMapInit->Execute();
|
||||
#if SOURCE_ENGINE != SE_OUTBREAK
|
||||
logicore.SetEntityLumpWritable(false);
|
||||
|
||||
if (!success)
|
||||
@@ -341,8 +354,12 @@ bool SourceModBase::LevelInit(char const *pMapName, char const *pMapEntities, ch
|
||||
}
|
||||
|
||||
RETURN_META_VALUE_NEWPARAMS(MRES_HANDLED, true, &IServerGameDLL::LevelInit, (pMapName, logicore.GetEntityLumpString(), pOldLevel, pLandmarkName, loadGame, background));
|
||||
#else
|
||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE != SE_OUTBREAK
|
||||
const char *SourceModBase::GetMapEntitiesString()
|
||||
{
|
||||
const char *pNewMapEntities = logicore.GetEntityLumpString();
|
||||
@@ -352,6 +369,7 @@ const char *SourceModBase::GetMapEntitiesString()
|
||||
}
|
||||
RETURN_META_VALUE(MRES_IGNORED, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SourceModBase::LevelShutdown()
|
||||
{
|
||||
@@ -465,7 +483,9 @@ void SourceModBase::CloseSourceMod()
|
||||
return;
|
||||
|
||||
SH_REMOVE_HOOK(IServerGameDLL, LevelInit, gamedll, SH_MEMBER(this, &SourceModBase::LevelInit), false);
|
||||
#if SOURCE_ENGINE != SE_OUTBREAK
|
||||
SH_REMOVE_HOOK(IVEngineServer, GetMapEntitiesString, engine, SH_MEMBER(this, &SourceModBase::GetMapEntitiesString), false);
|
||||
#endif
|
||||
|
||||
if (g_Loaded)
|
||||
{
|
||||
|
||||
@@ -77,7 +77,11 @@ public:
|
||||
/**
|
||||
* @brief Map change hook
|
||||
*/
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool LevelInit(char const *pMapName, void *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
||||
#else
|
||||
bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Level shutdown hook
|
||||
@@ -136,7 +140,9 @@ public: // ISourceMod
|
||||
private:
|
||||
void ShutdownServices();
|
||||
private:
|
||||
#if SOURCE_ENGINE != SE_OUTBREAK
|
||||
const char* GetMapEntitiesString();
|
||||
#endif
|
||||
char m_SMBaseDir[PLATFORM_MAX_PATH];
|
||||
char m_SMRelDir[PLATFORM_MAX_PATH];
|
||||
char m_ModDir[32];
|
||||
|
||||
@@ -154,7 +154,11 @@ CUtlVector<IEntityListener *> *EntListeners()
|
||||
* IServerGameDLL & IVEngineServer Hooks
|
||||
*/
|
||||
SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, false);
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, 0, bool, const char *, void *, const char *, const char *, bool, bool);
|
||||
#else
|
||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, 0, bool, const char *, const char *, const char *, const char *, bool, bool);
|
||||
#endif
|
||||
#ifdef GAMEDESC_CAN_CHANGE
|
||||
SH_DECL_HOOK0(IServerGameDLL, GetGameDescription, SH_NOATTRIB, 0, const char *);
|
||||
#endif
|
||||
@@ -964,7 +968,11 @@ const char *SDKHooks::Hook_GetGameDescription()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool SDKHooks::Hook_LevelInit(char const *pMapName, void *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
|
||||
#else
|
||||
bool SDKHooks::Hook_LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
|
||||
#endif
|
||||
{
|
||||
// Call OnLevelInit forward
|
||||
g_pOnLevelInit->PushString(pMapName);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#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 && \
|
||||
SOURCE_ENGINE != SE_BLADE && SOURCE_ENGINE != SE_MCV
|
||||
SOURCE_ENGINE != SE_BLADE && SOURCE_ENGINE != SE_MCV && SOURCE_ENGINE != SE_OUTBREAK
|
||||
#define GAMEDESC_CAN_CHANGE
|
||||
#endif
|
||||
|
||||
@@ -282,7 +282,11 @@ public:
|
||||
#ifdef GAMEDESC_CAN_CHANGE
|
||||
const char *Hook_GetGameDescription();
|
||||
#endif
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool Hook_LevelInit(char const *pMapName, void *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
||||
#else
|
||||
bool Hook_LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* CBaseEntity Hook Handlers
|
||||
|
||||
@@ -89,14 +89,15 @@ CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *
|
||||
m_flRadius = 0.0f;
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || \
|
||||
SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
m_iDamagedOtherPlayers = 0;
|
||||
m_iObjectsPenetrated = 0;
|
||||
m_uiBulletID = 0;
|
||||
m_uiRecoilIndex = 0;
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||
#if SOURCE_ENGINE == SE_LEFT4DEAD2 || SOURCE_ENGINE == SE_OUTBREAK
|
||||
m_vecDamageDirection.Init();
|
||||
m_iDamageStats = 0;
|
||||
m_iDamageVictimIndex = 0;
|
||||
|
||||
@@ -53,7 +53,11 @@
|
||||
* @brief Implements SDK Tools extension code.
|
||||
*/
|
||||
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, void *, const char *, const char *, bool, bool);
|
||||
#else
|
||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool);
|
||||
#endif
|
||||
SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, false);
|
||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_CSGO
|
||||
SH_DECL_HOOK1_void_vafmt(IVEngineServer, ClientCommand, SH_NOATTRIB, 0, edict_t *);
|
||||
@@ -108,7 +112,7 @@ extern sp_nativeinfo_t g_ClientNatives[];
|
||||
|
||||
static void InitSDKToolsAPI();
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
CDetour *g_WriteBaselinesDetour = NULL;
|
||||
|
||||
DETOUR_DECL_MEMBER3(CNetworkStringTableContainer__WriteBaselines, void, char const *, mapName, void *, buffer, int, currentTick)
|
||||
@@ -209,7 +213,7 @@ bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
m_CSGOBadList.add("m_bIsQuestEligible");
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
g_WriteBaselinesDetour = DETOUR_CREATE_MEMBER(CNetworkStringTableContainer__WriteBaselines, "WriteBaselines");
|
||||
if (g_WriteBaselinesDetour) {
|
||||
g_WriteBaselinesDetour->EnableDetour();
|
||||
@@ -246,7 +250,7 @@ void SDKTools::SDK_OnUnload()
|
||||
g_RegCalls.clear();
|
||||
ShutdownHelpers();
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (g_WriteBaselinesDetour) {
|
||||
g_WriteBaselinesDetour->DisableDetour();
|
||||
g_WriteBaselinesDetour = NULL;
|
||||
@@ -418,7 +422,11 @@ bool SDKTools::RegisterConCommandBase(ConCommandBase *pVar)
|
||||
return g_SMAPI->RegisterConCommandBase(g_PLAPI, pVar);
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool SDKTools::LevelInit(char const *pMapName, void *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
|
||||
#else
|
||||
bool SDKTools::LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
|
||||
#endif
|
||||
{
|
||||
m_bAnyLevelInited = true;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_ALIENSWARM || SOURCE_ENGINE == SE_PORTAL2 || SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI \
|
||||
|| SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
#define CLIENTVOICE_HOOK_SUPPORT
|
||||
#else
|
||||
#include <inetmsghandler.h>
|
||||
@@ -131,7 +131,12 @@ public: //ITimedEvent
|
||||
public: //ICommandTargetProcessor
|
||||
bool ProcessCommandTarget(cmd_target_info_t *info);
|
||||
public:
|
||||
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
bool LevelInit(char const *pMapName, void *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
||||
#else
|
||||
bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
||||
#endif
|
||||
void LevelShutdown();
|
||||
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
|
||||
public:
|
||||
|
||||
@@ -220,7 +220,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
|
||||
#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_BLADE \
|
||||
|| SOURCE_ENGINE == SE_PVKII || SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_PVKII || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (pProp->GetFlags() & SPROP_VARINT)
|
||||
{
|
||||
bit_count = sizeof(int) * 8;
|
||||
@@ -295,7 +295,7 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
#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_BLADE \
|
||||
|| SOURCE_ENGINE == SE_PVKII || SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_PVKII || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (pProp->GetFlags() & SPROP_VARINT)
|
||||
{
|
||||
bit_count = sizeof(int) * 8;
|
||||
|
||||
@@ -331,7 +331,8 @@ void TempEntityManager::Initialize()
|
||||
|| SOURCE_ENGINE == SE_BMS \
|
||||
|| SOURCE_ENGINE == SE_BLADE \
|
||||
|| SOURCE_ENGINE == SE_NUCLEARDAWN \
|
||||
|| SOURCE_ENGINE == SE_PVKII
|
||||
|| SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_OUTBREAK
|
||||
|
||||
if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr))
|
||||
{
|
||||
|
||||
@@ -155,7 +155,8 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|
||||
|| SOURCE_ENGINE == SE_DOI \
|
||||
|| SOURCE_ENGINE == SE_CSGO \
|
||||
|| SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_MCV
|
||||
|| SOURCE_ENGINE == SE_MCV \
|
||||
|| SOURCE_ENGINE == SE_OUTBREAK
|
||||
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
|
||||
#else
|
||||
s_call_addr = dlsym(handle, &sig[1]);
|
||||
|
||||
@@ -834,7 +834,11 @@ CON_COMMAND(sm_dump_classes, "Dumps the class list as a text file")
|
||||
for ( int i = dict->m_Factories.First(); i != dict->m_Factories.InvalidIndex(); i = dict->m_Factories.Next( i ) )
|
||||
{
|
||||
IServerNetworkable *entity = dict->Create(dict->m_Factories.GetElementName(i));
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
ServerClass *sclass = entity->GetServerClassForModify();
|
||||
#else
|
||||
ServerClass *sclass = entity->GetServerClass();
|
||||
#endif
|
||||
fprintf(fp,"%s - %s\n",sclass->GetName(), dict->m_Factories.GetElementName(i));
|
||||
|
||||
if (!gamehelpers->FindDataMapInfo(gamehelpers->GetDataMap(entity->GetBaseEntity()), "m_iEFlags", &info))
|
||||
@@ -1010,7 +1014,11 @@ CON_COMMAND(sm_dump_datamaps, "Dumps the data map list as a text file")
|
||||
for ( int i = dict->m_Factories.First(); i != dict->m_Factories.InvalidIndex(); i = dict->m_Factories.Next( i ) )
|
||||
{
|
||||
IServerNetworkable *entity = dict->Create(dict->m_Factories.GetElementName(i));
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
ServerClass *sclass = entity->GetServerClassForModify();
|
||||
#else
|
||||
ServerClass *sclass = entity->GetServerClass();
|
||||
#endif
|
||||
datamap_t *pMap = gamehelpers->GetDataMap(entity->GetBaseEntity());
|
||||
|
||||
fprintf(fp,"%s - %s\n", sclass->GetName(), dict->m_Factories.GetElementName(i));
|
||||
@@ -1158,7 +1166,11 @@ CON_COMMAND(sm_dump_datamaps_xml, "Dumps the data map list as an XML file")
|
||||
for (int i = dict->m_Factories.First(); i != dict->m_Factories.InvalidIndex(); i = dict->m_Factories.Next(i))
|
||||
{
|
||||
IServerNetworkable *entity = dict->Create(dict->m_Factories.GetElementName(i));
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
ServerClass *sclass = entity->GetServerClassForModify();
|
||||
#else
|
||||
ServerClass *sclass = entity->GetServerClass();
|
||||
#endif
|
||||
datamap_t *pMap = gamehelpers->GetDataMap(entity->GetBaseEntity());
|
||||
|
||||
fprintf(fp, " <serverclass name='%s' element='%s'>\n", sclass->GetName(), dict->m_Factories.GetElementName(i));
|
||||
|
||||
@@ -266,7 +266,7 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
return gamehelpers->EntityToBCompatRef(pEntity);
|
||||
}
|
||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
|
||||
#elif SOURCE_ENGINE == SE_LEFT4DEAD2 || SOURCE_ENGINE == SE_OUTBREAK
|
||||
// CBaseEntity *CTerrorPlayer::GiveNamedItem( const char *pchName, int iSubType, bool bForce, CBaseEntity *pUnk)
|
||||
static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
@@ -996,7 +996,8 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para
|
||||
|| SOURCE_ENGINE == SE_SDK2013 \
|
||||
|| SOURCE_ENGINE == SE_BLADE \
|
||||
|| SOURCE_ENGINE == SE_NUCLEARDAWN \
|
||||
|| SOURCE_ENGINE == SE_PVKII
|
||||
|| SOURCE_ENGINE == SE_PVKII \
|
||||
|| SOURCE_ENGINE == SE_OUTBREAK
|
||||
|
||||
static bool bHasServerTools3 = !!g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr);
|
||||
if (bHasServerTools3)
|
||||
@@ -1090,7 +1091,7 @@ static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
char *classname;
|
||||
pContext->LocalToString(params[1], &classname);
|
||||
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE && SOURCE_ENGINE != SE_MCV
|
||||
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE && SOURCE_ENGINE != SE_MCV && SOURCE_ENGINE != SE_OUTBREAK
|
||||
CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateEntityByName(classname);
|
||||
#else
|
||||
CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateItemEntityByName(classname);
|
||||
|
||||
@@ -38,6 +38,9 @@ SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
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 *);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_DECL_HOOK18(IEngineSound, EmitSound, SH_NOATTRIB, 0, SoundEventGuid_t, 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, SoundEventGuid_t, 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
|
||||
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);
|
||||
SH_DECL_HOOK17(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);
|
||||
@@ -360,6 +363,11 @@ int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChanne
|
||||
float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown)
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
SoundEventGuid_t 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,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown)
|
||||
#elif SOURCE_ENGINE >= SE_PORTAL2
|
||||
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,
|
||||
@@ -497,6 +505,16 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
|
||||
static_cast<soundlevel_t>(committed.level), committed.seed, committed.flags, committed.pitch, pOrigin,
|
||||
pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, nullptr)
|
||||
);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
RETURN_META_VALUE_NEWPARAMS(
|
||||
MRES_IGNORED,
|
||||
-1,
|
||||
static_cast<SoundEventGuid_t (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 *)>(&IEngineSound::EmitSound),
|
||||
(crf, committed.entity, committed.channel, committed.soundEntry, nSoundEntryHash, committed.sample, committed.volume,
|
||||
static_cast<soundlevel_t>(committed.level), committed.seed, committed.flags, committed.pitch, pOrigin,
|
||||
pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, nullptr)
|
||||
);
|
||||
#elif SOURCE_ENGINE >= SE_PORTAL2
|
||||
RETURN_META_VALUE_NEWPARAMS(
|
||||
MRES_IGNORED,
|
||||
@@ -537,6 +555,11 @@ int SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChann
|
||||
float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown)
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
SoundEventGuid_t 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,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown)
|
||||
#elif SOURCE_ENGINE >= SE_PORTAL2
|
||||
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,
|
||||
@@ -674,6 +697,16 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
|
||||
SNDLVL_TO_ATTN(static_cast<soundlevel_t>(committed.level)), committed.seed, committed.flags, committed.pitch,
|
||||
pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, pUnknown)
|
||||
);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
RETURN_META_VALUE_NEWPARAMS(
|
||||
MRES_IGNORED,
|
||||
-1,
|
||||
static_cast<SoundEventGuid_t (IEngineSound::*)(IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float,
|
||||
int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *)>(&IEngineSound::EmitSound),
|
||||
(crf, committed.entity, committed.channel, committed.soundEntry, nSoundEntryHash, committed.sample, committed.volume,
|
||||
SNDLVL_TO_ATTN(static_cast<soundlevel_t>(committed.level)), committed.seed, committed.flags, committed.pitch,
|
||||
pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, pUnknown)
|
||||
);
|
||||
#elif SOURCE_ENGINE >= SE_PORTAL2
|
||||
RETURN_META_VALUE_NEWPARAMS(
|
||||
MRES_IGNORED,
|
||||
@@ -714,7 +747,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
|
||||
if ( !soundname[0] )
|
||||
return false;
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
HSOUNDSCRIPTHASH index = soundemitterbase->HashSoundName(soundname);
|
||||
|
||||
if(!soundemitterbase->IsValidHash(index))
|
||||
@@ -727,7 +760,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
|
||||
#endif // SOURCE_ENGINE >= SE_PORTAL2
|
||||
if (!soundemitterbase->IsValidIndex(index))
|
||||
return false;
|
||||
#endif // SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#endif // SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
|
||||
gender_t gender = GENDER_NONE;
|
||||
|
||||
@@ -973,9 +1006,34 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
|
||||
player[0] = cl_array[i];
|
||||
crf.Reset();
|
||||
crf.Initialize(player, 1);
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (g_InSoundHook)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_CALL(enginesoundPatch,
|
||||
static_cast<SoundEventGuid_t (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 *)>
|
||||
|
||||
(&IEngineSound::EmitSound))
|
||||
(crf,
|
||||
player[0],
|
||||
channel,
|
||||
sample,
|
||||
-1,
|
||||
sample,
|
||||
vol,
|
||||
(soundlevel_t)level,
|
||||
0,
|
||||
flags,
|
||||
pitch,
|
||||
pOrigin,
|
||||
pDir,
|
||||
pOrigVec,
|
||||
updatePos,
|
||||
soundtime,
|
||||
speakerentity,
|
||||
nullptr);
|
||||
#else
|
||||
SH_CALL(enginesoundPatch,
|
||||
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 *)>
|
||||
@@ -999,6 +1057,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
|
||||
soundtime,
|
||||
speakerentity,
|
||||
nullptr);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1151,9 +1210,33 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV || SOURCE_ENGINE == SE_OUTBREAK
|
||||
if (g_InSoundHook)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_CALL(enginesoundPatch,
|
||||
static_cast<SoundEventGuid_t (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 *)>
|
||||
(&IEngineSound::EmitSound))
|
||||
(crf,
|
||||
entity,
|
||||
channel,
|
||||
sample,
|
||||
-1,
|
||||
sample,
|
||||
vol,
|
||||
(soundlevel_t)level,
|
||||
0,
|
||||
flags,
|
||||
pitch,
|
||||
pOrigin,
|
||||
pDir,
|
||||
pOrigVec,
|
||||
updatePos,
|
||||
soundtime,
|
||||
speakerentity,
|
||||
nullptr);
|
||||
#else
|
||||
SH_CALL(enginesoundPatch,
|
||||
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 *)>
|
||||
@@ -1176,6 +1259,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
|
||||
soundtime,
|
||||
speakerentity,
|
||||
nullptr);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1439,11 +1523,17 @@ static cell_t EmitSoundEntry(IPluginContext *pContext, const cell_t *params)
|
||||
if (g_InSoundHook)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
|
||||
SH_CALL(enginesoundPatch,
|
||||
SH_CALL(enginesoundPatch,
|
||||
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 *)>
|
||||
(&IEngineSound::EmitSound))(crf, player[0], channel, soundEntry, soundEntryHash, sample, vol, (soundlevel_t)level, seed,
|
||||
flags, pitch, pOrigin, pDir, pOrigVec, updatePos, soundtime, speakerentity, nullptr);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_CALL(enginesoundPatch,
|
||||
static_cast<SoundEventGuid_t (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 *)>
|
||||
(&IEngineSound::EmitSound))(crf, player[0], channel, soundEntry, soundEntryHash, sample, vol, (soundlevel_t)level, seed,
|
||||
flags, pitch, pOrigin, pDir, pOrigVec, updatePos, soundtime, speakerentity, nullptr);
|
||||
#else
|
||||
SH_CALL(enginesoundPatch,
|
||||
static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float,
|
||||
@@ -1468,6 +1558,12 @@ SH_CALL(enginesoundPatch,
|
||||
soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int, void *)>
|
||||
(&IEngineSound::EmitSound))(crf, entity, channel, soundEntry, soundEntryHash, sample, vol, (soundlevel_t)level,
|
||||
seed, flags, pitch, pOrigin, pDir, pOrigVec, updatePos, soundtime, speakerentity, nullptr);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
SH_CALL(enginesoundPatch,
|
||||
static_cast<SoundEventGuid_t (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 *)>
|
||||
(&IEngineSound::EmitSound))(crf, entity, channel, soundEntry, soundEntryHash, sample, vol, (soundlevel_t)level,
|
||||
seed, flags, pitch, pOrigin, pDir, pOrigVec, updatePos, soundtime, speakerentity, nullptr);
|
||||
#else
|
||||
SH_CALL(enginesoundPatch,
|
||||
static_cast<int (IEngineSound::*)(IRecipientFilter &, int, int, const char*, unsigned int, const char*, float,
|
||||
|
||||
@@ -60,6 +60,15 @@ public:
|
||||
float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown);
|
||||
#elif SOURCE_ENGINE == SE_OUTBREAK
|
||||
SoundEventGuid_t 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,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown);
|
||||
SoundEventGuid_t 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,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity, void *pUnknown);
|
||||
#elif SOURCE_ENGINE >= SE_PORTAL2
|
||||
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,
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
"engine" "contagion"
|
||||
"engine" "pvkii"
|
||||
"engine" "mcv"
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
@@ -198,6 +199,7 @@
|
||||
"game" "dystopia"
|
||||
"game" "treason"
|
||||
"game" "tf2classified"
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@@ -256,6 +258,7 @@
|
||||
"game" "dystopia"
|
||||
"game" "treason"
|
||||
"game" "tf2classified"
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@@ -323,6 +326,7 @@
|
||||
"game" "dystopia"
|
||||
"game" "treason"
|
||||
"game" "tf2classified"
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@@ -377,6 +381,7 @@
|
||||
"engine" "insurgency"
|
||||
"engine" "mcv"
|
||||
"engine" "doi"
|
||||
"engine" "outbreak"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
@@ -400,6 +405,7 @@
|
||||
"engine" "left4dead"
|
||||
"engine" "left4dead2"
|
||||
"engine" "nucleardawn"
|
||||
"engine" "outbreak"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 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"
|
||||
{
|
||||
"#default"
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
{
|
||||
/* CGlobalEntityList */
|
||||
/* L4D2:Outbreak has VSERVERTOOLS003, so we already have gEntList and only need the EntInfo offset from it */
|
||||
/* It's the first member after the vtable */
|
||||
"EntInfo"
|
||||
{
|
||||
"windows64" "8"
|
||||
"linux64" "8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,11 @@
|
||||
{
|
||||
"game" "gmod9"
|
||||
}
|
||||
|
||||
"game.l4d2outbreak.txt"
|
||||
{
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"blocklist.plugins.txt"
|
||||
{
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
{
|
||||
"game" "left4dead"
|
||||
"game" "left4dead2"
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Do not edit this file. Any changes will be overwritten by the gamedata
|
||||
* updater.
|
||||
*
|
||||
* 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"
|
||||
{
|
||||
"left4dead2"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
"Blocked"
|
||||
{
|
||||
"windows64" "126"
|
||||
"linux64" "127"
|
||||
}
|
||||
"EndTouch"
|
||||
{
|
||||
"windows64" "124"
|
||||
"linux64" "125"
|
||||
}
|
||||
"FireBullets"
|
||||
{
|
||||
"windows64" "138"
|
||||
"linux64" "139"
|
||||
}
|
||||
"GetMaxHealth"
|
||||
{
|
||||
"windows64" "142"
|
||||
"linux64" "143"
|
||||
}
|
||||
"OnTakeDamage"
|
||||
{
|
||||
"windows64" "86"
|
||||
"linux64" "87"
|
||||
}
|
||||
"OnTakeDamage_Alive"
|
||||
{
|
||||
"windows64" "327"
|
||||
"linux64" "228"
|
||||
}
|
||||
"PreThink"
|
||||
{
|
||||
"windows64" "401"
|
||||
"linux64" "402"
|
||||
}
|
||||
"PostThink"
|
||||
{
|
||||
"windows64" "402"
|
||||
"linux64" "403"
|
||||
}
|
||||
"Reload"
|
||||
{
|
||||
"windows64" "308"
|
||||
"linux64" "309"
|
||||
}
|
||||
"SetTransmit"
|
||||
{
|
||||
"windows64" "26"
|
||||
"linux64" "27"
|
||||
}
|
||||
"ShouldCollide"
|
||||
{
|
||||
"windows64" "20"
|
||||
"linux64" "21"
|
||||
}
|
||||
"Spawn"
|
||||
{
|
||||
"windows64" "28"
|
||||
"linux64" "29"
|
||||
}
|
||||
"StartTouch"
|
||||
{
|
||||
"windows64" "122"
|
||||
"linux64" "123"
|
||||
}
|
||||
"Think"
|
||||
{
|
||||
"windows64" "69"
|
||||
"linux64" "70"
|
||||
}
|
||||
"Touch"
|
||||
{
|
||||
"windows64" "123"
|
||||
"linux64" "124"
|
||||
}
|
||||
"TraceAttack"
|
||||
{
|
||||
"windows64" "84"
|
||||
"linux64" "85"
|
||||
}
|
||||
"Use"
|
||||
{
|
||||
"windows64" "121"
|
||||
"linux64" "122"
|
||||
}
|
||||
"VPhysicsUpdate"
|
||||
{
|
||||
"windows64" "178"
|
||||
"linux64" "179"
|
||||
}
|
||||
"Weapon_CanSwitchTo"
|
||||
{
|
||||
"windows64" "316"
|
||||
"linux64" "317"
|
||||
}
|
||||
"Weapon_CanUse"
|
||||
{
|
||||
"windows64" "310"
|
||||
"linux64" "311"
|
||||
}
|
||||
"Weapon_Drop"
|
||||
{
|
||||
"windows64" "313"
|
||||
"linux64" "314"
|
||||
}
|
||||
"Weapon_Equip"
|
||||
{
|
||||
"windows64" "311"
|
||||
"linux64" "312"
|
||||
}
|
||||
"Weapon_Switch"
|
||||
{
|
||||
"windows64" "314"
|
||||
"linux64" "315"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
"EntityListeners"
|
||||
{
|
||||
"windows64" "786488"
|
||||
"linux64" "786488"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,4 +235,8 @@
|
||||
{
|
||||
"game" "ship"
|
||||
}
|
||||
"game.l4d2outbreak.txt"
|
||||
{
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
/**
|
||||
* 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" "2"
|
||||
"SlapSound1" "player/damage1.wav"
|
||||
"SlapSound2" "player/damage2.wav"
|
||||
}
|
||||
}
|
||||
|
||||
/* General Temp Entities */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
"GetTEName"
|
||||
{
|
||||
"windows64" "8"
|
||||
"linux64" "8"
|
||||
}
|
||||
"GetTENext"
|
||||
{
|
||||
"windows64" "16"
|
||||
"linux64" "16"
|
||||
}
|
||||
"TE_GetServerClass"
|
||||
{
|
||||
"windows64" "0"
|
||||
"linux64" "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CBaseEntityOutput::FireOutput */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows64" "\x48\x8B\xC4\x4C\x89\x40\x18\x48\x89\x50\x10\x48\x89\x48\x08\x57"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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"
|
||||
{
|
||||
"windows64" "30"
|
||||
}
|
||||
/**
|
||||
* CBaseClient::SetName(char const*);
|
||||
* Linux offset straight from VTable dump.
|
||||
* Has string "(%d)%-0.*s"
|
||||
*/
|
||||
"SetClientName"
|
||||
{
|
||||
"windows64" "31"
|
||||
}
|
||||
/**
|
||||
* 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"
|
||||
{
|
||||
"windows64" "416"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
/**
|
||||
* CNetworkStringTableContainer::WriteBaselines
|
||||
* "Index error writing string table baseline %s\n"
|
||||
*/
|
||||
"WriteBaselines"
|
||||
{
|
||||
"library" "engine"
|
||||
"windows64" "\x48\x8B\xC4\x44\x89\x48\x20\x48\x81\xEC\xE8\x00\x00\x00"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
"SetOwnerEntity"
|
||||
{
|
||||
"windows64" "22"
|
||||
"linux64" "23"
|
||||
}
|
||||
/* CTerrorPlayer::GiveNamedItem(char const*, int, bool, CBaseEntity*) */
|
||||
"GiveNamedItem"
|
||||
{
|
||||
"windows64" "490"
|
||||
"linux64" "491"
|
||||
}
|
||||
"RemovePlayerItem"
|
||||
{
|
||||
"windows64" "325"
|
||||
"linux64" "326"
|
||||
}
|
||||
"Weapon_GetSlot"
|
||||
{
|
||||
"windows64" "318"
|
||||
"linux64" "319"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows64" "249"
|
||||
"linux64" "250"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows64" "252"
|
||||
"linux64" "253"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows64" "134"
|
||||
"linux64" "135"
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows64" "548"
|
||||
"linux64" "548"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
"windows64" "162"
|
||||
"linux64" "163"
|
||||
}
|
||||
"EyeAngles"
|
||||
{
|
||||
"windows64" "151"
|
||||
"linux64" "152"
|
||||
}
|
||||
"AcceptInput"
|
||||
{
|
||||
"windows64" "50"
|
||||
"linux64" "51"
|
||||
}
|
||||
"SetEntityModel"
|
||||
{
|
||||
"windows64" "31"
|
||||
"linux64" "32"
|
||||
}
|
||||
"WeaponEquip"
|
||||
{
|
||||
"windows64" "311"
|
||||
"linux64" "312"
|
||||
}
|
||||
"Activate"
|
||||
{
|
||||
"windows64" "42"
|
||||
"linux64" "43"
|
||||
}
|
||||
"PlayerRunCmd"
|
||||
{
|
||||
"windows64" "515"
|
||||
"linux64" "516"
|
||||
}
|
||||
"GiveAmmo"
|
||||
{
|
||||
"windows64" "304"
|
||||
"linux64" "305"
|
||||
}
|
||||
"GetAttachment"
|
||||
{
|
||||
"windows64" "243"
|
||||
"linux64" "244"
|
||||
}
|
||||
}
|
||||
|
||||
"Keys"
|
||||
{
|
||||
"GameRulesProxy" "CTerrorGameRulesProxy"
|
||||
"GameRulesDataTable" "terror_gamerules_data"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,4 +292,8 @@
|
||||
{
|
||||
"game" "tf2classified"
|
||||
}
|
||||
"game.l4d2outbreak.txt"
|
||||
{
|
||||
"game" "l4d2outbreak"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
Submodule hl2sdk-manifests updated: 931f7aa578...f7f2377c7e
@@ -88,6 +88,7 @@
|
||||
#define FILENAME_1_6_MOCK PLATFORM_ARCH_FOLDER "sourcemod.2.mock" PLATFORM_EXT
|
||||
#define FILENAME_1_6_PVKII PLATFORM_ARCH_FOLDER "sourcemod.2.pvkii" PLATFORM_EXT
|
||||
#define FILENAME_1_6_MCV PLATFORM_ARCH_FOLDER "sourcemod.2.mcv" PLATFORM_EXT
|
||||
#define FILENAME_1_6_OUTBREAK PLATFORM_ARCH_FOLDER "sourcemod.2.outbreak" PLATFORM_EXT
|
||||
|
||||
HINSTANCE g_hCore = NULL;
|
||||
bool load_attempted = false;
|
||||
@@ -353,6 +354,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
|
||||
filename = FILENAME_1_6_MCV;
|
||||
break;
|
||||
}
|
||||
case SOURCE_ENGINE_OUTBREAK:
|
||||
{
|
||||
filename = FILENAME_1_6_OUTBREAK;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return NULL;
|
||||
|
||||
@@ -83,7 +83,7 @@ public void OnPluginStart()
|
||||
g_Cvar_TriggerShow = CreateConVar("sm_trigger_show", "0", "Display triggers message to all players? (0 off, 1 on, def. 0)", 0, true, 0.0, true, 1.0);
|
||||
g_Cvar_TimeleftInterval = CreateConVar("sm_timeleft_interval", "0.0", "Display timeleft every x seconds. Default 0.", 0, true, 0.0, true, 1800.0);
|
||||
|
||||
if (g_GameEngine == Engine_Left4Dead || g_GameEngine == Engine_Left4Dead2)
|
||||
if (g_GameEngine == Engine_Left4Dead || g_GameEngine == Engine_Left4Dead2 || g_GameEngine == Engine_Outbreak)
|
||||
{
|
||||
g_Cvar_FriendlyFire = FindConVar("z_difficulty");
|
||||
}
|
||||
@@ -528,7 +528,7 @@ void ShowFriendlyFire(int client, int who)
|
||||
{
|
||||
if (g_Cvar_FriendlyFire)
|
||||
{
|
||||
if (g_GameEngine == Engine_Left4Dead || g_GameEngine == Engine_Left4Dead2)
|
||||
if (g_GameEngine == Engine_Left4Dead || g_GameEngine == Engine_Left4Dead2 || g_GameEngine == Engine_Outbreak)
|
||||
{
|
||||
char buffer[50];
|
||||
g_Cvar_FriendlyFire.GetString(buffer, sizeof(buffer)); // z_difficulty
|
||||
|
||||
@@ -92,6 +92,9 @@ enum EngineVersion
|
||||
Engine_DOI, /**< Day of Infamy */
|
||||
Engine_PVKII = 26, /**< Pirates, Vikings, and Knights II */
|
||||
Engine_MCV, /**< Military Conflict: Vietnam */
|
||||
Engine_CS2, /**< Counter-Strike 2 */
|
||||
Engine_Deadlock, /**< Deadlock */
|
||||
Engine_Outbreak, /**< Outbreak */
|
||||
};
|
||||
|
||||
enum FindMapResult
|
||||
|
||||
@@ -63,6 +63,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
||||
|| StrEqual(game, "dystopia", false)
|
||||
|| StrEqual(game, "synergy", false)
|
||||
|| StrEqual(game, "left4dead2", false)
|
||||
|| StrEqual(game, "l4d2outbreak", false)
|
||||
|| StrEqual(game, "garrysmod", false)
|
||||
|| StrEqual(game, "swarm", false)
|
||||
|| StrEqual(game, "reactivedrop", false)
|
||||
|
||||
@@ -42,7 +42,8 @@ typedef int QueryCvarCookie_t;
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#define CONVAR_REGISTER(object) ConVar_Register(0, object)
|
||||
|
||||
inline bool IsFlagSet(ConCommandBase *cmd, int flag)
|
||||
template <typename FlagType>
|
||||
inline bool IsFlagSet(ConCommandBase *cmd, FlagType flag)
|
||||
{
|
||||
return cmd->IsFlagSet(flag);
|
||||
}
|
||||
@@ -74,7 +75,8 @@ typedef int QueryCvarCookie_t;
|
||||
static int MaxCommandLength() { return 512; }
|
||||
};
|
||||
|
||||
inline bool IsFlagSet(ConCommandBase *cmd, int flag)
|
||||
template <typename FlagType>
|
||||
inline bool IsFlagSet(ConCommandBase *cmd, FlagType flag)
|
||||
{
|
||||
return cmd->IsBitSet(flag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user