mp_gamemode's development flag added back in commit 3209af9a6c2509e5e6969199f5d9913b0ddb6ed0 as it was being set internally only previously, but we have to run it through cbuf in the following frame when we launch into the new map to allow the engine to apply it to all global states properly, to run it through cbuf the developmentonly flag needs to be removed from the cvar.
- We don't need to call CVEngineServer::LockNetworkStringTables, as CVEngineServer::CreateFakeClient already does this.
- We should never run CVEngineServer::CreateFakeClient() and CServerGameClients::ClientFullyConnect() when we aren't doing this from the server frame thread, or when we are doing it outside the server frame thread while its active. We not wait and help with other jobs until the server frame thread is finished before adding our bot.
- Removed team number check, this is already performed in CClient::SetTeam().
This reverts commit 9939d963efa13332a1b9c2cf0d53bd90bc772ed1. It turns out we actually should check on !g_pServer->IsActive() as we shouldn't restrict on our listen server. Development code heavily relies on this.
This check is meant to drop the restrictions if we are in single player mode, we should however properly check in this by checking the actual game mode rather than if the listen server is running.
No longer needed as of commit 3209af9a6c2509e5e6969199f5d9913b0ddb6ed0. These defaults were for the server browser but this code has now been moved over properly.
This code was written at the start of the project before much of the engine was reverse engineered. There were some design problems where core server functions were shared with UI script.
A second problem was that not everything was properly synced between another; CServerHostManager held its own instance of the server name and server description, while the engine has actual convars to store these. So scripters weren't able to get the server name and server description if the server was a listen server and launched through the title screen.
The CServerHostManager class has been reworked to not keep a second instance, and the script functions for creating the servers have been reworked to always store the name and description in aforementioned convars.
Also moved the CreateServer and DestroyServer function to the UI namespace of scripts, and it is now only registered in UI context. The server should use GameRules_ChangeMap() to switch levels instead.
UI script also no longer registers core server functions, this was a design mistake and has been fully factored out in this patch.
The server script function 'SetClassVarSynced' has also been deprecated and removed, since calling this sends a netmsg to all connected clients, and running this once will not apply the new class var values to clients connecting afterwards. This should be managed through player.SetClassVar in the connect codecallbacks in scripts.
There was a bug where we only removed the old change callback on the dedicated server. On client builds we added a second one causing SetupGameMode to be called twice, and the second call will be with the incorrect (previously set) gamemode. We now fully replace the callback because the one we have in the SDK is identical to the one in the engine, except it does not call SetupGamemode through the client's engine interface.
The m_nDelayedFrames counter was being decremented when it was 0, this caused the removal logic to never remove anything from the list as m_nDelayedFrames was never 0
Implemented robust and cheap number parser, which can parse numbers from json string and json numbers. Strings can be hexadecimal, octal and decimal. Converter gets selected at compile time. Also implemented a few inlines that return user provided default if value wasn't found or didn't match specified or classified type.
In commit 1fd4c25cd0188f96c7d1fe7b0a8b072763eed032, an attempt was made to fix this by calling the message handler with WM_NULL, but WM_KILLFOCUS should've been passed instead, as Dear ImGui clears the keydown state with this message. WM_NULL does nothing.
PostMessage hooks are no longer needed as we properly handle the messages when the imgui window procedure is running. The g_nWindowRect global is also no longer necessary because we now properly update the CGame's window size members as of commit 7ec1e679fd2676cde8e286812a0f5bec454f7d92.
The engine never updates CGame's window size members when the window size is adjusted. This patch now calls CGame::SetWindowSize() when the window is resized to make sure these members are always in sync.
Holding a key while closing the panel will keep the message in the event queue, the next time one of the windows are opened, the message will be spammed. Send a null msg to clear it properly.
Check if the window is occluded first before sampling. Massive runtime load reduction when application minimized in full-screen mode.
This also fixes the issue where the console would scroll all the way to the top when the application is minimized in full screen mode, as we can't calculate the window sizes properly causing SetScrollPos to set the pos to a large negative value.
A common request was to make the tab key select the highlighted item in the autocomplete suggest window, much like the enter key. This key however could also be used to instantly select the first item in the autocomplete suggest window without having to move the cursor there.
In commit f5f14c153f0115af7a0ac5fe3b4be98b3816be84, a change was made to switch the default keys to pgup and pgdown. It appears however that these keys were used for the chat window.
The defaults have been adjusted to (backtick and f10) for console, and (insert and f11) for the browser.
There was also a bug in ImGuiConfig::Save() where it double nested the keyvalues, this has also been fixed. The keyvalue file now parser properly.
The option panel in the console has been slightly reworked to also show the secondary binding options for both the console als browser allowing the user to change both the primary and secondary for both windows without having to manually edit the files.
Cleanup by qualifying anything const that isn't or shouldn't be modified. Also made an optimization StringReplaceC (String Replace Copied), to only start copying if the substring to replace even exists in the given input.
Present only returns the status when DXGI_PRESENT_TEST is set, no data will be renderer and displayed. We should not run the frame rate limiting logic, and NVIDIA reflex on this!
The script engine supports running coroutines, which means we cannot use statics for each message as 2 coroutines could fight for a event mesage
I.e. we have 2 coroutines handling a player damaged event, the message could be populated with a mix of data between the 2 coroutines.
Therefore, we cannot optimize this by statically allocating it and must allocate it for each coroutine separately. The extra memory and cpu overhead caused by this is still very low.