mirror of
https://github.com/arthurdead/proxysend.git
synced 2025-12-07 02:18:22 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b493af742 | ||
|
|
09aa70e774 | ||
|
|
a4cb9f5fec | ||
|
|
eefac413f7 | ||
|
|
5e73c21103 | ||
|
|
1240e21fff | ||
|
|
db5b53b09e | ||
|
|
596e19892d | ||
|
|
1a0bae1814 | ||
|
|
5c1f39064b | ||
|
|
ea36957b1e | ||
|
|
849fc94958 | ||
|
|
ef14a08559 | ||
|
|
cc99f7246c | ||
|
|
df012b0585 | ||
|
|
4195cf9e84 | ||
|
|
cba45e117e | ||
|
|
6d7d7b3223 | ||
|
|
0df516b022 | ||
|
|
7ae9b63e18 |
@ -173,13 +173,11 @@ class ExtensionConfig(object):
|
|||||||
'-Wno-unused',
|
'-Wno-unused',
|
||||||
'-Wno-switch',
|
'-Wno-switch',
|
||||||
'-Wno-array-bounds',
|
'-Wno-array-bounds',
|
||||||
'-Wno-register',
|
|
||||||
'-msse',
|
'-msse',
|
||||||
'-m32',
|
'-m32',
|
||||||
'-fvisibility=hidden',
|
'-fvisibility=hidden',
|
||||||
]
|
]
|
||||||
cxx.cxxflags += [
|
cxx.cxxflags += [
|
||||||
'-std=gnu++2a',
|
|
||||||
'-fno-exceptions',
|
'-fno-exceptions',
|
||||||
'-fno-threadsafe-statics',
|
'-fno-threadsafe-statics',
|
||||||
'-Wno-non-virtual-dtor',
|
'-Wno-non-virtual-dtor',
|
||||||
@ -188,6 +186,11 @@ class ExtensionConfig(object):
|
|||||||
]
|
]
|
||||||
cxx.linkflags += ['-m32']
|
cxx.linkflags += ['-m32']
|
||||||
|
|
||||||
|
if cxx.version >= 'clang-5':
|
||||||
|
cxx.cxxflags += ['-Wno-register','-std=c++17']
|
||||||
|
else:
|
||||||
|
cxx.cxxflags += ['-std=c++14']
|
||||||
|
|
||||||
have_gcc = cxx.vendor == 'gcc'
|
have_gcc = cxx.vendor == 'gcc'
|
||||||
have_clang = cxx.vendor == 'clang'
|
have_clang = cxx.vendor == 'clang'
|
||||||
if cxx.version >= 'clang-3.6':
|
if cxx.version >= 'clang-3.6':
|
||||||
|
|||||||
@ -30,7 +30,7 @@ def CopyFiles(src, dest, files):
|
|||||||
|
|
||||||
# Include files
|
# Include files
|
||||||
CopyFiles('sourcemod/scripting/include', 'addons/sourcemod/scripting/include',
|
CopyFiles('sourcemod/scripting/include', 'addons/sourcemod/scripting/include',
|
||||||
[ 'proxysend.inc', ]
|
[ 'proxysend.inc', 'proxysend_tf2.inc' ]
|
||||||
)
|
)
|
||||||
|
|
||||||
# GameData files
|
# GameData files
|
||||||
|
|||||||
4466
extension.cpp
4466
extension.cpp
File diff suppressed because it is too large
Load Diff
10
extension.h
10
extension.h
@ -48,10 +48,13 @@
|
|||||||
class Sample final : public SDKExtension, public IPluginsListener, public ISMEntityListener, public IConCommandBaseAccessor, public proxysend
|
class Sample final : public SDKExtension, public IPluginsListener, public ISMEntityListener, public IConCommandBaseAccessor, public proxysend
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::vector<const parallel_pack_listener *> pack_ent_listeners;
|
using pack_ent_listeners_t = std::vector<const parallel_pack_listener *>;
|
||||||
|
pack_ent_listeners_t pack_ent_listeners{};
|
||||||
|
|
||||||
bool add_listener(const parallel_pack_listener *ptr) noexcept override final;
|
bool add_listener(const parallel_pack_listener *ptr) noexcept override final;
|
||||||
bool remove_listener(const parallel_pack_listener *ptr) noexcept override final;
|
bool remove_listener(const parallel_pack_listener *ptr) noexcept override final;
|
||||||
|
bool remove_serverclass_from_cache(ServerClass *ptr) noexcept override final;
|
||||||
|
prop_types guess_prop_type(const SendProp *prop, const SendTable *table) const noexcept override final;
|
||||||
|
|
||||||
bool is_parallel_pack_allowed() const noexcept;
|
bool is_parallel_pack_allowed() const noexcept;
|
||||||
|
|
||||||
@ -60,6 +63,9 @@ public:
|
|||||||
virtual void OnPluginUnloaded(IPlugin *plugin) noexcept override final;
|
virtual void OnPluginUnloaded(IPlugin *plugin) noexcept override final;
|
||||||
virtual void OnEntityDestroyed(CBaseEntity *pEntity) noexcept override final;
|
virtual void OnEntityDestroyed(CBaseEntity *pEntity) noexcept override final;
|
||||||
|
|
||||||
|
virtual void NotifyInterfaceDrop(SMInterface *pInterface);
|
||||||
|
virtual bool QueryInterfaceDrop(SMInterface *pInterface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is called after the initial loading sequence has been processed.
|
* @brief This is called after the initial loading sequence has been processed.
|
||||||
*
|
*
|
||||||
@ -93,7 +99,7 @@ public:
|
|||||||
* @param maxlen Size of error message buffer.
|
* @param maxlen Size of error message buffer.
|
||||||
* @return True if working, false otherwise.
|
* @return True if working, false otherwise.
|
||||||
*/
|
*/
|
||||||
//virtual bool QueryRunning(char *error, size_t maxlen);
|
virtual bool QueryRunning(char *error, size_t maxlen);
|
||||||
public:
|
public:
|
||||||
#if defined SMEXT_CONF_METAMOD
|
#if defined SMEXT_CONF_METAMOD
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include <IShareSys.h>
|
#include <IShareSys.h>
|
||||||
|
|
||||||
#define SMINTERFACE_PROXYSEND_NAME "proxysend"
|
#define SMINTERFACE_PROXYSEND_NAME "proxysend"
|
||||||
#define SMINTERFACE_PROXYSEND_VERSION 1
|
#define SMINTERFACE_PROXYSEND_VERSION 3
|
||||||
|
|
||||||
class proxysend : public SourceMod::SMInterface
|
class proxysend : public SourceMod::SMInterface
|
||||||
{
|
{
|
||||||
@ -16,9 +16,34 @@ public:
|
|||||||
class parallel_pack_listener
|
class parallel_pack_listener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual bool is_allowed() const noexcept = 0;
|
virtual bool is_allowed() const noexcept { return true; }
|
||||||
|
virtual void pre_pack_entity(CBaseEntity *pEntity) const noexcept {}
|
||||||
|
virtual void pre_write_deltas() const noexcept {}
|
||||||
|
virtual void post_write_deltas() const noexcept {}
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual bool add_listener(const parallel_pack_listener *ptr) noexcept = 0;
|
virtual bool add_listener(const parallel_pack_listener *ptr) noexcept = 0;
|
||||||
virtual bool remove_listener(const parallel_pack_listener *ptr) noexcept = 0;
|
virtual bool remove_listener(const parallel_pack_listener *ptr) noexcept = 0;
|
||||||
|
virtual bool remove_serverclass_from_cache(ServerClass *ptr) noexcept = 0;
|
||||||
|
|
||||||
|
enum class prop_types : unsigned char
|
||||||
|
{
|
||||||
|
int_,
|
||||||
|
short_,
|
||||||
|
char_,
|
||||||
|
unsigned_int,
|
||||||
|
unsigned_short,
|
||||||
|
unsigned_char,
|
||||||
|
float_,
|
||||||
|
vector,
|
||||||
|
qangle,
|
||||||
|
cstring,
|
||||||
|
ehandle,
|
||||||
|
bool_,
|
||||||
|
color32_,
|
||||||
|
tstring,
|
||||||
|
unknown
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual prop_types guess_prop_type(const SendProp *prop, const SendTable *table) const noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
/* Basic information exposed publicly */
|
/* Basic information exposed publicly */
|
||||||
#define SMEXT_CONF_NAME "proxysend"
|
#define SMEXT_CONF_NAME "proxysend"
|
||||||
#define SMEXT_CONF_DESCRIPTION "proxysend"
|
#define SMEXT_CONF_DESCRIPTION "proxysend"
|
||||||
#define SMEXT_CONF_VERSION "0.1.0.0"
|
#define SMEXT_CONF_VERSION "0.1.0.8"
|
||||||
#define SMEXT_CONF_AUTHOR "Arthurdead"
|
#define SMEXT_CONF_AUTHOR "Arthurdead"
|
||||||
#define SMEXT_CONF_URL ""
|
#define SMEXT_CONF_URL ""
|
||||||
#define SMEXT_CONF_LOGTAG "PROXYSEND"
|
#define SMEXT_CONF_LOGTAG "PROXYSEND"
|
||||||
|
|||||||
@ -1,70 +1,80 @@
|
|||||||
"Games"
|
"Games"
|
||||||
{
|
{
|
||||||
"tf"
|
"#default"
|
||||||
{
|
{
|
||||||
"Offsets"
|
"Offsets"
|
||||||
{
|
{
|
||||||
"CBaseClient::UpdateSendState"
|
"CBaseClient::UpdateSendState"
|
||||||
{
|
{
|
||||||
"linux" "46"
|
"linux" "46"
|
||||||
}
|
}
|
||||||
"CBaseClient::SendSnapshot"
|
"CBaseClient::SendSnapshot"
|
||||||
{
|
{
|
||||||
"linux" "52"
|
"linux" "52"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"Signatures"
|
"Signatures"
|
||||||
{
|
{
|
||||||
"SendTable_CalcDelta"
|
"SendTable_CalcDelta"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_Z19SendTable_CalcDeltaPK9SendTablePKviS3_iPiii"
|
"linux" "@_Z19SendTable_CalcDeltaPK9SendTablePKviS3_iPiii"
|
||||||
}
|
}
|
||||||
"SendTable_Encode"
|
"SendTable_Encode"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_Z16SendTable_EncodePK9SendTablePKvP8bf_writeiP10CUtlMemoryI20CSendProxyRecipientsiEb"
|
"linux" "@_Z16SendTable_EncodePK9SendTablePKvP8bf_writeiP10CUtlMemoryI20CSendProxyRecipientsiEb"
|
||||||
}
|
}
|
||||||
"SV_ComputeClientPacks"
|
"SV_ComputeClientPacks"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_Z21SV_ComputeClientPacksiPP11CGameClientP14CFrameSnapshot"
|
"linux" "@_Z21SV_ComputeClientPacksiPP11CGameClientP14CFrameSnapshot"
|
||||||
}
|
}
|
||||||
"CGameServer::SendClientMessages"
|
"CGameServer::SendClientMessages"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_ZN11CGameServer18SendClientMessagesEb"
|
"linux" "@_ZN11CGameServer18SendClientMessagesEb"
|
||||||
}
|
}
|
||||||
"CFrameSnapshotManager::GetPackedEntity"
|
"CFrameSnapshotManager::GetPackedEntity"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_ZN21CFrameSnapshotManager15GetPackedEntityEP14CFrameSnapshoti"
|
"linux" "@_ZN21CFrameSnapshotManager15GetPackedEntityEP14CFrameSnapshoti"
|
||||||
}
|
}
|
||||||
"CBaseServer::WriteDeltaEntities"
|
"CGameClient::GetSendFrame"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_ZN11CBaseServer18WriteDeltaEntitiesEP11CBaseClientP12CClientFrameS3_R8bf_write"
|
"linux" "@_ZN11CGameClient12GetSendFrameEv"
|
||||||
}
|
}
|
||||||
"CGameClient::GetSendFrame"
|
"SV_PackEntity"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_ZN11CGameClient12GetSendFrameEv"
|
"linux" "@_ZL13SV_PackEntityiP7edict_tP11ServerClassP14CFrameSnapshot"
|
||||||
}
|
}
|
||||||
"SV_PackEntity"
|
"InvalidateSharedEdictChangeInfos"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_ZL13SV_PackEntityiP7edict_tP11ServerClassP14CFrameSnapshot"
|
"linux" "@_Z32InvalidateSharedEdictChangeInfosv"
|
||||||
}
|
}
|
||||||
"InvalidateSharedEdictChangeInfos"
|
"PackWork_t::Process"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "engine"
|
||||||
"linux" "@_Z32InvalidateSharedEdictChangeInfosv"
|
"linux" "@_ZN10PackWork_t7ProcessERS_"
|
||||||
}
|
}
|
||||||
"PackWork_t::Process"
|
"SendProxy_StringT_To_String"
|
||||||
{
|
{
|
||||||
"library" "engine"
|
"library" "server"
|
||||||
"linux" "@_ZN10PackWork_t7ProcessERS_"
|
"linux" "@_Z27SendProxy_StringT_To_StringPK8SendPropPKvS3_P8DVariantii"
|
||||||
}
|
}
|
||||||
}
|
"SendProxy_Color32ToInt"
|
||||||
}
|
{
|
||||||
}
|
"library" "server"
|
||||||
|
"linux" "@_Z22SendProxy_Color32ToIntPK8SendPropPKvS3_P8DVariantii"
|
||||||
|
}
|
||||||
|
"SendProxy_EHandleToInt"
|
||||||
|
{
|
||||||
|
"library" "server"
|
||||||
|
"linux" "@_Z22SendProxy_EHandleToIntPK8SendPropPKvS3_P8DVariantii"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#define __PROXYSEND_INC
|
#define __PROXYSEND_INC
|
||||||
|
|
||||||
#include <tf2>
|
|
||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
|
|
||||||
typeset proxysend_callbacks
|
typeset proxysend_callbacks
|
||||||
@ -27,58 +26,9 @@ typeset proxysend_callbacks
|
|||||||
native void proxysend_hook(int entity, const char[] prop, proxysend_callbacks callback, bool per_client);
|
native void proxysend_hook(int entity, const char[] prop, proxysend_callbacks callback, bool per_client);
|
||||||
native void proxysend_unhook(int entity, const char[] prop, proxysend_callbacks callback);
|
native void proxysend_unhook(int entity, const char[] prop, proxysend_callbacks callback);
|
||||||
|
|
||||||
stock int get_bit_for_cond(TFCond cond)
|
#if defined _tf2_included || defined _tf2_stocks_included
|
||||||
{
|
#include <proxysend_tf2>
|
||||||
int icond = view_as<int>(cond);
|
#endif
|
||||||
switch(icond / 32) {
|
|
||||||
case 0: return (1 << icond);
|
|
||||||
case 1: return (1 << (icond - 32));
|
|
||||||
case 2: return (1 << (icond - 64));
|
|
||||||
case 3: return (1 << (icond - 96));
|
|
||||||
case 4: return (1 << (icond - 128));
|
|
||||||
default: ThrowError("Invalid TFCond value %d", icond);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock void get_prop_name_for_cond(TFCond cond, char[] name, int len)
|
|
||||||
{
|
|
||||||
int icond = view_as<int>(cond);
|
|
||||||
switch(icond / 32) {
|
|
||||||
case 0: strcopy(name, len, "m_nPlayerCond");
|
|
||||||
case 1: strcopy(name, len, "m_nPlayerCondEx");
|
|
||||||
case 2: strcopy(name, len, "m_nPlayerCondEx2");
|
|
||||||
case 3: strcopy(name, len, "m_nPlayerCondEx3");
|
|
||||||
case 4: strcopy(name, len, "m_nPlayerCondEx4");
|
|
||||||
default: ThrowError("Invalid TFCond value %d", icond);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stock void proxysend_hook_cond(int entity, TFCond cond, proxysend_callbacks callback, bool per_client)
|
|
||||||
{
|
|
||||||
int icond = view_as<int>(cond);
|
|
||||||
switch(icond / 32) {
|
|
||||||
case 0: proxysend_hook(entity, "m_nPlayerCond", callback, per_client);
|
|
||||||
case 1: proxysend_hook(entity, "m_nPlayerCondEx", callback, per_client);
|
|
||||||
case 2: proxysend_hook(entity, "m_nPlayerCondEx2", callback, per_client);
|
|
||||||
case 3: proxysend_hook(entity, "m_nPlayerCondEx3", callback, per_client);
|
|
||||||
case 4: proxysend_hook(entity, "m_nPlayerCondEx4", callback, per_client);
|
|
||||||
default: ThrowError("Invalid TFCond value %d", icond);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stock void proxysend_unhook_cond(int entity, TFCond cond, proxysend_callbacks callback)
|
|
||||||
{
|
|
||||||
int icond = view_as<int>(cond);
|
|
||||||
switch(icond / 32) {
|
|
||||||
case 0: proxysend_unhook(entity, "m_nPlayerCond", callback);
|
|
||||||
case 1: proxysend_unhook(entity, "m_nPlayerCondEx", callback);
|
|
||||||
case 2: proxysend_unhook(entity, "m_nPlayerCondEx2", callback);
|
|
||||||
case 3: proxysend_unhook(entity, "m_nPlayerCondEx3", callback);
|
|
||||||
case 4: proxysend_unhook(entity, "m_nPlayerCondEx4", callback);
|
|
||||||
default: ThrowError("Invalid TFCond value %d", icond);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined REQUIRE_EXTENSIONS
|
#if !defined REQUIRE_EXTENSIONS
|
||||||
public __ext_proxysend_SetNTVOptional()
|
public __ext_proxysend_SetNTVOptional()
|
||||||
@ -102,4 +52,4 @@ public Extension __ext_proxysend =
|
|||||||
#else
|
#else
|
||||||
required = 0,
|
required = 0,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
63
sourcemod/scripting/include/proxysend_tf2.inc
Normal file
63
sourcemod/scripting/include/proxysend_tf2.inc
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#if defined __PROXYSEND_TF2_INC
|
||||||
|
#endinput
|
||||||
|
#endif
|
||||||
|
#define __PROXYSEND_TF2_INC
|
||||||
|
|
||||||
|
#include <tf2>
|
||||||
|
|
||||||
|
#if !defined __PROXYSEND_INC
|
||||||
|
#include <proxysend>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
stock int get_bit_for_cond(TFCond cond)
|
||||||
|
{
|
||||||
|
int icond = view_as<int>(cond);
|
||||||
|
switch(icond / 32) {
|
||||||
|
case 0: return (1 << icond);
|
||||||
|
case 1: return (1 << (icond - 32));
|
||||||
|
case 2: return (1 << (icond - 64));
|
||||||
|
case 3: return (1 << (icond - 96));
|
||||||
|
case 4: return (1 << (icond - 128));
|
||||||
|
default: ThrowError("Invalid TFCond value %d", icond);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
stock void get_prop_name_for_cond(TFCond cond, char[] name, int len)
|
||||||
|
{
|
||||||
|
int icond = view_as<int>(cond);
|
||||||
|
switch(icond / 32) {
|
||||||
|
case 0: strcopy(name, len, "m_nPlayerCond");
|
||||||
|
case 1: strcopy(name, len, "m_nPlayerCondEx");
|
||||||
|
case 2: strcopy(name, len, "m_nPlayerCondEx2");
|
||||||
|
case 3: strcopy(name, len, "m_nPlayerCondEx3");
|
||||||
|
case 4: strcopy(name, len, "m_nPlayerCondEx4");
|
||||||
|
default: ThrowError("Invalid TFCond value %d", icond);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stock void proxysend_hook_cond(int entity, TFCond cond, proxysend_callbacks callback, bool per_client)
|
||||||
|
{
|
||||||
|
int icond = view_as<int>(cond);
|
||||||
|
switch(icond / 32) {
|
||||||
|
case 0: proxysend_hook(entity, "m_nPlayerCond", callback, per_client);
|
||||||
|
case 1: proxysend_hook(entity, "m_nPlayerCondEx", callback, per_client);
|
||||||
|
case 2: proxysend_hook(entity, "m_nPlayerCondEx2", callback, per_client);
|
||||||
|
case 3: proxysend_hook(entity, "m_nPlayerCondEx3", callback, per_client);
|
||||||
|
case 4: proxysend_hook(entity, "m_nPlayerCondEx4", callback, per_client);
|
||||||
|
default: ThrowError("Invalid TFCond value %d", icond);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stock void proxysend_unhook_cond(int entity, TFCond cond, proxysend_callbacks callback)
|
||||||
|
{
|
||||||
|
int icond = view_as<int>(cond);
|
||||||
|
switch(icond / 32) {
|
||||||
|
case 0: proxysend_unhook(entity, "m_nPlayerCond", callback);
|
||||||
|
case 1: proxysend_unhook(entity, "m_nPlayerCondEx", callback);
|
||||||
|
case 2: proxysend_unhook(entity, "m_nPlayerCondEx2", callback);
|
||||||
|
case 3: proxysend_unhook(entity, "m_nPlayerCondEx3", callback);
|
||||||
|
case 4: proxysend_unhook(entity, "m_nPlayerCondEx4", callback);
|
||||||
|
default: ThrowError("Invalid TFCond value %d", icond);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user