397 Commits

Author SHA1 Message Date
Marvin D
d00aaa933d CRenderView init, GetWorldMatrixForView()
* Fixed .gitignore for root /game/
* Fixed bug in WalkVTable where it would offset self.
* General clean up: VAR -> CON, CON -> VAR
2022-11-10 00:53:12 +01:00
Kawe Mazidjatari
6266549cd7 CEngineAPI::SetStartupInfo rebuild
Full rebuild of assembled function "CEngineAPI::SetStartupInfo". The assembly seems to match original function after rebuild. Does NOT support S1 yet, because TRACEINIT is inline in S1.
2022-11-07 22:25:20 +01:00
Kawe Mazidjatari
dc8ad3dd53 Log all mounted/unmounted VPK files
* Log all mounted/unmounted VPK files.
* Add command for unmounting a VPK file.
* Increased logging buffer size to 4096 for all loggers that weren't updated to this yet.
2022-11-06 12:21:21 +01:00
Kawe Mazidjatari
a9244cd8ea Set VPK default workspace to 'platform/' 2022-11-05 00:11:43 +01:00
Kawe Mazidjatari
4bd164a535 NavMesh hot swap system improvements
* Check if server is active in command callback before attempting to hot swap.
* Hook 'v_Detour_LevelInit', and log NavMeshes that failed to load.
* Split free/destroy logic into separate function.
* Created constants for NavMesh and AI Network paths/extensions.
* Added performance profiler for hot swap logic in command callback.
* Renamed "navmesh_reload" to "navmesh_hotswap".
* "navmesh_hotswap" is now development only.
2022-11-03 17:12:22 +01:00
Kawe Mazidjatari
ba252c8e98 Implement logic for hot swapping NavMesh
The new command 'navmesh_reload' hot swaps the current NavMesh for all hulls in memory, with that of the 'new' files on the disk. The memory of the old NavMesh gets freed and destroyed.
2022-11-03 10:44:59 +01:00
Kawe Mazidjatari
40566235e0 Server authentication code improvements
* Added validity checks for player names, they must be UTF-8 encoded, else game clients will crash attempting to set non-UTF-8 player names in RUI.
* CServer::RejectConnection now takes a 'v_netadr_t*', previously it was 'user_creds_s*', which worked as 'v_netadr_t' is the first member in 'user_creds_s'.
* Programmer must now manually pass a character buffer to 'v_net_adr::GetAddress(...)'.
2022-11-03 02:30:57 +01:00
Amos
bf88ecbc4a Update command names in help descriptions 2022-11-02 14:30:43 +01:00
Kawe Mazidjatari
5cfcc12ba5 Add new cvar for logging missing materials
The behavior has been changed; when a material is missing and bComplain is false, nothing gets printed to the console unless 'mat_alwaysComplain' is nonzero.
2022-10-21 21:49:10 +02:00
Kawe Mazidjatari
44f2f87460 CConsole: heavy cleanup
* Move all default assignments to constructor.
* Rename cvar 'con_max_size_logvector' to 'con_max_lines'.
* Rename cvar 'con_max_size_history' to 'con_max_history'.
* Use array indexes instead of hardcoding context prefixes.
* Added netcon context prefix to help legend.
* Added public method to obtain history as string vector.
* Added public method to clear history.
* Internal CConsole::AddLog no longer locks the mutex.
* CConsole::LoadFlagIcons accesses resource vector by reference.
* Implemented "HELP", "HISTORY" and "CLEAR" as real console commands: "con_help", "con_history", "con_clearlines".
* Added a new command "con_clearhistory" (clears the dev console submission history).
2022-10-20 12:29:50 +02:00
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