1540 Commits

Author SHA1 Message Date
Kawe Mazidjatari
1c29d5aed5 CEngineAPI vftable implementation 2022-08-29 01:14:53 +02:00
Kawe Mazidjatari
1a3f17a422 Update pylon time-out message 2022-08-29 00:29:32 +02:00
Kawe Mazidjatari
50fceec016 Update error messages 2022-08-29 00:19:11 +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
f6d8a966a3 Don't reload level when reparsing weapon scripts 2022-08-28 17:42:58 +02:00
Kawe Mazidjatari
0b49ea1f29 Use 'g_pServer->IsActive()' over 'g_pHostState->m_bActiveGame' 2022-08-28 17:40:03 +02:00
Kawe Mazidjatari
a9aded7fd8 CConsole: Fixed problem where window claims focus over all other windows when summary is painted 2022-08-28 17:28:53 +02:00
Kawe Mazidjatari
48e708e498 CPylon: Exception handling for all 'json::parse' calls 2022-08-28 17:12:58 +02:00
Kawe Mazidjatari
dff3f2f53e Remove deprecated patch 2022-08-28 00:13:53 +02:00
Kawe Mazidjatari
38c94eda27 Banlist writing optimizations
* Only write if there is something to write.
* Don't write each iteration, write after the loops are finished.
2022-08-28 00:11:33 +02:00
Kawe Mazidjatari
532b4125d5 More thread safety improvements
* Run 'CHostState::Think()' in the main thread.
* Construct 'NetGameServer_t' objects in main thread before dispatching (TODO: browser).
* Dispatch the call to 'CBanSystem::AddConnectionRefuse' from 'SV_IsClientBanned' to the main thread if we aren't main.
* Return bool for CBanSystem::AddEntry and CBanSystem::DeleteEntry for future optimizations (next commit).
2022-08-27 23:45:58 +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
6af5c7cdcf Use internal FileSystem for loading and handling
AIN files are now written to GAME dir, and the engine attempts to load the AI files from any GAME dir (search includes the VPK's).
2022-08-23 21:32:12 +02:00
Kawe Mazidjatari
260f862a69 Load level settings file using game's filesystem
This allows for loading the file from all search directories and the VPK's
2022-08-23 16:45:42 +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
Marvin D
5f73413286 different print for OpenFile 2022-08-22 19:03:33 +02:00
Marvin D
806cfbc8c4 Update opcodes.cpp 2022-08-22 14:45:34 +02:00
Marvin D
3a8647b6f4 Load .starpak from /Win32/ support
* S3< not tested.
2022-08-22 14:43:06 +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
28d1463c9f 'CServerListManager::LaunchServer()' improvements
Changelevel instead when we have an active game (Script_ShutdownHostGame() no longer needs to be called beforehands).
2022-08-22 01:56:20 +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
8476d22777 Fix concurrent access to several CConsole members
* Fix concurrent access to CConsole::m_Logger.
* Fix concurrent access to CConsole::m_vHistory.
* Additional DX system cleanup.
2022-08-21 19:35:06 +02:00
Marvin D
6f79d11696 remove testing code from CPluginSDK::InitSDK(() 2022-08-21 11:28:50 +02:00
Kawe Mazidjatari
8df311d126 Flip Cbuf_Execute() removal
Removed the wrong call
2022-08-21 01:44:01 +02:00
Kawe Mazidjatari
ba9f61a163 Remove extraneous Cbuf_Execute() calls 2022-08-21 01:34:10 +02:00
Marvin D
af9b7e9d8c GetFactorySystem() docs 2022-08-21 01:02:07 +02:00
Marvin D
10b87b3bbc PluginSDK init and PluginSystem improvements
* Plugins can be loaded now (commented)
2022-08-21 00:59:55 +02:00
Marvin D
c37d7a6b0c remove versioning, will be handled by factory. 2022-08-20 12:45:14 +02:00
Marvin D
60b2db9eaa create abstract class for PluginSystem, refactor Factory System 2022-08-20 12:42:19 +02:00
Marvin D
cebc6a13b6 Merge PluginSystem_Reload and PluginSystem_Init together 2022-08-20 11:42:22 +02:00
Marvin D
0a8a463245 PluginSystem_Reload logic 2022-08-20 11:28:28 +02:00
Kawe Mazidjatari
5284e8987f Use abstract class for CCommandLine 2022-08-20 03:15:51 +02:00
Marvin D
55a620aa4d CPluginSystem init, for native mods.
* Not finished yet.
* Need to make a proper ModuleManager
* Handle PluginSystem_Reload()
2022-08-20 01:59:36 +02:00
Kawe Mazidjatari
52e19e9ad6 Single-thread the game console
Run all task in the same thread used to run the browser/console frame and remove all mutexes.
2022-08-20 01:48:42 +02:00
Kawe Mazidjatari
aa807b565d Only run 'Script_Execute()' in main thread 2022-08-19 23:49:51 +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
Marvin D
eeec292238 Don't need to run CBuf_Execute. Game does it itself.
* How did I forget to remember that for almost a year..
* Connect and disconnect commands also fixed now.
2022-08-19 22:25:26 +02:00
Kawe Mazidjatari
6764b5e56e Implement frame tasks
Run all Cbuf_Execute calls in the main thread. This should fix every problem related to (but not only):
* Connecting to server while RUI dialogue is still open.
* Connecting to server while in an active game.
* Running 'weapon_reparse'.
2022-08-19 21:33:31 +02:00
Kawe Mazidjatari
b14f239971 Don't add 'common_sdk.rpak' and 'ui_mp.rpak' to the loaded handle vector
This prevents those 2 rpaks from being unloaded, they should never be auto-unloaded.
2022-08-18 12:41:35 +02:00
Kawe Mazidjatari
5bc798fe97 Merge 'Sys_LoadAssetHelper' with 'RTech::OpenFile' and rehook.
Removed clashing hook and merged logic into RTech::OpenFile, and re-enabled hook.
2022-08-18 12:34:33 +02:00
Kawe Mazidjatari
efd16fbc72 Implement 'ThreadInMainThread()' (originally tier0 export) 2022-08-18 12:00:01 +02:00
Kawe Mazidjatari
edbf1af98c Use clock drift managers for displaying the server and client tick count 2022-08-18 11:35:32 +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
9019e5cb70 Move LogType_t to dbg.h
Renamed to EGlobalContext_t and used globally for all context types combined into one (required for rcon messages for example, as we do native and script messages, while also retaining colors).
2022-08-17 12:28:52 +02:00