359 Commits

Author SHA1 Message Date
Kawe Mazidjatari
570f6419df Add 'reload_playlists' concommand.
Allows reloading the playlists file from the console or the dedicated server.
2022-09-08 01:02:22 +02:00
Kawe Mazidjatari
954165c2ea ConCommand: use FCVAR_GAMEDLL flags for several server commands.
These could only be ran if the server is running, and allows for running them as ServerCommand.
2022-09-05 23:02:54 +02:00
Kawe Mazidjatari
83ce041b65 Fix client.dll compile errors. 2022-09-01 01:32:32 +02:00
Kawe Mazidjatari
c35829013e Change VFTavle indexes from read only to contant 2022-08-31 14:38:49 +02:00
Kawe Mazidjatari
1285d15623 Ban system and authentication improvements
* Fixed bug where multiple of the same entries get added to the global ban/refuse list.
* Fixed bug where we still use the client instance after deleting it in 'CBanSystem::BanListCheck()'.
* Load banlist at a later state (not at construction of class), this is needed for a future change of adapting the 'business' code to feature the game's FileSystem.
* CServer cleanup.
* More detailed ban messages (banned, added to refused list, removed from slot, etc..).
* Use localization key for banned message ("#Valve_Reject_Banned").
* Add const qualifiers to all CPylon methods.

Note:
* This commit requires changes on the master server, these changes are already performed, however the new master server isn't live yet until we publish the new release.
2022-08-30 12:07:09 +02:00
Kawe Mazidjatari
afad5b92ec Rename 'OriginID' to 'NucleusID'
Nucleus ID is the official internal term for the platform user id used by the OriginSDK.
2022-08-29 15:59:12 +02:00
Kawe Mazidjatari
e54c2df621 Light cleanup 2022-08-29 14:00:54 +02:00
Kawe Mazidjatari
0f488c685c Move simple task to global fixed frame
Avoids having to create threads for tiny little things.
2022-08-29 02:21:32 +02:00
Kawe Mazidjatari
d7df115543 Properly check bounds for Q_strncat in PrintListHeader()/PrintCommand().
Calculate remaining size for the buffer.
2022-08-28 23:54:52 +02:00
Kawe Mazidjatari
656b0be3ec Improve threading (work in progress)
* Only run '_DownloadPlaylists_f()' in the main thread, schedule for next frame if we aren't in the main thread. (this should fix crash cases related to disconnecting from the game).

* Locked read/write to CBrowser members (thread for obtaining the server list is detached, but once the 'slow' post operation in this thread is complete, mutex lock is acquired (locking the render thread if the browser is active) to set the string members of CBrowser, this operation is very fast as we only set the string and the color after the http post operation (this never caused a crash, but the behavior without any lock mechanism is technically undefined regardless).

* Obtain the host name dynamically from the ConVar 'pylon_matchmaking_hostname' (atomic operation). Initial approach was deleting the whole master server pointer just to construct a new httpclient object..
2022-08-27 18:57:56 +02:00
Kawe Mazidjatari
cf5ab260da Improve spelling 2022-08-24 00:42:59 +02:00
Kawe Mazidjatari
147089f8df Fix mp_gamemode not working on dedicated server when launched as retail
Put in !DEDICATED by accident.
2022-08-23 11:49:13 +02:00
Kawe Mazidjatari
1001f84f73 Fix 'Script_GameRules_GetGameMode' not returning the current GameMode correctly
ConVar 'mp_gamemode' had to have its FCVAR_DEVELOPMENTONLY flag removed.
2022-08-23 00:18:52 +02:00
Kawe Mazidjatari
ca0172ed1f Add cvar for RTech debugging and removed dev flag from 'launchplaylist' 2022-08-22 21:15:46 +02:00
Kawe Mazidjatari
2010e11310 Add 'fatal' functionality to Error()
When fatal is set, the function will show a error dialogue, which will halt the process and close when the message is dismissed. Else we will end up in a crash.
2022-08-22 12:42:41 +02:00
Kawe Mazidjatari
2c7aaf531f Host_Changelevel_f rebuild 2022-08-22 03:53:38 +02:00
Kawe Mazidjatari
a71030d3e7 Clamp some ConVar's
Clamping required to prevent crashes or illogical/undefined behavior.
2022-08-22 01:31:05 +02:00
Kawe Mazidjatari
3414a2cd2c ImGui panel improvements
* Eliminated all forms of concurrency for CConsole logger.
* Used enum for determining which theme user loaded (DEFAULT, LEGACY, MODERN).
* Fixed issue where browser panel doesn't have the same frame padding as the console for the modern theme.
* Fixed issue where the history items count shows number higher than maximum until updated (updates vector before displaying, else this happens in g_pConsole->RunTask which is the operation that happens before we add new elements to the vector, thus showing the wrong count as this size is getting corrected the next frame after we painted, we don't update the summary each frame for performance reasons).
2022-08-22 01:10:18 +02:00
Kawe Mazidjatari
bd7a637286 Update command flags 2022-08-19 23:49:20 +02:00
Marvin D
b8cd006687 Update pszMaskedBases[] 2022-08-19 22:50:39 +02:00
Kawe Mazidjatari
5548a74d59 Major cleanup (see description)
* Fix all compiler error for GameSDK on S0 and S1.
* Remove some unused patterns and globals (launch performance gains of 100ms).
* Remove most duplicate patterns.
* Relocate globals from engine to a more appropriate location.
* Renamed some unknown vars to a more appropriate name (most of these where obtained a while back, but as we reversed more parts of the engine, some of these vars become known).
* Renamed some vars to fit the naming convention used in the SDK.
* Fixed pattern debug logging using the wrong pointer, thus displaying the wrong address.
2022-08-18 02:15:23 +02:00
Kawe Mazidjatari
619ac76452 Implement client rcon send log request
If 'cl_rcon_request_sendlogs' is set, the netconsole will request the server to send console logs to the rcon client after successful auth.
2022-08-17 11:50:40 +02:00
Kawe Mazidjatari
39b95a9716 Add cvar for determining whether or not to send rcon console logs to netconsole 2022-08-17 02:20:04 +02:00
Kawe Mazidjatari
3c3da82154 Additional code improvements
* Removed some unused signatures.
* Named 2 CBaseFileSystem methods, and applied them to 'MOD_ProcessPakQueue()'.
* Renamed 'qword_1671061C8' to 'g_pMTVFTaskItem'.
* Renamed 'g_pMapVPKCache' to 'g_szMTVFItemName'.
* Only set first byte to 0 in 'g_szMTVFItemName' (actual size is 0x100, not 0x40).
2022-08-16 21:42:57 +02:00
Kawe Mazidjatari
8bf6dac3d8 Code improvements
* Use GetVirtualMethodTable for VFTable pointers.
* Pack CClientState to 4 bytes (this aligns it properly in memory).
* Use CClientState members directly for setting m_bRestrictServerCommands/m_bRestrictClientCommands.
2022-08-15 22:29:16 +02:00
Kawe Mazidjatari
e6f45aaa9b CBitBuf improvements
* Use proper types reflecting assembly from the engine in 'CBitRead::Seek' (some values are 64bit, either changed by Respawn or the compiler used by Respawn).
* Confirmed changes made to NETMSG_TYPE_BITS (now 511 instead of 255) and NETMSG_LENGTH_BITS (now 12 which is 511 max instead of 255).
* Confirmed msg HUD types.
* Enforce NET_MIN_MESSAGE on 'SVC_UserMessage::Process'.
* Remove unnecessary padding and add proper symbols where padding was actually used.
2022-08-15 02:59:41 +02:00
Kawe Mazidjatari
851682ab89 Fix most compiler warnings 2022-08-14 18:35:01 +02:00
Kawe Mazidjatari
066bbdeaf0 Map out CCvar even more 2022-08-14 18:33:37 +02:00
Kawe Mazidjatari
cf824aa2fc Remove FCVAR_DEVELOPMENTONLY from 'origin_disconnectWhenOffline'
Allow 100% offline play in retail mode.
2022-08-14 16:00:40 +02:00
Kawe Mazidjatari
27f9d6b110 SQVM logging improvements
* Allow setting logging level in retail mode.
* Also color log on error to the in-game console overlays when log level < 2.
2022-08-14 15:20:28 +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
4cc0d085d4 Add generichash, utlfixedmemory and utlrbtree
Generichash for future reversing of CCvar.
2022-08-12 15:53:58 +02:00
Kawe Mazidjatari
3b160b6ac6 Free memory properly 2022-08-12 15:45:49 +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
f9ea1b0f65 Rename bits.h/.cpp to fbits.h/.cpp (floatbits) 2022-08-09 18:07:32 +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
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