Coder Social home page Coder Social logo

alliedmodders / hl2sdk Goto Github PK

View Code? Open in Web Editor NEW
341.0 38.0 162.0 546.37 MB

Half-Life 2 SDK Mirrors

Home Page: https://github.com/valvesoftware

C++ 94.94% C 4.42% Shell 0.01% Perl 0.23% Makefile 0.07% Assembly 0.01% Batchfile 0.02% GLSL 0.31%
source-engine source-engine-sdk reverse-engineering hacktoberfest

hl2sdk's People

Contributors

ddorab avatar dvander avatar gnif avatar joeludwig avatar jorgenpt avatar maximsmol avatar psychonic avatar sapphonie avatar sigsegv-mvm avatar theds avatar theds1337 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hl2sdk's Issues

License

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.

Remove IToolGameEventAPI, how to use event manager now?

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.

Makefile (VSP)

Please correct the makefile. I renamed the library names to the new ones (libtier0, libvstdlib), but the plugin still won't compile.
Branch: csgo.

Interfaces version with INT

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 :

define INTERFACEVERSION_VENGINESERVER "VEngineServer023"

define INTERFACEVERSION_VENGINESERVER_INT 23

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.

tchar compilation errors?

Hello! Im having a lot of compilation errors related to the tchar usage in a code (using CS2 branch):
image

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

Black Mesa Trace Ray functions not work

test.txt

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

Sync sdk2013 with Valve

Requesting a sync with the latest changes from Valve's 2013 repo. Mostly for easy browsing with the MXR site.

hl2sdk-tf2 utlstringmap compile fix

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();
        }

Tier1 is Failing to Compile on Ubuntu 20.04.3 LTS

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’

CBaseViewModel

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();  // Добавьте это определение
};

CS2 support tracker

This issue is a progress/issue tracker for the ongoing development of cs2 hl2sdk branch done by the community and am members.

Completion status:

  • ConVar and ConCommand related stuff:
    • ICvar interface;
    • ConVar lifecycle (Creation/Operation/Deletion) (Currently requires API only work);
    • ConCommand lifecycle (Creation/Operation/Deletion);
  • Utility classes:
    • Obsoletion of tier1.lib and transition to tier0 structure:
      • commandbuffer.cpp moved to tier0;
      • memstack.cpp moved to tier0;
      • netadr.cpp moved to tier0;
      • stringpool.cpp moved to tier0;
      • strtools.cpp moved to tier0;
      • uniqueid.cpp moved to tier0;
      • checksum_* moved to tier0;
      • diff.cpp moved to tier0;
      • cbyteswap.cpp moved to tier0;
    • VProf related classes (mostly moved to tier0):
      • CVProfNode;
      • CVProfile;
      • VProfScopeHelper;
    • KeyValues;
    • KeyValues3;
    • CBufferString;
    • CUtlString;
    • CUtlLeanVector;
    • CUtlVectorBase;
    • CUtlOrderedMap;
    • Vec3D;
    • CUtlTSHash;
    • CUtlMemoryPoolBase (?);
    • CUtlMemoryFixedGrowable_Base (?);
    • CCircularBuffer/CFixedSizeCircularBuffer;
    • CUtlScratchMemoryPool/CUtlScratchMemoryPoolFixedGrowable;
    • bf_read/bf_write seems to have additional properties, might need a revisit;
  • Game interfaces that require attention/reversal:
    • INetworkGameServer;
    • INetChannel;
    • ISource2Server;
    • ISource2GameEntities;
    • ISource2ServerConfig;
    • CSchemaSystemTypeScope (Now using CUtlOrderedMap for CSchemaPtrMap);
  • Schema/Datamap access:
    • CEntityClass;
    • Datamap;
    • CSchemaClassInfo;
  • Game Events:
    • IGameEvent;
    • IGameEventSystem;
    • IGameEventManager2;
  • Entity access:
    • Client userid/pawn/controller/ehandle conversation;
    • Entity lifecycle API (Generally these could be replaced by calling game functions instead, so these mostly optional if there's a way to do it without using the game code):
      • Creating an entity (by classname, other means?);
      • Dispatching spawn and its keyvalues;
      • Killing/Freeing an entity;
    • UTIL_* functions to provide conversation from (?):
      • CEntityIndex -> CBaseEntity;
      • CPlayerSlot -> CBaseEntity;
    • CGameEntitySystem;
    • CConcreteEntityList;
    • CEntityIdentity;
    • CEntityHandle;
    • CEntityKeyValues;
    • EntityInstanceByClassIter_t;
  • Resource/Manifest management:
    • Basic resource precaching workflow;
    • CEntityPrecacheContext (Needs to be moved to a separate location);
    • IEntityPrecacheConfiguration;
    • IEntityResourceManifest;
  • Ray Tracing mechanisms (Generally its already doable with what we have):
    • CGamePhysicsQueryInterface;
    • IVPhysics2World;
    • CGameTrace;
    • CTraceFilter;
    • Ray_t;
    • Update MASK/CONTENTS flags;

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!

sdktools crashes due to recent tf2 update on certain cpus

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.

Missing branch ob-valve

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.

[CS2 metamod plugin][issue] using a static library of redis

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

hl2sdk-csgo Mistake introduced in IAppSystem?

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?

sdk2013: Mac: debug: issues with memdbgon.h

To reproduce:

  1. Clone Metamod:Source
  2. Clone the sdk2013 branch
  3. Build sample_mm from Metamod:Source with the sdk2013 SDK

Expected:
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__.

tf2, css: memalloc: call to IsPowerOfTwo is ambiguous

To reproduce:

  1. Clone and build metamod-source
  2. Clone the tf2 or css branch
  3. Try building metamod-source/sample_mm with the cloned sdk

Expected:
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!

sdk2013: Mac: debug build fails with -Werror

To reproduce:

  1. Clone into Metamod:Source
  2. Clone the sdk2013
  3. Build MM:S with -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 ]

[Question] engine for client interfaces i.e. in CSS?

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.

  • GetLightForPoint has 3 instead of 2 parameters
  • GetLightForPointFast has 3 instead of 2 parameters
  • USE_SDL is false
  • The VEngineClient014 interface has an additional function somewhere after FlashWindow

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

BMS OnPlayerRunCmd strange value on mouse parameter

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 ?

[CSGO, VS2022 17.4.1] Manually compiling tier1.lib failed.

When compiling strtools.h, it reports that log10 not found, see screenshots here.
屏幕截图 2022-11-18 224607

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?

hl2sdk-tf2 and itoolentity.h

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:

  • Debian 7.6 (Wheezy)
  • Eclipse 3.8.0
  • gcc/g++ 4.7.2
  • latest hl2sdk-tf2
  • latest sourcemod-master (1.6.1)
  • latest metamod-master (1.10)

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)

[L4D2] (May 14th) `KeyValues` structure updated

image-1

Similar to csgo's one:

uint32 m_iKeyName : 24; // keyname is a symbol defined in KeyValuesSystem
uint32 m_iKeyNameCaseSensitive1 : 8; // 1st part of case sensitive symbol defined in KeyValueSystem
// These are needed out of the union because the API returns string pointers
char *m_sValue;
wchar_t *m_wsValue;
// we don't delete these
union
{
int m_iValue;
float m_flValue;
void *m_pValue;
unsigned char m_Color[4];
};
char m_iDataType;
char m_bHasEscapeSequences; // true, if while parsing this KeyValue, Escape Sequences are used (default false)
uint16 m_iKeyNameCaseSensitive2; // 2nd part of case sensitive symbol defined in KeyValueSystem;
IKeyValuesSystem *m_pKeyValuesSystem;
bool m_bOwnsCustomKeyValuesSystem;
KeyValues *m_pPeer; // pointer to next key in list
KeyValues *m_pSub; // pointer to Start of a new sub key list
KeyValues *m_pChain;// Search here if it's not in our list
};

but looks missing an int32 at the end (a1[10]).

Source 2 - Reverse 9/2022 ConVar / ConCommand changes

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);
        }
    }
}

Sync with upstream SDK 2013?

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.

[Dota 2] GameEventHandle_t__->m_MessageID incorrect values

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]"

[CS2 metamod plugin] undefined symbol: _ZNK15CEntityIdentity11NameMatchesEPKc)

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.

CMoveData::m_flMaxSpeed is at the wrong offset

m_flMaxSpeed is at the wrong offset.

float m_flMaxSpeed;

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

https://github.com/TheAlePower/TeamFortress2/blob/1b81dded673d49adebf4d0958e52236ecc28a956/tf2_src/game/shared/tf/tf_gamemovement.cpp#L315

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.

hl2sdk on darwin

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?

TF2 Navmesh

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.