alliedmodders / hl2sdk Goto Github PK
View Code? Open in Web Editor NEWHalf-Life 2 SDK Mirrors
Home Page: https://github.com/valvesoftware
Half-Life 2 SDK Mirrors
Home Page: https://github.com/valvesoftware
Hi,
I just need some help to correct one point about the licensing of the sdks.
I used you versions along with the original source sdk 2013 to produce a dynamic sdk here and I just wanted to know if the licenses (Including Google's protobuf) are compatible with the license I choosed for this plugin.
It's not like I can't read licenses but I just have troubles understanding them.
Thanks if you ever answer this.
Before I used:
gameeventmanager = static_cast<IGameEventManager2*>(CallVFunc<IToolGameEventAPI*, 93>(g_pSource2Server));
But now IToolGameEventAPI does not exists
I tried to use:
gameeventmanager = static_cast<IGameEventManager2*>(CallVFunc<IGameEventManager2*, 93>(g_pSource2Server));
It is compiled but does not work. Segmentation fault.
EmitGameSound* functions in Black Mesa crash the server.
Same sound plays correctly via playgamesound command.
I'm guessing it could be CSGO code like with trace functions in #70 .
Test code
soundtest.txt
Throttle
Thread 0 (crashed):
0: jit_code_3890720768_1048576 + 0xf64e0
https://crash.limetech.org/qdvzopc5s77y
SM 1.11.0.6562
Metamod 1.10.7-dev
Please correct the makefile. I renamed the library names to the new ones (libtier0, libvstdlib), but the plugin still won't compile.
Branch: csgo.
Hi,
I would like the interfaces version to have a INT macro as it is done in the source sdk 2013 but for csgo branch.
Like :
I could make a pull request but I have no clue how to do that as I'm using your sdk in a submodule.
Thanks.
Hello! Im having a lot of compilation errors related to the tchar usage in a code (using CS2 branch):
The error says an obvious thing about "tchar" that cannot be used as a "char". What am i doing wrong..? (Developing a metamod plugin)
VS2022, Win10, compiling for x64.
Preprocessor definitions: COMPILER_MSVC COMPILER_MSVC64 META_IS_SOURCE2
The problem with black mesa it always return visible regardless where players are on the map ! (player is very far away and behind big stones/walls etc)
> bool:IsPointVisible(const Float:start[VEC], const Float:end[VEC])
> {
> TR_TraceRayFilter(start, end, MASK_SHOT|CONTENTS_GRATE|CONTENTS_OPAQUE, RayType_EndPoint, TraceEntityFilterPoints);
> return TR_GetFraction() == 1.0;
> }
>
> public bool:TraceEntityFilterPoints(entity, mask, data)
> {
> return entity > MaxClients;
> }
SM (1.11 - build 6520) and metamod (1.11 - build 1130)
@asherkin its a game data update missing but found nothing strange.
SDK update ? some one can check if its a SM issue or a game issue please ? @dvander @psychonic
Requesting a sync with the latest changes from Valve's 2013 repo. Mostly for easy browsing with the MXR site.
diff --git a/public/tier1/UtlStringMap.h b/public/tier1/UtlStringMap.h
index cfa9d8cc..f2ad0002 100644
--- a/public/tier1/UtlStringMap.h
+++ b/public/tier1/UtlStringMap.h
@@ -47,7 +47,7 @@ public:
bool Defined( const char *pString ) const
{
- return m_SymbolTable.Find( pString ) != UTL_INVAL_SYMBOL;
+ return m_SymbolTable.Find( pString ).IsValid();
}
It looks like it is failing due to not finding the definition of min and max. Some examples:
hl2sdk/tier1/KeyValues.cpp:109:21: error: ‘max’ was not declared in this scope; did you mean ‘Max’?
hl2sdk/tier1/diff.cpp:222:27: error: ‘min’ was not declared in this scope; did you mean ‘Min’
See branch on csgo @ lib\win32\debug and compare to lib\win32\release
I'm so sorry, but i don't un how can I get CBaseViewModel from Cbaseentity, Someone can help, I would be very grateful..
Here is the code to get CBaseEntity
#pragma once
#include <entity2/entityidentity.h>
#include <baseentity.h>
#include "schemasystem.h"
#include "ehandle.h"
#include "CBsePlayer.h"
//#include "playernet_vars.h"
#include "shared_classnames.h"
//#include "CBsePlayer.h"
//#include "c_baseplayer.h"
//class CBasePlayer*;
inline CEntityInstance* UTIL_FindEntityByClassname(CEntityInstance* pStart, const char* name)
{
extern CEntitySystem* g_pEntitySystem;
CEntityIdentity* pEntity = pStart ? pStart->m_pEntity->m_pNext : g_pEntitySystem->m_EntityList.m_pFirstActiveEntity;
for (; pEntity; pEntity = pEntity->m_pNext)
{
if (!strcmp(pEntity->m_designerName.String(), name))
return pEntity->m_pInstance;
};
return nullptr;
}
class SC_CBaseEntity : public CBaseEntity
{
public:
SCHEMA_FIELD(int32_t, CBaseEntity, m_iHealth);
SCHEMA_FIELD(int32_t, CBaseEntity, m_iMaxHealth);
SCHEMA_FIELD(LifeState_t, CBaseEntity, m_lifeState);
SCHEMA_FIELD(uint8_t, CBaseEntity, m_iTeamNum);
SCHEMA_FIELD(float, CBaseEntity, m_flGravityScale);
SCHEMA_FIELD(CHandle<SC_ViewModel>, CBaseViewModel, m_hViewModel);
//CBaseViewModel* ToBaseViewModel()
// {
// if ( !m_hViewModel )
// return nullptr;
// return ::ToBaseViewModel(m_hViewModel.Get());
// }
//CBasePlayer* GetPlayer();
// virtual CBasePlayer* GetPredictionOwner(); // Добавьте это определение
};
This issue is a progress/issue tracker for the ongoing development of cs2 hl2sdk branch done by the community and am members.
Completion status:
CEntityIndex
-> CBaseEntity
;CPlayerSlot
-> CBaseEntity
;If you want to contribute to the project, please make sure to pr the changes to cs2 branch as well as discuss them beforehand in the AlliedModders discord in appropriate channels.
This is a collaborative work and a lot of the research and development was done by: vanz, Wend4r, slidybat, poggu_, psychonic9, zer0.k, mooshua, boeing666, komashchenko, 0xe58, number201724 and others from the AM Discord. So huge thanks to them!
error: ordered comparison of function pointers ('SchemaCollectionManipulatorFn_t' (aka 'void ()(SchemaCollectionManipulatorAction_t, void *, void *, void *)') and 'SchemaCollectionManipulatorFn_t') [-Werror,-Wordered-compare-function-pointers]
return m_pfnManipulator < rhs.m_pfnManipulator;
Cs2 branch
CSGO's latest operation added a few new User messages which haven't been updated to be used with SourceMod yet.
https://github.com/SteamDatabase/Protobufs/blob/master/csgo/cstrike15_usermessages.proto#L80-L82
The new TF2 update broke GetCPUInformation() for at least 1 of my cpus. This function is dynamically linked to in libtier0_srv.so.
It shows the intel cpu as having 3dnow an AMD only instruction set and not having SSE. So when NormalizeVector is called, the server crashes due to running AMD only code. This doesn't seem to be an issue on every CPU.
I don't know if this will be fixed so maybe it's worth not using the game for basic math operations like this.
The old mercurial repository had a branch for the Valve OB games called ob-valve. Is there a reason that branch was never brought over to this repository? I assume it was just missed, but perhaps there was a reason. The link states that the branch is here:
https://hg.alliedmods.net/hl2sdks/hl2sdk-ob/
The reason I ask is that I am fairly certain that the ob-valve branch is the one that we (the Source.Python dev team) need to build against to get our plugin working for Valve single-player games. It would be awesome if that branch was brought over.
Hello!
Earler I used the static library of redis-plus-plus in the metamod plugin for CS2:
postlink:
os.path.join(builder.sourcePath, 'redis', 'lib', 'libredis++.a'),
os.path.join(builder.sourcePath, 'redis', 'lib', 'libhiredis.a'),
In the code:
#include <sw/redis++/redis++.h>
using namespace sw::redis;
std::unique_ptr<Redis> redis;
In the statup function:
redis = std::make_unique<Redis>(std::string("tcp://") + redis_settings["ip"] + ":" + redis_settings["port"] + "/" + redis_settings["db"]);
.....
It worked fine. But after yesterday's update it is compiled but I get the error when I load my plugin:
undefined symbol: _ZN2sw5redis5reply5parseENS1_8ParseTagISsEER10redisReply
I don't understand what I need to resolve it
I have a question regarding this commit:
It introduces an IsSingleton function
However when I look at my vstdlib.dll from the current CS:GO version:
] version
Protocol version 13483
Exe version 1.34.8.3 (csgo)
Exe build: 15:15:43 Apr 28 2015 (5949) (730)
The vtable for VEngineCvar007 / ICvar doesn't include that IsSingleton function, instead at it's place there is already the AllocateDLLIdentifier function from the ICvar / VEngineCvar007 interface.
Is the mistake on my end?
Hi,
Could you add headers for fgdlib into the csgo branch?
Thanks
To reproduce:
sdk2013
branchsdk2013
SDKExpected:
Build without error.
*Actual:
Fails with error:
hl2sdk-sdk2013/public/tier0/memdbgon.h:39:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
^~~~~~~~~~
1 error generated.
If that is fixed (see Possible Fix), fails with the following:
hl2sdk-sdk2013/public/tier1/utlstring.h:19:17: error: expected parameter declarator
inline wchar_t *wcsdup(const wchar_t *pString)
^
hl2sdk-sdk2013/public/tier0/memdbgon.h:132:41: note: expanded from macro 'wcsdup'
#define wcsdup(s) MemAlloc_WcStrDup(s, __FILE__, __LINE__)
^
<scratch space>:30:1: note: expanded from here
"hl2sdk-sdk2013/public/tier1/utlstring.h"
^
hl2sdk-sdk2013/public/tier1/utlstring.h:19:17: error: expected ')'
hl2sdk-sdk2013/public/tier0/memdbgon.h:132:41: note: expanded from macro 'wcsdup'
#define wcsdup(s) MemAlloc_WcStrDup(s, __FILE__, __LINE__)
^
<scratch space>:30:1: note: expanded from here
"hl2sdk-sdk2013/public/tier1/utlstring.h"
^
hl2sdk-sdk2013/public/tier1/utlstring.h:19:17: note: to match this '('
hl2sdk-sdk2013/public/tier0/memdbgon.h:132:37: note: expanded from macro 'wcsdup'
#define wcsdup(s) MemAlloc_WcStrDup(s, __FILE__, __LINE__)
Possible fix:
In platform.h there is the following:
#if defined __APPLE__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
Seems like this is the canonical way to overcome the missing malloc.h
header. Another options is to include <malloc/malloc.h>
, but best to just use the same approach as in platform.h
The other bug happens because both tier1/utlstring.h
and tier0/memdbgon.h
try to provide wcsdup
on Mac debug builds.
A potential fix is to conditionally disable the implementation in utlstring.h
to let memdbg
track allocations, as the implementations only differ in that memdbg
calls g_pMemAlloc->Alloc
and not malloc
and tracks __FILE__
and __LINE__
.
To reproduce:
metamod-source
tf2
or css
branchmetamod-source/sample_mm
with the cloned sdkExpected:
Builds without error.
Actual:
tf2
branch build crashes with error: (https://gist.github.com/maximsmol/cdda5865b2d1284029bcc85f06c0fcf8)
hl2sdk-tf2/public/tier0/memalloc.h:251:8: error: call to 'IsPowerOfTwo' is ambiguous
if ( !IsPowerOfTwo( align ) )
css
branch build crashes with error:
/hl2sdk-css/public/tier0/memalloc.h:181:7: error: call to 'IsPowerOfTwo' is ambiguous
if (!IsPowerOfTwo(align))
Potential fix:
Given that
inline bool ValueIsPowerOfTwo( size_t value ) // don't clash with mathlib definition
already exists, it is safe to assume that it was meant to be used in all the cases where IsPowerOfTwo
is used with a size_t
argument to avoid the clash.
It seems like this issue might be common to all the SDK versions!
I'm curious about the discrepancies I've noticed between the 2007 SDK and this one. For example, where is networksystem? Has it been removed or has its contents been dispersed into other parts of the SDK due to legitimate valve updates?
To reproduce:
sdk2013
-s sdk2013
and --enable-debug
Expected:
Builds without error
Actual:
Build fails due to -Werror
: (https://gist.github.com/maximsmol/bebf474bcb7c385ac6344bf5b5c84204)
error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
DebuggerBreak();
^
.../sdks/hl2sdk-sdk2013/public/tier0/platform.h:430:81: note: expanded from macro 'DebuggerBreak'
#define DebuggerBreak() if ( Plat_IsInDebugSession() ) { __asm ( "int $3" ); } else { raise(SIGTRAP); }
If that is fixed as suggested in Potential Fix, fails with:
hl2sdk-sdk2013/public/tier1/utlblockmemory.h:340:6: error: unused variable 'nBlocksOld' [-Werror,-Wunused-variable]
int nBlocksOld = m_nBlocks;
If that is fixed, fails in multiple locations with -Wunused-local-typedef
resulting from COMPILE_TIME_ASSERT
:
hl2sdk-sdk2013/public/tier0/threadtools.h:346:4: error: unused typedef 'generated_id_346' [-Werror,-Wunused-local-typedef]
COMPILE_TIME_ASSERT( sizeof(T) == sizeof(void *) );
^
hl2sdk-sdk2013/public/tier0/dbg.h:570:50: note: expanded from macro 'COMPILE_TIME_ASSERT'
#define COMPILE_TIME_ASSERT( pred ) typedef int UNIQUE_ID[ (pred) ? 1 : -1 ]
^
hl2sdk-sdk2013/public/tier0/basetypes.h:372:19: note: expanded from macro 'UNIQUE_ID'
#define UNIQUE_ID UID_CAT2(UID_PREFIX,__LINE__)
^
hl2sdk-sdk2013/public/tier0/basetypes.h:367:23: note: expanded from macro 'UID_CAT2'
#define UID_CAT2(a,c) UID_CAT1(a,c)
^
hl2sdk-sdk2013/public/tier0/basetypes.h:366:23: note: expanded from macro 'UID_CAT1'
#define UID_CAT1(a,c) a ## c
^
<scratch space>:16:1: note: expanded from here
generated_id_346
Potential fix:
DebuggerBreak
:
Wrap macro in do { ... } while (0)
nBlocksOld
:
int nBlockSize = NumElementsInBlock();
int nBlocksOld = m_nBlocks;
int nBlocks = ( numElements + nBlockSize - 1 ) / nBlockSize;
// If the number of blocks is the same as the allocated number of blocks, we are done.
if ( nBlocks == m_nBlocks )
return;
m_nBlocks
is clearly not modified between being saved to nBlocksOld
and being compared to nBlocks
, so this is likely not a bug and we can just remove nBlocksOld
.
COMPILE_TIME_ASSERT
:
Add __attribute(unused)__
to the typedef as the code is conditional on GCC anyway.
#elif defined __GNUC__
#define COMPILE_TIME_ASSERT( pred ) typedef int UNIQUE_ID[ (pred) ? 1 : -1 ]
Hello.
I am just curious, if there is a chance, that you'll update the engine for client interfaces somewhen, or if they are beyond your scope, meaning you care only about server interfaces?
Because if you care about the former too, I wanted to inform you, that at least your CSS VEngineClient013 interface is out of date, it almost matches the Source SDK 2013 interface now, apart from i.e.
I read somewhere that you reverse engineer your interfaces from the MAC binaries, if so I sadly probably can't help much with that, because I don't have a MAC and don't know how to download MAC binaries on Windows or Linux, even though there might be a way maybe.
With kind regards
on native OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seed, mouse[2])
i got strange value on mouse parameter
like this:
...
mouse X=-13411 Y=19121
mouse X=-13349 Y=19121
...
X the value increase from -32000 to 32000 (not sure of the range)
Y value increase all 30s!
normally those values are 0 if we dont move mouse and change when we move the mouse
a new parameter in this function on sdk ?
When compiling strtools.h
, it reports that log10 not found, see screenshots here.
This just happened recently, and when I navigated to log10, it jumps to corecrt_math.h
, and I did not found this header with all files related.
Looks like microsoft removed this header file somewhere.
Perhaps we need to add #include <cmath>
somewhere to ensure that it can be compiled?
Please, add appropriate fix for l4d1:
l4d2...l4d2-swapfix
Hey, you guys doing a great job, but can you help me out fixing a problem?
Actually my first time doing an extension, and finally got it to compile with Linux and Eclipse.
Anyway, I am trying to #include <itoolentity.h>
to work with servertools->FindEntityByTarget()
(and other stuff from IServerTools
), but as soon as I uncomment #define SMEXT_CONF_METAMOD
in the config it starts to rain errors.
What I am using:
The build log (compiled with _LINUX defined, without there are tons of errors):
00:45:22 **** Incremental Build of configuration Debug for project botentities ****
make all
Using built-in specs.
Building file: ../extension.cpp
Invoking: GCC C++ Compiler
g++ -m32 -D_LINUX -I/root/workspace/extensions/sourcemod-1.6/public -I/root/workspace/extensions/sourcemod-1.6/public/sourcepawn -I/root/workspace/extensions/hl2sdk-tf2/public -I/root/workspace/extensions/hl2sdk-tf2/public/engine -I/root/workspace/extensions/hl2sdk-tf2/public/game/server -I/root/workspace/extensions/hl2sdk-tf2/public/tier0 -I/root/workspace/extensions/hl2sdk-tf2/public/tier1 -I/root/workspace/extensions/hl2sdk-tf2/public/toolframework -I/root/workspace/extensions/metamod-1.10/core-legacy/sourcehook -I/root/workspace/extensions/metamod-1.10/core-legacy -O0 -g3 -Wall -c -fmessage-length=0 -v -fPIC -MMD -MP -MF"extension.d" -MT"extension.d" -o "extension.o" "../extension.cpp"
COLLECT_GCC=g++
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)
COLLECT_GCC_OPTIONS='-m32' '-D' '_LINUX' '-I' '/root/workspace/extensions/sourcemod-1.6/public' '-I' '/root/workspace/extensions/sourcemod-1.6/public/sourcepawn' '-I' '/root/workspace/extensions/hl2sdk-tf2/public' '-I' '/root/workspace/extensions/hl2sdk-tf2/public/engine' '-I' '/root/workspace/extensions/hl2sdk-tf2/public/game/server' '-I' '/root/workspace/extensions/hl2sdk-tf2/public/tier0' '-I' '/root/workspace/extensions/hl2sdk-tf2/public/tier1' '-I' '/root/workspace/extensions/hl2sdk-tf2/public/toolframework' '-I' '/root/workspace/extensions/metamod-1.10/core-legacy/sourcehook' '-I' '/root/workspace/extensions/metamod-1.10/core-legacy' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-fPIC' '-MMD' '-MP' '-MF' 'extension.d' '-MT' 'extension.d' '-o' 'extension.o' '-shared-libgcc' '-mtune=generic' '-march=i586'
/usr/lib/gcc/x86_64-linux-gnu/4.7/cc1plus -quiet -v -I /root/workspace/extensions/sourcemod-1.6/public -I /root/workspace/extensions/sourcemod-1.6/public/sourcepawn -I /root/workspace/extensions/hl2sdk-tf2/public -I /root/workspace/extensions/hl2sdk-tf2/public/engine -I /root/workspace/extensions/hl2sdk-tf2/public/game/server -I /root/workspace/extensions/hl2sdk-tf2/public/tier0 -I /root/workspace/extensions/hl2sdk-tf2/public/tier1 -I /root/workspace/extensions/hl2sdk-tf2/public/toolframework -I /root/workspace/extensions/metamod-1.10/core-legacy/sourcehook -I /root/workspace/extensions/metamod-1.10/core-legacy -imultilib 32 -imultiarch i386-linux-gnu -MMD extension.d -MF extension.d -MP -MT extension.d -dD -D_GNU_SOURCE -D _LINUX ../extension.cpp -quiet -dumpbase extension.cpp -m32 -mtune=generic -march=i586 -auxbase-strip extension.o -g3 -O0 -Wall -version -fmessage-length=0 -fPIC -o /tmp/ccJHMGos.s
GNU C++ (Debian 4.7.2-5) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128333
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i386-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/root/workspace/extensions/sourcemod-1.6/public
/root/workspace/extensions/sourcemod-1.6/public/sourcepawn
/root/workspace/extensions/hl2sdk-tf2/public
/root/workspace/extensions/hl2sdk-tf2/public/engine
/root/workspace/extensions/hl2sdk-tf2/public/game/server
/root/workspace/extensions/hl2sdk-tf2/public/tier0
/root/workspace/extensions/hl2sdk-tf2/public/tier1
/root/workspace/extensions/hl2sdk-tf2/public/toolframework
/root/workspace/extensions/metamod-1.10/core-legacy/sourcehook
/root/workspace/extensions/metamod-1.10/core-legacy
/usr/include/c++/4.7
/usr/include/c++/4.7/x86_64-linux-gnu/32
/usr/include/c++/4.7/backward
/usr/lib/gcc/x86_64-linux-gnu/4.7/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
/usr/include
End of search list.
GNU C++ (Debian 4.7.2-5) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128333
Compiler executable checksum: 66d178dd81da8c975e003e06d9f5e782
In file included from /root/workspace/extensions/hl2sdk-tf2/public/mathlib/vector.h:27:0,
from /root/workspace/extensions/hl2sdk-tf2/public/mathlib/mathlib.h:12,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/utlblockmemory.h:19,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/utlvector.h:24,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/convar.h:21,
from /root/workspace/extensions/hl2sdk-tf2/public/eiface.h:16,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmAPI.h:20,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmPlugin.h:21,
from ../smsdk_ext.h:102,
from ../extension.h:46,
from ../extension.cpp:32:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/xmmintrin.h:32:3: error: #error "SSE instruction set not enabled"
In file included from /root/workspace/extensions/hl2sdk-tf2/public/tier1/convar.h:19:0,
from /root/workspace/extensions/hl2sdk-tf2/public/eiface.h:16,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmAPI.h:20,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmPlugin.h:21,
from ../smsdk_ext.h:102,
from ../extension.h:46,
from ../extension.cpp:32:
/root/workspace/extensions/hl2sdk-tf2/public/tier0/dbg.h: In constructor ‘CDbgFmtMsg::CDbgFmtMsg(const tchar*, ...)’:
/root/workspace/extensions/hl2sdk-tf2/public/tier0/dbg.h:579:61: error: ‘_vsnprintf’ was not declared in this scope
In file included from /root/workspace/extensions/hl2sdk-tf2/public/tier1/iconvar.h:21:0,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/convar.h:20,
from /root/workspace/extensions/hl2sdk-tf2/public/eiface.h:16,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmAPI.h:20,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmPlugin.h:21,
from ../smsdk_ext.h:102,
from ../extension.h:46,
from ../extension.cpp:32:
/root/workspace/extensions/hl2sdk-tf2/public/tier1/strtools.h: In function ‘int V_stricmp(const char*, const char*)’:
/root/workspace/extensions/hl2sdk-tf2/public/tier1/strtools.h:101:84: error: ‘stricmp’ was not declared in this scope
In file included from /root/workspace/extensions/hl2sdk-tf2/public/tier1/utlvector.h:23:0,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/convar.h:21,
from /root/workspace/extensions/hl2sdk-tf2/public/eiface.h:16,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmAPI.h:20,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmPlugin.h:21,
from ../smsdk_ext.h:102,
from ../extension.h:46,
from ../extension.cpp:32:
/root/workspace/extensions/hl2sdk-tf2/public/tier1/utlmemory.h: In function ‘void* MemAlloc_AllocAligned(size_t, size_t)’:
/root/workspace/extensions/hl2sdk-tf2/public/tier1/utlmemory.h:41:14: error: redefinition of ‘void* MemAlloc_AllocAligned(size_t, size_t)’
In file included from /root/workspace/extensions/hl2sdk-tf2/public/tier1/utlmemory.h:21:0,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/utlvector.h:23,
from /root/workspace/extensions/hl2sdk-tf2/public/tier1/convar.h:21,
from /root/workspace/extensions/hl2sdk-tf2/public/eiface.h:16,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmAPI.h:20,
from /root/workspace/extensions/metamod-1.10/core-legacy/ISmmPlugin.h:21,
from ../smsdk_ext.h:102,
from ../extension.h:46,
from ../extension.cpp:32:
/root/workspace/extensions/hl2sdk-tf2/public/tier0/memalloc.h:120:14: error: ‘void* MemAlloc_AllocAligned(size_t, size_t)’ previously defined here
make: *** [extension.o] Error 1
00:45:23 Build Finished (took 1s.443ms)
Similar to csgo's one:
hl2sdk/public/tier1/KeyValues.h
Lines 335 to 361 in c758235
but looks missing an int32 at the end (a1[10]
).
ConVars and ConCommands in Source 2 got a rework with a Dota 2 update a couple of months ago. The implementation seems to be fully rewritten.
Some snippets from a Russian Cheat Forum:
enum class EConvarType : std::uint8_t
{
BOOL = 0,
INT32,
UINT32,
INT64,
UINT64,
FLOAT,
DOUBLE,
STRING,
COLOR_RGBA,
UNK_SOME_TWO_FLOATS,
UNK_SOME_THREE_FLOATS,
UNK_SOME_FOUR_FLOATS,
UNK_SOME_THREE_FLOATS_AGAIN,
};
struct CvarNode
{
ConVariable* var{};
int some_leaf_like_index_shit{};
};
union ConVarValue
{
bool boolean{};
std::uint64_t u64;
std::int64_t i64;
std::uint32_t u32;
std::int32_t i32;
float flt;
double dbl;
const char* str;
std::uint32_t clr_rgba;
std::array<float, 2> two_floats;
std::array<float, 3> three_floats;
std::array<float, 4> four_floats;
};
struct ConVariable
{
const char* name{};
void* next_convar_node_like_shit{};
void* unk1{};
void* unk2{};
const char* help{};
EConvarType type{};
int unk_maybe_number_of_times_changed{};
int flags{};
int unk4{};
int CALLBACK_INDEX{};
int unk5{};
ConVarValue value{};
}
struct ConCmd
{
const char* name{};
const char* help{};
int flags{};
void* accessor{};
void* accessor_related_shit_maybe{};
int shit_unk{};
int CallbackListIndex{};
};
struct ConCMDID
{
static inline constexpr auto BAD_ID = 0xFFFF;
std::uint64_t impl{};
bool IsGood() const noexcept
{
return impl != BAD_ID;
}
void Invalidate() noexcept
{
impl = BAD_ID;
}
};
struct ConCMDRegistrationInfo
{
const char* cmd_name{};
const char* help_str{};
std::uint64_t flags{};
void* callback{};
void* unk1{};
void* unk2{};
void* unk3{};
void* output_id_holder{};
};
ConCommandSource2(const std::string_view& name, const std::string_view& desc, void(* callback)(void*, const CCommand&))
{
ICvar::ConCMDRegistrationInfo info{};
info.cmd_name = name.data();
info.help_str = desc.data();
info.callback = callback;
info.output_id_holder = this;
Constructor::Invoke(&info);
}
...
//CCvar VVV
private:
//search for xrefs for constructed concmd variables.
static inline constexpr auto UnRegisterCMDVFTable_Index = 38;
public:
auto UnRegisterCMD(const ConCMDID& id)
{
CallVFunc<UnRegisterCMDVFTable_Index>(id);
}
struct ConVarID
{
static inline constexpr auto BAD_ID = 0xFFFFFFFF;
std::uint64_t impl{};
void* var_ptr{};
bool IsGood() const noexcept
{
return impl != BAD_ID;
}
void Invalidate() noexcept
{
impl = BAD_ID;
}
};
using t_CvarCallback = void(*)(const ConVarID& id, int unk1, const ConVarValue* val, const ConVarValue* old_val);
/*
t_CvarCallback GetCVarCallback(int index)
{
if (index)
{
auto table = Member<void*>(0x80);
if (table)
return *reinterpret_cast<t_CvarCallback*>(reinterpret_cast<std::uintptr_t>(table) + 24 * index);
}
return nullptr;
}
*/
/*
auto CCvar::GetCvarList() const noexcept
{
return std::span<const CvarNode>{ Member<const CvarNode*>(0x40), Member<std::uint16_t>(0x58) };
}
*/
for (const auto& [cvar_node, idx] : ICvar::Create()->GetCvarList() | indexed_range)
{
if (cvar_node.var)
{
if (make_stringview(cvar_node.var->name) == "dota_camera_distance")
{
const auto old_val = cvar_node.var->value;
cvar_node.var->value.flt = 2222.0f;
if (auto cb = ICvar::Create()->GetCVarCallback(cvar_node.var->CALLBACK_INDEX); cb)
cb(ICvar::ConVarID{ .impl = static_cast<std::uint64_t>(idx), .var_ptr = (void*)&cvar_node},
0, &cvar_node.var->value, & old_val);
}
if (make_stringview(cvar_node.var->name) == "sv_cheats")
{
const auto old_val = cvar_node.var->value;
cvar_node.var->value.boolean = true;
if (auto cb = ICvar::Create()->GetCVarCallback(cvar_node.var->CALLBACK_INDEX); cb)
cb(ICvar::ConVarID{ .impl = static_cast<std::uint64_t>(idx), .var_ptr = (void*)&cvar_node },
0, &cvar_node.var->value, &old_val);
}
}
}
The upstream repo for SDK 2013 was updated 13 months ago, but those changes still haven't made their way into the sdk2013 branch. Any chance that merge could happen soon?
And if there are compat-related reasons for waiting, could we possibly get an alternative branch, e.g. sdk2013-latest
or some such thing, for people who explicitly do want the most recent Valve code pushes? (I guess I could always fork-and-merge myself, but that's less ideal.)
Additional question: assuming I'm only working with TF2/MMSource/SourceMod, would there any particular problem with including/linking to the upstream version of the SDK 2013 mp directory instead of hl2sdk-sdk2013
, or are the modifications in this repo relative to upstream important enough that doing such a thing would be a fundamentally bad idea?
Thanks.
I would like to know what will cause a huge amount of this warning?
Here is the current vtable from engine_srv.so:
Looking at the interface here it appears to be missing.
I'm guessing the type is something like this:
virtual vcollide_t *GetPhysics2VCollide( int modelindex ) const = 0;
for hl2sdk-tf2 maybe more
change int to intptr_t
Line 25 in 78dab58
#define MyOffsetOf( type, var ) ( (intptr_t)&((type*)0)->var )
It worked fine until ~yesterday. Now it's giving almost random results for each usermsg. I'm hooking IGameEventSystem::PostEventAbstract here:
(gdb) print pEvent->m_MessageID
$1 = 1
(gdb) print pEvent->m_szMessageType
$2 = 0x9c6b4f8 "CDOTAUserMsg_GamerulesStateChanged [506]"
(gdb) print pEvent->m_MessageID
$3 = 1599360513
(gdb) print pEvent->m_szMessageType
$4 = 0x9c9e478 "CDOTAUserMsg_UnitEvent [488]"
Can somebody help? After yesterday's update metamod was bkoken. I updated hl2sdk, metamod is compiled and works.
After changing the variable reason in the function ClientDisconnect of my plugin from int to ENetworkDisconnectionReason it is compiled too. But if I try to load the plugin I get the error:
undefined symbol: _ZNK15CEntityIdentity11NameMatchesEPKc).
I don't use CEntityIdentity::NameMatches in my plugin
I tried to compile the sample from metamod. There is the same error.
m_flMaxSpeed is at the wrong offset.
hl2sdk/game/shared/igamemovement.h
Line 55 in c33f715
I found it in the member variable below it .
float m_flClientMaxSpeed;
I verified this by hooking CTFGameMovement::ProcessMovement( CBasePlayer *pBasePlayer, CMoveData *pMove ). m_flMaxSpeed was 0.0 and m_flClientMaxSpeed was 520.0 as it is set by this code
I'm not sure how I would go about finding the exact member that was added to cause the variable to shift downwards and where, but I thought I would report it.
These can start out as being copied from another branch, and then adjusted as necessary.
https://github.com/alliedmodders/hl2sdk/blob/csgo/public/tier1/convar.h#L461
m_bHasMin and onwards were shifted by 16 bytes
hl2sdk-tf2 does not link to ThreadInterlockedIncrement in libtier0_srv.so
It appears that the signature in libtier0_srv.so is a long volatile* instead of a int32_t volatile* .
ThreadInterlockedAssignIf64 is also missing from libtier0_srv.so so I am not sure what to do about that.
Hey there
You guys are doing really well with this modding and related. Still, I got a huge trouble with porting existing plugin from windows to mac. I had a bunch of issues, like "Unsupported platform" and "Unknown architecture" here. Looks like in some cases I need to define it better.
I am building on latest OS X with latest gcc/g++ with cmake 2.8.10.2.
Can anybody help me out?
Hello I ran into a small problem recently, and I need some help over it.
I don't really know how valve's sdk2013 repo is organized, but i have noticed that while going through tf2 server code, at NavAreaTravelDistance function, GetParent() which is in fact m_parent, is differing of 4 bytes from the value given in the sdk2013 repo:
v6 = *(_DWORD *)(v6 + 120);
https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/nav_area.h#L249
So I'm not sure if I can safely use the functions provided from that repo with a CNavArea pointer from the server.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.