4458 Commits

Author SHA1 Message Date
Kawe Mazidjatari
7440e2d5da Tier1: add function for checking if SDK ConVar's are registered 2024-10-06 11:49:15 +02:00
Kawe Mazidjatari
59a904320e LiveAPI: update readme
Nesting depth was increased in commit b91fd983f9440f274330c6d2c3fdf42f7288700a
2024-10-06 11:48:38 +02:00
Kawe Mazidjatari
56b884c7ff Engine: remove duplicate forward declaration 2024-10-06 11:47:30 +02:00
Kawe Mazidjatari
ec3c670b2b Tier0: increment sigcache db version number
Force full rebuild on server and client.
2024-10-04 16:38:31 +02:00
Kawe Mazidjatari
79afdf08fe Recast: fix editor crash in prune tool
Always reset flags buffer as polygon references will no longer align with flags buffer on rebuild.
2024-10-04 16:04:55 +02:00
Kawe Mazidjatari
b91fd983f9 Server: light LiveAPI improvements
Increase nesting limit to 128, this should make sure it will always be enough while also making sure no infinite recursions occur. Also improved error print formatting.
2024-10-04 13:00:09 +02:00
Kawe Mazidjatari
ed62ebec9f Server: map IServerGameClients interface out
Not everything has been reversed yet.
2024-10-04 12:53:05 +02:00
Kawe Mazidjatari
277a2bf48b Recast: remove comments that is no longer applicable
PCH was already split.
2024-10-04 12:51:53 +02:00
Kawe Mazidjatari
cf7031866f Server: make inline method const 2024-10-04 12:50:31 +02:00
Kawe Mazidjatari
04afde3a80 Common: rename netmsg function 2024-10-04 12:50:03 +02:00
Kawe Mazidjatari
60f3191bae
Merge pull request #129 from Mauler125/class_var_change_networking
Class var change networking
2024-10-01 12:40:04 +02:00
Kawe Mazidjatari
d312597c91 Engine: rework class var command and netmsg design
New command '_setClassVarClient' only sets the class var on the client, similar to how '_setClassVarServer' only sets it on the server. Command 'set' still has its old behavior, setting it on the server and client. The netmsg SVC_SetClassVar now only runs the _setClassVarClient handler, and if the netmsg was successfully sent, the code runs the _setClassVarServer handler directly instead of relying on the client to NET_StringMsg it in. This is a lot more reliable, secure and performant than the previous approach and drops the requirement of setting sv_cheats to function.
2024-09-28 12:43:11 +02:00
Kawe Mazidjatari
432cb923cc Engine: fix compile error
Netmsg is defined as SVC_SetClassVar, not as SVC_SetClassSettingsVar. Rename was missed before submitting b11d7e3c9b1555673d6cb490e60eca19153195e9.
2024-09-28 12:28:28 +02:00
Kawe Mazidjatari
0d5a5df1a4 CMake: move spdlog and detours under 'Debugging' filter 2024-09-25 20:16:33 +02:00
Kawe Mazidjatari
ba5801cce6 Server: implement script utility to set class variables on connected players
Allows setting class var changes on all connected players (SetClassVarSynced(key, val)), or on individual players (player.SetClassVar(key, val)).
2024-09-25 20:12:14 +02:00
Kawe Mazidjatari
b11d7e3c9b Engine: add new netmsg 'SVC_SetClassVar'
Netmessage SVC_SetClassVar allows the server to change class settings securely on the client. This was implemented due to popular demand, and previous approaches using a combination of ClientCommands (Cbuf and NET_StringCmd) were deemed insecure and unreliable.
2024-09-25 20:08:28 +02:00
Kawe Mazidjatari
3b1622af95 Common: fix crash on dedicated server
First change callback of cvar 'mp_gamemode' must be removed as its client only, calling this on the server causes a crash as we never initialize client specific systems, therefore, the globals used in the change callback are null.
2024-09-25 20:01:10 +02:00
Kawe Mazidjatari
9a68b15412 VScript: run initial registration code class callbacks first
Must be ran within the hook as otherwise engine code class functions won't be registered.
2024-09-25 15:39:01 +02:00
Kawe Mazidjatari
8abbed283e Engine: add implementation for registering new netmessages 2024-09-25 15:04:45 +02:00
Kawe Mazidjatari
3b3127c2cf VScript: add code class script globals and registraction callbacks
Will be used to register custom script class functions.
2024-09-25 14:36:20 +02:00
Kawe Mazidjatari
97fb6c91d3 VScript: add code class descriptor class
Used for script class functions, e.g. player.GetOrigin().
2024-09-25 14:34:56 +02:00
Kawe Mazidjatari
8c2400bab5 VScript: add 'sq_getentity' to SDK 2024-09-25 14:21:43 +02:00
Kawe Mazidjatari
27c085482f Tier0: double sigscan mask buffer
Some common (future) function signatures exceed this, which don't have other means of accessing it.
2024-09-25 14:21:17 +02:00
Kawe Mazidjatari
56f8a69114 Tier1: fix flag testing bug in ConVar::Create
The archive + playerprofile flags check was done on the uninitialized member variable 'm_nFlags', but it should've been performed on the function's input parameter 'flags' as m_nFlags is only initialized past this check in BaseClass::Create (its part of ConCommandBase). This caused statically initialized ConVar's flagged 'FCVAR_ARCHIVE | FCVAR_ARCHIVE_PLAYERPROFILE' to go undetected, and dynamically initialized ones (e.g. through mod settings) to have random memory and intermittently fail this check. The latter is how this bug was found and ultimately fixed in this patch.
2024-09-23 16:23:34 +02:00
Kawe Mazidjatari
3fc1bcd2b7 Tier1: properly fix V_SplitString2
Patch in commit 057a2c801a40c2f280193da9963b009adb9f75f6 was done incorrectly, causing intermittent string truncation as subtracting pFirstSeparator from pCurPos will leave with a window in the buffer of exactly that split string, but the previous patch subtracted another char from it whilst adding one in AllocString just for it to be nulled.
2024-09-23 16:19:53 +02:00
Kawe Mazidjatari
8c9d873fbe Tier1: use CUtlStringList for ConVar flag string parser
The previous implementation contained a bug causing it to add other flags intermittently. Utilize CUtlStringList instead as it was designed for this purpose.
2024-09-23 15:46:25 +02:00
Kawe Mazidjatari
057a2c801a Tier1: exclude delimiter from split string
A string "test3,test4" using the delimiter ',' would be split into "test3," and "test4", but should be "test3" and "test4". The delimiter should not be included. This patch fixes the issue.
2024-09-23 15:44:44 +02:00
Kawe Mazidjatari
7e1e4e902a Recast: remove extraneous comments
Should not be flipped.
2024-09-23 12:34:00 +02:00
Kawe Mazidjatari
d21565d00f Recast: use rdSwap for rdVectorBase::swap
Headers were reorganized a while back, clean this code up.
2024-09-23 12:31:31 +02:00
Kawe Mazidjatari
da37f898cf Recast: deduplicate XX_VERTS_PER_POLYGON constant
Must be synced between Recast & Detour.
2024-09-23 12:25:25 +02:00
Kawe Mazidjatari
0298591068 Recast: rename shape volume methods
Reflect new changes, which supports more than only convex shapes.
2024-09-23 12:19:49 +02:00
Kawe Mazidjatari
fa1db8f995 Recast: clamp the off-mesh connection positions as well
Allows for parsing zipline positions from BSP entity partitions and placing them whilst also having it clamp the positions correctly to the polygon the zipliner will end up or start from.
2024-09-23 12:11:44 +02:00
Kawe Mazidjatari
5cb0e93766 Recast: better slider limits and layout for primitive shape editor 2024-09-23 12:09:54 +02:00
Kawe Mazidjatari
1bd47494bf Recast: pre-select primitive volume on creation
Pre-select it so it can be modified directly afterwards.
2024-09-22 15:33:49 +02:00
Kawe Mazidjatari
29e57e1605 Recast: allow modifying brush types of existing primitive volumes 2024-09-22 15:26:50 +02:00
Kawe Mazidjatari
feaca14e8a Recast: left panel UX improvements
Make it slightly larger (20 units) and make the sliders wider as well.
2024-09-22 14:28:34 +02:00
Kawe Mazidjatari
5f3abdb656 Recast: select primitive volume by volume hit index
As of commit 2a2b05c42ada643eb3a535b497d0da7e16ebef41, the primitive volume index is sent to the click handler. Use this instead of relying on a point being inside a shape which is unreliable.
2024-09-22 14:13:39 +02:00
Kawe Mazidjatari
2a2b05c42a Recast: sent intersected primitive volume index to click handler
Click handler should be notified about the primitive volume that the ray collided with, which will make selecting objects in the world a lot more reliable and easier.
2024-09-22 14:11:44 +02:00
Kawe Mazidjatari
9e46c8be75 Recast: implement primitive shape volume editor
Allows for selecting already created volumes and modifying or deleting them.
2024-09-22 12:27:45 +02:00
Kawe Mazidjatari
da66a7b9c1 Recast: implement shape volume highlighting in renderer
Highlight shape volume by index, will be used by the shape volume tool for editing.
2024-09-22 01:23:37 +02:00
Kawe Mazidjatari
e9e1a96310 Recast: make sure shape editor and shape instance max vert count is always the same
Use the same constant for class ShapeVolumeTool and struct ShapeVolume, since we do plan on increasing this in the future. Having multiple constants can cause hard to find problems when tweaking this.
2024-09-22 00:40:12 +02:00
Kawe Mazidjatari
be27f75442 Recast: rename shape volume tool source files
Source files were named after the convex polygon volume shape, but the tool can now handle more primitive shapes. Renamed to avoid future confusion.
2024-09-22 00:33:48 +02:00
Kawe Mazidjatari
3eb505e169 Recast: update default render offsets
Render recast geometry at its original location, render detour geometry 4 units from its original z-axis to avoid clipping. The previous values were too extreme and caused the cursor to visibly clip in recast geometry.
2024-09-21 22:32:13 +02:00
Kawe Mazidjatari
01f1361e26 Recast: implement masking in raycast algorithm
Allow caller to filter out what to collide with. For the editor cursor, we want to test on everything (including triggers). For the traverse link algorithm, we only want to test on clip brushes or world geometry as traversing through a trigger volume is valid.
2024-09-21 22:09:32 +02:00
Kawe Mazidjatari
f82c3fcc35 Recast: rework raycast algorithm and fix several bugs
* Only run rcGetChunksOverlappingSegment when we do intersection queries on world geometry (major optimization).
* Always find the closest intersection if caller provided tmin, and skip out if caller didn't while our ray intersected with something (major optimization for larger levels with a high number of primitive volumes).
* Reduce max overlapping chunk indices to 512, this was increased to 4096 during the initial coordinate system conversion but this was not necessary and ultimately bloated the stack.
2024-09-21 21:43:12 +02:00
Kawe Mazidjatari
b37a77d547 Recast: enforce consistency in intersection code
Some code uses different timing bounds. Enforce consistency between all code utilizing this.
2024-09-21 12:26:34 +02:00
Kawe Mazidjatari
eb6a3b37d2 Recast: implement intersection test for convex hulls
Similar to the intersection test for cylindric volumes. The old convex hull intersection test in the raycast algorithm is inaccurate and also doesn't calculate the hit time, which prevents the editor from placing the cursor at the intersection. Raycast algorithm is pending a refactor and its convex hull isect test will be replaced with this.
2024-09-21 12:22:02 +02:00
Kawe Mazidjatari
3a51c4f8c9 Recast: take cylinder caps into account during intersection test
Cylinder caps were not accounted for and thus tmin/tmax were never set causing incorrect ray tracing results when intersecting with a cylinder cap.
2024-09-20 21:54:24 +02:00
Kawe Mazidjatari
c952f59920 Recast: add ability to delete cylinder and AABB volumes as well 2024-09-20 16:01:39 +02:00
Kawe Mazidjatari
32f470f2ed Recast: add functions for checking if point is in cylinder and AABB 2024-09-20 16:00:23 +02:00