1248 Commits

Author SHA1 Message Date
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
Kawe Mazidjatari
0c583d7522 Temporary fix for rpaks not loading from override dir 2022-08-06 22:17:47 +02:00
Marvin D
587b92659e dedicated compile fix for RTech changes. v2.0.9_rc1 2022-08-06 00:34:26 +02:00
PixieCore
946da4b2cc Fix variable names in RTech::OpenFile 2022-08-06 00:20:49 +02:00
PixieCore
1cd0ae5c87 General code cleanup, Rebuild and hooked RTech::OpenFile
* RTech std namespace removal
* RTech::OpenFile Rebuild.
* FileHandleTracker_t fully reversed, grabbing m_FileHandles from memory now.
* RTech::FindFreeSlotInFiles needs more research.
*
2022-08-06 00:16:11 +02:00
Kawe Mazidjatari
9dfa2da7aa Update playlists
Set 'survival_wallrun_enabled' and 'survival_wallrun_enabled' to 0 in defaults.

I get a lot of mixed opinions on this, there are people who prefer wallrunning and double jumping, but there are also people who don't want these enabled. I received advice to disable them for defaults for the time being (all br modes and firing range/training modes have them disabled, tdm/ctf and dev_default have them enabled).
2022-08-04 23:10:22 +02:00
Kawe Mazidjatari
cd2fe28490 Update config files
* Added new map in vpk build/extract configs.
* Explicitly set 'sv_cheats' to 0 for retail.
2022-08-04 23:06:57 +02:00
Kawe Mazidjatari
b496327380 Cleanup 2022-08-04 22:51:21 +02:00
Kawe Mazidjatari
c568995d56 Refresh server browser on startup
User gets to see all available servers directly without having to refresh first.
2022-08-04 22:49:30 +02:00
Kawe Mazidjatari
33b588b42e Private server improvements
* Don't clear the token string each time we get a response from the master server (it gets assigned each time anyways, so if the master server decides to change it the user will get the new one, this operation only happens once a second).
* Clear the token message when no longer hosting.
2022-08-04 22:44:23 +02:00
Kawe Mazidjatari
df81a1e277 Update rui_drawEnable help text 2022-08-04 17:56:54 +02:00
Kawe Mazidjatari
0cad187587 Fix client.dll compile errors 2022-08-04 17:52:34 +02:00
Kawe Mazidjatari
8f513a519f Properly implement ConCommand callbacks
COMMAND_COMPLETION_MAXITEMS and COMMAND_COMPLETION_ITEM_LENGTH are confirmed to be 128 (original code is 64).
New register func sets the callback bit fields accordingly (no longer hardcoded).
2022-08-04 17:37:30 +02:00
Kawe Mazidjatari
ea5f17b4ca Light cleanup
* Moved ConVar usage text that where part of the help string to the usage string parameter.
* Flagged ConVar 'bhit_abs_origin' as FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED.
* Flagged ConCommand 'bhit' as FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL.
* Check 'bhit_enable' before running the 'bhit' command callback.
* Fixed spelling in a few area's.
2022-08-04 16:34:23 +02:00
Kawe Mazidjatari
418bd2d679 Improve NavMesh poly blue tone color 2022-08-04 15:41:45 +02:00
Kawe Mazidjatari
d89967a5c2 Switch between -windowed and -fullscreen properly in launcher
Checking/Unchecking will now switch between them properly.
-forceborder does not work and the issue resides in the engine itself (it does the same bitshift operation as -windowed for some reason).
2022-08-04 12:56:05 +02:00
Kawe Mazidjatari
dec7cc0fa5 Fix max_players showing incorrect max_player count
Moved m_nMaxMilesAudioQueues in CGlobalVarsBase behind m_nMaxClients.
m_nMaxClients and m_nGameMode align correctly now, including the mapname and mapversion in CGlobalVars
2022-08-04 12:44:00 +02:00
Kawe Mazidjatari
68b3185a41 Use ssize_t for size types in CUtlMemory 2022-08-04 11:51:38 +02:00
Kawe Mazidjatari
6d92fdf15f Use game's global malloc singleton for allocating/reallocating memory in CUtlMemory
This ensures anything we create in the SDK will be usable within the game engine (Realloc, Free, GetSize, etc..), as we share the global singleton.
2022-08-04 11:33:40 +02:00
Kawe Mazidjatari
238e145818 Implement ConVar change callbacks
CUtlVector containing callbacks (you can have several callbacks for each ConVar).

also, in 'ConVar::InternalSetValue' Valve and Respawn run V_atod (atof) on function param 'pszValue', but they also check if input param 'pszValue' is a nullptr (which in this case, 'pszNewValue' gets set to an empty string), but yet they deref 'pszValue' (nullptr or not) in 'SetColorFromString' and V_atod, is this correct behavior?

For now I swapped these out with 'pszNewValue' for the very rare event the string happens to be nullptr.
2022-08-04 11:06:56 +02:00
Kawe Mazidjatari
babbcbe6d5 Add CStdMemAlloc::GetSize() to SDK
Returns the size of the buffer allocated with MemAllocSingleton()->Alloc() etc.
2022-08-04 02:02:09 +02:00
Kawe Mazidjatari
20d1fabd0c Implement CUtlMemory, CUtlBlockMemory and CUtlVector
CUtlMemory has been modified to fit the size of the in-engine structure.
The new types seem to be either int64 or unsigned (size_t?).
2022-08-04 01:28:07 +02:00
Kawe Mazidjatari
0fe554b3d1 Fix crash cases when setting ConVar string using SetValue
Added IsMaterialThreadSetAllowed and QueueMaterialThreadSetValue checks.
2022-08-04 00:21:48 +02:00
Kawe Mazidjatari
9ba5e63ada Add max size bounds for PayLoadLen when setting size of m_RecvBuffer
Should technically never fail, but in case it does it won't crash the application.
2022-08-03 18:41:25 +02:00
Kawe Mazidjatari
3f8476db88 Logging system light refactor
* Use responceid from server to determine in which context to log.
* Moved all script loggers from combined enums to minus instead (SERVER = -3, CLIENT = -2, UI = -1 SERVER_CODE = 0, etc), this makes it much easier to align stuff in combined systems such as the RUI logger or NetMsg().
* Color log networked RCON messages properly on the client.
* Added dedicated logger for all received RCON messages (net_console.log).
* Log commands submitted through in-game console (allows for easier debugging when going through log files).
2022-08-03 18:34:44 +02:00