4739 Commits

Author SHA1 Message Date
Kawe Mazidjatari
20e212b1ea VpkLib: use Min operator provided by basetypes
Use Min() from basetypes as this is the prefered min operator.
2024-11-15 14:01:47 +01:00
Kawe Mazidjatari
aac8c84442 VpkLib: use correct type for chunk offset
This var must be unsigned as VPKChunkDescriptor_t's ctor takes an u64 for chunk offset.
2024-11-15 13:59:12 +01:00
Kawe Mazidjatari
bc54931408 Engine: detour function CEngineAPI::OnStartup()
Allows for initializing SDK code before or after CEngineAPI::OnStartup().
2024-11-15 13:49:29 +01:00
Kawe Mazidjatari
7114bc6a40 InputSystem: rework CInputStackSystem::PopInputContext()
The method in the engine now takes a pointer to a context and pops it if its found in the stack by index. Adjusted SDK rebuild to reflect this change. The rest of the input stack system remained unchanged.
2024-11-15 13:44:56 +01:00
Kawe Mazidjatari
18545ec422 Tier1: implement PopAt in CUtlStack
SourceSDK doesn't contain this feature, but it has to be implemented for reworking CInputStackSystem::PopInputContext() as this has changed; the method allows for popping the provided index to element rather than following a strict push/pop order.
2024-11-15 13:42:47 +01:00
Kawe Mazidjatari
f0fcb821a8 Engine: only call ImguiSystem message handler when imgui surface is active
Save even more performance by not calling the ImguiSystem message handler at all when the imgui surface isn't active; we don't need to track input movement at all when this isn't active. Also dropped the blockage of all window messages except 'WM_SETCURSOR', added a detailed comment as to why this is blocked.
2024-11-15 13:40:39 +01:00
Kawe Mazidjatari
36bee21784 Engine: set correct type for member variable
Member variable 'm_pInputContext_Maybe' is confirmed to be 'm_hInputContext', set correct type.
2024-11-15 13:38:02 +01:00
Kawe Mazidjatari
fa949c8e6a ImguiSystem: don't run the message handler if the system isn't initialized
ImGui_ImplWin32_WndProcHandler will return out early anyways if Dear Imgui itself isn't initialized, there is therefore no need to lock any mutex here when the system isn't initialized. Return out early.
2024-11-14 23:30:08 +01:00
Kawe Mazidjatari
a331d43488 ImguiSystem: fix input latency caused by mutex
There were reports of high input latency even though we implemented NVIDIA Reflex and AMD Anti-Lag 2.
The reason for this increased latency was because CThreadFastMutex was being used in the window procedure instead of a CThread mutex.

The contention for CImguiSystem::m_systemInitState in CImguiSystem::MessageHandler() is high, and therefore we should not use CThreadFastMutex as its only effective  in its fastness when the contention isn't high. Using CThreadMutex instead resulted in an extreme reduction of input latency.
2024-11-14 23:28:47 +01:00
Kawe Mazidjatari
b88ed6d5cb Resource: fix typo in CFG file header
This is the server's offline configuration file.
2024-11-14 15:51:10 +01:00
Kawe Mazidjatari
14e0c8f5e4 Engine: separate server and client offline configuration files
Dedicated server or Client only builds will warn to the console if something is trying to set a convar, or execute a concommand that doesn't exist. Dedicated server builds don't have client commands/convars, and visa versa.
2024-11-14 15:49:57 +01:00
Kawe Mazidjatari
3d5ddd2bed Client: update the "name" convar in "cl_setname" concommand callback
Update the name everywhere in code.
2024-11-14 15:44:27 +01:00
Kawe Mazidjatari
e8fe12b4fd Engine: fix heap buffer overflow
Should always leave 1 byte for the null terminator in the persona name buffer.
2024-11-14 15:26:40 +01:00
Kawe Mazidjatari
da6ffe9005 Engine: implement pak preloading
Some specific paks are loaded through code (common.rpak, ui.rpak. etc). We have implemented a system that also loads 2 common rpaks that are of our own (common_sdk.rpak and ui_sdk.rpak).

There is al additional syustem we had implemented earlier that allows you to mount rpaks during level load, which will get loaded before the actual level rpak, this is useful as when we port a map that has evolved slightly from its original one, only needing 20 new models, it makes more sense to load the original rpak + a new one that contains the 20 new models to save disk space.

This is also useful for mounting paks specific to mods for a certain map, however since we have some core mods (flowstate) we have to add it to the settings for for each level. These paks also get dropped and reloaded each time on level changes causing longer load times and more memory usage during level loads.

This system mounts paks after all common paks are loaded (from both the engine and sdk), and keeps them active just like the common paks throughout level changes until they are either manually unloaded, or the game has been closed.
2024-11-14 14:54:27 +01:00
Kawe Mazidjatari
b3796c32cc Tier2: fix regression preventing remote errors from being logged
When CURLParams::failOnError is set, it makes code stop instantly when the request has errored somewhere (400 or higher response codes), but this prevents code from displaying the error reason attached to the failed request.

Setting this to false by default fixes the problem; if this option needs to be used it should be set explicitly.
2024-11-14 14:27:31 +01:00
Kawe Mazidjatari
ad741882ae DataCache: only check on DC_INVALID_HANDLE in debug builds
In release we should only check if the handle is NULL for performance reasons (the release engine executable never sets DC_INVALID_HANDLE on invalid handles. In debug we also check on DC_INVALID_HANDLE as this is easier to cache in memory.
2024-11-14 14:21:01 +01:00
Kawe Mazidjatari
abe5578557 RTech: add param to LoadFromFile for parse failures
Gets set if parsing failed.
2024-11-14 13:38:28 +01:00
Kawe Mazidjatari
1909ad63ab RTech: implement RSON array subvalues 2024-11-14 13:37:20 +01:00
Kawe Mazidjatari
35f5c34190 Recast: use dtLink's traverse type getters
Small cleanup.
2024-11-14 02:53:19 +01:00
Kawe Mazidjatari
93588edca5 Recast: fix bug caused by incorrect representation of microlut
TITAN and GOLIATH had a small typo in their microluts, causing the lookup to be incorrect. Decimal 30 has bit 1 2 3 and 4 set, TITAN and GOLIATH could only use bit 4 and 5 which is what 30 in hex represents. This caused traverse types of type 1 2 and 3 to appear in TITAN and GOLIATH navmeshes.
2024-11-14 02:45:29 +01:00
Kawe Mazidjatari
c0a451f90d LiveAPI: remove newline character from error message
SQVM::RaiseError() does not need a newline character, remove it to keep consistency with the rest of the file.
2024-11-14 01:19:23 +01:00
Kawe Mazidjatari
2813c0e24f Server: improve ConVar help string
Improved the helpstring for ConVar navmesh_always_reachable.
2024-11-13 14:18:05 +01:00
Kawe Mazidjatari
94c296561f Recast: remove commented off-mesh connection check
Off-mesh links should never make it into rebuildBVTree, there is also an assert for it to catch bugs if it happens. Removed commented code.
2024-11-13 14:05:34 +01:00
Kawe Mazidjatari
c71d7f52dc Recast: calculate 3D AABB box for rcCunkyTriMesh
The code originally did a 2D AABB, which has several negative effects. Its cheaper to calculate on load however the NavMesh results are less accurate as the boxes won't be subdivided on the Z axis during the build process. The second issue is that the raycast will query all overlapping triangles in a rectangle on a XY plane, for a detailed mesh, this could mean having to test over 1000 triangles for a simple ray cast accorss the geometry. A sample that collected 1000 triangles to test has been reduces to just 3 with this change. The build times have also been reduced by 50% (Kings Canyon NavMesh now builds in 32 minutes rather than 60+ minutes).
2024-11-13 14:03:56 +01:00
Kawe Mazidjatari
62f7b04f5a Recast: use actual hull width for walkableRadius
The NavMesh must be build with the actual radius and not its scaled extents. Titanfall 2 single-player NavMesh tile headers confirmed this. Also added a getter for the hull's radius.
2024-11-13 13:56:51 +01:00
Kawe Mazidjatari
a6958dcee7 Recast: move raycast call to wrapper 2024-11-13 13:54:26 +01:00
Kawe Mazidjatari
cb598e397d Recast: add option to limit portal creation between 2 polys to 1
The algorithm can create multiple portals of different traverse types between 2 specific polygons, this option allows the user to override this behavior by limiting this to 1.
2024-11-12 14:20:51 +01:00
Kawe Mazidjatari
46e2424bb2 Engine: increase default stringcmd quota to 32
16 was causing the clients to get kicked when they hover and moving their cursor over the characters in character select very fast. The scripts tell the server to update the view to other clients but unfortunately the system relies on string commands (ClientCommand) and is pending a rewrite to incorporate a proper RPC just like Server and UI has. For now we increase the limit to 32 as 32 is still outside the exploitable range when the game is ran without dev tools enabled.
v2.5_r3
2024-11-12 02:08:40 +01:00
Kawe Mazidjatari
4aee1e707c CPylon: fix bug in GetServerByToken
Field name and field type were incorrectly set, GetServerByToken only returns 1 server and is always an object but it was always treated as an array of servers. Fixed field name and field type.
2024-11-12 00:14:08 +01:00
Kawe Mazidjatari
24e731e4ee ThirdParty: upgrade l8w8jwt library to 2.4.0
Security fixes.
2024-11-12 00:10:46 +01:00
Kawe Mazidjatari
e5d7644d19 Common: add missing comment to OOB message ID
The only out-of-band message ID that lacked a comment explaining what it is.
2024-11-11 20:32:53 +01:00
Kawe Mazidjatari
b16985ee0c Tier0: bump game sdk version to 012
Force new version on master server.
2024-11-11 20:27:59 +01:00
Kawe Mazidjatari
0a0c99ba77 Tier0: bump sig cache version to 0x2E
Force full rebuild of RVA cache.
2024-11-11 20:27:30 +01:00
Kawe Mazidjatari
35b23915d3 Common: reverse engineer last OOB message ID
Out-of-band message ID 'N' is MatchInfo update (calls CHLClient::RemoteMatchInfoUpdated() which then calls UICodeCallback_RemoteMatchInfoUpdated. The RemoteMatchInfo data can be retrieved through script function GetRemoteMatchInfo()).
2024-11-11 20:22:19 +01:00
Kawe Mazidjatari
9a9e84f974 Tier0: fix compiler specific compile error
This code doesn't compile on VS2017 15.6 (does on 2019 and above). We also don't need to ABS; removed the ABS code as the code is currently only used for unsigned types and we probably do want to take the sign into account when getting mins/maxs from signed values too. If not then this could always be ABS'd by the caller to explicitly set the behavior.
2024-11-11 19:50:01 +01:00
Kawe Mazidjatari
a809b1f262 Server: remove exraneous client pointer check
CServer::GetClient() will never return NULL as it returns address of client in array. Removed extraneous checks as its misleading, and added const where possible.
2024-11-11 17:47:36 +01:00
Kawe Mazidjatari
5ed734a4ff Client: fix controller curve look
The rebuild was wrong, the reported issue was that during auto-aim, the rotation speed is higher than original with a weaker magnet. Since the dissasembly and decompile of this function wasn't correct, along with not being able to reproduce the issue locally, it was hard to debug the problem (the difference between the rebuild and the original implementation was very small, where only experienced players noticed it). Since I have concluded that we don't need this function rebuilt as nothing else in the function needed adjustments, we can therefore just hook it and add the multiplication scalars on the computed joy angles. This now seems to yield correct behavior based on new tests that were performed with these changes.
2024-11-11 17:39:53 +01:00
Kawe Mazidjatari
5e962d6eb0 Loader: update SDK loader documentation
The loader no longer loads from WinMain as this caused problems during shutdown. It was switched back to LauncherMain with several adjustments to make it work perfectly for both initialization and shutdown.
2024-11-11 13:56:01 +01:00
Kawe Mazidjatari
50b4c559c6 Pylon: light cleanup of GetBannedList
Logic remains unchanged, just unscoped the iteration code by inverting the check for whether the array is empty.
2024-11-11 00:14:25 +01:00
Kawe Mazidjatari
c1ca886ee5
Merge pull request #131 from O-Robotic/p4sync
Pylon: Fix incorrect return value in GetBannedList
2024-11-10 23:51:12 +01:00
O-Robotic
cce4429606 Pylon: Fix incorrect return value in GetBannedList
GetBannedList was returning true even when no players were pushed to the banlist causing excessive thread creation in the bulk check system.
2024-11-10 17:00:23 +00:00
Kawe Mazidjatari
0806b10f79 Recast: delay sub-edge area calculation
Optimization by only calulcating it when its used to avoid calculating it for nothing when we end up moving to the next edge. This is only used when the link is established.
2024-11-10 14:28:10 +01:00
Kawe Mazidjatari
427860e6e9 InputSystem: add option to run the old CurveLook implementation
The rebuild should be correct, but to rule out any problems we might have after releasing this build, we should have a simple option to force the old implementation.
2024-11-10 14:02:49 +01:00
Kawe Mazidjatari
c72e34606b Server: only run the loop if we have an attached NavMesh 2024-11-10 12:27:14 +01:00
Kawe Mazidjatari
bca3a595e5 Pylon: enforce consistency in schema v2.5_r1 v2.5_r2 2024-11-09 14:05:41 +01:00
Kawe Mazidjatari
2513d9e70e Tier0: bump game sdk version to 011
Force new version on master server.
2024-11-09 03:04:45 +01:00
Kawe Mazidjatari
913b36d225 Tier0: bump sig cache version to 2D
Force full rebuild of RVA cache.
2024-11-09 03:04:00 +01:00
Kawe Mazidjatari
f7d75dd25f Resource: add offline autoexec file
Add to resources, refer to commit 43e162711e94293935e5eacf017c6cd0fa4c948b for details.
2024-11-09 01:26:12 +01:00
Kawe Mazidjatari
9968769e37 Core: update launch emblem
Updated to v2.5.
2024-11-09 01:23:09 +01:00
Kawe Mazidjatari
43e162711e Core: add option to run the game fully offline
The game can now be ran fully offline by providing '-offline' to the command line arguments. The engine will auto execute 'system/autoexec_offline.cfg' which overrides other autoexecs to ensure the game runs offline. The system/autoexec_offline.cfg file only overrides the variables it sets.
2024-11-09 01:22:43 +01:00