1322 Commits

Author SHA1 Message Date
Kawe Mazidjatari
0b3e4ff1f7 Update cpp.hint 2022-08-14 15:19:03 +02:00
Kawe Mazidjatari
9f7d4f57d3 CCVarIteratorInternal cleanup
* Improve readability.
* Free allocated iterator memory.
* Enforce FCVAR_HIDDEN ConVar's in ImGui console (there are only 17 ConVar's marked 'hidden', and most of these are stryder/platform related stuff. This is usefull for if we ever wish to create a hidden cvar).
2022-08-14 02:51:15 +02:00
Kawe Mazidjatari
61dbda67f7 Address reported issues
Addressed:
* 'Expression: vector subscript out of range' (we only ever ensured capacity upon construction).
* Compiler error as AssertMsg1 is unimplemented, used Assert instead.
2022-08-14 00:48:29 +02:00
Kawe Mazidjatari
8068bcf176 Mask off FCVAR_DEVELOPMENTONLY from essential commands
Only mask FCVAR_DEVELOPMENTONLY off from essential commands if launched in retail mode (this hardens security and increases performance).
2022-08-13 21:38:44 +02:00
Kawe Mazidjatari
515487c63a Changed behavior of ConCommandBase::IsFlagSet (read description)
This commit breaks the indev branch for the time being (this will be solved very soon).
We no longer mask off dev flags from every commandbase, we only mask them off from the essential ones (map, connect, give, etc..), unless the SDK is launched as dev, then we mask everything off like usual, but this time at initialization and not whenever we encounter a var with this flag.
2022-08-13 20:21:32 +02:00
Kawe Mazidjatari
fad1a092e4 More CCvar reversing
Still work-in-progress
2022-08-13 19:41:45 +02:00
Kawe Mazidjatari
b18f9148e4 Renames
* Rename FCVAR_ARCHIVE_GAMECONSOLE to FCVAR_ARCHIVE_PLAYERPROFILE.
* Rename CONVARFLAG(UNLOGGED, "log") to CONVARFLAG(UNLOGGED, "ulog").
2022-08-13 15:35:38 +02:00
Kawe Mazidjatari
8740c7261a Add ARCHIVE_GAMECONSOLE to g_ConVarFlags 2022-08-13 13:58:27 +02:00
Kawe Mazidjatari
e4eb6d278f Hook up 'convar_findByFlags' command callback
In-engine implementation has logging stripped.
2022-08-13 13:06:30 +02:00
Kawe Mazidjatari
f08fbc8745 Hook up 'help' command callback
In-engine implementation has logging stripped.
2022-08-13 12:57:52 +02:00
Kawe Mazidjatari
dbdfdc2b3a Only log changed convars for 'convar_differences' 2022-08-13 12:53:08 +02:00
Kawe Mazidjatari
4551f6d494 Implement convar_list and convar_differences
Also added more CCvarUtilities methods which are yet to be implemented.
2022-08-13 12:39:57 +02:00
Kawe Mazidjatari
aa72579656 Heavy FileSystem upgrades
Implement VFTable's to interface with engine (for the most part mapped out, only the new VPK methods needs further reversing).
This exposes a good majority of the FileSystem implementation of the engine, to the SDK.
2022-08-13 11:24:55 +02:00
Kawe Mazidjatari
4cc0d085d4 Add generichash, utlfixedmemory and utlrbtree
Generichash for future reversing of CCvar.
2022-08-12 15:53:58 +02:00
Kawe Mazidjatari
9bf7660138 FileSystem improvements
* Added method 'FPrintf'.
* Shifted indexes back by 2 if <GAMEDLL_S3 (Anything <S3 doesn't have the 2 FeatureFlags initialization methods which shifts everything past index 10 back by 2).
2022-08-12 15:51:04 +02:00
Kawe Mazidjatari
aa9e7f25ed Fix CStdMemAlloc:Realloc()
Missing argument mistake.
2022-08-12 15:49:26 +02:00
Kawe Mazidjatari
3b160b6ac6 Free memory properly 2022-08-12 15:45:49 +02:00
Kawe Mazidjatari
52ee409f5f Use CIOStream for reading NavMesh and AIN files 2022-08-11 12:09:38 +02:00
Kawe Mazidjatari
88b3336758 Many small code improvements and optimizations
* Use c++ methods as much as possible.
* Use enum types for accessing NavMesh objects from array.
* Use size_t for for loops when testing against size types.
* Don't compute strlen twice of more on the same string.
* Don't use unnecessary c string casts if there is a method with a std::string overload.
* Don't create string objects from string pointers if we could use them directly.
* Don't initialize RCON password twice on each change, and don't set if the new password equals the old.
2022-08-11 11:07:45 +02:00
Kawe Mazidjatari
ab097126ff Update playlists
Add the new maps.
v2.0.9_rc3
2022-08-09 20:18:22 +02:00
Kawe Mazidjatari
1662816c5d Update utility.cpp 2022-08-09 18:22:50 +02:00
Kawe Mazidjatari
f9ea1b0f65 Rename bits.h/.cpp to fbits.h/.cpp (floatbits) 2022-08-09 18:07:32 +02:00
Kawe Mazidjatari
cdfc557452 CBanSystem optimizations
Pass by constant reference, const qualifiers, size_t loop iterators instead of implicit cast to int, extraneous cast to c-string, etc..
2022-08-09 17:57:43 +02:00
Kawe Mazidjatari
efd92f8ebc Move 'bansystem' from 'public' to 'networksystem' 2022-08-09 17:34:10 +02:00
Kawe Mazidjatari
329621c6ad Move all public headers into root of 'public' 2022-08-09 17:18:07 +02:00
Kawe Mazidjatari
e92b5d1300 General cleanup
Use c++ methods, remove unnecessary casts, unnecessary use of auto, etc..
2022-08-09 15:19:12 +02:00
Kawe Mazidjatari
0b4eb06dd2 Use compare method instead of strcmp on std::string 2022-08-09 14:01:29 +02:00
Kawe Mazidjatari
e97b4e53b2 More ConvertToWinPath/ConvertToUnixPath optimizations
Don't allocate static buffer on the stack, use the result string instead.
2022-08-09 14:00:51 +02:00
Kawe Mazidjatari
5334f31644 ConvertToWinPath and ConvertToUnixPath optimizations
* Don't compute strlen on each iteration.
2022-08-09 13:50:43 +02:00
Kawe Mazidjatari
f14d588d0a Improve readability
Null terminator for end of szBuf.
2022-08-09 13:08:58 +02:00
Kawe Mazidjatari
baeb343164 Improve pad removal of CPU brand identifier
Reverse scan CPU brand name until first non space character is found.
2022-08-09 13:05:12 +02:00
Kawe Mazidjatari
f015667f88 Light ImGui cleanup
* CTextLogger: Explicit cast return value of size() to int when testing int value against size_t.
* CBrowser: Run think and request thread on client.dll, but for the request, only the refresh.
2022-08-09 12:13:31 +02:00
Kawe Mazidjatari
ade1de41a9 Implement abstract class 'IEngine'
Also reversed one new method: IEngine::GetPlaylistCount (gets the number of playlists read from the playlists file, the other 2 unknown methods after this one also do stuff with the playlists, but rather on KeyValues level, one checks if something exists i think, the other returns a const char. Haven't ran these yet).
2022-08-09 11:53:33 +02:00
Kawe Mazidjatari
a399e1e190 Use 'std::string::compare' instead 2022-08-09 10:56:57 +02:00
Kawe Mazidjatari
f8807e4da9 Remove unnecessary cast to c string 2022-08-09 10:56:03 +02:00
Kawe Mazidjatari
73fba5fcb0 Add all WSA error codes 2022-08-09 10:55:31 +02:00
Kawe Mazidjatari
db90f3722c Add more information to global server/client global debug print 2022-08-09 10:55:13 +02:00
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
0e5724c187 Update cleaner batch file
Added extra unused RPak file.
2022-08-09 00:47:12 +02:00
Kawe Mazidjatari
adec16ec02 Update playlists file
Add new map in lobby and ctf mode.
2022-08-09 00:46:40 +02:00
Kawe Mazidjatari
be01006ca0 Light cleanup of SQVM_PrintFunc 2022-08-08 18:17:40 +02:00
Kawe Mazidjatari
cc3d7d3afc Update comment regarding server VPK's 2022-08-08 17:51:35 +02:00
Kawe Mazidjatari
d96bb2deb0 Use correct size type format specifier in packetstore.cpp
Using %llu is also correct, but this is the standard approach.
2022-08-08 17:51:09 +02:00
Kawe Mazidjatari
8fde529e2b Print script errors to the console at all times
This change prints script errors and their callstack to the console even when sq_showvmoutput < 2 (this avoids confusion when running a dedicated server and the server 'appears' to shutdown the game on its own. You could also check the script log files which are written to at all times, but having some indication is nice).
2022-08-08 17:49:46 +02:00
Kawe Mazidjatari
fccff58d0b Don't force ServerBrowser visibility to 0 from cfg's
These are now automatically set.
2022-08-08 16:21:26 +02:00
Kawe Mazidjatari
12fed87378 Update playlists_r5_patch.txt 2022-08-08 12:14:45 +02:00
Kawe Mazidjatari
f97b347d88 Fix ConVar's and ConCommand's creation memory leak
Using the 'new' keyword and then assigning *this to *pNewConVar will lead to having 2 copies of the same constructed data, and one being used in the SDK whilst the other one being used by the engine.
We unfortunately cannot write the code exactly like the engine, as we hook the engine and dependent heavily on its global memalloc singleton.
This commit fixes the memory leak and allows the engine to free the memory as well whenever it wants to.
v2.0.9_rc2
2022-08-08 01:40:28 +02:00
Kawe Mazidjatari
6cb44740f1 Use MAX_MAP_NAME constant for setting levelname in ServerBrowser 2022-08-08 00:33:07 +02:00
Kawe Mazidjatari
8328da706a Use engine's internal memalloc singleton for KeyValues methods 2022-08-08 00:32:25 +02:00