Add support for Military Conflict: Vietnam (#1887)

This commit is contained in:
Nicholas Hastings 2022-12-20 16:46:18 -05:00 committed by GitHub
parent 0d6179299c
commit b77e8c50ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 604 additions and 115 deletions

View File

@ -63,7 +63,8 @@ SDKMap = {
'swarm': SDK('HL2SDK-SWARM', '2.swarm', '17', 'ALIENSWARM', WinOnly, 'swarm'),
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
'csgo': SDK('HL2SDKCSGO', '2.csgo', '22', 'CSGO', CSGO, 'csgo'),
'mcv': SDK('HL2SDKMCV', '2.mcv', '22', 'MCV', WinOnly, 'mcv'),
'csgo': SDK('HL2SDKCSGO', '2.csgo', '23', 'CSGO', CSGO, 'csgo'),
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '18', 'PORTAL2', [], 'portal2'),
'blade': SDK('HL2SDKBLADE', '2.blade', '19', 'BLADE', Blade, 'blade'),
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '20', 'INSURGENCY', WinLinuxMac, 'insurgency'),
@ -616,7 +617,7 @@ class SMConfig(object):
# For everything after Swarm, this needs to be defined for entity networking
# to work properly with sendprop value changes.
if sdk.name in ['blade', 'insurgency', 'doi', 'csgo']:
if sdk.name in ['blade', 'insurgency', 'doi', 'mcv', 'csgo']:
compiler.defines += ['NETWORK_VARS_ENABLED']
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'pvkii']:
@ -678,7 +679,7 @@ class SMConfig(object):
os.path.join(lib_folder, 'mathlib_i486.a')
]
if sdk.name in ['blade', 'insurgency', 'doi', 'csgo']:
if sdk.name in ['blade', 'insurgency', 'doi', 'mcv' 'csgo']:
if compiler.target.arch == 'x86_64':
compiler.postlink += [os.path.join(lib_folder, 'interfaces.a')]
else:
@ -699,7 +700,7 @@ class SMConfig(object):
dynamic_libs = ['libtier0.dylib', 'libvstdlib.dylib']
elif compiler.target.platform == 'windows':
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
if sdk.name in ['swarm', 'blade', 'insurgency', 'doi', 'csgo']:
if sdk.name in ['swarm', 'blade', 'insurgency', 'doi', 'mcv', 'csgo']:
libs.append('interfaces')
for lib in libs:
if compiler.target.arch == 'x86':

View File

@ -42,6 +42,20 @@ project.sources += [
'GameHooks.cpp',
]
# SDK name to shipping gamedir
pb_gamedir_map = {
'csgo': 'csgo',
'blade': 'berimbau',
'mcv': 'vietnam',
}
# SDK name to source code gamedir
pb_gamesrcdir_map = {
'csgo': 'cstrike15',
'blade': 'berimbau',
'mcv': 'vietnam',
}
for sdk_name in SM.sdks:
sdk = SM.sdks[sdk_name]
for cxx in builder.targets:
@ -58,25 +72,19 @@ for sdk_name in SM.sdks:
builder.sourcePath
]
if sdk.name == 'csgo':
if sdk.name in ['csgo', 'blade', 'mcv']:
compiler.cxxincludes += [
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf')
os.path.join(sdk.path, 'public', 'game', 'shared', pb_gamedir_map[sdk.name], 'protobuf')
]
elif sdk.name == 'blade':
compiler.cxxincludes += [
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf')
]
if compiler.like('msvc'):
compiler.defines += ['_ALLOW_KEYWORD_MACROS']
if cxx.target.platform == 'linux':
compiler.postlink += ['-lpthread', '-lrt']
if sdk.name in ['csgo', 'blade']:
if sdk.name in ['csgo', 'blade', 'mcv']:
if compiler.target.platform == 'linux':
if compiler.target.arch == 'x86':
lib_path = os.path.join(sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a')
@ -108,7 +116,7 @@ for sdk_name in SM.sdks:
lib_path = os.path.join(sdk.path, 'lib', platform, 'release', 'vs' + vs_year, 'libprotobuf.lib')
compiler.linkflags.insert(0, lib_path)
if sdk.name in ['csgo', 'blade']:
if sdk.name in ['csgo', 'blade', 'mcv']:
binary.sources += ['smn_protobuf.cpp']
else:
binary.sources += ['smn_bitbuffer.cpp']
@ -118,18 +126,17 @@ for sdk_name in SM.sdks:
'vprof_tool.cpp',
]
if sdk.name == 'csgo':
if sdk.name in ['csgo', 'blade', 'mcv']:
binary.sources += [
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
]
elif sdk.name == 'blade':
binary.sources += [
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf', 'berimbau_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf', 'berimbau_usermessage_helpers.cpp'),
os.path.join(sdk.path, 'public', 'game', 'shared', pb_gamedir_map[sdk.name], 'protobuf', pb_gamesrcdir_map[sdk.name] + '_usermessages.pb.cc'),
os.path.join(sdk.path, 'public', 'game', 'shared', pb_gamedir_map[sdk.name], 'protobuf', pb_gamesrcdir_map[sdk.name] + '_usermessage_helpers.cpp'),
]
if sdk.name == 'mcv':
binary.sources += [
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'),
]
SM.binaries += builder.Add(project)

View File

@ -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
# if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
if (g_Players.HandleConVarQuery(cookie, client, result, cvarName, cvarValue))
return;
# endif

View File

@ -47,6 +47,8 @@
#include <cstrike15_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <berimbau_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_MCV
#include <vietnam_usermessages.pb.h>
#endif
typedef ICommandLine *(*FakeGetCommandLine)();
@ -539,7 +541,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
char buffer[253];
ke::SafeSprintf(buffer, sizeof(buffer), "%s\1\n", msg);
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_SayText *pMsg;
if ((pMsg = (CCSUsrMsg_SayText *)g_UserMsgs.StartProtobufMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -566,7 +568,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
}
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_TextMsg *pMsg;
if ((pMsg = (CCSUsrMsg_TextMsg *)g_UserMsgs.StartProtobufMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -603,7 +605,7 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
{
cell_t players[] = {client};
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_HintText *pMsg;
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -633,7 +635,7 @@ 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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_HintText *pMsg;
if ((pMsg = (CCSUsrMsg_HintText *)g_UserMsgs.StartProtobufMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
{
@ -668,7 +670,7 @@ 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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_VGUIMenu *pMsg;
if ((pMsg = (CCSUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
{
@ -693,7 +695,7 @@ bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, boo
SubKey = data->GetFirstSubKey();
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
pMsg->set_name(name);
pMsg->set_show(show);
@ -1528,7 +1530,8 @@ uint64_t CHalfLife2::GetServerSteamId64() const
|| SOURCE_ENGINE == SE_SDK2013 \
|| SOURCE_ENGINE == SE_ALIENSWARM \
|| SOURCE_ENGINE == SE_TF2 \
|| SOURCE_ENGINE == SE_PVKII
|| SOURCE_ENGINE == SE_PVKII \
|| SOURCE_ENGINE == SE_MCV
const CSteamID *sid = engine->GetGameServerSteamID();
if (sid)
{

View File

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

View File

@ -514,7 +514,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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
pPlayer->m_LangId = translator->GetServerLanguage();
#else
const char *name;
@ -669,7 +669,8 @@ 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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_MCV
// 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
|| strcmp(playername, "BBTV") == 0
@ -728,7 +729,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
}
pPlayer->Authorize_Post();
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
else if(m_QueryLang)
{
// Not a bot
@ -788,7 +789,7 @@ 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
#if SOURCE_ENGINE < SE_LEFT4DEAD || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_MCV
// These games have the bug fixed where hltv/replay was getting kicked on hibernation
if (pPlayer->IsSourceTV() || pPlayer->IsReplay())
continue;
@ -1959,7 +1960,7 @@ void CmdMaxplayersCallback()
g_Players.MaxPlayersChanged();
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
bool PlayerManager::HandleConVarQuery(QueryCvarCookie_t cookie, int client, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
{
for (int i = 1; i <= m_maxClients; i++)
@ -2197,7 +2198,7 @@ void CPlayer::Disconnect()
m_bIsSourceTV = false;
m_bIsReplay = false;
m_Serial.value = -1;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
m_LanguageCookie = InvalidQueryCvarCookie;
#endif
ClearNetchannelQueue();
@ -2419,7 +2420,7 @@ void CPlayer::Kick(const char *str)
}
else
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
pClient->Disconnect(str);
#else
pClient->Disconnect("%s", str);

View File

@ -153,7 +153,7 @@ private:
bool m_bIsReplay = false;
serial_t m_Serial;
CSteamID m_SteamId;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie;
#endif
std::deque<std::string> m_PrintfBuffer;
@ -238,7 +238,7 @@ public:
{
return m_bInCCKVHook;
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
bool HandleConVarQuery(QueryCvarCookie_t cookie, int client, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue);
#endif
private:

View File

@ -816,9 +816,6 @@ public:
inline bool GetColor(const char *pszFieldName, Color *out)
{
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false;
#else
GETCHECK_FIELD();
CHECK_FIELD_TYPE(MESSAGE);
CHECK_FIELD_NOT_REPEATED();
@ -832,14 +829,10 @@ public:
);
return true;
#endif
}
inline bool SetColor(const char *pszFieldName, const Color &value)
{
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false;
#else
GETCHECK_FIELD();
CHECK_FIELD_TYPE(MESSAGE);
CHECK_FIELD_NOT_REPEATED();
@ -851,14 +844,10 @@ public:
msgRGBA->set_a(value.a());
return true;
#endif
}
inline bool GetRepeatedColor(const char *pszFieldName, int index, Color *out)
{
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false;
#else
GETCHECK_FIELD();
CHECK_FIELD_TYPE(MESSAGE);
CHECK_FIELD_REPEATED();
@ -873,14 +862,10 @@ public:
);
return true;
#endif
}
inline bool SetRepeatedColor(const char *pszFieldName, int index, const Color &value)
{
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false;
#else
GETCHECK_FIELD();
CHECK_FIELD_TYPE(MESSAGE);
CHECK_FIELD_REPEATED();
@ -893,14 +878,10 @@ public:
msgRGBA->set_a(value.a());
return true;
#endif
}
inline bool AddColor(const char *pszFieldName, const Color &value)
{
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE
return false;
#else
GETCHECK_FIELD();
CHECK_FIELD_TYPE(MESSAGE);
CHECK_FIELD_REPEATED();
@ -912,7 +893,6 @@ public:
msgRGBA->set_a(value.a());
return true;
#endif
}
inline bool GetVector2D(const char *pszFieldName, Vector2D *out)

View File

@ -37,12 +37,14 @@
#include <cstrike15_usermessage_helpers.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <berimbau_usermessage_helpers.h>
#elif SOURCE_ENGINE == SE_MCV
#include <vietnam_usermessage_helpers.h>
#endif
#include <amtl/am-string.h>
UserMessages g_UserMsgs;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
SH_DECL_HOOK3_void(IVEngineServer, SendUserMessage, SH_NOATTRIB, 0, IRecipientFilter &, int, const protobuf::Message &);
#else
#if SOURCE_ENGINE >= SE_LEFT4DEAD
@ -51,7 +53,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
#endif // ==SE_CSGO || ==SE_BLADE || ==SE_MCV
UserMessages::UserMessages()
#ifndef USE_PROTOBUF_USERMESSAGES
@ -95,7 +97,7 @@ void UserMessages::OnSourceModAllShutdown()
{
if (m_HookCount)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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
@ -115,6 +117,8 @@ int UserMessages::GetMessageIndex(const char *msg)
return g_Cstrike15UsermessageHelpers.GetIndex(msg);
#elif SOURCE_ENGINE == SE_BLADE
return g_BerimbauUsermessageHelpers.GetIndex(msg);
#elif SOURCE_ENGINE == SE_MCV
return g_VietnamUsermessageHelpers.GetIndex(msg);
#else
int msgid;
@ -154,6 +158,8 @@ bool UserMessages::GetMessageName(int msgid, char *buffer, size_t maxlength) con
const char *pszName = g_Cstrike15UsermessageHelpers.GetName(msgid);
#elif SOURCE_ENGINE == SE_BLADE
const char *pszName = g_BerimbauUsermessageHelpers.GetName(msgid);
#elif SOURCE_ENGINE == SE_MCV
const char *pszName = g_VietnamUsermessageHelpers.GetName(msgid);
#endif
if (!pszName)
return false;
@ -303,7 +309,7 @@ bool UserMessages::EndMessage()
return false;
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
if (m_CurFlags & USERMSG_BLOCKHOOKS)
{
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(m_CellRecFilter), m_CurId, *m_FakeEngineBuffer);
@ -333,7 +339,7 @@ bool UserMessages::EndMessage()
} else {
engine->MessageEnd();
}
#endif // SE_CSGO || SE_BLADE
#endif // SE_CSGO || SE_BLADE || SE_MCV
m_InExec = false;
m_CurFlags = 0;
@ -418,7 +424,7 @@ bool UserMessages::InternalHook(int msg_id, IBitBufUserMessageListener *pListene
if (!m_HookCount++)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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
@ -446,6 +452,8 @@ const protobuf::Message *UserMessages::GetMessagePrototype(int msg_type)
return g_Cstrike15UsermessageHelpers.GetPrototype(msg_type);
#elif SOURCE_ENGINE == SE_BLADE
return g_BerimbauUsermessageHelpers.GetPrototype(msg_type);
#elif SOURCE_ENGINE == SE_MCV
return g_VietnamUsermessageHelpers.GetPrototype(msg_type);
#endif
}
#endif
@ -495,7 +503,7 @@ void UserMessages::_DecRefCounter()
{
if (--m_HookCount == 0)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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
@ -507,13 +515,15 @@ void UserMessages::_DecRefCounter()
}
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
void UserMessages::OnSendUserMessage_Pre(IRecipientFilter &filter, int msg_type, const protobuf::Message &msg)
{
#if SOURCE_ENGINE == SE_CSGO
const char *pszName = g_Cstrike15UsermessageHelpers.GetName(msg_type);
#elif SOURCE_ENGINE == SE_BLADE
const char *pszName = g_BerimbauUsermessageHelpers.GetName(msg_type);
#elif SOURCE_ENGINE == SE_MCV
const char *pszName = g_VietnamUsermessageHelpers.GetName(msg_type);
#endif
OnStartMessage_Pre(&filter, msg_type, pszName);
@ -562,7 +572,7 @@ void UserMessages::OnSendUserMessage_Post(IRecipientFilter &filter, int msg_type
RETURN_META(res)
#endif
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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)
@ -602,7 +612,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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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)
@ -767,7 +777,7 @@ void UserMessages::OnMessageEnd_Pre()
if (!handled && intercepted)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
ENGINE_CALL(SendUserMessage)(static_cast<IRecipientFilter &>(*m_CurRecFilter), m_CurId, *m_InterceptBuffer);
#else
bf_write *engine_bfw;
@ -779,11 +789,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
#endif // SE_CSGO || SE_BLADE || SE_MCV
}
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
int size = m_OrigBuffer->ByteSize();
uint8 *data = (uint8 *)stackalloc(size);
m_OrigBuffer->SerializePartialToArray(data, size);
@ -813,7 +823,7 @@ void UserMessages::OnMessageEnd_Pre()
iter++;
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
delete pTempMsg;
#endif
}

View File

@ -44,7 +44,7 @@
using namespace SourceHook;
using namespace SourceMod;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
#define USE_PROTOBUF_USERMESSAGES
#endif
@ -102,12 +102,12 @@ public: //IUserMessages
bool intercept=false);
UserMessageType GetUserMessageType() const;
public:
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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

View File

@ -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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
SH_DECL_HOOK2_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *, bool);
#else
SH_DECL_HOOK1_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
@ -82,7 +82,7 @@ public:
#endif
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
void LinkConCommandBase(ConCommandBase *pBase, bool unknown)
#else
void LinkConCommandBase(ConCommandBase *pBase)

View File

@ -373,6 +373,8 @@ void UTIL_ConsolePrint(const char *fmt, ...)
#define GAMEFIX "2.contagion"
#elif SOURCE_ENGINE == SE_PVKII
#define GAMEFIX "2.pvkii"
#elif SOURCE_ENGINE == SE_MCV
#define GAMEFIX "2.mcv"
#else
#define GAMEFIX "2.ep1"
#endif
@ -499,6 +501,8 @@ const char *CoreProviderImpl::GetSourceEngineName()
return "mock";
#elif SOURCE_ENGINE == SE_PVKII
return "pvkii";
#elif SOURCE_ENGINE == SE_MCV
return "mcv";
#endif
}
@ -517,7 +521,8 @@ bool CoreProviderImpl::SymbolsAreHidden()
|| (SOURCE_ENGINE == SE_DOI) \
|| (SOURCE_ENGINE == SE_BLADE) \
|| (SOURCE_ENGINE == SE_CSGO) \
|| (SOURCE_ENGINE == SE_PVKII)
|| (SOURCE_ENGINE == SE_PVKII) \
|| (SOURCE_ENGINE == SE_MCV)
return true;
#else
return false;

View File

@ -51,7 +51,7 @@
#include <bridge/include/ILogger.h>
#include <ITranslator.h>
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
#include <netmessages.pb.h>
#endif
@ -1229,7 +1229,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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CNETMsg_SetConVar msg;
CMsg_CVars_CVar *cvar = msg.mutable_convars()->add_cvars();

View File

@ -1458,7 +1458,8 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#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_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII \
|| SOURCE_ENGINE == SE_MCV
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;
@ -1577,7 +1578,8 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#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_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII \
|| SOURCE_ENGINE == SE_MCV
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;

View File

@ -519,6 +519,7 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
return 70;
case SOURCE_ENGINE_CSGO:
return 80;
// Deprecated, and not very useful. Don't bother adding new games
}
return 0;

View File

@ -41,6 +41,8 @@
#include <game/shared/csgo/protobuf/cstrike15_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_BLADE
#include <game/shared/berimbau/protobuf/berimbau_usermessages.pb.h>
#elif SOURCE_ENGINE == SE_MCV
#include <game/shared/vietnam/protobuf/vietnam_usermessages.pb.h>
#endif
#define MAX_HUD_CHANNELS 6
@ -321,7 +323,7 @@ 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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
msg->set_channel(textparms.channel & 0xFF);
@ -376,7 +378,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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
char message_buffer[512];
#else
char message_buffer[255-36];
@ -465,7 +467,7 @@ static cell_t ShowHudText(IPluginContext *pContext, const cell_t *params)
{
int client;
CPlayer *pPlayer;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
char message_buffer[512];
#else
char message_buffer[255-36];

View File

@ -20,7 +20,9 @@
#if SOURCE_ENGINE >= SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD
#define GETMAXHEALTH_IS_VIRTUAL
#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
#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
#define GAMEDESC_CAN_CHANGE
#endif

View File

@ -89,7 +89,7 @@ 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
#if SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
m_iDamagedOtherPlayers = 0;
m_iObjectsPenetrated = 0;
m_uiBulletID = 0;

View File

@ -108,7 +108,7 @@ extern sp_nativeinfo_t g_ClientNatives[];
static void InitSDKToolsAPI();
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CDetour *g_WriteBaselinesDetour = NULL;
DETOUR_DECL_MEMBER3(CNetworkStringTableContainer__WriteBaselines, void, char const *, mapName, void *, buffer, int, currentTick)
@ -209,7 +209,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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
g_WriteBaselinesDetour = DETOUR_CREATE_MEMBER(CNetworkStringTableContainer__WriteBaselines, "WriteBaselines");
if (g_WriteBaselinesDetour) {
g_WriteBaselinesDetour->EnableDetour();
@ -247,7 +247,7 @@ void SDKTools::SDK_OnUnload()
g_RegCalls.clear();
ShutdownHelpers();
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
if (g_WriteBaselinesDetour) {
g_WriteBaselinesDetour->DisableDetour();
g_WriteBaselinesDetour = NULL;

View File

@ -61,7 +61,8 @@
#include <itoolentity.h>
#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
#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
#define CLIENTVOICE_HOOK_SUPPORT
#else
#include <inetmsghandler.h>

View File

@ -213,7 +213,8 @@ 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_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE \
|| SOURCE_ENGINE == SE_PVKII || SOURCE_ENGINE == SE_MCV
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;
@ -287,7 +288,8 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
FIND_PROP_SEND(DPT_Int, "integer");
#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_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE \
|| SOURCE_ENGINE == SE_PVKII || SOURCE_ENGINE == SE_MCV
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;

View File

@ -152,7 +152,8 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
|| SOURCE_ENGINE == SE_INSURGENCY \
|| SOURCE_ENGINE == SE_DOI \
|| SOURCE_ENGINE == SE_CSGO \
|| SOURCE_ENGINE == SE_PVKII
|| SOURCE_ENGINE == SE_PVKII \
|| SOURCE_ENGINE == SE_MCV
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
#else
s_call_addr = dlsym(handle, &sig[1]);

View File

@ -202,7 +202,7 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
return gamehelpers->EntityToBCompatRef(pEntity);
}
#elif SOURCE_ENGINE == SE_BLADE
#elif SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
class CEconItemView;
static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
{
@ -1020,7 +1020,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
#if SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_BLADE || SOURCE_ENGINE != SE_MCV
CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateEntityByName(classname);
#else
CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateItemEntityByName(classname);

View File

@ -34,7 +34,7 @@
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float);
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#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_PORTAL2
@ -316,7 +316,7 @@ uint32 GenerateSoundEntryHash(char const *pSoundEntry)
}
#endif
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
@ -434,7 +434,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
CellRecipientFilter crf;
crf.Initialize(players, size);
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
RETURN_META_VALUE_NEWPARAMS(
MRES_IGNORED,
-1,
@ -479,7 +479,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
#endif
}
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
@ -598,7 +598,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
CellRecipientFilter crf;
crf.Initialize(players, size);
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
RETURN_META_VALUE_NEWPARAMS(
MRES_IGNORED,
-1,
@ -648,7 +648,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
if ( !soundname[0] )
return false;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
HSOUNDSCRIPTHASH index = soundemitterbase->HashSoundName(soundname);
if(!soundemitterbase->IsValidHash(index))
@ -661,7 +661,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
#endif // SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
gender_t gender = GENDER_NONE;
@ -907,7 +907,7 @@ 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
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
if (g_InSoundHook)
{
SH_CALL(enginesoundPatch,
@ -1085,7 +1085,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
#endif
}
} else {
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
if (g_InSoundHook)
{
SH_CALL(enginesoundPatch,
@ -1372,7 +1372,7 @@ static cell_t EmitSoundEntry(IPluginContext *pContext, const cell_t *params)
if (g_InSoundHook)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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 *)>
@ -1396,7 +1396,7 @@ SH_CALL(enginesoundPatch,
else {
if (g_InSoundHook)
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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 *)>

View File

@ -53,7 +53,7 @@ public:
void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
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,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,

View File

@ -106,6 +106,7 @@
"engine" "sdk2013"
"engine" "contagion"
"engine" "pvkii"
"engine" "mcv"
}
"Offsets"
@ -190,6 +191,7 @@
"game" "doi"
"game" "bms"
"game" "iosoccer"
"game" "vietnam"
}
"Keys"
@ -240,6 +242,7 @@
"game" "doi"
"game" "bms"
"game" "iosoccer"
"game" "vietnam"
}
"Keys"
@ -300,6 +303,7 @@
"game" "csgo"
"game" "reactivedrop"
"game" "FortressForever"
"game" "vietnam"
}
"Keys"
@ -352,6 +356,7 @@
"engine" "csgo"
"engine" "blade"
"engine" "insurgency"
"engine" "mcv"
}
"Keys"

View File

@ -0,0 +1,45 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* CGlobalEntityList */
"#default"
{
"#supported"
{
"engine" "mcv"
}
"Offsets"
{
/* Offset into LevelShutdown */
"gEntList"
{
"windows" "33"
}
"EntInfo"
{
"windows" "4"
}
}
"Signatures"
{
"LevelShutdown"
{
"library" "server"
"windows" "\x56\x8B\x35\x2A\x2A\x2A\x2A\x8B\xCE\x8B\x06\xFF\x90\x84\x00\x00\x00\xE8\x2A\x2A\x2A\x2A\xE8"
}
}
}
}

View File

@ -100,6 +100,11 @@
{
"engine" "pvkii"
}
"engine.mcv.txt"
{
"engine" "mcv"
}
"game.dinodday.txt"
{

View File

@ -0,0 +1,112 @@
"Games"
{
"#default"
{
"Offsets"
{
"Blocked"
{
"windows" "106"
}
"EndTouch"
{
"windows" "104"
}
"FireBullets"
{
"windows" "118"
}
"GetMaxHealth"
{
"windows" "122"
}
"OnTakeDamage"
{
"windows" "68"
}
"OnTakeDamage_Alive"
{
"windows" "306"
}
"PreThink"
{
"windows" "376"
}
"PostThink"
{
"windows" "377"
}
"Reload"
{
"windows" "295"
}
"SetTransmit"
{
"windows" "23"
}
"ShouldCollide"
{
"windows" "18"
}
"Spawn"
{
"windows" "25"
}
"StartTouch"
{
"windows" "102"
}
"Think"
{
"windows" "52"
}
"Touch"
{
"windows" "103"
}
"TraceAttack"
{
"windows" "66"
}
"Use"
{
"windows" "101"
}
"VPhysicsUpdate"
{
"windows" "157"
}
"Weapon_CanSwitchTo"
{
"windows" "297"
}
"Weapon_CanUse"
{
"windows" "291"
}
"Weapon_Drop"
{
"windows" "294"
}
"Weapon_Equip"
{
"windows" "292"
}
"Weapon_Switch"
{
"windows" "296"
}
}
}
"#default"
{
"Offsets"
{
"EntityListeners"
{
"windows" "196644"
}
}
}
}

View File

@ -61,6 +61,11 @@
"engine" "insurgency"
"engine" "doi" // #cheating #yolo
}
"engine.mcv.txt"
{
"engine" "mcv"
}
/*
Not Yet

View File

@ -0,0 +1,284 @@
/**
* 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" "6"
"SlapSound1" "physics/flesh/vietnam_flesh_impact_bullet1.wav"
"SlapSound2" "physics/flesh/vietnam_flesh_impact_bullet2.wav"
"SlapSound3" "physics/flesh/vietnam_flesh_impact_bullet3.wav"
"SlapSound4" "physics/flesh/vietnam_flesh_impact_bullet4.wav"
"SlapSound5" "physics/flesh/vietnam_flesh_impact_bullet5.wav"
"SlapSound6" "physics/flesh/vietnam_flesh_impact_bullet6.wav"
}
}
/* General Temp Entities */
"#default"
{
"Offsets"
{
/* Offset into CBaseTempEntity signature address */
"s_pTempEntities"
{
"windows" "16"
}
"GetTEName"
{
"windows" "4"
}
"GetTENext"
{
"windows" "8"
}
"TE_GetServerClass"
{
"windows" "0"
}
}
"Signatures"
{
"CBaseTempEntity"
{
"library" "server"
"windows" "\x55\x8B\xEC\x8B\x45\x08\x89\x41\x04\xC7\x01"
}
}
}
/* CGlobalEntityList */
"#default"
{
"Signatures"
{
/* Functions in CGlobalEntityList */
"FindEntityByClassname"
{
"library" "server"
"windows" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x1C\x8B\x45\x0C\x8B\x5D\x08\x8B\x7D\x10\x85\xC0\x0F\x84\x2A\x2A\x2A\x2A\x8B\x10\x89\x04\x24\xFF\x52\x0C\x8B\x10\xB8\xFF\x1F\x00\x00\x0F\xB7\xCA\x83\xFA\xFF\x0F\x45\xC1\x8D\x04\x40\x8B\x5C\xC3\x10\xEB\x2A\x90\x2A\x2A\x2A\x2A\x89"
}
}
}
/* General GameRules */
"#default"
{
"Keys"
{
"GameRulesProxy" "CVietnamGameRulesProxy"
"GameRulesDataTable" "vietnam_gamerules"
}
}
/* IServer interface pointer */
"#default"
{
"Keys"
{
/* Signature for the beginning of IVEngineServer::CreateFakeClient.
*
* The engine binary is not actually scanned in order to look for
* this. SourceHook is used to used to determine the address of the
* function and this signature is used to verify that it contains
* the expected code. A pointer to sv (IServer interface) is used
* here.
*/
"CreateFakeClient_Windows" "\x55\x8B\xEC\x56\xFF\x75\x08\xB9"
}
"Offsets"
{
/* Offset into IVEngineServer::CreateFakeClient */
"sv"
{
"windows" "8"
}
}
}
/* EntityFactoryDictionary function */
"#default"
{
"Signatures"
{
"EntityFactory"
{
"library" "server"
"windows" "\xA1\x2A\x2A\x2A\x2A\xA8\x01\x0F\x85\x2A\x2A\x2A\x2A\x83\xC8\x01"
}
}
}
/* CBaseEntityOutput::FireOutput */
"#default"
{
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x55\x8B\xEC\x81\xEC\x44\x01\x00\x00\x8B\xC1"
}
}
}
/* CBaseAnimating::LookupAttachment */
"#default"
{
"Signatures"
{
"LookupAttachment"
{
"library" "server"
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x83\xBE\xF4\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\xF4\x04\x00\x00\x5E\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75\x08\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x40"
}
}
}
/* 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"
{
/* Not 100% sure on this, why would windows change and not linux - TEST ME */
"windows" "31"
}
/**
* CBaseClient::SetName(char const*);
* Linux offset straight from VTable dump.
* Has string "(%d)%-0.*s"
*/
"SetClientName"
{
"windows" "30"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
* Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
* Linux: mov byte ptr [esi+0B0h], 0
* Win: mov byte ptr [esi+0B0h], 0
*
* L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
*/
"InfoChanged"
{
"windows" "488"
}
}
}
"#default"
{
"Keys"
{
// Netprop on the team entity for team score
"m_iScore" "m_scoreTotal"
}
"Offsets"
{
"SetOwnerEntity"
{
"windows" "19"
}
"GiveNamedItem"
{
"windows" "461"
}
"RemovePlayerItem"
{
"windows" "304"
}
"Weapon_GetSlot"
{
"windows" "299"
}
"Ignite"
{
"windows" "229"
}
"Extinguish"
{
"windows" "232"
}
"Teleport"
{
"windows" "114"
}
"CommitSuicide"
{
"windows" "510"
}
"GetVelocity"
{
"windows" "140"
}
"EyeAngles"
{
"windows" "131"
}
"AcceptInput"
{
"windows" "41"
}
"SetEntityModel"
{
"windows" "27"
}
"WeaponEquip"
{
"windows" "292"
}
"Activate"
{
"windows" "38"
}
"PlayerRunCmd"
{
"windows" "481"
}
"GiveAmmo"
{
"windows" "285"
}
"GetAttachment"
{
"windows" "223"
}
}
"Signatures"
{
/**
* CNetworkStringTableContainer::WriteBaselines
* "Index error writing string table baseline %s\n"
*/
"WriteBaselines"
{
"library" "engine"
"windows" "\x55\x8B\xEC\x83\xEC\x58\x53\x56\x8B\xF1"
}
}
}
}

View File

@ -95,6 +95,11 @@
{
"engine" "pvkii"
}
"engine.mcv.txt"
{
"engine" "mcv"
}
"game.tf.txt"
{

View File

@ -87,6 +87,7 @@
#define FILENAME_1_6_BMS PLATFORM_ARCH_FOLDER "sourcemod.2.bms" PLATFORM_EXT
#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
HINSTANCE g_hCore = NULL;
bool load_attempted = false;
@ -347,6 +348,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
filename = FILENAME_1_6_PVKII;
break;
}
case SOURCE_ENGINE_MCV:
{
filename = FILENAME_1_6_MCV;
break;
}
default:
{
return NULL;

View File

@ -90,7 +90,8 @@ enum EngineVersion
Engine_Contagion, /**< Contagion */
Engine_BlackMesa, /**< Black Mesa Multiplayer */
Engine_DOI, /**< Day of Infamy */
ENGINE_PVKII /**< Pirates, Vikings, and Knights II */
Engine_PVKII = 26, /**< Pirates, Vikings, and Knights II */
Engine_MCV, /**< Military Conflict: Vietnam */
};
enum FindMapResult

View File

@ -67,7 +67,8 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|| StrEqual(game, "swarm", false)
|| StrEqual(game, "reactivedrop", false)
|| engine == Engine_Insurgency
|| engine == Engine_DOI)
|| engine == Engine_DOI
|| engine == Engine_MCV)
{
strcopy(error, err_max, "Nextmap is incompatible with this game");
return APLRes_SilentFailure;