287 Commits

Author SHA1 Message Date
Kawe Mazidjatari
d113774a6d Console improvements and new command
* Commented "ImGui::SetItemDefaultFocus()", this seems to somewhat fix the issue where the input field does not claim focus on console invocation.
* Added command "con_removeline" (removes lines from start to end index).
2022-10-20 12:29:49 +02:00
Amos
05ef7be4f4 Update IConVar.cpp 2022-10-12 16:20:45 +02:00
Kawe Mazidjatari
1e23ddbf35 Fix client dll crash during squirrel script init
The 'developer' cvar was nullptr because it was never assigned to the developer cvar address (it was defined away).
2022-10-09 12:38:16 +02:00
Kawe Mazidjatari
f215ca0720 Improve bullet-hit trajectory debug
The ConVar 'bhit_abs_origin' will now draw a sphere at the predicted abs origin of the entity upon hit. This is useful for debugging lag compensation on the server (white star).
2022-10-01 00:27:51 +02:00
Kawe Mazidjatari
cc26113c9e Implement debug draw AIN node links to nearest node
Feature can be toggled using the "ai_script_nodes_draw_nearest" cvar.
2022-09-28 00:14:33 +02:00
Kawe Mazidjatari
926b410bce Increase net channel process time budget to 50ms
New value is 200ms, this should fix the very few false positives.
2022-09-25 22:16:52 +02:00
Kawe Mazidjatari
2fa2fd1433 Make 'pak_listpaks' FCVAR_RELEASE 2022-09-24 22:44:57 +02:00
rexx
769cfc1d29 change pylon_showdebuginfo flag to FCVAR_RELEASE 2022-09-24 21:12:26 +01:00
Kawe Mazidjatari
23eba316df Cmd: add rate limit logic for 'Cmd_ForwardToServer'
If the client happens to exceed the quota by accident, the client will not be disconnected. This is a quality of life change. Client could still increase cl_quota_stringCmdsPerSecond to allow more submissions per second, or disabling the throttle entirely by setting cl_quota_stringCmdsPerSecond to 0.
2022-09-22 21:37:58 +02:00
Kawe Mazidjatari
eec4d9598e CSquirrelVM: define "DEVELOPER" to value of "ceveloper" convar
In this retail engine, "DEV" is always zero, except for scripts.rson. I think Respawn Entertainment defined this as zero for production builds under each context except the global one.. To fix this problem, we define a new constant named "DEVELOPER", change all references in scripts that where DEV (now R5DEV due to legacy reasons to mitigate this problem), to DEVELOPER. When the game is launched with -dev, anything within #if DEVELOPER with compiled, like the development behavior of DEV.
2022-09-22 15:00:01 +02:00
Kawe Mazidjatari
42c6be9e08 Fix client.dll compile errors 2022-09-22 00:08:49 +02:00
Kawe Mazidjatari
df986f7d3b ConVar renames
Renamed:
- sv_pylonRefreshInterval => sv_pylonRefreshRate.
- sv_banlistRefreshInterval  => sv_banlistRefreshRate.
- sv_statusRefreshInterval => sv_statusRefreshRate.
2022-09-21 21:23:09 +02:00
Kawe Mazidjatari
7804241376 CClient: add rate limit logic for 'ProcessStringCmd'
Client's can run string commands on the server with no rate limit. This means when you run 50k+ commands that are unknown, or spam 30k 'status' commands, you will be able to hang the server for 800/1200ms (15k/30kms if script printing to console is enabled!). Although the netchan processing budget system will kick you, the damage has already been done at this point. This change effectively breaks the ability to DOS the server from the client using networked string commands.
In easier words; binding 'status' to your mousewheel will get you kicked from the server, without hitching the server.
2022-09-20 22:48:55 +02:00
Kawe Mazidjatari
dcc2c6224b Improve NetChan process time limit
* Check if m_MessageHandler is removed before running limit test.
* Add warning DevMsg if client exceeds value.
* Default 'net_processTimeBudget' value to '200'.
2022-09-20 02:00:52 +02:00
Kawe Mazidjatari
fdd74aa622 Implement net message processing budget
Implement net message process budget (channel gets removed if value is exceeded).
Use 'net_processLimit' to enable the implementation on the server. It will get enabled by default after testing and some cleanup. This helps against people trying to slow the server down by spamming net messages with a higher rate, e.g. using 'bind "mousewheel_up" "status"'.
2022-09-18 23:19:50 +02:00
rexx
f81780a72d fix flags on sv_forceChatToTeamOnly 2022-09-18 21:49:14 +01:00
Kawe Mazidjatari
8f2fb9b3a2 Light help strings cleanup
Everything marked '( !slower! )' could potentially slow the process down through usage or abuse (script prints could be abused as conhost is slow and bottlenecks the thread, they are by default only logged using SpdLog, which is very fast and won't cause a hitch even when you dump 2 live netchannels).
2022-09-17 20:48:41 +02:00
Kawe Mazidjatari
c523d13864 Remove FCVAR_CHEAT flag from 'net_tracePayload'
Flag is useless; allow dumping traffic at all times for static analysis (if launched as dev).
2022-09-17 20:43:16 +02:00
Kawe Mazidjatari
34b779735e Don't allow server to execute 'disconnect' on client
Removed extraneous 'FCVAR_SERVER_CAN_EXECUTE' flag. We disconnect clients using 'CClient::Disconnect(..)', relying on the client is useless without an anti-cheat and anti-tamper. Client can still use this to disconnect on its own though.

'migrateme' seemed useless as well, removed 'FCVAR_SERVER_CAN_EXECUTE'.

This makes all 'FCVAR_SERVER_CAN_EXECUTE' require 'FCVAR_DEVELOPMENTONLY' to be stripped, in order to execute without the '-devsdk' parameter (development launch arg),
2022-09-17 20:43:16 +02:00
Kawe Mazidjatari
9c9843a0fc Centralize kick/ban wrappers to CBanSystem and add new server functions for kicking/banning players 2022-09-15 23:13:37 +02:00
Kawe Mazidjatari
d9ddb575e2 Add ConVar to auto-reload the server after x seconds.
This should allow users to host dedicated servers without looking back, as you should reload/restart a server every 3 hours (a full process restart is the most recommended option, but a 'soft' reload works like a charm most of the time).
2022-09-15 01:37:45 +02:00
Kawe Mazidjatari
3d6d6644bd Logging bug fix and error handling improvements
* Replaced the boolean 'fatal' parameter with a error code parameter, anything non-null will prompt a message (fatal) and terminate the process with given error code.
* Fixed bug where the global ostreamsink for spdlog did NOT get cleared in 'SQVM_PrintFunc' when cvar 'sq_showvmoutput' was < 3. Moved to global scope.
* Added error message for when detouring the process has failed, with the error code.
* Only call 'Plat_GetProcessUpTime()' once per log, (improves performance and fixes bug where the error message box would show a different time stamp than what is logged into the console or file).
* All TIER0 loggers only log to notify and console when the SDK engine has fully initialized and detoured all functions.
2022-09-14 00:39:38 +02:00
Kawe Mazidjatari
88fcec1e69 Hook 'ConVar_PrintDescription' 2022-09-12 23:59:32 +02:00
Kawe Mazidjatari
577a8760cd CConsole: add more color coded flags
* Added more color coded flags to the console autocomplete window.
* Removed 'hidden' as FCVAR_HIDDEN is now enforced on the autocomplete window.
* force real-time CommandBase flags (previously compile-time).
2022-09-12 01:49:51 +02:00
Kawe Mazidjatari
23a95f84a8 ConVar names cleanup 2022-09-12 00:44:03 +02:00
Kawe Mazidjatari
1b754fd0b9 'con_notify' improvements
* Fade notify text by a fixed amount regardless of the frame times.
* Implement Valve's 'lerping' animation for text when entries fade away and expire.
* Don't run/push/remove anything if 'con_drawnotify' is disabled.
2022-09-11 23:48:11 +02:00
Kawe Mazidjatari
705b81a9e3 Set VPK compression level through ConVar 2022-09-11 00:16:31 +02:00
Kawe Mazidjatari
34a06147d7 Fix spelling errors
Overall spelling improvements and cleanup..
2022-09-09 19:47:31 +02:00
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