3060 Commits

Author SHA1 Message Date
rexx
1c179434d3 fix dedi compile
sets pylon language in a cvar change callback instead of accessing directly, as networksystem does not have a DEDICATED define
2023-08-17 20:22:28 +01:00
rexx
356f0ce7c0 send language to MS 2023-08-17 20:02:42 +01:00
Amos
4601c65bc6 Fix bots stuck in air
Make sure we set a frame time and command time.
2023-08-17 02:00:50 +02:00
Amos
5e47e45d83 Take clock drift into account during lag compensation clamp
Client's clock could be behind or ahead of the server's, take this into account. Note that this code has been tested over night and only had a few hits when new baseline snapshots were applied on the server, or when there was a clock drift. It still requires an actual playtest with several players on low and high latency to determine if this is even needed.
2023-08-17 01:59:54 +02:00
Amos
e66680881b Add 'sv_clockcorrection_msecs' cvar to SDK 2023-08-17 01:56:42 +02:00
Amos
3c36b606f0 Add function for checking if there's still pending data in reliable waiting buffers 2023-08-16 00:15:01 +02:00
Amos
2ff35a94cd Add inline for getting server time 2023-08-16 00:06:03 +02:00
Amos
c7f1cfbaaa Improve unlag exploit fix
- Check and clamp if commandTime is above serverTime (too far in future).
- Check commandTime delta before checking if above serverTime or below lastCommandTime.
2023-08-15 22:53:42 +02:00
Amos
ebe7a997ac Fixup comments 2023-08-15 20:20:29 +02:00
Amos
75e327e447 Normalize pitch angles
Prob not needed, but other unclamped angles/vectors were able to crash games in the past, so just normalize this too.
2023-08-15 20:19:38 +02:00
Amos
3ff85c174a Finish unlag exploit fix
- Make sure cmdTime is never lower than last.
- Make sure delta doesn't exceed maxUnlag.
- Make sure latency gets clamped to maxUnlag (clamp appears to be missing in the engine).
- Only check for cmdTime if we are not discarding the cmd; previously, already processed queued cmd's got checked before being discarded.
2023-08-15 00:45:58 +02:00
Amos
631e6d9e17 Work in progress unlag exploit fix
Temporary lag compensation exploit fix by clamping the difference. Exploiter could carefully control the detonation time of a grenade, or alter the ability cool downs by altering the 'CUserCmd::command_time' field before sending it up.
2023-08-14 20:47:02 +02:00
Amos
00f7415380 Fixup CClient types 2023-08-14 00:30:20 +02:00
Amos
2768b925b0 Make assert better
Check if not below zero.
2023-08-13 20:26:52 +02:00
Amos
abb9f30753 Add inlines for getting edict and names 2023-08-13 20:26:08 +02:00
Amos
8136374693 Make inline
Make inline.
2023-08-13 20:20:01 +02:00
Amos
cf41004f74 Cleanup 'CServerGameClients::ProcessUserCmds'
Client gets dropped if buffer overflow flag is set, remove old code and just print the warning.
2023-08-13 18:08:14 +02:00
rexx
25bd407b39 add ScriptError script func 2023-08-12 22:41:48 +01:00
Kawe Mazidjatari
fa4325eda0 Change more to errors
Should never happen, and be shown in release builds.
2023-08-09 15:31:22 +02:00
Kawe Mazidjatari
298bab630e Change to error
Should never happen, and be shown in release builds.
2023-08-09 15:05:08 +02:00
Kawe Mazidjatari
5f64cd83d8 Fix FileSystem size integer truncation
The implementation in the engine always took/returned signed 64bit size types, but I made a mistake when reversing the virtual function table. All types have been changed to what they should be (mostly signed 64bit, very few unsigned), and usage in-SDK has been adjusted accordingly.
2023-08-09 14:43:54 +02:00
Kawe Mazidjatari
d59a320d69 Remove 'Error(EXIT_FAILURE)' call from 'CreateWeaponBolt()'
The bug has been fixed in the engine.
2023-08-09 02:56:58 +02:00
Kawe Mazidjatari
30031e3275 Don't allow stringcmd's if client isn't active
Potential exploit vector, executing stringcmd's during signon states where it shouldn't be used.
2023-08-08 19:25:12 +02:00
Kawe Mazidjatari
9a9d6b290a Fix typo 2023-08-08 19:05:12 +02:00
Kawe Mazidjatari
d0544a3bc7 Remove development only flags for some cvars
Removed for:
* base_tickinterval_sp
* base_tickinterval_mp
* sv_updaterate_sp
* sv_updaterate_mp
* cl_updaterate_mp

Cvar 'cl_cmdrate' is deprecated in the engine and SDK since the CL_Move rebuild, and therefore has been removed entirely.
2023-08-08 13:05:33 +02:00
Kawe Mazidjatari
849372d68e Show server CPU, frame time and current tick as well 2023-08-08 12:55:17 +02:00
Kawe Mazidjatari
9d5eb5ba23 Remove redundant CEngine stuff
No longer required, the vftable has been reversed.
2023-08-08 09:28:11 +02:00
Kawe Mazidjatari
aa569173c9 Remove useless copy constructions
A string was constructed, but only for checking if its empty. This can be done on the char pointer itself. Made a inline helper func to reduce duplicate code.
2023-08-08 02:21:33 +02:00
Kawe Mazidjatari
71652f02c7 Don't index into it again
If the string has a value, then we can just use that since it will be equal to that of the vector.
2023-08-08 02:19:45 +02:00
Kawe Mazidjatari
822d9f2b19 CTextOverlay cleanup
Slightly improved performance, reduced number of copy constructions, reduced number of integral type casts by just using the CUtlVector class.
2023-08-07 22:10:06 +02:00
Kawe Mazidjatari
704900e2cd Don't index into it again
Use the already cached reference.
2023-08-07 21:23:42 +02:00
Kawe Mazidjatari
a840fd1493 Remove devonly flag from 'discord_updatePresence'
Allow user to enable it, seems to work perfectly fine.
2023-08-07 17:54:57 +02:00
Kawe Mazidjatari
89431cc61f Fix crasher by clamping stringcmd length before tokenizing it
Possible crasher is to send a stringcmd >= 512 in size with funny UTF8 characters and have CUtlBuffer::ParseToken() read past it. Apparently seems to be mostly a problem on 32bit? I was unable to initiate a crash, though one string caused interesting behavior before, and there was one report of the dedicated server being 'crashed' with this. There is no reason to tokenize it up to 512 bytes if the game is only ever going to allow 128, so clamp it to 129 and if the user exceeds it then they still get the message and we just jettison it.
2023-08-07 16:52:35 +02:00
Kawe Mazidjatari
3ca092f598 Temporarily fix convar value assignment bug in 'CRConServer::Execute()'
Command string buffer contains "sv_cheats" and value buffer contains "sv_cheats 1". Ideally value buffer only contains "1", and we just concatenate to "sv_cheats 1" for 'Cmd_Dispatch()' to avoid confusion on the netconsole's programmer side. This will be refactored in the future.
2023-08-05 20:29:07 +02:00
Kawe Mazidjatari
2d6a1c79ac Comment 'sv_rcon_banpenalty' out for now
Nice to implement at some point, but its not a priority. The current system just disables itself if its under attack (requires action from server owner to re-enable).
v2.2_rc10
2023-08-05 01:14:03 +02:00
Kawe Mazidjatari
759d8d6d2e Flip 'sv_rcon_sendlogs' if netcon is not input only 2023-08-05 01:11:32 +02:00
Kawe Mazidjatari
5e4ea7d25a Minor convar string stuff 2023-08-05 01:09:53 +02:00
Kawe Mazidjatari
ef8173636d
Merge pull request #107 from Mauler125/rcon_improvements
Rcon improvements
2023-08-04 17:50:30 +02:00
Kawe Mazidjatari
0a25f5e0fe Adjust 'CNetConBase' vftable order
Order has been adjusted to match the order of execution.
2023-08-04 17:45:30 +02:00
Kawe Mazidjatari
d7f92cbefd Adjust names
Adjust since previously they were pointers but now references.
2023-08-04 17:41:55 +02:00
Kawe Mazidjatari
bb5e92a563 Fix redundant socket closing bug
Cvar 'sv_rcon_maxsockets' is always higher than the actual allowed socket count. Should only check if its count is higher than the cvar.
2023-08-04 17:34:30 +02:00
Kawe Mazidjatari
f2783ae93f Make use of 'CConnectedNetConsoleData::m_bInputOnly' properly
This member was in the class when RCON was added to the r5sdk, but it was never utilized. Now, each netconsole can toggle whether they are input only or not, the server only sends logs to netconsoles that are not input only. This patch also contains a fix in which the listen server sends logs to the client of its own process, causing an infinite recursive call to DevMsg.
2023-08-04 17:28:01 +02:00
Kawe Mazidjatari
3a19ac0c24 Add a note 2023-08-04 15:39:40 +02:00
Kawe Mazidjatari
461fb48575 More reliable way of enablin ansi colors on netconsole
Compare arguments individually instead of performing a scan over the whole command line string.
2023-08-04 15:36:40 +02:00
Kawe Mazidjatari
e7420a26af Properly tokenize netconsole input
Use the command tokenizer class.
2023-08-04 15:35:20 +02:00
Kawe Mazidjatari
568f88040e
Merge pull request #106 from Mauler125/convar_restructure
Restructure concommandbase classes
2023-08-04 14:33:12 +02:00
Kawe Mazidjatari
26c10dfd11 Restructure concommandbase classes
Move all classes deriving from ConCommandBase to a single file, and split out CCommand, CCvar, CCvarUtilities etc to their own files. This makes it possible to use CCommand and stuff in external tools without linker errors/warnings.
2023-08-04 14:32:06 +02:00
Kawe Mazidjatari
dbe75c0709 Make private
No reason to be public.
2023-08-04 12:44:46 +02:00
Kawe Mazidjatari
ce4b7b84a8 Promote RCON command execution authority
Allow RCON to execute any commands and set any cvar, regardless of their flags.
2023-08-04 11:53:46 +02:00
Kawe Mazidjatari
f6d2628937 Cleanup proto structure
Removed unused/extraneous enumerants.
2023-08-04 11:20:24 +02:00