345 Commits

Author SHA1 Message Date
Kawe Mazidjatari
e9e323f9d4 Add option to disable cache map
* Add '-nosmap' command line parameter to disable signature caching.
* Invalidate the cache map after initialization.
* Add const qualifiers where possible.
2022-12-04 14:16:12 +01:00
Kawe Mazidjatari
55b90781ee Remove experimental CRC implementation in LZHAM
This implementation was done to calculate buffer CRC on the go, as that was what the VPK file system uses for the file crc's. But it later turned out to be unnecessary, and was never reverted.
2022-12-04 01:33:10 +01:00
Marvin D
c3158b6937 Slight improvements.
CModule::GetSectionByName adjustments.
RTech::CreateDXTexture improvements.
2022-12-04 00:01:31 +01:00
Kawe Mazidjatari
10a0a41162 Rename to maintain consistency 2022-12-03 17:40:05 +01:00
Kawe Mazidjatari
e26679f199 Use 'Error' instead when SMap compression failed 2022-12-03 17:27:54 +01:00
Marvin D
e1caeb7eaf movetype and datamap_t fixes. 2022-12-03 15:42:06 +01:00
Marvin D
cb2bdfe2a2 Update networkvar.cpp 2022-12-03 03:10:20 +01:00
Marvin D
0e12551158 indent 2022-12-03 02:58:34 +01:00
Marvin D
c0c06a14b8 client networkable vars init. 2022-12-03 02:57:11 +01:00
Kawe Mazidjatari
a9e518e2e6 Fix PluginSDK compile errors 2022-12-03 00:08:48 +01:00
Kawe Mazidjatari
5695e3016c CIOStream: use stf::fstream instead 2022-12-02 22:31:42 +01:00
Kawe Mazidjatari
5903b40f96 Implement LZHAM compression for the signature cache map 2022-12-02 22:14:46 +01:00
Kawe Mazidjatari
b90d6f929c Finish Signature Cache Map implementation
* Fixed bug where the system still added entries after we are initialized (file has already been written to the disk).
* Moved loading logic to CSigCache class.
* Dedicated and Host/Client now have their own cache files.
2022-12-02 12:12:13 +01:00
Kawe Mazidjatari
81fbf9ded7 Finish signature cache map implementation in CModule 2022-12-02 11:10:53 +01:00
Kawe Mazidjatari
c3eba48472 Implement signature cache further into the CModule class
Init speeds have been reduced from 1.7 sec (average) to 0.06 sec (average)
2022-12-02 10:37:41 +01:00
Kawe Mazidjatari
783b3dbb5a Initial working implementation of the Signature Cache Map.
Init speeds have been reduced from 1.7 seconds (average) to 0.3 seconds (average)
2022-12-02 00:30:49 +01:00
Kawe Mazidjatari
5513057f53 Pass patterns by const string reference 2022-12-02 00:28:29 +01:00
Kawe Mazidjatari
053f284029 Compute the file size properly 2022-12-02 00:25:28 +01:00
Kawe Mazidjatari
30e360e3b7 Merge branch 'SignatureMap' into ByteMaskToString 2022-12-01 22:47:50 +01:00
Kawe Mazidjatari
f999372f37 Work in progress signature cache map loading and parsing 2022-12-01 22:47:39 +01:00
Kawe Mazidjatari
2501c37044 Globally convert all byte patterns to strings
These get reconverted to masked byte patterns at runtime. With the signature map cache system, this will only happen when building the cache.
2022-12-01 22:44:55 +01:00
Kawe Mazidjatari
3a4a5a08f8 Add CMemStack class 2022-11-29 00:01:47 +01:00
Kawe Mazidjatari
31a9d1cb25 Update IKeyValuesMemory method string parameter names 2022-11-27 22:13:47 +01:00
Kawe Mazidjatari
3d72d60385 Update IKeyValuesMemory method parameter types
These have been promoted to 64bit integers as CKeyValuesSystem::m_iMaxKeyValuesSize has been changed a 64bit
2022-11-27 22:12:30 +01:00
Kawe Mazidjatari
806f2514db Add new method to IKeyValuesSystem class
This is a new virtual method introduced in Respawn's engine.
2022-11-27 21:57:17 +01:00
Kawe Mazidjatari
f6c26464c7 Add IKeyValuesSystem class from Valve Source SDK 2013 2022-11-27 21:53:54 +01:00
Kawe Mazidjatari
4ba88963ff Fix bugs and many compiler warnings
* Promoted size types in CUtlBuffer to int64.
* Fixed bug where CUtlBuffer::GetPtr returns a 64bit pointer that was promoted from a 32bit integral type.
* Use int64/size_t for anything strlen, pointer subtraction, etc..
* Removed invalid structure alignment declarations.
2022-11-24 15:41:52 +01:00
Kawe Mazidjatari
a7c33d4df3 Use KeyValues system for level settings file instead
Previously we used Json, however the rest of the game features KeyValues. I changed the system to feature KeyValues instead, to maintain consistency. Also improved the logic behind loading/parsing so we don't reparse the same level settings file if the pointer is still valid and we are on the same level.
2022-11-24 11:10:46 +01:00
Kawe Mazidjatari
824a9f8bb2 utility.cpp light cleanup
* Use ternary operator for simple tests.
* Default 'GetFileName's 'bRemoveExtension' parameter to false.
2022-11-23 16:54:10 +01:00
Kawe Mazidjatari
0ab31606eb CPackedStore refactor
The CPackedStore class now heavily relies on the engine's FileSystem and KeyValues API. Since its part of the engine, it would make more sense to utilize the engine's features instead. It also allows for easier modifications.
* The logic behind the build process hasn't changed.
2022-11-23 12:18:33 +01:00
Kawe Mazidjatari
69cd41881e Move common VPK types to dedicated public header 2022-11-23 12:11:53 +01:00
Kawe Mazidjatari
a82674bbc8 Add 'KeyValues::RecursiveSaveToFile' to the SDK
Relies on the engine's implementation of 'KeyValues::RecursiveSaveToFile'. The IFileSystem methods have been fixed up with the CUtlBuffer class rebuild in which we could call these to write a KV memory structure as a file to the disk.
2022-11-22 09:04:28 +01:00
Marvin D
d59d798d13 datamap_t init.
* Get datamap vars from class datamap.
2022-11-19 03:16:49 +01:00
Marvin D
5532a5ff35 SendPropType impl. 2022-11-17 17:51:37 +01:00
Kawe Mazidjatari
11fa1c5119 Add case insensitive search for developer console input field
This has been requested by a user. This change will allow for searching convars from partial input regardless of the case.
2022-11-13 23:44:30 +01:00
Kawe Mazidjatari
24a4097cef Improve string trimming logic
Add option to trim anything before/after the criteria.
2022-11-11 01:17:11 +01:00
Marvin D
d00aaa933d CRenderView init, GetWorldMatrixForView()
* Fixed .gitignore for root /game/
* Fixed bug in WalkVTable where it would offset self.
* General clean up: VAR -> CON, CON -> VAR
2022-11-10 00:53:12 +01:00
Kawe Mazidjatari
dcb909cab9 Only attempt to load .VMT files from the disk if VPK mode is 0
Only load from disk if mode is 0. Mode can be set to 0 using the '-novpk' launch parameter.
2022-11-08 01:11:14 +01:00
Kawe Mazidjatari
01b67fec8a Remove deprecated information in worldsize.h 2022-11-05 23:46:39 +01:00
Kawe Mazidjatari
40566235e0 Server authentication code improvements
* Added validity checks for player names, they must be UTF-8 encoded, else game clients will crash attempting to set non-UTF-8 player names in RUI.
* CServer::RejectConnection now takes a 'v_netadr_t*', previously it was 'user_creds_s*', which worked as 'v_netadr_t' is the first member in 'user_creds_s'.
* Programmer must now manually pass a character buffer to 'v_net_adr::GetAddress(...)'.
2022-11-03 02:30:57 +01:00
Marvin D
56806e9045 ServerClass impl 2022-11-03 00:06:11 +01:00
Kawe Mazidjatari
5f84803ac6 ImGui and DirectX code improvements
* Fix history duplication by removing trailing white space characters from submitted commands in console.
* Fix out of range exception caused by caching svConVar.size() in CConsole::BuildSummary while we are modifying it.
* Fixed memory leak  caused by extraneous Strdup calls in CConsole.
* Renamed variables and structure members, static vars in id3dx.cpp are not prefixed with s_, IBrowser_Config is now m_BrowserConfig.
* Performed code cleanup in id3dx.cpp.
2022-10-20 12:29:50 +02:00
Kawe Mazidjatari
47beb282f2 RTech cleanup and improvements
* Combined members of TextureHeader_t and RTechTextureInfo_t.
* Renamed 's_pRTechBytesPerPixel' to 's_pBytesPerPixel' and declared const.
* Renamed 'dxgiToRPakFormat' to 's_DxgiToTxtrTable' and declared const.
* Renamed 'rpakToDxgiFormat' to 's_TxtrToDxgiTable' and declared const.
* Moved 'g_DxgiToTxtrTable' and 'g_TxtrToDxgiTable' to 'texture.g.h'.
* Moved 's_pBytesPerPixel' to 'texture.g.h'.
* Fixed defect where we used the [] operator on a std::map that should be const (s_TxtrToDxgiTable), replaced with the const version of std::map::at.
2022-10-13 21:59:06 +02:00
Kawe Mazidjatari
50fee7414d Missing material error logging
This commit implements missing material error logging.
When a material does not exist, it will get replaced with an error material, we log which material is missing, and with which error material it gets replaced with.
This commit also comes with some updates regarding the CMaterialGlue class, and some new types used by this class from the RePak project.
2022-10-13 02:22:50 +02:00
Kawe Mazidjatari
f215ca0720 Improve bullet-hit trajectory debug
The ConVar 'bhit_abs_origin' will now draw a sphere at the predicted abs origin of the entity upon hit. This is useful for debugging lag compensation on the server (white star).
2022-10-01 00:27:51 +02:00
Kawe Mazidjatari
bef7f352d6 Implement '-novid' param check
the parameter check for '-novid' has been removed from S2 onwards, but later added back in. Our S3 build doesn't have it as well. This commit adds it back in and allows user to launch the game without the startup video's by adding '-novid' to the launch arguments. ('-dev' also works, but this enables developer and sv_cheats..).
2022-09-25 13:36:55 +02:00
Kawe Mazidjatari
de2400f6a2 Implement StrintCount utility
Counts the number or delimiters found in a given string
2022-09-22 17:08:20 +02:00
Kawe Mazidjatari
7912b79fa2 CL_CopyExistingEntity: implement missing bounds check
Implement bounds check for non-sanitized value of u.m_nNewEntity.
Debug builds of the engine have an assertion, however in release these are stripped.
This fixes a full chain client RCE exploit, for more information, see: https://ctf.re/source-engine/exploitation/2021/05/01/source-engine-2/
2022-09-21 02:38:58 +02:00
Kawe Mazidjatari
9c9843a0fc Centralize kick/ban wrappers to CBanSystem and add new server functions for kicking/banning players 2022-09-15 23:13:37 +02:00
Kawe Mazidjatari
23a95f84a8 ConVar names cleanup 2022-09-12 00:44:03 +02:00