1862 Commits

Author SHA1 Message Date
Kawe Mazidjatari
21f4d0fa07 Initial working bots implementation
* Changed 'CClient' handle time to 'edict_t' which is an alias of 'uint16_t'.
* Changed 'g_pServerGameDLL' and 'g_pServerGameClients' init (obtain from factory instead).
* Use interface version macro's for obtaining factory pointers instead.
* Added 'g_pServerGameEntities'.
2023-01-16 21:09:21 +01:00
Amos
11648d4932 Additional bot stuff 2023-01-16 16:54:01 +01:00
Amos
68f197dcef Initial fake client (bot) implementation
New bots can be added using 'sv_addbot <name> <teamid>'.
2023-01-16 15:52:33 +01:00
Amos
39920283c0 Fix arithmetic register formatting for high number
High values would cause the formatting to be decimal while it should be hexadecimal if the value equals or exceeds one million.
2023-01-16 15:28:39 +01:00
Kawe Mazidjatari
ca3e5ac9d1 ImGuiConfig: fix incorrect allocation size causing OOB memory write
Fix was found after the issue in the previous commit was found.
2023-01-15 18:12:39 +01:00
rexx
9d2ffa6e26
bansystem: fix incorrect allocation size causing OOB memory write 2023-01-14 15:35:46 +00:00
Kawe Mazidjatari
d8dd9aba93 Fix CCrashHandler method name
Renamed from APU to ALU (typo).
2023-01-04 14:55:58 +01:00
Kawe Mazidjatari
34fddd52a8 Add cvar/command flag tooltip
Show a more detailed description of all flags set on cvar/command when user hovers its mouse over the flags texture.
2022-12-29 13:30:33 +01:00
Kawe Mazidjatari
1abc14b828 Improve string pooling
Changed some string concats back to the old approach as this will pool strings a lot better, especially common strings such as "%s - %s". Also removed from a few other (not all) functions to maintain consistency with logs emitted from the game itself.
2022-12-28 22:00:06 +01:00
Kawe Mazidjatari
08ed169cf3 Only run game's exception filter if ours didn't handle it
This is required as otherwise the game's exception filter will be called after ours. If we didn't handle the exception, the game's implementation, or an exception handler associated to the exception raised by address will take care of it. Unlike the game's implementation, our exception handler does not handle unknown exceptions. We only do the low level stuff reliably.
2022-12-28 21:44:51 +01:00
Kawe Mazidjatari
f00153ccb4 Rename exception filter 2022-12-28 21:39:58 +01:00
Kawe Mazidjatari
3c7ad57650 CCrashHandler improvements
* Move large module instance array to the heap.
* Add ability to query whether or not an exception was handled.
2022-12-28 21:38:47 +01:00
Kawe Mazidjatari
2c70283397 CCrashHandler improvements
* Only handle exceptions we could handle (anything that isn't in the switch case is not getting handled).
* Only show hexadecimal representation of decimal integer if could contain hexadecimal digits.
2022-12-28 20:30:33 +01:00
Kawe Mazidjatari
6139d943d8 Increase stack reserve size
Increased to that of 'r5apex.exe' for all dll's directly interfacing with the main game executable.
2022-12-28 16:37:55 +01:00
Kawe Mazidjatari
5de241b807 CCrashHandler: light cleanup 2022-12-28 16:36:52 +01:00
Kawe Mazidjatari
700bb48494 Fix compiler error 2022-12-28 15:38:34 +01:00
Kawe Mazidjatari
56c48f2949 Fix FPU formatting for negative numbers
Properly format negative numbers too. The function now checks if any of the 4 values in the SSE register are above or below one million before displaying in hexadecimal. Prior to this commit, the value was unsigned leading to negative numbers bellow one million being displayed as very high in hexadecimal.
2022-12-28 15:38:18 +01:00
Kawe Mazidjatari
bc99a064b1 Don't write null character to text file on disc 2022-12-27 23:12:21 +01:00
Kawe Mazidjatari
1376e1be82 Add temporary whitelist address for materialsystem crash case
This is required as we still have a very hacky approach for running 'custom' BSP files. Even though we are pretty much ready to move over the proper approach, we haven't been able to update all files yet. This is kept in place but will have to be deprecated and removed among with the MaterialSystem hack before the next release.
2022-12-27 23:10:51 +01:00
Kawe Mazidjatari
d2fc2405c3 Add ability to whitelist return addresses from exception filter
Programmer could add and remove whitelisted addresses. If an exception occurs, the system checks the callstack up to 'MAX_IMI_SEARCH' frames (defined in CCrashHandler), and returns true if found (returning early with 'EXCEPTION_CONTINUE_SEARCH' so we use whatever exception handler is set for this particular case), false otherwise.
2022-12-27 23:08:59 +01:00
Kawe Mazidjatari
81adf428ff Add GPU model info on startup
Kept in for dedicated as the main executable imports the same DLL used for 'EnumDisplayDevices'. No GPU will be displayed if there is none installed or set as primary.
2022-12-27 17:39:00 +01:00
Kawe Mazidjatari
3f4884b20a Fix CrashMsg flag
'2' means that the generic "Apex crashed" message box gets displayed without any additional information regarding the module.
2022-12-27 14:23:54 +01:00
Kawe Mazidjatari
b48f028b5a Make FPU vector unsigned
Value must be unsigned to yield proper output.
2022-12-27 14:21:20 +01:00
Kawe Mazidjatari
57c71b8ee4 Log loaded module information (base and base+imageSize) 2022-12-27 14:12:46 +01:00
Kawe Mazidjatari
3f5102cc6f Detect possible return address in callstack
Also increased the number of frames to capture from 60 to 128, and skipped the last 2 frames.
2022-12-27 13:19:57 +01:00
Kawe Mazidjatari
7dfef9c9c8 CCrashHandler and logging improvements
* CCrashHandler now calls the crashmsg executable to display the error to the user.
* Logs are now placed into directories named to the current time to avoid overwriting them or having 2 instances of the game writing to the same logs.
2022-12-27 02:28:43 +01:00
Kawe Mazidjatari
5502dcb8f1 Add 'build_id' to crash log
Also performed light cleanup.
2022-12-26 23:35:41 +01:00
Kawe Mazidjatari
cd3a80479e Log system information to the crash file
Added:
* CPU brand identifier
* CPU clock speed
* GPU device string
* GPU device state flags
* RAM total (physical/virtual)
* RAM avail (physical/virtual)
2022-12-26 22:00:38 +01:00
Kawe Mazidjatari
89bedf59d8 Fix typo 2022-12-26 21:58:39 +01:00
Kawe Mazidjatari
23070bd8ce Reorder 'CCrashHandler' class and add descriptions to functions 2022-12-26 20:33:09 +01:00
Kawe Mazidjatari
b4383478d1 Initial refactor of the CCrashHandler class
* Fixed recursive call.
* Format file similarly to Respawn's.
* Reduced output code size.

TODO:
* Call crashmsg.exe.
* Add build and system information.
2022-12-26 20:11:37 +01:00
Kawe Mazidjatari
1371bb1f38 Fix typo 2022-12-26 17:01:14 +01:00
Kawe Mazidjatari
08a550327a Fix bug in engine caused by missing comma separator
Valve and Respawn Entertainment forgot a comma in 'g_FieldTypes' causing "FIELD_INTERVAL" and "FIELD_MODELINDEX" to be concatenation. The engine executable patch fixes this problem
2022-12-26 16:58:07 +01:00
Rika
10c82e7e64
Model fixup (#91)
* fix header, flags, and add rest of major structs

* minor type swap

* bone flags because there are new ones

* forgor this

* Add compressed vector types.

* fix bitfield sizes

* Fix compilation.

Co-authored-by: Marvin D <41352111+IcePixelx@users.noreply.github.com>
Co-authored-by: rexx <67599507+r-ex@users.noreply.github.com>
2022-12-26 01:42:26 +01:00
Kawe Mazidjatari
9ec5b6aabd Improve formatting for FPU 2022-12-25 22:49:49 +01:00
Kawe Mazidjatari
0a9045f1c7 Fix typo in crash handler 2022-12-25 22:44:07 +01:00
Marvin D
61383efb50 Comment to plugin system for a bug that needs fixing. 2022-12-25 14:49:24 +01:00
Marvin D
c79f98e4f8 Remove comment on crashhandler. 2022-12-24 16:48:15 +01:00
Marvin D
f9f09bd02a Limit IMI search to 7. 2022-12-24 16:43:19 +01:00
Marvin D
e24b9b90a5 VEH Clean-up. 2022-12-24 16:41:47 +01:00
Marvin D
22506fa689 Fix VEH.
* Make sure IsMaterialInternal won't be inlined.
* Fix recurssive VEH throwing.
* Check if IsMaterialInternal caused exception and ignore it.
2022-12-24 16:40:04 +01:00
Marvin D
d1ec3aaf71 Disable VEH till fix. 2022-12-24 13:06:44 +01:00
Marvin D
8506851860 VEH clean up. 2022-12-23 14:06:31 +01:00
Marvin D
bd2cc9f4b3 EXCEPTION_EXECUTE_HANDLER -> EXCEPTION_CONTINUE_SEARCH 2022-12-23 03:19:43 +01:00
Marvin D
37a50c92b8 VectoredExceptionHandler init.
* Only gets compiled in for release builds.
* Attaches on gamesdk init, so should catch everything on dll setup also.
* Fake PDB parsing still needs to be done.
2022-12-23 02:56:40 +01:00
rexx
c4d23ebcc8 Remove unnecessary comment 2022-12-22 21:45:39 +00:00
rexx
3c3e1c46df Add pak_listtypes command 2022-12-22 21:44:38 +00:00
Kawe Mazidjatari
d9ac275d71 Fix bug where input is lost during resize
This commit fixes a bug causing all input to be lost. This gets triggered when either the console or server browser window is drawing while the user tabs out of the full-screen window, or resizes the game window.
2022-12-22 17:49:38 +01:00
Marvin D
6177c1ebe7 Fix deadlock detection when processing relations 2022-12-22 16:48:47 +01:00
Marvin D
89bc31de10 pass directly instead of ref. 2022-12-22 01:05:39 +01:00